orcheo-canvas 0.0.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +26 -0
- package/README.md +32 -0
- package/components.json +21 -0
- package/dist/assets/index-C8cjvUcR.js +772 -0
- package/dist/assets/index-D_Md8dhB.css +1 -0
- package/dist/favicon.drawio +83 -0
- package/dist/favicon.png +0 -0
- package/dist/favicon.svg +4 -0
- package/dist/index.html +19 -0
- package/eslint.config.js +28 -0
- package/index.html +18 -0
- package/package.json +165 -0
- package/postcss.config.js +6 -0
- package/public/favicon.drawio +83 -0
- package/public/favicon.png +0 -0
- package/public/favicon.svg +4 -0
- package/src/App.test.tsx +10 -0
- package/src/App.tsx +43 -0
- package/src/assets/react.svg +1 -0
- package/src/design-system/ui/accordion.tsx +57 -0
- package/src/design-system/ui/alert-dialog.tsx +141 -0
- package/src/design-system/ui/alert.tsx +59 -0
- package/src/design-system/ui/aspect-ratio.tsx +7 -0
- package/src/design-system/ui/avatar.tsx +50 -0
- package/src/design-system/ui/badge.tsx +37 -0
- package/src/design-system/ui/breadcrumb.tsx +115 -0
- package/src/design-system/ui/button.tsx +58 -0
- package/src/design-system/ui/calendar.tsx +76 -0
- package/src/design-system/ui/card.tsx +83 -0
- package/src/design-system/ui/carousel/carousel-context.ts +17 -0
- package/src/design-system/ui/carousel/carousel-navigation.tsx +65 -0
- package/src/design-system/ui/carousel/carousel-provider.tsx +18 -0
- package/src/design-system/ui/carousel/carousel-root.tsx +119 -0
- package/src/design-system/ui/carousel/carousel-slides.tsx +49 -0
- package/src/design-system/ui/carousel/types.ts +24 -0
- package/src/design-system/ui/carousel.tsx +6 -0
- package/src/design-system/ui/chart-context-shared.ts +27 -0
- package/src/design-system/ui/chart-context.tsx +81 -0
- package/src/design-system/ui/chart-legend.tsx +68 -0
- package/src/design-system/ui/chart-tooltip.tsx +164 -0
- package/src/design-system/ui/chart-utils.ts +39 -0
- package/src/design-system/ui/chart.tsx +3 -0
- package/src/design-system/ui/checkbox.tsx +30 -0
- package/src/design-system/ui/collapsible.tsx +11 -0
- package/src/design-system/ui/command.tsx +153 -0
- package/src/design-system/ui/context-menu.tsx +200 -0
- package/src/design-system/ui/dialog.tsx +122 -0
- package/src/design-system/ui/drawer.tsx +118 -0
- package/src/design-system/ui/dropdown-menu.tsx +201 -0
- package/src/design-system/ui/form.tsx +180 -0
- package/src/design-system/ui/hover-card.tsx +29 -0
- package/src/design-system/ui/input-otp.tsx +71 -0
- package/src/design-system/ui/input.tsx +22 -0
- package/src/design-system/ui/label.tsx +26 -0
- package/src/design-system/ui/menubar-content.tsx +85 -0
- package/src/design-system/ui/menubar-items.tsx +123 -0
- package/src/design-system/ui/menubar-root.tsx +60 -0
- package/src/design-system/ui/menubar.tsx +26 -0
- package/src/design-system/ui/navigation-menu.tsx +129 -0
- package/src/design-system/ui/pagination.tsx +117 -0
- package/src/design-system/ui/popover.tsx +33 -0
- package/src/design-system/ui/progress.tsx +28 -0
- package/src/design-system/ui/radio-group.tsx +44 -0
- package/src/design-system/ui/resizable.tsx +45 -0
- package/src/design-system/ui/scroll-area.tsx +48 -0
- package/src/design-system/ui/select.tsx +159 -0
- package/src/design-system/ui/separator.tsx +31 -0
- package/src/design-system/ui/sheet.tsx +140 -0
- package/src/design-system/ui/sidebar/constants.ts +6 -0
- package/src/design-system/ui/sidebar/sidebar-context.ts +15 -0
- package/src/design-system/ui/sidebar/sidebar-layout.tsx +216 -0
- package/src/design-system/ui/sidebar/sidebar-menu/index.ts +11 -0
- package/src/design-system/ui/sidebar/sidebar-menu/menu-action.tsx +35 -0
- package/src/design-system/ui/sidebar/sidebar-menu/menu-badge.tsx +28 -0
- package/src/design-system/ui/sidebar/sidebar-menu/menu-button-variants.ts +25 -0
- package/src/design-system/ui/sidebar/sidebar-menu/menu-button.tsx +73 -0
- package/src/design-system/ui/sidebar/sidebar-menu/menu-skeleton.tsx +45 -0
- package/src/design-system/ui/sidebar/sidebar-menu/menu-sub.tsx +61 -0
- package/src/design-system/ui/sidebar/sidebar-menu/menu.tsx +33 -0
- package/src/design-system/ui/sidebar/sidebar-provider.tsx +132 -0
- package/src/design-system/ui/sidebar/sidebar-structure.tsx +152 -0
- package/src/design-system/ui/sidebar/use-sidebar.ts +14 -0
- package/src/design-system/ui/sidebar.ts +35 -0
- package/src/design-system/ui/skeleton.tsx +15 -0
- package/src/design-system/ui/slider.tsx +28 -0
- package/src/design-system/ui/sonner.tsx +31 -0
- package/src/design-system/ui/switch.tsx +29 -0
- package/src/design-system/ui/table.tsx +120 -0
- package/src/design-system/ui/tabs.tsx +55 -0
- package/src/design-system/ui/textarea.tsx +22 -0
- package/src/design-system/ui/toast.tsx +129 -0
- package/src/design-system/ui/toaster.tsx +35 -0
- package/src/design-system/ui/toggle-group.tsx +61 -0
- package/src/design-system/ui/toggle.tsx +46 -0
- package/src/design-system/ui/tooltip.tsx +32 -0
- package/src/features/account/components/settings/appearance-settings-tab.tsx +70 -0
- package/src/features/account/components/settings/application-settings-tab.tsx +146 -0
- package/src/features/account/components/settings/notification-settings-tab.tsx +157 -0
- package/src/features/account/components/settings/team-billing-settings-tab.tsx +164 -0
- package/src/features/account/components/theme-settings.tsx +228 -0
- package/src/features/account/components/use-theme-preferences.ts +111 -0
- package/src/features/account/pages/profile/components/profile-api-keys-tab.tsx +59 -0
- package/src/features/account/pages/profile/components/profile-general-tab.tsx +125 -0
- package/src/features/account/pages/profile/components/profile-security-tab.tsx +114 -0
- package/src/features/account/pages/profile/types.ts +8 -0
- package/src/features/account/pages/profile.tsx +64 -0
- package/src/features/account/pages/settings.tsx +58 -0
- package/src/features/auth/components/auth-logos.tsx +61 -0
- package/src/features/auth/components/auth-page.tsx +213 -0
- package/src/features/auth/pages/login.tsx +5 -0
- package/src/features/auth/pages/signup.tsx +5 -0
- package/src/features/chatkit/components/canvas-chat-bubble.tsx +324 -0
- package/src/features/chatkit/components/chatkit-surface.tsx +18 -0
- package/src/features/chatkit/components/public-chat-error-boundary.tsx +74 -0
- package/src/features/chatkit/components/public-chat-widget.tsx +138 -0
- package/src/features/chatkit/lib/chatkit-client.test.ts +98 -0
- package/src/features/chatkit/lib/chatkit-client.ts +175 -0
- package/src/features/chatkit/lib/chatkit-theme.ts +20 -0
- package/src/features/chatkit/lib/telemetry.ts +29 -0
- package/src/features/chatkit/lib/workflow-session.ts +69 -0
- package/src/features/chatkit/pages/public-chat.tsx +391 -0
- package/src/features/shared/components/chat-input/attachment-preview.tsx +78 -0
- package/src/features/shared/components/chat-input/chat-input-types.ts +13 -0
- package/src/features/shared/components/chat-input/emoji-picker.tsx +106 -0
- package/src/features/shared/components/chat-input.tsx +234 -0
- package/src/features/shared/components/chat-interface-options.ts +305 -0
- package/src/features/shared/components/chat-interface.tsx +162 -0
- package/src/features/shared/components/chat-interface.types.ts +36 -0
- package/src/features/shared/components/chat-message-attachments.tsx +122 -0
- package/src/features/shared/components/chat-message-markdown.ts +33 -0
- package/src/features/shared/components/chat-message.tsx +128 -0
- package/src/features/shared/components/top-navigation/account-menu.tsx +101 -0
- package/src/features/shared/components/top-navigation/command-palette-button.tsx +78 -0
- package/src/features/shared/components/top-navigation/project-switcher.tsx +64 -0
- package/src/features/shared/components/top-navigation/top-navigation-types.ts +16 -0
- package/src/features/shared/components/top-navigation/use-window-width.ts +24 -0
- package/src/features/shared/components/top-navigation/workflow-breadcrumbs.tsx +107 -0
- package/src/features/shared/components/top-navigation.tsx +52 -0
- package/src/features/support/components/support-chat-callout.tsx +40 -0
- package/src/features/support/components/support-header.tsx +53 -0
- package/src/features/support/components/support-help-tabs.tsx +172 -0
- package/src/features/support/components/support-resources.tsx +157 -0
- package/src/features/support/pages/help-support.tsx +72 -0
- package/src/features/workflow/components/canvas/annotations-layer/annotation-composer.tsx +109 -0
- package/src/features/workflow/components/canvas/annotations-layer/annotation-item.tsx +141 -0
- package/src/features/workflow/components/canvas/annotations-layer/annotation-list.tsx +30 -0
- package/src/features/workflow/components/canvas/annotations-layer/types.ts +10 -0
- package/src/features/workflow/components/canvas/annotations-layer.tsx +99 -0
- package/src/features/workflow/components/canvas/breakpoints-layer.tsx +148 -0
- package/src/features/workflow/components/canvas/connection-validator.tsx +230 -0
- package/src/features/workflow/components/canvas/custom-edge.tsx +154 -0
- package/src/features/workflow/components/canvas/edge-hover-context.tsx +11 -0
- package/src/features/workflow/components/canvas/mini-map.tsx +111 -0
- package/src/features/workflow/components/canvas/split-pane.tsx +165 -0
- package/src/features/workflow/components/canvas/time-travel-debugger.tsx +164 -0
- package/src/features/workflow/components/canvas/time-travel-header.tsx +45 -0
- package/src/features/workflow/components/canvas/time-travel-playback-controls.tsx +174 -0
- package/src/features/workflow/components/canvas/time-travel-state-details.tsx +63 -0
- package/src/features/workflow/components/canvas/time-travel-timeline.tsx +80 -0
- package/src/features/workflow/components/canvas/time-travel-types.ts +18 -0
- package/src/features/workflow/components/canvas/workflow-context-menu.tsx +179 -0
- package/src/features/workflow/components/canvas/workflow-controls/action-control-group.tsx +219 -0
- package/src/features/workflow/components/canvas/workflow-controls/history-control-group.tsx +84 -0
- package/src/features/workflow/components/canvas/workflow-controls/types.ts +18 -0
- package/src/features/workflow/components/canvas/workflow-controls.tsx +50 -0
- package/src/features/workflow/components/canvas/workflow-flow.tsx +214 -0
- package/src/features/workflow/components/canvas/workflow-search.tsx +152 -0
- package/src/features/workflow/components/dialogs/add-credential-dialog.tsx +233 -0
- package/src/features/workflow/components/dialogs/add-notification-channel-dialog.tsx +230 -0
- package/src/features/workflow/components/dialogs/command-palette-items.tsx +77 -0
- package/src/features/workflow/components/dialogs/command-palette-types.ts +13 -0
- package/src/features/workflow/components/dialogs/command-palette-utils.ts +44 -0
- package/src/features/workflow/components/dialogs/command-palette.tsx +195 -0
- package/src/features/workflow/components/dialogs/credential-access-badge.tsx +44 -0
- package/src/features/workflow/components/dialogs/credential-status-badge.tsx +45 -0
- package/src/features/workflow/components/dialogs/credentials-table.tsx +234 -0
- package/src/features/workflow/components/dialogs/credentials-vault.tsx +63 -0
- package/src/features/workflow/components/dialogs/notification-channel-card.tsx +106 -0
- package/src/features/workflow/components/dialogs/notification-event-toggles.tsx +95 -0
- package/src/features/workflow/components/dialogs/notification-settings.tsx +108 -0
- package/src/features/workflow/components/dialogs/notification-settings.types.ts +34 -0
- package/src/features/workflow/components/dialogs/use-command-palette-navigation.ts +60 -0
- package/src/features/workflow/components/dialogs/user-role-management/invite-user-dialog.tsx +152 -0
- package/src/features/workflow/components/dialogs/user-role-management/role-badges.tsx +83 -0
- package/src/features/workflow/components/dialogs/user-role-management/user-role-table.tsx +188 -0
- package/src/features/workflow/components/dialogs/user-role-management/user-role-types.ts +20 -0
- package/src/features/workflow/components/dialogs/user-role-management.tsx +61 -0
- package/src/features/workflow/components/dialogs/version-control-dialog.tsx +232 -0
- package/src/features/workflow/components/layouts/sidebar-layout.tsx +208 -0
- package/src/features/workflow/components/layouts/use-sidebar-resize.ts +83 -0
- package/src/features/workflow/components/layouts/workflow-page-layout.tsx +69 -0
- package/src/features/workflow/components/nodes/chat-trigger-node.tsx +106 -0
- package/src/features/workflow/components/nodes/group-node.tsx +195 -0
- package/src/features/workflow/components/nodes/node-label.tsx +105 -0
- package/src/features/workflow/components/nodes/start-end-node.tsx +68 -0
- package/src/features/workflow/components/nodes/sticky-note-node.tsx +246 -0
- package/src/features/workflow/components/nodes/workflow-node-controls.tsx +91 -0
- package/src/features/workflow/components/nodes/workflow-node-handle-config.ts +22 -0
- package/src/features/workflow/components/nodes/workflow-node-handles.tsx +79 -0
- package/src/features/workflow/components/nodes/workflow-node-style.tsx +50 -0
- package/src/features/workflow/components/nodes/workflow-node.tsx +147 -0
- package/src/features/workflow/components/nodes/workflow-node.types.ts +32 -0
- package/src/features/workflow/components/panels/node-inspector/config-panel.tsx +130 -0
- package/src/features/workflow/components/panels/node-inspector/index.tsx +225 -0
- package/src/features/workflow/components/panels/node-inspector/input-panel.tsx +199 -0
- package/src/features/workflow/components/panels/node-inspector/live-data-unavailable.tsx +26 -0
- package/src/features/workflow/components/panels/node-inspector/node-inspector-layout.tsx +251 -0
- package/src/features/workflow/components/panels/node-inspector/output-panel.tsx +165 -0
- package/src/features/workflow/components/panels/node-inspector/schema-fields.ts +39 -0
- package/src/features/workflow/components/panels/node-inspector/types.ts +31 -0
- package/src/features/workflow/components/panels/node-inspector/use-node-tester.ts +209 -0
- package/src/features/workflow/components/panels/node-inspector/utils.ts +82 -0
- package/src/features/workflow/components/panels/rjsf-basic-widgets.tsx +21 -0
- package/src/features/workflow/components/panels/rjsf-condition-widgets.tsx +241 -0
- package/src/features/workflow/components/panels/rjsf-input-widgets.tsx +105 -0
- package/src/features/workflow/components/panels/rjsf-templates.tsx +146 -0
- package/src/features/workflow/components/panels/rjsf-text-widgets.tsx +139 -0
- package/src/features/workflow/components/panels/rjsf-theme.tsx +16 -0
- package/src/features/workflow/components/panels/schema-dnd.ts +79 -0
- package/src/features/workflow/components/panels/sidebar-node-item.tsx +42 -0
- package/src/features/workflow/components/panels/sidebar-nodes/actions.tsx +34 -0
- package/src/features/workflow/components/panels/sidebar-nodes/ai.tsx +40 -0
- package/src/features/workflow/components/panels/sidebar-nodes/data.tsx +53 -0
- package/src/features/workflow/components/panels/sidebar-nodes/index.ts +2 -0
- package/src/features/workflow/components/panels/sidebar-nodes/logic.tsx +127 -0
- package/src/features/workflow/components/panels/sidebar-nodes/node-categories.tsx +19 -0
- package/src/features/workflow/components/panels/sidebar-nodes/node-lists.ts +71 -0
- package/src/features/workflow/components/panels/sidebar-nodes/special.tsx +44 -0
- package/src/features/workflow/components/panels/sidebar-nodes/triggers.tsx +44 -0
- package/src/features/workflow/components/panels/sidebar-nodes/visualization.tsx +33 -0
- package/src/features/workflow/components/panels/sidebar-panel.tsx +243 -0
- package/src/features/workflow/components/panels/sidebar-panel.types.ts +73 -0
- package/src/features/workflow/components/panels/variable-inspector-table.tsx +99 -0
- package/src/features/workflow/components/panels/variable-inspector-tree.tsx +193 -0
- package/src/features/workflow/components/panels/variable-inspector-types.ts +3 -0
- package/src/features/workflow/components/panels/variable-inspector.tsx +189 -0
- package/src/features/workflow/components/panels/workflow-diff-dialog.tsx +207 -0
- package/src/features/workflow/components/panels/workflow-execution-details.tsx +118 -0
- package/src/features/workflow/components/panels/workflow-execution-history.hooks.ts +116 -0
- package/src/features/workflow/components/panels/workflow-execution-history.tsx +150 -0
- package/src/features/workflow/components/panels/workflow-execution-history.types.ts +53 -0
- package/src/features/workflow/components/panels/workflow-execution-history.utils.ts +195 -0
- package/src/features/workflow/components/panels/workflow-execution-sidebar.tsx +221 -0
- package/src/features/workflow/components/panels/workflow-governance-panel/subworkflow-list-card.tsx +147 -0
- package/src/features/workflow/components/panels/workflow-governance-panel/types.ts +26 -0
- package/src/features/workflow/components/panels/workflow-governance-panel/validation-section.tsx +126 -0
- package/src/features/workflow/components/panels/workflow-governance-panel.tsx +43 -0
- package/src/features/workflow/components/panels/workflow-history-filters.tsx +62 -0
- package/src/features/workflow/components/panels/workflow-history-footer.tsx +28 -0
- package/src/features/workflow/components/panels/workflow-history-header.tsx +47 -0
- package/src/features/workflow/components/panels/workflow-history-table.tsx +148 -0
- package/src/features/workflow/components/panels/workflow-history.tsx +150 -0
- package/src/features/workflow/components/panels/workflow-node-gallery-data/categories.ts +11 -0
- package/src/features/workflow/components/panels/workflow-node-gallery-data/items/actions.tsx +39 -0
- package/src/features/workflow/components/panels/workflow-node-gallery-data/items/ai.tsx +39 -0
- package/src/features/workflow/components/panels/workflow-node-gallery-data/items/data.tsx +55 -0
- package/src/features/workflow/components/panels/workflow-node-gallery-data/items/logic.tsx +39 -0
- package/src/features/workflow/components/panels/workflow-node-gallery-data/items/special.tsx +50 -0
- package/src/features/workflow/components/panels/workflow-node-gallery-data/items/triggers.tsx +71 -0
- package/src/features/workflow/components/panels/workflow-node-gallery-data/types.ts +9 -0
- package/src/features/workflow/components/panels/workflow-node-gallery-data.tsx +21 -0
- package/src/features/workflow/components/panels/workflow-node-gallery.tsx +86 -0
- package/src/features/workflow/components/panels/workflow-tabs.tsx +49 -0
- package/src/features/workflow/components/trace/agent-prism/Avatar.tsx +146 -0
- package/src/features/workflow/components/trace/agent-prism/Badge.tsx +95 -0
- package/src/features/workflow/components/trace/agent-prism/BrandLogo.tsx +102 -0
- package/src/features/workflow/components/trace/agent-prism/Button.tsx +124 -0
- package/src/features/workflow/components/trace/agent-prism/CollapseAndExpandControls.tsx +45 -0
- package/src/features/workflow/components/trace/agent-prism/CollapsibleSection.tsx +124 -0
- package/src/features/workflow/components/trace/agent-prism/CopyButton.tsx +63 -0
- package/src/features/workflow/components/trace/agent-prism/DetailsView/DetailsView.tsx +143 -0
- package/src/features/workflow/components/trace/agent-prism/DetailsView/DetailsViewAttributesTab.tsx +125 -0
- package/src/features/workflow/components/trace/agent-prism/DetailsView/DetailsViewContentViewer.tsx +51 -0
- package/src/features/workflow/components/trace/agent-prism/DetailsView/DetailsViewHeader.tsx +100 -0
- package/src/features/workflow/components/trace/agent-prism/DetailsView/DetailsViewHeaderActions.tsx +21 -0
- package/src/features/workflow/components/trace/agent-prism/DetailsView/DetailsViewInputOutputTab.tsx +126 -0
- package/src/features/workflow/components/trace/agent-prism/DetailsView/DetailsViewJsonOutput.tsx +30 -0
- package/src/features/workflow/components/trace/agent-prism/DetailsView/DetailsViewRawDataTab.tsx +31 -0
- package/src/features/workflow/components/trace/agent-prism/IconButton.tsx +75 -0
- package/src/features/workflow/components/trace/agent-prism/PriceBadge.tsx +14 -0
- package/src/features/workflow/components/trace/agent-prism/SearchInput.tsx +17 -0
- package/src/features/workflow/components/trace/agent-prism/SpanBadge.tsx +52 -0
- package/src/features/workflow/components/trace/agent-prism/SpanCard/SpanCard.tsx +480 -0
- package/src/features/workflow/components/trace/agent-prism/SpanCard/SpanCardBadges.tsx +23 -0
- package/src/features/workflow/components/trace/agent-prism/SpanCard/SpanCardConnector.tsx +36 -0
- package/src/features/workflow/components/trace/agent-prism/SpanCard/SpanCardTimeline.tsx +60 -0
- package/src/features/workflow/components/trace/agent-prism/SpanCard/SpanCardToggle.tsx +39 -0
- package/src/features/workflow/components/trace/agent-prism/SpanStatus.tsx +80 -0
- package/src/features/workflow/components/trace/agent-prism/TabSelector.tsx +35 -0
- package/src/features/workflow/components/trace/agent-prism/Tabs.tsx +140 -0
- package/src/features/workflow/components/trace/agent-prism/TextInput.tsx +143 -0
- package/src/features/workflow/components/trace/agent-prism/TimestampBadge.tsx +22 -0
- package/src/features/workflow/components/trace/agent-prism/TokensBadge.tsx +27 -0
- package/src/features/workflow/components/trace/agent-prism/TraceList/TraceList.tsx +87 -0
- package/src/features/workflow/components/trace/agent-prism/TraceList/TraceListItem.tsx +86 -0
- package/src/features/workflow/components/trace/agent-prism/TraceList/TraceListItemHeader.tsx +37 -0
- package/src/features/workflow/components/trace/agent-prism/TraceViewer/TraceViewer.test.tsx +183 -0
- package/src/features/workflow/components/trace/agent-prism/TraceViewer/TraceViewer.tsx +207 -0
- package/src/features/workflow/components/trace/agent-prism/TraceViewer/TraceViewerDesktopLayout.tsx +99 -0
- package/src/features/workflow/components/trace/agent-prism/TraceViewer/TraceViewerMobileLayout.tsx +103 -0
- package/src/features/workflow/components/trace/agent-prism/TraceViewer/TraceViewerPlaceholder.tsx +5 -0
- package/src/features/workflow/components/trace/agent-prism/TraceViewer/TraceViewerSearchAndControls.tsx +30 -0
- package/src/features/workflow/components/trace/agent-prism/TraceViewer/TraceViewerTreeViewContainer.tsx +76 -0
- package/src/features/workflow/components/trace/agent-prism/TraceViewer/useTraceSelection.ts +186 -0
- package/src/features/workflow/components/trace/agent-prism/TreeView.tsx +73 -0
- package/src/features/workflow/components/trace/agent-prism/index.ts +7 -0
- package/src/features/workflow/components/trace/agent-prism/shared.ts +170 -0
- package/src/features/workflow/components/trace/agent-prism/theme/index.js +97 -0
- package/src/features/workflow/components/trace/agent-prism/theme/index.ts +101 -0
- package/src/features/workflow/components/trace/agent-prism/theme/theme.css +247 -0
- package/src/features/workflow/data/node-types.ts +32 -0
- package/src/features/workflow/data/templates/feedly-digest.ts +120 -0
- package/src/features/workflow/data/templates/index.ts +30 -0
- package/src/features/workflow/data/templates/mongodb-session.ts +59 -0
- package/src/features/workflow/data/templates/python-task.ts +59 -0
- package/src/features/workflow/data/templates/quickstart-welcome.ts +65 -0
- package/src/features/workflow/data/templates/rss-monitor.ts +60 -0
- package/src/features/workflow/data/templates/slack-broadcast.ts +58 -0
- package/src/features/workflow/data/templates/telegram-broadcast.ts +76 -0
- package/src/features/workflow/data/templates/template-owner.ts +7 -0
- package/src/features/workflow/data/workflow-data.ts +13 -0
- package/src/features/workflow/data/workflow-types.ts +47 -0
- package/src/features/workflow/lib/graph-config/constants.ts +7 -0
- package/src/features/workflow/lib/graph-config/edge-processing.ts +147 -0
- package/src/features/workflow/lib/graph-config/name-mapping.ts +30 -0
- package/src/features/workflow/lib/graph-config/node-handlers/branching.ts +171 -0
- package/src/features/workflow/lib/graph-config/node-handlers/index.ts +16 -0
- package/src/features/workflow/lib/graph-config/node-handlers/integrations.ts +201 -0
- package/src/features/workflow/lib/graph-config/node-handlers/set-variable.ts +124 -0
- package/src/features/workflow/lib/graph-config/node-processing.ts +163 -0
- package/src/features/workflow/lib/graph-config/serialization.ts +31 -0
- package/src/features/workflow/lib/graph-config/terminal-connections.ts +37 -0
- package/src/features/workflow/lib/graph-config/types.ts +84 -0
- package/src/features/workflow/lib/graph-config/utils.ts +65 -0
- package/src/features/workflow/lib/graph-config/workload.ts +29 -0
- package/src/features/workflow/lib/graph-config.integration.logic.test.ts +168 -0
- package/src/features/workflow/lib/graph-config.integration.start-end.test.ts +68 -0
- package/src/features/workflow/lib/graph-config.integration.variables.test.ts +67 -0
- package/src/features/workflow/lib/graph-config.ts +80 -0
- package/src/features/workflow/lib/graph-utils.ts +193 -0
- package/src/features/workflow/lib/node-icons.tsx +183 -0
- package/src/features/workflow/lib/node-schemas/ai-nodes.ts +81 -0
- package/src/features/workflow/lib/node-schemas/base.ts +154 -0
- package/src/features/workflow/lib/node-schemas/condition-operators.ts +111 -0
- package/src/features/workflow/lib/node-schemas/index.ts +73 -0
- package/src/features/workflow/lib/node-schemas/integration-nodes.ts +153 -0
- package/src/features/workflow/lib/node-schemas/logic-nodes.ts +110 -0
- package/src/features/workflow/lib/node-schemas/state-nodes.ts +45 -0
- package/src/features/workflow/lib/node-schemas/trigger-nodes.ts +218 -0
- package/src/features/workflow/lib/node-schemas/ui.ts +88 -0
- package/src/features/workflow/lib/python-node.ts +23 -0
- package/src/features/workflow/lib/workflow-diff.ts +191 -0
- package/src/features/workflow/lib/workflow-execution-builders.ts +101 -0
- package/src/features/workflow/lib/workflow-execution-formatters.ts +145 -0
- package/src/features/workflow/lib/workflow-execution-storage.ts +60 -0
- package/src/features/workflow/lib/workflow-execution.types.ts +38 -0
- package/src/features/workflow/lib/workflow-storage-api.ts +122 -0
- package/src/features/workflow/lib/workflow-storage-helpers.ts +207 -0
- package/src/features/workflow/lib/workflow-storage-versioning.ts +71 -0
- package/src/features/workflow/lib/workflow-storage.constants.ts +21 -0
- package/src/features/workflow/lib/workflow-storage.list.integration.test.ts +70 -0
- package/src/features/workflow/lib/workflow-storage.sanitized-save.integration.test.ts +116 -0
- package/src/features/workflow/lib/workflow-storage.save.integration.test.ts +124 -0
- package/src/features/workflow/lib/workflow-storage.test-helpers.ts +29 -0
- package/src/features/workflow/lib/workflow-storage.ts +183 -0
- package/src/features/workflow/lib/workflow-storage.types.ts +76 -0
- package/src/features/workflow/pages/workflow-canvas/components/canvas-tab-content.tsx +157 -0
- package/src/features/workflow/pages/workflow-canvas/components/execution-tab-content.tsx +57 -0
- package/src/features/workflow/pages/workflow-canvas/components/readiness-tab-content.tsx +49 -0
- package/src/features/workflow/pages/workflow-canvas/components/settings-tab-content.tsx +160 -0
- package/src/features/workflow/pages/workflow-canvas/components/trace-tab-content.test.tsx +204 -0
- package/src/features/workflow/pages/workflow-canvas/components/trace-tab-content.tsx +202 -0
- package/src/features/workflow/pages/workflow-canvas/components/workflow-canvas-layout.tsx +179 -0
- package/src/features/workflow/pages/workflow-canvas/handlers/credentials.ts +158 -0
- package/src/features/workflow/pages/workflow-canvas/handlers/subworkflows.ts +227 -0
- package/src/features/workflow/pages/workflow-canvas/handlers/validation.ts +175 -0
- package/src/features/workflow/pages/workflow-canvas/helpers/clipboard.ts +85 -0
- package/src/features/workflow/pages/workflow-canvas/helpers/execution.ts +39 -0
- package/src/features/workflow/pages/workflow-canvas/helpers/id.ts +15 -0
- package/src/features/workflow/pages/workflow-canvas/helpers/node-identity.ts +157 -0
- package/src/features/workflow/pages/workflow-canvas/helpers/runtime-cache.ts +70 -0
- package/src/features/workflow/pages/workflow-canvas/helpers/sticky-notes.ts +52 -0
- package/src/features/workflow/pages/workflow-canvas/helpers/subworkflow-library.ts +12 -0
- package/src/features/workflow/pages/workflow-canvas/helpers/subworkflows/content-qa.ts +88 -0
- package/src/features/workflow/pages/workflow-canvas/helpers/subworkflows/customer-onboarding.ts +67 -0
- package/src/features/workflow/pages/workflow-canvas/helpers/subworkflows/incident-response.ts +88 -0
- package/src/features/workflow/pages/workflow-canvas/helpers/subworkflows/types.ts +9 -0
- package/src/features/workflow/pages/workflow-canvas/helpers/trace.ts +552 -0
- package/src/features/workflow/pages/workflow-canvas/helpers/transformers.ts +140 -0
- package/src/features/workflow/pages/workflow-canvas/helpers/types.ts +122 -0
- package/src/features/workflow/pages/workflow-canvas/helpers/validation.ts +57 -0
- package/src/features/workflow/pages/workflow-canvas/hooks/controller/build-layout-props.ts +229 -0
- package/src/features/workflow/pages/workflow-canvas/hooks/controller/use-workflow-canvas-controller.ts +26 -0
- package/src/features/workflow/pages/workflow-canvas/hooks/controller/use-workflow-canvas-core.ts +188 -0
- package/src/features/workflow/pages/workflow-canvas/hooks/controller/use-workflow-canvas-execution.ts +269 -0
- package/src/features/workflow/pages/workflow-canvas/hooks/controller/use-workflow-canvas-lifecycle.ts +44 -0
- package/src/features/workflow/pages/workflow-canvas/hooks/controller/use-workflow-canvas-resources.ts +92 -0
- package/src/features/workflow/pages/workflow-canvas/hooks/execution-canvas-updater.ts +79 -0
- package/src/features/workflow/pages/workflow-canvas/hooks/execution-log-helpers.ts +75 -0
- package/src/features/workflow/pages/workflow-canvas/hooks/execution-node-status.ts +46 -0
- package/src/features/workflow/pages/workflow-canvas/hooks/execution-record-updater.ts +118 -0
- package/src/features/workflow/pages/workflow-canvas/hooks/execution-record.ts +69 -0
- package/src/features/workflow/pages/workflow-canvas/hooks/execution-runtime-updates.ts +84 -0
- package/src/features/workflow/pages/workflow-canvas/hooks/node-factory.ts +166 -0
- package/src/features/workflow/pages/workflow-canvas/hooks/use-canvas-ui-state.ts +19 -0
- package/src/features/workflow/pages/workflow-canvas/hooks/use-decorated-nodes.ts +115 -0
- package/src/features/workflow/pages/workflow-canvas/hooks/use-execution-history-handlers.ts +187 -0
- package/src/features/workflow/pages/workflow-canvas/hooks/use-execution-trace.ts +302 -0
- package/src/features/workflow/pages/workflow-canvas/hooks/use-execution-updates.ts +143 -0
- package/src/features/workflow/pages/workflow-canvas/hooks/use-initial-fit-view.ts +27 -0
- package/src/features/workflow/pages/workflow-canvas/hooks/use-node-creation.ts +133 -0
- package/src/features/workflow/pages/workflow-canvas/hooks/use-node-inspector-handlers.ts +194 -0
- package/src/features/workflow/pages/workflow-canvas/hooks/use-pause-workflow.ts +95 -0
- package/src/features/workflow/pages/workflow-canvas/hooks/use-run-workflow.ts +139 -0
- package/src/features/workflow/pages/workflow-canvas/hooks/use-runtime-cache-sync.ts +52 -0
- package/src/features/workflow/pages/workflow-canvas/hooks/use-subworkflow-state.ts +47 -0
- package/src/features/workflow/pages/workflow-canvas/hooks/use-workflow-canvas-history.ts +233 -0
- package/src/features/workflow/pages/workflow-canvas/hooks/use-workflow-chat.ts +284 -0
- package/src/features/workflow/pages/workflow-canvas/hooks/use-workflow-clipboard.ts +218 -0
- package/src/features/workflow/pages/workflow-canvas/hooks/use-workflow-credentials.ts +139 -0
- package/src/features/workflow/pages/workflow-canvas/hooks/use-workflow-duplicate-nodes.ts +140 -0
- package/src/features/workflow/pages/workflow-canvas/hooks/use-workflow-execution-state.ts +20 -0
- package/src/features/workflow/pages/workflow-canvas/hooks/use-workflow-file-transfer.ts +203 -0
- package/src/features/workflow/pages/workflow-canvas/hooks/use-workflow-keybindings.ts +126 -0
- package/src/features/workflow/pages/workflow-canvas/hooks/use-workflow-loader.ts +174 -0
- package/src/features/workflow/pages/workflow-canvas/hooks/use-workflow-metadata-state.ts +28 -0
- package/src/features/workflow/pages/workflow-canvas/hooks/use-workflow-node-deletion.ts +167 -0
- package/src/features/workflow/pages/workflow-canvas/hooks/use-workflow-node-state.ts +89 -0
- package/src/features/workflow/pages/workflow-canvas/hooks/use-workflow-saver.ts +204 -0
- package/src/features/workflow/pages/workflow-canvas/hooks/use-workflow-search.ts +167 -0
- package/src/features/workflow/pages/workflow-canvas/hooks/use-workflow-sticky-notes.ts +89 -0
- package/src/features/workflow/pages/workflow-canvas/hooks/use-workflow-storage-listener.ts +51 -0
- package/src/features/workflow/pages/workflow-canvas/hooks/use-workflow-validation-state.ts +22 -0
- package/src/features/workflow/pages/workflow-canvas/hooks/workflow-clipboard-copy.ts +96 -0
- package/src/features/workflow/pages/workflow-canvas/hooks/workflow-clipboard-paste.ts +109 -0
- package/src/features/workflow/pages/workflow-canvas/hooks/workflow-runner-websocket.ts +146 -0
- package/src/features/workflow/pages/workflow-canvas.test.tsx +194 -0
- package/src/features/workflow/pages/workflow-canvas.tsx +23 -0
- package/src/features/workflow/pages/workflow-execution-details.tsx +194 -0
- package/src/features/workflow/pages/workflow-gallery/types.ts +21 -0
- package/src/features/workflow/pages/workflow-gallery/use-workflow-gallery-actions.ts +219 -0
- package/src/features/workflow/pages/workflow-gallery/use-workflow-gallery-state.ts +204 -0
- package/src/features/workflow/pages/workflow-gallery/use-workflow-gallery.ts +21 -0
- package/src/features/workflow/pages/workflow-gallery/workflow-card.tsx +222 -0
- package/src/features/workflow/pages/workflow-gallery/workflow-create-dialogs.tsx +114 -0
- package/src/features/workflow/pages/workflow-gallery/workflow-filter-popover.tsx +190 -0
- package/src/features/workflow/pages/workflow-gallery/workflow-gallery-header.tsx +134 -0
- package/src/features/workflow/pages/workflow-gallery/workflow-gallery-tabs.tsx +93 -0
- package/src/features/workflow/pages/workflow-gallery/workflow-thumbnail.tsx +82 -0
- package/src/features/workflow/pages/workflow-gallery.tsx +100 -0
- package/src/features/workflow/types/credential-vault.ts +36 -0
- package/src/hooks/use-color-scheme.ts +77 -0
- package/src/hooks/use-credential-vault.ts +245 -0
- package/src/hooks/use-mobile.tsx +21 -0
- package/src/hooks/use-toast.ts +182 -0
- package/src/index.css +95 -0
- package/src/lib/api.test.ts +135 -0
- package/src/lib/api.ts +45 -0
- package/src/lib/config.ts +84 -0
- package/src/lib/theme.ts +71 -0
- package/src/lib/utils.ts +6 -0
- package/src/main.tsx +24 -0
- package/src/setupTests.ts +5 -0
- package/src/test-utils/chatkit-stub.ts +15 -0
- package/src/testing/mocks/backend/credentials.ts +60 -0
- package/src/testing/mocks/backend/request-utils.ts +32 -0
- package/src/testing/mocks/backend/workflows.ts +235 -0
- package/src/testing/mocks/backend.ts +52 -0
- package/src/testing/mocks/chatkit.ts +14 -0
- package/src/vite-env.d.ts +10 -0
- package/tailwind.config.js +61 -0
- package/tsconfig.app.json +30 -0
- package/tsconfig.json +16 -0
- package/tsconfig.node.json +20 -0
- package/vite.config.ts +30 -0
|
@@ -0,0 +1,772 @@
|
|
|
1
|
+
var QK=Object.defineProperty;var JK=(e,t,n)=>t in e?QK(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n;var eY=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports);var ft=(e,t,n)=>JK(e,typeof t!="symbol"?t+"":t,n);var MPe=eY((br,wr)=>{function lz(e,t){for(var n=0;n<t.length;n++){const r=t[n];if(typeof r!="string"&&!Array.isArray(r)){for(const a in r)if(a!=="default"&&!(a in e)){const s=Object.getOwnPropertyDescriptor(r,a);s&&Object.defineProperty(e,a,s.get?s:{enumerable:!0,get:()=>r[a]})}}}return Object.freeze(Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}))}(function(){const t=document.createElement("link").relList;if(t&&t.supports&&t.supports("modulepreload"))return;for(const a of document.querySelectorAll('link[rel="modulepreload"]'))r(a);new MutationObserver(a=>{for(const s of a)if(s.type==="childList")for(const i of s.addedNodes)i.tagName==="LINK"&&i.rel==="modulepreload"&&r(i)}).observe(document,{childList:!0,subtree:!0});function n(a){const s={};return a.integrity&&(s.integrity=a.integrity),a.referrerPolicy&&(s.referrerPolicy=a.referrerPolicy),a.crossOrigin==="use-credentials"?s.credentials="include":a.crossOrigin==="anonymous"?s.credentials="omit":s.credentials="same-origin",s}function r(a){if(a.ep)return;a.ep=!0;const s=n(a);fetch(a.href,s)}})();var rm=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function zr(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var zb={exports:{}},Sd={};/**
|
|
2
|
+
* @license React
|
|
3
|
+
* react-jsx-runtime.production.js
|
|
4
|
+
*
|
|
5
|
+
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
6
|
+
*
|
|
7
|
+
* This source code is licensed under the MIT license found in the
|
|
8
|
+
* LICENSE file in the root directory of this source tree.
|
|
9
|
+
*/var EO;function tY(){if(EO)return Sd;EO=1;var e=Symbol.for("react.transitional.element"),t=Symbol.for("react.fragment");function n(r,a,s){var i=null;if(s!==void 0&&(i=""+s),a.key!==void 0&&(i=""+a.key),"key"in a){s={};for(var l in a)l!=="key"&&(s[l]=a[l])}else s=a;return a=s.ref,{$$typeof:e,type:r,key:i,ref:a!==void 0?a:null,props:s}}return Sd.Fragment=t,Sd.jsx=n,Sd.jsxs=n,Sd}var TO;function nY(){return TO||(TO=1,zb.exports=tY()),zb.exports}var c=nY(),qb={exports:{}},Fe={};/**
|
|
10
|
+
* @license React
|
|
11
|
+
* react.production.js
|
|
12
|
+
*
|
|
13
|
+
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
14
|
+
*
|
|
15
|
+
* This source code is licensed under the MIT license found in the
|
|
16
|
+
* LICENSE file in the root directory of this source tree.
|
|
17
|
+
*/var AO;function rY(){if(AO)return Fe;AO=1;var e=Symbol.for("react.transitional.element"),t=Symbol.for("react.portal"),n=Symbol.for("react.fragment"),r=Symbol.for("react.strict_mode"),a=Symbol.for("react.profiler"),s=Symbol.for("react.consumer"),i=Symbol.for("react.context"),l=Symbol.for("react.forward_ref"),d=Symbol.for("react.suspense"),f=Symbol.for("react.memo"),h=Symbol.for("react.lazy"),p=Symbol.for("react.activity"),g=Symbol.iterator;function y(D){return D===null||typeof D!="object"?null:(D=g&&D[g]||D["@@iterator"],typeof D=="function"?D:null)}var S={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},w=Object.assign,b={};function x(D,W,B){this.props=D,this.context=W,this.refs=b,this.updater=B||S}x.prototype.isReactComponent={},x.prototype.setState=function(D,W){if(typeof D!="object"&&typeof D!="function"&&D!=null)throw Error("takes an object of state variables to update or a function which returns an object of state variables.");this.updater.enqueueSetState(this,D,W,"setState")},x.prototype.forceUpdate=function(D){this.updater.enqueueForceUpdate(this,D,"forceUpdate")};function _(){}_.prototype=x.prototype;function j(D,W,B){this.props=D,this.context=W,this.refs=b,this.updater=B||S}var C=j.prototype=new _;C.constructor=j,w(C,x.prototype),C.isPureReactComponent=!0;var T=Array.isArray;function A(){}var k={H:null,A:null,T:null,S:null},O=Object.prototype.hasOwnProperty;function M(D,W,B){var $=B.ref;return{$$typeof:e,type:D,key:W,ref:$!==void 0?$:null,props:B}}function z(D,W){return M(D.type,W,D.props)}function L(D){return typeof D=="object"&&D!==null&&D.$$typeof===e}function U(D){var W={"=":"=0",":":"=2"};return"$"+D.replace(/[=:]/g,function(B){return W[B]})}var F=/\/+/g;function q(D,W){return typeof D=="object"&&D!==null&&D.key!=null?U(""+D.key):W.toString(36)}function V(D){switch(D.status){case"fulfilled":return D.value;case"rejected":throw D.reason;default:switch(typeof D.status=="string"?D.then(A,A):(D.status="pending",D.then(function(W){D.status==="pending"&&(D.status="fulfilled",D.value=W)},function(W){D.status==="pending"&&(D.status="rejected",D.reason=W)})),D.status){case"fulfilled":return D.value;case"rejected":throw D.reason}}throw D}function P(D,W,B,$,G){var ee=typeof D;(ee==="undefined"||ee==="boolean")&&(D=null);var re=!1;if(D===null)re=!0;else switch(ee){case"bigint":case"string":case"number":re=!0;break;case"object":switch(D.$$typeof){case e:case t:re=!0;break;case h:return re=D._init,P(re(D._payload),W,B,$,G)}}if(re)return G=G(D),re=$===""?"."+q(D,0):$,T(G)?(B="",re!=null&&(B=re.replace(F,"$&/")+"/"),P(G,W,B,"",function(ae){return ae})):G!=null&&(L(G)&&(G=z(G,B+(G.key==null||D&&D.key===G.key?"":(""+G.key).replace(F,"$&/")+"/")+re)),W.push(G)),1;re=0;var ne=$===""?".":$+":";if(T(D))for(var Q=0;Q<D.length;Q++)$=D[Q],ee=ne+q($,Q),re+=P($,W,B,ee,G);else if(Q=y(D),typeof Q=="function")for(D=Q.call(D),Q=0;!($=D.next()).done;)$=$.value,ee=ne+q($,Q++),re+=P($,W,B,ee,G);else if(ee==="object"){if(typeof D.then=="function")return P(V(D),W,B,$,G);throw W=String(D),Error("Objects are not valid as a React child (found: "+(W==="[object Object]"?"object with keys {"+Object.keys(D).join(", ")+"}":W)+"). If you meant to render a collection of children, use an array instead.")}return re}function K(D,W,B){if(D==null)return D;var $=[],G=0;return P(D,$,"","",function(ee){return W.call(B,ee,G++)}),$}function H(D){if(D._status===-1){var W=D._result;W=W(),W.then(function(B){(D._status===0||D._status===-1)&&(D._status=1,D._result=B)},function(B){(D._status===0||D._status===-1)&&(D._status=2,D._result=B)}),D._status===-1&&(D._status=0,D._result=W)}if(D._status===1)return D._result.default;throw D._result}var Z=typeof reportError=="function"?reportError:function(D){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var W=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof D=="object"&&D!==null&&typeof D.message=="string"?String(D.message):String(D),error:D});if(!window.dispatchEvent(W))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",D);return}console.error(D)},J={map:K,forEach:function(D,W,B){K(D,function(){W.apply(this,arguments)},B)},count:function(D){var W=0;return K(D,function(){W++}),W},toArray:function(D){return K(D,function(W){return W})||[]},only:function(D){if(!L(D))throw Error("React.Children.only expected to receive a single React element child.");return D}};return Fe.Activity=p,Fe.Children=J,Fe.Component=x,Fe.Fragment=n,Fe.Profiler=a,Fe.PureComponent=j,Fe.StrictMode=r,Fe.Suspense=d,Fe.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=k,Fe.__COMPILER_RUNTIME={__proto__:null,c:function(D){return k.H.useMemoCache(D)}},Fe.cache=function(D){return function(){return D.apply(null,arguments)}},Fe.cacheSignal=function(){return null},Fe.cloneElement=function(D,W,B){if(D==null)throw Error("The argument must be a React element, but you passed "+D+".");var $=w({},D.props),G=D.key;if(W!=null)for(ee in W.key!==void 0&&(G=""+W.key),W)!O.call(W,ee)||ee==="key"||ee==="__self"||ee==="__source"||ee==="ref"&&W.ref===void 0||($[ee]=W[ee]);var ee=arguments.length-2;if(ee===1)$.children=B;else if(1<ee){for(var re=Array(ee),ne=0;ne<ee;ne++)re[ne]=arguments[ne+2];$.children=re}return M(D.type,G,$)},Fe.createContext=function(D){return D={$$typeof:i,_currentValue:D,_currentValue2:D,_threadCount:0,Provider:null,Consumer:null},D.Provider=D,D.Consumer={$$typeof:s,_context:D},D},Fe.createElement=function(D,W,B){var $,G={},ee=null;if(W!=null)for($ in W.key!==void 0&&(ee=""+W.key),W)O.call(W,$)&&$!=="key"&&$!=="__self"&&$!=="__source"&&(G[$]=W[$]);var re=arguments.length-2;if(re===1)G.children=B;else if(1<re){for(var ne=Array(re),Q=0;Q<re;Q++)ne[Q]=arguments[Q+2];G.children=ne}if(D&&D.defaultProps)for($ in re=D.defaultProps,re)G[$]===void 0&&(G[$]=re[$]);return M(D,ee,G)},Fe.createRef=function(){return{current:null}},Fe.forwardRef=function(D){return{$$typeof:l,render:D}},Fe.isValidElement=L,Fe.lazy=function(D){return{$$typeof:h,_payload:{_status:-1,_result:D},_init:H}},Fe.memo=function(D,W){return{$$typeof:f,type:D,compare:W===void 0?null:W}},Fe.startTransition=function(D){var W=k.T,B={};k.T=B;try{var $=D(),G=k.S;G!==null&&G(B,$),typeof $=="object"&&$!==null&&typeof $.then=="function"&&$.then(A,Z)}catch(ee){Z(ee)}finally{W!==null&&B.types!==null&&(W.types=B.types),k.T=W}},Fe.unstable_useCacheRefresh=function(){return k.H.useCacheRefresh()},Fe.use=function(D){return k.H.use(D)},Fe.useActionState=function(D,W,B){return k.H.useActionState(D,W,B)},Fe.useCallback=function(D,W){return k.H.useCallback(D,W)},Fe.useContext=function(D){return k.H.useContext(D)},Fe.useDebugValue=function(){},Fe.useDeferredValue=function(D,W){return k.H.useDeferredValue(D,W)},Fe.useEffect=function(D,W){return k.H.useEffect(D,W)},Fe.useEffectEvent=function(D){return k.H.useEffectEvent(D)},Fe.useId=function(){return k.H.useId()},Fe.useImperativeHandle=function(D,W,B){return k.H.useImperativeHandle(D,W,B)},Fe.useInsertionEffect=function(D,W){return k.H.useInsertionEffect(D,W)},Fe.useLayoutEffect=function(D,W){return k.H.useLayoutEffect(D,W)},Fe.useMemo=function(D,W){return k.H.useMemo(D,W)},Fe.useOptimistic=function(D,W){return k.H.useOptimistic(D,W)},Fe.useReducer=function(D,W,B){return k.H.useReducer(D,W,B)},Fe.useRef=function(D){return k.H.useRef(D)},Fe.useState=function(D){return k.H.useState(D)},Fe.useSyncExternalStore=function(D,W,B){return k.H.useSyncExternalStore(D,W,B)},Fe.useTransition=function(){return k.H.useTransition()},Fe.version="19.2.0",Fe}var RO;function iu(){return RO||(RO=1,qb.exports=rY()),qb.exports}var N=iu();const Me=zr(N),ky=lz({__proto__:null,default:Me},[N]);var Fb={exports:{}},Mn={};/**
|
|
18
|
+
* @license React
|
|
19
|
+
* react-dom.production.js
|
|
20
|
+
*
|
|
21
|
+
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
22
|
+
*
|
|
23
|
+
* This source code is licensed under the MIT license found in the
|
|
24
|
+
* LICENSE file in the root directory of this source tree.
|
|
25
|
+
*/var kO;function aY(){if(kO)return Mn;kO=1;var e=iu();function t(d){var f="https://react.dev/errors/"+d;if(1<arguments.length){f+="?args[]="+encodeURIComponent(arguments[1]);for(var h=2;h<arguments.length;h++)f+="&args[]="+encodeURIComponent(arguments[h])}return"Minified React error #"+d+"; visit "+f+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function n(){}var r={d:{f:n,r:function(){throw Error(t(522))},D:n,C:n,L:n,m:n,X:n,S:n,M:n},p:0,findDOMNode:null},a=Symbol.for("react.portal");function s(d,f,h){var p=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:a,key:p==null?null:""+p,children:d,containerInfo:f,implementation:h}}var i=e.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE;function l(d,f){if(d==="font")return"";if(typeof f=="string")return f==="use-credentials"?f:""}return Mn.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=r,Mn.createPortal=function(d,f){var h=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!f||f.nodeType!==1&&f.nodeType!==9&&f.nodeType!==11)throw Error(t(299));return s(d,f,null,h)},Mn.flushSync=function(d){var f=i.T,h=r.p;try{if(i.T=null,r.p=2,d)return d()}finally{i.T=f,r.p=h,r.d.f()}},Mn.preconnect=function(d,f){typeof d=="string"&&(f?(f=f.crossOrigin,f=typeof f=="string"?f==="use-credentials"?f:"":void 0):f=null,r.d.C(d,f))},Mn.prefetchDNS=function(d){typeof d=="string"&&r.d.D(d)},Mn.preinit=function(d,f){if(typeof d=="string"&&f&&typeof f.as=="string"){var h=f.as,p=l(h,f.crossOrigin),g=typeof f.integrity=="string"?f.integrity:void 0,y=typeof f.fetchPriority=="string"?f.fetchPriority:void 0;h==="style"?r.d.S(d,typeof f.precedence=="string"?f.precedence:void 0,{crossOrigin:p,integrity:g,fetchPriority:y}):h==="script"&&r.d.X(d,{crossOrigin:p,integrity:g,fetchPriority:y,nonce:typeof f.nonce=="string"?f.nonce:void 0})}},Mn.preinitModule=function(d,f){if(typeof d=="string")if(typeof f=="object"&&f!==null){if(f.as==null||f.as==="script"){var h=l(f.as,f.crossOrigin);r.d.M(d,{crossOrigin:h,integrity:typeof f.integrity=="string"?f.integrity:void 0,nonce:typeof f.nonce=="string"?f.nonce:void 0})}}else f==null&&r.d.M(d)},Mn.preload=function(d,f){if(typeof d=="string"&&typeof f=="object"&&f!==null&&typeof f.as=="string"){var h=f.as,p=l(h,f.crossOrigin);r.d.L(d,h,{crossOrigin:p,integrity:typeof f.integrity=="string"?f.integrity:void 0,nonce:typeof f.nonce=="string"?f.nonce:void 0,type:typeof f.type=="string"?f.type:void 0,fetchPriority:typeof f.fetchPriority=="string"?f.fetchPriority:void 0,referrerPolicy:typeof f.referrerPolicy=="string"?f.referrerPolicy:void 0,imageSrcSet:typeof f.imageSrcSet=="string"?f.imageSrcSet:void 0,imageSizes:typeof f.imageSizes=="string"?f.imageSizes:void 0,media:typeof f.media=="string"?f.media:void 0})}},Mn.preloadModule=function(d,f){if(typeof d=="string")if(f){var h=l(f.as,f.crossOrigin);r.d.m(d,{as:typeof f.as=="string"&&f.as!=="script"?f.as:void 0,crossOrigin:h,integrity:typeof f.integrity=="string"?f.integrity:void 0})}else r.d.m(d)},Mn.requestFormReset=function(d){r.d.r(d)},Mn.unstable_batchedUpdates=function(d,f){return d(f)},Mn.useFormState=function(d,f,h){return i.H.useFormState(d,f,h)},Mn.useFormStatus=function(){return i.H.useHostTransitionStatus()},Mn.version="19.2.0",Mn}var OO;function cz(){if(OO)return Fb.exports;OO=1;function e(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(e)}catch(t){console.error(t)}}return e(),Fb.exports=aY(),Fb.exports}var ol=cz();const uz=zr(ol),sY=lz({__proto__:null,default:uz},[ol]);var Ub={exports:{}},_d={},Hb={exports:{}},Bb={};/**
|
|
26
|
+
* @license React
|
|
27
|
+
* scheduler.production.js
|
|
28
|
+
*
|
|
29
|
+
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
30
|
+
*
|
|
31
|
+
* This source code is licensed under the MIT license found in the
|
|
32
|
+
* LICENSE file in the root directory of this source tree.
|
|
33
|
+
*/var MO;function oY(){return MO||(MO=1,(function(e){function t(P,K){var H=P.length;P.push(K);e:for(;0<H;){var Z=H-1>>>1,J=P[Z];if(0<a(J,K))P[Z]=K,P[H]=J,H=Z;else break e}}function n(P){return P.length===0?null:P[0]}function r(P){if(P.length===0)return null;var K=P[0],H=P.pop();if(H!==K){P[0]=H;e:for(var Z=0,J=P.length,D=J>>>1;Z<D;){var W=2*(Z+1)-1,B=P[W],$=W+1,G=P[$];if(0>a(B,H))$<J&&0>a(G,B)?(P[Z]=G,P[$]=H,Z=$):(P[Z]=B,P[W]=H,Z=W);else if($<J&&0>a(G,H))P[Z]=G,P[$]=H,Z=$;else break e}}return K}function a(P,K){var H=P.sortIndex-K.sortIndex;return H!==0?H:P.id-K.id}if(e.unstable_now=void 0,typeof performance=="object"&&typeof performance.now=="function"){var s=performance;e.unstable_now=function(){return s.now()}}else{var i=Date,l=i.now();e.unstable_now=function(){return i.now()-l}}var d=[],f=[],h=1,p=null,g=3,y=!1,S=!1,w=!1,b=!1,x=typeof setTimeout=="function"?setTimeout:null,_=typeof clearTimeout=="function"?clearTimeout:null,j=typeof setImmediate<"u"?setImmediate:null;function C(P){for(var K=n(f);K!==null;){if(K.callback===null)r(f);else if(K.startTime<=P)r(f),K.sortIndex=K.expirationTime,t(d,K);else break;K=n(f)}}function T(P){if(w=!1,C(P),!S)if(n(d)!==null)S=!0,A||(A=!0,U());else{var K=n(f);K!==null&&V(T,K.startTime-P)}}var A=!1,k=-1,O=5,M=-1;function z(){return b?!0:!(e.unstable_now()-M<O)}function L(){if(b=!1,A){var P=e.unstable_now();M=P;var K=!0;try{e:{S=!1,w&&(w=!1,_(k),k=-1),y=!0;var H=g;try{t:{for(C(P),p=n(d);p!==null&&!(p.expirationTime>P&&z());){var Z=p.callback;if(typeof Z=="function"){p.callback=null,g=p.priorityLevel;var J=Z(p.expirationTime<=P);if(P=e.unstable_now(),typeof J=="function"){p.callback=J,C(P),K=!0;break t}p===n(d)&&r(d),C(P)}else r(d);p=n(d)}if(p!==null)K=!0;else{var D=n(f);D!==null&&V(T,D.startTime-P),K=!1}}break e}finally{p=null,g=H,y=!1}K=void 0}}finally{K?U():A=!1}}}var U;if(typeof j=="function")U=function(){j(L)};else if(typeof MessageChannel<"u"){var F=new MessageChannel,q=F.port2;F.port1.onmessage=L,U=function(){q.postMessage(null)}}else U=function(){x(L,0)};function V(P,K){k=x(function(){P(e.unstable_now())},K)}e.unstable_IdlePriority=5,e.unstable_ImmediatePriority=1,e.unstable_LowPriority=4,e.unstable_NormalPriority=3,e.unstable_Profiling=null,e.unstable_UserBlockingPriority=2,e.unstable_cancelCallback=function(P){P.callback=null},e.unstable_forceFrameRate=function(P){0>P||125<P?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):O=0<P?Math.floor(1e3/P):5},e.unstable_getCurrentPriorityLevel=function(){return g},e.unstable_next=function(P){switch(g){case 1:case 2:case 3:var K=3;break;default:K=g}var H=g;g=K;try{return P()}finally{g=H}},e.unstable_requestPaint=function(){b=!0},e.unstable_runWithPriority=function(P,K){switch(P){case 1:case 2:case 3:case 4:case 5:break;default:P=3}var H=g;g=P;try{return K()}finally{g=H}},e.unstable_scheduleCallback=function(P,K,H){var Z=e.unstable_now();switch(typeof H=="object"&&H!==null?(H=H.delay,H=typeof H=="number"&&0<H?Z+H:Z):H=Z,P){case 1:var J=-1;break;case 2:J=250;break;case 5:J=1073741823;break;case 4:J=1e4;break;default:J=5e3}return J=H+J,P={id:h++,callback:K,priorityLevel:P,startTime:H,expirationTime:J,sortIndex:-1},H>Z?(P.sortIndex=H,t(f,P),n(d)===null&&P===n(f)&&(w?(_(k),k=-1):w=!0,V(T,H-Z))):(P.sortIndex=J,t(d,P),S||y||(S=!0,A||(A=!0,U()))),P},e.unstable_shouldYield=z,e.unstable_wrapCallback=function(P){var K=g;return function(){var H=g;g=K;try{return P.apply(this,arguments)}finally{g=H}}}})(Bb)),Bb}var DO;function iY(){return DO||(DO=1,Hb.exports=oY()),Hb.exports}/**
|
|
34
|
+
* @license React
|
|
35
|
+
* react-dom-client.production.js
|
|
36
|
+
*
|
|
37
|
+
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
38
|
+
*
|
|
39
|
+
* This source code is licensed under the MIT license found in the
|
|
40
|
+
* LICENSE file in the root directory of this source tree.
|
|
41
|
+
*/var PO;function lY(){if(PO)return _d;PO=1;var e=iY(),t=iu(),n=cz();function r(o){var u="https://react.dev/errors/"+o;if(1<arguments.length){u+="?args[]="+encodeURIComponent(arguments[1]);for(var m=2;m<arguments.length;m++)u+="&args[]="+encodeURIComponent(arguments[m])}return"Minified React error #"+o+"; visit "+u+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function a(o){return!(!o||o.nodeType!==1&&o.nodeType!==9&&o.nodeType!==11)}function s(o){var u=o,m=o;if(o.alternate)for(;u.return;)u=u.return;else{o=u;do u=o,(u.flags&4098)!==0&&(m=u.return),o=u.return;while(o)}return u.tag===3?m:null}function i(o){if(o.tag===13){var u=o.memoizedState;if(u===null&&(o=o.alternate,o!==null&&(u=o.memoizedState)),u!==null)return u.dehydrated}return null}function l(o){if(o.tag===31){var u=o.memoizedState;if(u===null&&(o=o.alternate,o!==null&&(u=o.memoizedState)),u!==null)return u.dehydrated}return null}function d(o){if(s(o)!==o)throw Error(r(188))}function f(o){var u=o.alternate;if(!u){if(u=s(o),u===null)throw Error(r(188));return u!==o?null:o}for(var m=o,v=u;;){var E=m.return;if(E===null)break;var R=E.alternate;if(R===null){if(v=E.return,v!==null){m=v;continue}break}if(E.child===R.child){for(R=E.child;R;){if(R===m)return d(E),o;if(R===v)return d(E),u;R=R.sibling}throw Error(r(188))}if(m.return!==v.return)m=E,v=R;else{for(var I=!1,X=E.child;X;){if(X===m){I=!0,m=E,v=R;break}if(X===v){I=!0,v=E,m=R;break}X=X.sibling}if(!I){for(X=R.child;X;){if(X===m){I=!0,m=R,v=E;break}if(X===v){I=!0,v=R,m=E;break}X=X.sibling}if(!I)throw Error(r(189))}}if(m.alternate!==v)throw Error(r(190))}if(m.tag!==3)throw Error(r(188));return m.stateNode.current===m?o:u}function h(o){var u=o.tag;if(u===5||u===26||u===27||u===6)return o;for(o=o.child;o!==null;){if(u=h(o),u!==null)return u;o=o.sibling}return null}var p=Object.assign,g=Symbol.for("react.element"),y=Symbol.for("react.transitional.element"),S=Symbol.for("react.portal"),w=Symbol.for("react.fragment"),b=Symbol.for("react.strict_mode"),x=Symbol.for("react.profiler"),_=Symbol.for("react.consumer"),j=Symbol.for("react.context"),C=Symbol.for("react.forward_ref"),T=Symbol.for("react.suspense"),A=Symbol.for("react.suspense_list"),k=Symbol.for("react.memo"),O=Symbol.for("react.lazy"),M=Symbol.for("react.activity"),z=Symbol.for("react.memo_cache_sentinel"),L=Symbol.iterator;function U(o){return o===null||typeof o!="object"?null:(o=L&&o[L]||o["@@iterator"],typeof o=="function"?o:null)}var F=Symbol.for("react.client.reference");function q(o){if(o==null)return null;if(typeof o=="function")return o.$$typeof===F?null:o.displayName||o.name||null;if(typeof o=="string")return o;switch(o){case w:return"Fragment";case x:return"Profiler";case b:return"StrictMode";case T:return"Suspense";case A:return"SuspenseList";case M:return"Activity"}if(typeof o=="object")switch(o.$$typeof){case S:return"Portal";case j:return o.displayName||"Context";case _:return(o._context.displayName||"Context")+".Consumer";case C:var u=o.render;return o=o.displayName,o||(o=u.displayName||u.name||"",o=o!==""?"ForwardRef("+o+")":"ForwardRef"),o;case k:return u=o.displayName||null,u!==null?u:q(o.type)||"Memo";case O:u=o._payload,o=o._init;try{return q(o(u))}catch{}}return null}var V=Array.isArray,P=t.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,K=n.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,H={pending:!1,data:null,method:null,action:null},Z=[],J=-1;function D(o){return{current:o}}function W(o){0>J||(o.current=Z[J],Z[J]=null,J--)}function B(o,u){J++,Z[J]=o.current,o.current=u}var $=D(null),G=D(null),ee=D(null),re=D(null);function ne(o,u){switch(B(ee,u),B(G,o),B($,null),u.nodeType){case 9:case 11:o=(o=u.documentElement)&&(o=o.namespaceURI)?Xk(o):0;break;default:if(o=u.tagName,u=u.namespaceURI)u=Xk(u),o=Zk(u,o);else switch(o){case"svg":o=1;break;case"math":o=2;break;default:o=0}}W($),B($,o)}function Q(){W($),W(G),W(ee)}function ae(o){o.memoizedState!==null&&B(re,o);var u=$.current,m=Zk(u,o.type);u!==m&&(B(G,o),B($,m))}function Y(o){G.current===o&&(W($),W(G)),re.current===o&&(W(re),vd._currentValue=H)}var te,se;function le(o){if(te===void 0)try{throw Error()}catch(m){var u=m.stack.trim().match(/\n( *(at )?)/);te=u&&u[1]||"",se=-1<m.stack.indexOf(`
|
|
42
|
+
at`)?" (<anonymous>)":-1<m.stack.indexOf("@")?"@unknown:0:0":""}return`
|
|
43
|
+
`+te+o+se}var fe=!1;function ve(o,u){if(!o||fe)return"";fe=!0;var m=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{var v={DetermineComponentFrameRoot:function(){try{if(u){var be=function(){throw Error()};if(Object.defineProperty(be.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(be,[])}catch(pe){var he=pe}Reflect.construct(o,[],be)}else{try{be.call()}catch(pe){he=pe}o.call(be.prototype)}}else{try{throw Error()}catch(pe){he=pe}(be=o())&&typeof be.catch=="function"&&be.catch(function(){})}}catch(pe){if(pe&&he&&typeof pe.stack=="string")return[pe.stack,he.stack]}return[null,null]}};v.DetermineComponentFrameRoot.displayName="DetermineComponentFrameRoot";var E=Object.getOwnPropertyDescriptor(v.DetermineComponentFrameRoot,"name");E&&E.configurable&&Object.defineProperty(v.DetermineComponentFrameRoot,"name",{value:"DetermineComponentFrameRoot"});var R=v.DetermineComponentFrameRoot(),I=R[0],X=R[1];if(I&&X){var oe=I.split(`
|
|
44
|
+
`),de=X.split(`
|
|
45
|
+
`);for(E=v=0;v<oe.length&&!oe[v].includes("DetermineComponentFrameRoot");)v++;for(;E<de.length&&!de[E].includes("DetermineComponentFrameRoot");)E++;if(v===oe.length||E===de.length)for(v=oe.length-1,E=de.length-1;1<=v&&0<=E&&oe[v]!==de[E];)E--;for(;1<=v&&0<=E;v--,E--)if(oe[v]!==de[E]){if(v!==1||E!==1)do if(v--,E--,0>E||oe[v]!==de[E]){var ge=`
|
|
46
|
+
`+oe[v].replace(" at new "," at ");return o.displayName&&ge.includes("<anonymous>")&&(ge=ge.replace("<anonymous>",o.displayName)),ge}while(1<=v&&0<=E);break}}}finally{fe=!1,Error.prepareStackTrace=m}return(m=o?o.displayName||o.name:"")?le(m):""}function Se(o,u){switch(o.tag){case 26:case 27:case 5:return le(o.type);case 16:return le("Lazy");case 13:return o.child!==u&&u!==null?le("Suspense Fallback"):le("Suspense");case 19:return le("SuspenseList");case 0:case 15:return ve(o.type,!1);case 11:return ve(o.type.render,!1);case 1:return ve(o.type,!0);case 31:return le("Activity");default:return""}}function Re(o){try{var u="",m=null;do u+=Se(o,m),m=o,o=o.return;while(o);return u}catch(v){return`
|
|
47
|
+
Error generating stack: `+v.message+`
|
|
48
|
+
`+v.stack}}var De=Object.prototype.hasOwnProperty,Ve=e.unstable_scheduleCallback,Le=e.unstable_cancelCallback,$e=e.unstable_shouldYield,qe=e.unstable_requestPaint,Je=e.unstable_now,qt=e.unstable_getCurrentPriorityLevel,ln=e.unstable_ImmediatePriority,Sn=e.unstable_UserBlockingPriority,cn=e.unstable_NormalPriority,Wa=e.unstable_LowPriority,Fr=e.unstable_IdlePriority,Tu=e.log,jl=e.unstable_setDisableYieldValue,Rn=null,Ft=null;function ma(o){if(typeof Tu=="function"&&jl(o),Ft&&typeof Ft.setStrictMode=="function")try{Ft.setStrictMode(Rn,o)}catch{}}var Fn=Math.clz32?Math.clz32:E0,j0=Math.log,C0=Math.LN2;function E0(o){return o>>>=0,o===0?32:31-(j0(o)/C0|0)|0}var Cl=256,El=262144,Tl=4194304;function Ga(o){var u=o&42;if(u!==0)return u;switch(o&-o){case 1:return 1;case 2:return 2;case 4:return 4;case 8:return 8;case 16:return 16;case 32:return 32;case 64:return 64;case 128:return 128;case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:return o&261888;case 262144:case 524288:case 1048576:case 2097152:return o&3932160;case 4194304:case 8388608:case 16777216:case 33554432:return o&62914560;case 67108864:return 67108864;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 0;default:return o}}function Al(o,u,m){var v=o.pendingLanes;if(v===0)return 0;var E=0,R=o.suspendedLanes,I=o.pingedLanes;o=o.warmLanes;var X=v&134217727;return X!==0?(v=X&~R,v!==0?E=Ga(v):(I&=X,I!==0?E=Ga(I):m||(m=X&~o,m!==0&&(E=Ga(m))))):(X=v&~R,X!==0?E=Ga(X):I!==0?E=Ga(I):m||(m=v&~o,m!==0&&(E=Ga(m)))),E===0?0:u!==0&&u!==E&&(u&R)===0&&(R=E&-E,m=u&-u,R>=m||R===32&&(m&4194048)!==0)?u:E}function ii(o,u){return(o.pendingLanes&~(o.suspendedLanes&~o.pingedLanes)&u)===0}function T0(o,u){switch(o){case 1:case 2:case 4:case 8:case 64:return u+250;case 16:case 32:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return u+5e3;case 4194304:case 8388608:case 16777216:case 33554432:return-1;case 67108864:case 134217728:case 268435456:case 536870912:case 1073741824:return-1;default:return-1}}function Dh(){var o=Tl;return Tl<<=1,(Tl&62914560)===0&&(Tl=4194304),o}function Au(o){for(var u=[],m=0;31>m;m++)u.push(o);return u}function li(o,u){o.pendingLanes|=u,u!==268435456&&(o.suspendedLanes=0,o.pingedLanes=0,o.warmLanes=0)}function A0(o,u,m,v,E,R){var I=o.pendingLanes;o.pendingLanes=m,o.suspendedLanes=0,o.pingedLanes=0,o.warmLanes=0,o.expiredLanes&=m,o.entangledLanes&=m,o.errorRecoveryDisabledLanes&=m,o.shellSuspendCounter=0;var X=o.entanglements,oe=o.expirationTimes,de=o.hiddenUpdates;for(m=I&~m;0<m;){var ge=31-Fn(m),be=1<<ge;X[ge]=0,oe[ge]=-1;var he=de[ge];if(he!==null)for(de[ge]=null,ge=0;ge<he.length;ge++){var pe=he[ge];pe!==null&&(pe.lane&=-536870913)}m&=~be}v!==0&&Ph(o,v,0),R!==0&&E===0&&o.tag!==0&&(o.suspendedLanes|=R&~(I&~u))}function Ph(o,u,m){o.pendingLanes|=u,o.suspendedLanes&=~u;var v=31-Fn(u);o.entangledLanes|=u,o.entanglements[v]=o.entanglements[v]|1073741824|m&261930}function $h(o,u){var m=o.entangledLanes|=u;for(o=o.entanglements;m;){var v=31-Fn(m),E=1<<v;E&u|o[v]&u&&(o[v]|=u),m&=~E}}function Ih(o,u){var m=u&-u;return m=(m&42)!==0?1:Ru(m),(m&(o.suspendedLanes|u))!==0?0:m}function Ru(o){switch(o){case 2:o=1;break;case 8:o=4;break;case 32:o=16;break;case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:case 4194304:case 8388608:case 16777216:case 33554432:o=128;break;case 268435456:o=134217728;break;default:o=0}return o}function ku(o){return o&=-o,2<o?8<o?(o&134217727)!==0?32:268435456:8:2}function Lh(){var o=K.p;return o!==0?o:(o=window.event,o===void 0?32:bO(o.type))}function zh(o,u){var m=K.p;try{return K.p=o,u()}finally{K.p=m}}var ga=Math.random().toString(36).slice(2),un="__reactFiber$"+ga,kn="__reactProps$"+ga,Ka="__reactContainer$"+ga,Rl="__reactEvents$"+ga,qh="__reactListeners$"+ga,R0="__reactHandles$"+ga,Fh="__reactResources$"+ga,ci="__reactMarker$"+ga;function Ou(o){delete o[un],delete o[kn],delete o[Rl],delete o[qh],delete o[R0]}function Hs(o){var u=o[un];if(u)return u;for(var m=o.parentNode;m;){if(u=m[Ka]||m[un]){if(m=u.alternate,u.child!==null||m!==null&&m.child!==null)for(o=aO(o);o!==null;){if(m=o[un])return m;o=aO(o)}return u}o=m,m=o.parentNode}return null}function Bs(o){if(o=o[un]||o[Ka]){var u=o.tag;if(u===5||u===6||u===13||u===31||u===26||u===27||u===3)return o}return null}function Vs(o){var u=o.tag;if(u===5||u===26||u===27||u===6)return o.stateNode;throw Error(r(33))}function Ws(o){var u=o[Fh];return u||(u=o[Fh]={hoistableStyles:new Map,hoistableScripts:new Map}),u}function en(o){o[ci]=!0}var Uh=new Set,Hh={};function Ya(o,u){Gs(o,u),Gs(o+"Capture",u)}function Gs(o,u){for(Hh[o]=u,o=0;o<u.length;o++)Uh.add(u[o])}var k0=RegExp("^[:A-Z_a-z\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u02FF\\u0370-\\u037D\\u037F-\\u1FFF\\u200C-\\u200D\\u2070-\\u218F\\u2C00-\\u2FEF\\u3001-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFFD][:A-Z_a-z\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u02FF\\u0370-\\u037D\\u037F-\\u1FFF\\u200C-\\u200D\\u2070-\\u218F\\u2C00-\\u2FEF\\u3001-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFFD\\-.0-9\\u00B7\\u0300-\\u036F\\u203F-\\u2040]*$"),Mu={},Bh={};function O0(o){return De.call(Bh,o)?!0:De.call(Mu,o)?!1:k0.test(o)?Bh[o]=!0:(Mu[o]=!0,!1)}function kl(o,u,m){if(O0(u))if(m===null)o.removeAttribute(u);else{switch(typeof m){case"undefined":case"function":case"symbol":o.removeAttribute(u);return;case"boolean":var v=u.toLowerCase().slice(0,5);if(v!=="data-"&&v!=="aria-"){o.removeAttribute(u);return}}o.setAttribute(u,""+m)}}function Ol(o,u,m){if(m===null)o.removeAttribute(u);else{switch(typeof m){case"undefined":case"function":case"symbol":case"boolean":o.removeAttribute(u);return}o.setAttribute(u,""+m)}}function Ur(o,u,m,v){if(v===null)o.removeAttribute(m);else{switch(typeof v){case"undefined":case"function":case"symbol":case"boolean":o.removeAttribute(m);return}o.setAttributeNS(u,m,""+v)}}function Kn(o){switch(typeof o){case"bigint":case"boolean":case"number":case"string":case"undefined":return o;case"object":return o;default:return""}}function Vh(o){var u=o.type;return(o=o.nodeName)&&o.toLowerCase()==="input"&&(u==="checkbox"||u==="radio")}function M0(o,u,m){var v=Object.getOwnPropertyDescriptor(o.constructor.prototype,u);if(!o.hasOwnProperty(u)&&typeof v<"u"&&typeof v.get=="function"&&typeof v.set=="function"){var E=v.get,R=v.set;return Object.defineProperty(o,u,{configurable:!0,get:function(){return E.call(this)},set:function(I){m=""+I,R.call(this,I)}}),Object.defineProperty(o,u,{enumerable:v.enumerable}),{getValue:function(){return m},setValue:function(I){m=""+I},stopTracking:function(){o._valueTracker=null,delete o[u]}}}}function Ks(o){if(!o._valueTracker){var u=Vh(o)?"checked":"value";o._valueTracker=M0(o,u,""+o[u])}}function Wh(o){if(!o)return!1;var u=o._valueTracker;if(!u)return!0;var m=u.getValue(),v="";return o&&(v=Vh(o)?o.checked?"true":"false":o.value),o=v,o!==m?(u.setValue(o),!0):!1}function Ml(o){if(o=o||(typeof document<"u"?document:void 0),typeof o>"u")return null;try{return o.activeElement||o.body}catch{return o.body}}var D0=/[\n"\\]/g;function On(o){return o.replace(D0,function(u){return"\\"+u.charCodeAt(0).toString(16)+" "})}function Du(o,u,m,v,E,R,I,X){o.name="",I!=null&&typeof I!="function"&&typeof I!="symbol"&&typeof I!="boolean"?o.type=I:o.removeAttribute("type"),u!=null?I==="number"?(u===0&&o.value===""||o.value!=u)&&(o.value=""+Kn(u)):o.value!==""+Kn(u)&&(o.value=""+Kn(u)):I!=="submit"&&I!=="reset"||o.removeAttribute("value"),u!=null?Dl(o,I,Kn(u)):m!=null?Dl(o,I,Kn(m)):v!=null&&o.removeAttribute("value"),E==null&&R!=null&&(o.defaultChecked=!!R),E!=null&&(o.checked=E&&typeof E!="function"&&typeof E!="symbol"),X!=null&&typeof X!="function"&&typeof X!="symbol"&&typeof X!="boolean"?o.name=""+Kn(X):o.removeAttribute("name")}function Gh(o,u,m,v,E,R,I,X){if(R!=null&&typeof R!="function"&&typeof R!="symbol"&&typeof R!="boolean"&&(o.type=R),u!=null||m!=null){if(!(R!=="submit"&&R!=="reset"||u!=null)){Ks(o);return}m=m!=null?""+Kn(m):"",u=u!=null?""+Kn(u):m,X||u===o.value||(o.value=u),o.defaultValue=u}v=v??E,v=typeof v!="function"&&typeof v!="symbol"&&!!v,o.checked=X?o.checked:!!v,o.defaultChecked=!!v,I!=null&&typeof I!="function"&&typeof I!="symbol"&&typeof I!="boolean"&&(o.name=I),Ks(o)}function Dl(o,u,m){u==="number"&&Ml(o.ownerDocument)===o||o.defaultValue===""+m||(o.defaultValue=""+m)}function Pl(o,u,m,v){if(o=o.options,u){u={};for(var E=0;E<m.length;E++)u["$"+m[E]]=!0;for(m=0;m<o.length;m++)E=u.hasOwnProperty("$"+o[m].value),o[m].selected!==E&&(o[m].selected=E),E&&v&&(o[m].defaultSelected=!0)}else{for(m=""+Kn(m),u=null,E=0;E<o.length;E++){if(o[E].value===m){o[E].selected=!0,v&&(o[E].defaultSelected=!0);return}u!==null||o[E].disabled||(u=o[E])}u!==null&&(u.selected=!0)}}function VT(o,u,m){if(u!=null&&(u=""+Kn(u),u!==o.value&&(o.value=u),m==null)){o.defaultValue!==u&&(o.defaultValue=u);return}o.defaultValue=m!=null?""+Kn(m):""}function WT(o,u,m,v){if(u==null){if(v!=null){if(m!=null)throw Error(r(92));if(V(v)){if(1<v.length)throw Error(r(93));v=v[0]}m=v}m==null&&(m=""),u=m}m=Kn(u),o.defaultValue=m,v=o.textContent,v===m&&v!==""&&v!==null&&(o.value=v),Ks(o)}function $l(o,u){if(u){var m=o.firstChild;if(m&&m===o.lastChild&&m.nodeType===3){m.nodeValue=u;return}}o.textContent=u}var GW=new Set("animationIterationCount aspectRatio borderImageOutset borderImageSlice borderImageWidth boxFlex boxFlexGroup boxOrdinalGroup columnCount columns flex flexGrow flexPositive flexShrink flexNegative flexOrder gridArea gridRow gridRowEnd gridRowSpan gridRowStart gridColumn gridColumnEnd gridColumnSpan gridColumnStart fontWeight lineClamp lineHeight opacity order orphans scale tabSize widows zIndex zoom fillOpacity floodOpacity stopOpacity strokeDasharray strokeDashoffset strokeMiterlimit strokeOpacity strokeWidth MozAnimationIterationCount MozBoxFlex MozBoxFlexGroup MozLineClamp msAnimationIterationCount msFlex msZoom msFlexGrow msFlexNegative msFlexOrder msFlexPositive msFlexShrink msGridColumn msGridColumnSpan msGridRow msGridRowSpan WebkitAnimationIterationCount WebkitBoxFlex WebKitBoxFlexGroup WebkitBoxOrdinalGroup WebkitColumnCount WebkitColumns WebkitFlex WebkitFlexGrow WebkitFlexPositive WebkitFlexShrink WebkitLineClamp".split(" "));function GT(o,u,m){var v=u.indexOf("--")===0;m==null||typeof m=="boolean"||m===""?v?o.setProperty(u,""):u==="float"?o.cssFloat="":o[u]="":v?o.setProperty(u,m):typeof m!="number"||m===0||GW.has(u)?u==="float"?o.cssFloat=m:o[u]=(""+m).trim():o[u]=m+"px"}function KT(o,u,m){if(u!=null&&typeof u!="object")throw Error(r(62));if(o=o.style,m!=null){for(var v in m)!m.hasOwnProperty(v)||u!=null&&u.hasOwnProperty(v)||(v.indexOf("--")===0?o.setProperty(v,""):v==="float"?o.cssFloat="":o[v]="");for(var E in u)v=u[E],u.hasOwnProperty(E)&&m[E]!==v&>(o,E,v)}else for(var R in u)u.hasOwnProperty(R)&>(o,R,u[R])}function P0(o){if(o.indexOf("-")===-1)return!1;switch(o){case"annotation-xml":case"color-profile":case"font-face":case"font-face-src":case"font-face-uri":case"font-face-format":case"font-face-name":case"missing-glyph":return!1;default:return!0}}var KW=new Map([["acceptCharset","accept-charset"],["htmlFor","for"],["httpEquiv","http-equiv"],["crossOrigin","crossorigin"],["accentHeight","accent-height"],["alignmentBaseline","alignment-baseline"],["arabicForm","arabic-form"],["baselineShift","baseline-shift"],["capHeight","cap-height"],["clipPath","clip-path"],["clipRule","clip-rule"],["colorInterpolation","color-interpolation"],["colorInterpolationFilters","color-interpolation-filters"],["colorProfile","color-profile"],["colorRendering","color-rendering"],["dominantBaseline","dominant-baseline"],["enableBackground","enable-background"],["fillOpacity","fill-opacity"],["fillRule","fill-rule"],["floodColor","flood-color"],["floodOpacity","flood-opacity"],["fontFamily","font-family"],["fontSize","font-size"],["fontSizeAdjust","font-size-adjust"],["fontStretch","font-stretch"],["fontStyle","font-style"],["fontVariant","font-variant"],["fontWeight","font-weight"],["glyphName","glyph-name"],["glyphOrientationHorizontal","glyph-orientation-horizontal"],["glyphOrientationVertical","glyph-orientation-vertical"],["horizAdvX","horiz-adv-x"],["horizOriginX","horiz-origin-x"],["imageRendering","image-rendering"],["letterSpacing","letter-spacing"],["lightingColor","lighting-color"],["markerEnd","marker-end"],["markerMid","marker-mid"],["markerStart","marker-start"],["overlinePosition","overline-position"],["overlineThickness","overline-thickness"],["paintOrder","paint-order"],["panose-1","panose-1"],["pointerEvents","pointer-events"],["renderingIntent","rendering-intent"],["shapeRendering","shape-rendering"],["stopColor","stop-color"],["stopOpacity","stop-opacity"],["strikethroughPosition","strikethrough-position"],["strikethroughThickness","strikethrough-thickness"],["strokeDasharray","stroke-dasharray"],["strokeDashoffset","stroke-dashoffset"],["strokeLinecap","stroke-linecap"],["strokeLinejoin","stroke-linejoin"],["strokeMiterlimit","stroke-miterlimit"],["strokeOpacity","stroke-opacity"],["strokeWidth","stroke-width"],["textAnchor","text-anchor"],["textDecoration","text-decoration"],["textRendering","text-rendering"],["transformOrigin","transform-origin"],["underlinePosition","underline-position"],["underlineThickness","underline-thickness"],["unicodeBidi","unicode-bidi"],["unicodeRange","unicode-range"],["unitsPerEm","units-per-em"],["vAlphabetic","v-alphabetic"],["vHanging","v-hanging"],["vIdeographic","v-ideographic"],["vMathematical","v-mathematical"],["vectorEffect","vector-effect"],["vertAdvY","vert-adv-y"],["vertOriginX","vert-origin-x"],["vertOriginY","vert-origin-y"],["wordSpacing","word-spacing"],["writingMode","writing-mode"],["xmlnsXlink","xmlns:xlink"],["xHeight","x-height"]]),YW=/^[\u0000-\u001F ]*j[\r\n\t]*a[\r\n\t]*v[\r\n\t]*a[\r\n\t]*s[\r\n\t]*c[\r\n\t]*r[\r\n\t]*i[\r\n\t]*p[\r\n\t]*t[\r\n\t]*:/i;function Kh(o){return YW.test(""+o)?"javascript:throw new Error('React has blocked a javascript: URL as a security precaution.')":o}function Xa(){}var $0=null;function I0(o){return o=o.target||o.srcElement||window,o.correspondingUseElement&&(o=o.correspondingUseElement),o.nodeType===3?o.parentNode:o}var Il=null,Ll=null;function YT(o){var u=Bs(o);if(u&&(o=u.stateNode)){var m=o[kn]||null;e:switch(o=u.stateNode,u.type){case"input":if(Du(o,m.value,m.defaultValue,m.defaultValue,m.checked,m.defaultChecked,m.type,m.name),u=m.name,m.type==="radio"&&u!=null){for(m=o;m.parentNode;)m=m.parentNode;for(m=m.querySelectorAll('input[name="'+On(""+u)+'"][type="radio"]'),u=0;u<m.length;u++){var v=m[u];if(v!==o&&v.form===o.form){var E=v[kn]||null;if(!E)throw Error(r(90));Du(v,E.value,E.defaultValue,E.defaultValue,E.checked,E.defaultChecked,E.type,E.name)}}for(u=0;u<m.length;u++)v=m[u],v.form===o.form&&Wh(v)}break e;case"textarea":VT(o,m.value,m.defaultValue);break e;case"select":u=m.value,u!=null&&Pl(o,!!m.multiple,u,!1)}}}var L0=!1;function XT(o,u,m){if(L0)return o(u,m);L0=!0;try{var v=o(u);return v}finally{if(L0=!1,(Il!==null||Ll!==null)&&(Pp(),Il&&(u=Il,o=Ll,Ll=Il=null,YT(u),o)))for(u=0;u<o.length;u++)YT(o[u])}}function Pu(o,u){var m=o.stateNode;if(m===null)return null;var v=m[kn]||null;if(v===null)return null;m=v[u];e:switch(u){case"onClick":case"onClickCapture":case"onDoubleClick":case"onDoubleClickCapture":case"onMouseDown":case"onMouseDownCapture":case"onMouseMove":case"onMouseMoveCapture":case"onMouseUp":case"onMouseUpCapture":case"onMouseEnter":(v=!v.disabled)||(o=o.type,v=!(o==="button"||o==="input"||o==="select"||o==="textarea")),o=!v;break e;default:o=!1}if(o)return null;if(m&&typeof m!="function")throw Error(r(231,u,typeof m));return m}var Za=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),z0=!1;if(Za)try{var $u={};Object.defineProperty($u,"passive",{get:function(){z0=!0}}),window.addEventListener("test",$u,$u),window.removeEventListener("test",$u,$u)}catch{z0=!1}var Ys=null,q0=null,Yh=null;function ZT(){if(Yh)return Yh;var o,u=q0,m=u.length,v,E="value"in Ys?Ys.value:Ys.textContent,R=E.length;for(o=0;o<m&&u[o]===E[o];o++);var I=m-o;for(v=1;v<=I&&u[m-v]===E[R-v];v++);return Yh=E.slice(o,1<v?1-v:void 0)}function Xh(o){var u=o.keyCode;return"charCode"in o?(o=o.charCode,o===0&&u===13&&(o=13)):o=u,o===10&&(o=13),32<=o||o===13?o:0}function Zh(){return!0}function QT(){return!1}function Yn(o){function u(m,v,E,R,I){this._reactName=m,this._targetInst=E,this.type=v,this.nativeEvent=R,this.target=I,this.currentTarget=null;for(var X in o)o.hasOwnProperty(X)&&(m=o[X],this[X]=m?m(R):R[X]);return this.isDefaultPrevented=(R.defaultPrevented!=null?R.defaultPrevented:R.returnValue===!1)?Zh:QT,this.isPropagationStopped=QT,this}return p(u.prototype,{preventDefault:function(){this.defaultPrevented=!0;var m=this.nativeEvent;m&&(m.preventDefault?m.preventDefault():typeof m.returnValue!="unknown"&&(m.returnValue=!1),this.isDefaultPrevented=Zh)},stopPropagation:function(){var m=this.nativeEvent;m&&(m.stopPropagation?m.stopPropagation():typeof m.cancelBubble!="unknown"&&(m.cancelBubble=!0),this.isPropagationStopped=Zh)},persist:function(){},isPersistent:Zh}),u}var ui={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(o){return o.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},Qh=Yn(ui),Iu=p({},ui,{view:0,detail:0}),XW=Yn(Iu),F0,U0,Lu,Jh=p({},Iu,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:B0,button:0,buttons:0,relatedTarget:function(o){return o.relatedTarget===void 0?o.fromElement===o.srcElement?o.toElement:o.fromElement:o.relatedTarget},movementX:function(o){return"movementX"in o?o.movementX:(o!==Lu&&(Lu&&o.type==="mousemove"?(F0=o.screenX-Lu.screenX,U0=o.screenY-Lu.screenY):U0=F0=0,Lu=o),F0)},movementY:function(o){return"movementY"in o?o.movementY:U0}}),JT=Yn(Jh),ZW=p({},Jh,{dataTransfer:0}),QW=Yn(ZW),JW=p({},Iu,{relatedTarget:0}),H0=Yn(JW),eG=p({},ui,{animationName:0,elapsedTime:0,pseudoElement:0}),tG=Yn(eG),nG=p({},ui,{clipboardData:function(o){return"clipboardData"in o?o.clipboardData:window.clipboardData}}),rG=Yn(nG),aG=p({},ui,{data:0}),eA=Yn(aG),sG={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},oG={8:"Backspace",9:"Tab",12:"Clear",13:"Enter",16:"Shift",17:"Control",18:"Alt",19:"Pause",20:"CapsLock",27:"Escape",32:" ",33:"PageUp",34:"PageDown",35:"End",36:"Home",37:"ArrowLeft",38:"ArrowUp",39:"ArrowRight",40:"ArrowDown",45:"Insert",46:"Delete",112:"F1",113:"F2",114:"F3",115:"F4",116:"F5",117:"F6",118:"F7",119:"F8",120:"F9",121:"F10",122:"F11",123:"F12",144:"NumLock",145:"ScrollLock",224:"Meta"},iG={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function lG(o){var u=this.nativeEvent;return u.getModifierState?u.getModifierState(o):(o=iG[o])?!!u[o]:!1}function B0(){return lG}var cG=p({},Iu,{key:function(o){if(o.key){var u=sG[o.key]||o.key;if(u!=="Unidentified")return u}return o.type==="keypress"?(o=Xh(o),o===13?"Enter":String.fromCharCode(o)):o.type==="keydown"||o.type==="keyup"?oG[o.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:B0,charCode:function(o){return o.type==="keypress"?Xh(o):0},keyCode:function(o){return o.type==="keydown"||o.type==="keyup"?o.keyCode:0},which:function(o){return o.type==="keypress"?Xh(o):o.type==="keydown"||o.type==="keyup"?o.keyCode:0}}),uG=Yn(cG),dG=p({},Jh,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),tA=Yn(dG),fG=p({},Iu,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:B0}),hG=Yn(fG),pG=p({},ui,{propertyName:0,elapsedTime:0,pseudoElement:0}),mG=Yn(pG),gG=p({},Jh,{deltaX:function(o){return"deltaX"in o?o.deltaX:"wheelDeltaX"in o?-o.wheelDeltaX:0},deltaY:function(o){return"deltaY"in o?o.deltaY:"wheelDeltaY"in o?-o.wheelDeltaY:"wheelDelta"in o?-o.wheelDelta:0},deltaZ:0,deltaMode:0}),yG=Yn(gG),vG=p({},ui,{newState:0,oldState:0}),xG=Yn(vG),bG=[9,13,27,32],V0=Za&&"CompositionEvent"in window,zu=null;Za&&"documentMode"in document&&(zu=document.documentMode);var wG=Za&&"TextEvent"in window&&!zu,nA=Za&&(!V0||zu&&8<zu&&11>=zu),rA=" ",aA=!1;function sA(o,u){switch(o){case"keyup":return bG.indexOf(u.keyCode)!==-1;case"keydown":return u.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function oA(o){return o=o.detail,typeof o=="object"&&"data"in o?o.data:null}var zl=!1;function SG(o,u){switch(o){case"compositionend":return oA(u);case"keypress":return u.which!==32?null:(aA=!0,rA);case"textInput":return o=u.data,o===rA&&aA?null:o;default:return null}}function _G(o,u){if(zl)return o==="compositionend"||!V0&&sA(o,u)?(o=ZT(),Yh=q0=Ys=null,zl=!1,o):null;switch(o){case"paste":return null;case"keypress":if(!(u.ctrlKey||u.altKey||u.metaKey)||u.ctrlKey&&u.altKey){if(u.char&&1<u.char.length)return u.char;if(u.which)return String.fromCharCode(u.which)}return null;case"compositionend":return nA&&u.locale!=="ko"?null:u.data;default:return null}}var NG={color:!0,date:!0,datetime:!0,"datetime-local":!0,email:!0,month:!0,number:!0,password:!0,range:!0,search:!0,tel:!0,text:!0,time:!0,url:!0,week:!0};function iA(o){var u=o&&o.nodeName&&o.nodeName.toLowerCase();return u==="input"?!!NG[o.type]:u==="textarea"}function lA(o,u,m,v){Il?Ll?Ll.push(v):Ll=[v]:Il=v,u=Up(u,"onChange"),0<u.length&&(m=new Qh("onChange","change",null,m,v),o.push({event:m,listeners:u}))}var qu=null,Fu=null;function jG(o){Bk(o,0)}function ep(o){var u=Vs(o);if(Wh(u))return o}function cA(o,u){if(o==="change")return u}var uA=!1;if(Za){var W0;if(Za){var G0="oninput"in document;if(!G0){var dA=document.createElement("div");dA.setAttribute("oninput","return;"),G0=typeof dA.oninput=="function"}W0=G0}else W0=!1;uA=W0&&(!document.documentMode||9<document.documentMode)}function fA(){qu&&(qu.detachEvent("onpropertychange",hA),Fu=qu=null)}function hA(o){if(o.propertyName==="value"&&ep(Fu)){var u=[];lA(u,Fu,o,I0(o)),XT(jG,u)}}function CG(o,u,m){o==="focusin"?(fA(),qu=u,Fu=m,qu.attachEvent("onpropertychange",hA)):o==="focusout"&&fA()}function EG(o){if(o==="selectionchange"||o==="keyup"||o==="keydown")return ep(Fu)}function TG(o,u){if(o==="click")return ep(u)}function AG(o,u){if(o==="input"||o==="change")return ep(u)}function RG(o,u){return o===u&&(o!==0||1/o===1/u)||o!==o&&u!==u}var ar=typeof Object.is=="function"?Object.is:RG;function Uu(o,u){if(ar(o,u))return!0;if(typeof o!="object"||o===null||typeof u!="object"||u===null)return!1;var m=Object.keys(o),v=Object.keys(u);if(m.length!==v.length)return!1;for(v=0;v<m.length;v++){var E=m[v];if(!De.call(u,E)||!ar(o[E],u[E]))return!1}return!0}function pA(o){for(;o&&o.firstChild;)o=o.firstChild;return o}function mA(o,u){var m=pA(o);o=0;for(var v;m;){if(m.nodeType===3){if(v=o+m.textContent.length,o<=u&&v>=u)return{node:m,offset:u-o};o=v}e:{for(;m;){if(m.nextSibling){m=m.nextSibling;break e}m=m.parentNode}m=void 0}m=pA(m)}}function gA(o,u){return o&&u?o===u?!0:o&&o.nodeType===3?!1:u&&u.nodeType===3?gA(o,u.parentNode):"contains"in o?o.contains(u):o.compareDocumentPosition?!!(o.compareDocumentPosition(u)&16):!1:!1}function yA(o){o=o!=null&&o.ownerDocument!=null&&o.ownerDocument.defaultView!=null?o.ownerDocument.defaultView:window;for(var u=Ml(o.document);u instanceof o.HTMLIFrameElement;){try{var m=typeof u.contentWindow.location.href=="string"}catch{m=!1}if(m)o=u.contentWindow;else break;u=Ml(o.document)}return u}function K0(o){var u=o&&o.nodeName&&o.nodeName.toLowerCase();return u&&(u==="input"&&(o.type==="text"||o.type==="search"||o.type==="tel"||o.type==="url"||o.type==="password")||u==="textarea"||o.contentEditable==="true")}var kG=Za&&"documentMode"in document&&11>=document.documentMode,ql=null,Y0=null,Hu=null,X0=!1;function vA(o,u,m){var v=m.window===m?m.document:m.nodeType===9?m:m.ownerDocument;X0||ql==null||ql!==Ml(v)||(v=ql,"selectionStart"in v&&K0(v)?v={start:v.selectionStart,end:v.selectionEnd}:(v=(v.ownerDocument&&v.ownerDocument.defaultView||window).getSelection(),v={anchorNode:v.anchorNode,anchorOffset:v.anchorOffset,focusNode:v.focusNode,focusOffset:v.focusOffset}),Hu&&Uu(Hu,v)||(Hu=v,v=Up(Y0,"onSelect"),0<v.length&&(u=new Qh("onSelect","select",null,u,m),o.push({event:u,listeners:v}),u.target=ql)))}function di(o,u){var m={};return m[o.toLowerCase()]=u.toLowerCase(),m["Webkit"+o]="webkit"+u,m["Moz"+o]="moz"+u,m}var Fl={animationend:di("Animation","AnimationEnd"),animationiteration:di("Animation","AnimationIteration"),animationstart:di("Animation","AnimationStart"),transitionrun:di("Transition","TransitionRun"),transitionstart:di("Transition","TransitionStart"),transitioncancel:di("Transition","TransitionCancel"),transitionend:di("Transition","TransitionEnd")},Z0={},xA={};Za&&(xA=document.createElement("div").style,"AnimationEvent"in window||(delete Fl.animationend.animation,delete Fl.animationiteration.animation,delete Fl.animationstart.animation),"TransitionEvent"in window||delete Fl.transitionend.transition);function fi(o){if(Z0[o])return Z0[o];if(!Fl[o])return o;var u=Fl[o],m;for(m in u)if(u.hasOwnProperty(m)&&m in xA)return Z0[o]=u[m];return o}var bA=fi("animationend"),wA=fi("animationiteration"),SA=fi("animationstart"),OG=fi("transitionrun"),MG=fi("transitionstart"),DG=fi("transitioncancel"),_A=fi("transitionend"),NA=new Map,Q0="abort auxClick beforeToggle cancel canPlay canPlayThrough click close contextMenu copy cut drag dragEnd dragEnter dragExit dragLeave dragOver dragStart drop durationChange emptied encrypted ended error gotPointerCapture input invalid keyDown keyPress keyUp load loadedData loadedMetadata loadStart lostPointerCapture mouseDown mouseMove mouseOut mouseOver mouseUp paste pause play playing pointerCancel pointerDown pointerMove pointerOut pointerOver pointerUp progress rateChange reset resize seeked seeking stalled submit suspend timeUpdate touchCancel touchEnd touchStart volumeChange scroll toggle touchMove waiting wheel".split(" ");Q0.push("scrollEnd");function Hr(o,u){NA.set(o,u),Ya(u,[o])}var tp=typeof reportError=="function"?reportError:function(o){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var u=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof o=="object"&&o!==null&&typeof o.message=="string"?String(o.message):String(o),error:o});if(!window.dispatchEvent(u))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",o);return}console.error(o)},jr=[],Ul=0,J0=0;function np(){for(var o=Ul,u=J0=Ul=0;u<o;){var m=jr[u];jr[u++]=null;var v=jr[u];jr[u++]=null;var E=jr[u];jr[u++]=null;var R=jr[u];if(jr[u++]=null,v!==null&&E!==null){var I=v.pending;I===null?E.next=E:(E.next=I.next,I.next=E),v.pending=E}R!==0&&jA(m,E,R)}}function rp(o,u,m,v){jr[Ul++]=o,jr[Ul++]=u,jr[Ul++]=m,jr[Ul++]=v,J0|=v,o.lanes|=v,o=o.alternate,o!==null&&(o.lanes|=v)}function ex(o,u,m,v){return rp(o,u,m,v),ap(o)}function hi(o,u){return rp(o,null,null,u),ap(o)}function jA(o,u,m){o.lanes|=m;var v=o.alternate;v!==null&&(v.lanes|=m);for(var E=!1,R=o.return;R!==null;)R.childLanes|=m,v=R.alternate,v!==null&&(v.childLanes|=m),R.tag===22&&(o=R.stateNode,o===null||o._visibility&1||(E=!0)),o=R,R=R.return;return o.tag===3?(R=o.stateNode,E&&u!==null&&(E=31-Fn(m),o=R.hiddenUpdates,v=o[E],v===null?o[E]=[u]:v.push(u),u.lane=m|536870912),R):null}function ap(o){if(50<dd)throw dd=0,cb=null,Error(r(185));for(var u=o.return;u!==null;)o=u,u=o.return;return o.tag===3?o.stateNode:null}var Hl={};function PG(o,u,m,v){this.tag=o,this.key=m,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.refCleanup=this.ref=null,this.pendingProps=u,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=v,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function sr(o,u,m,v){return new PG(o,u,m,v)}function tx(o){return o=o.prototype,!(!o||!o.isReactComponent)}function Qa(o,u){var m=o.alternate;return m===null?(m=sr(o.tag,u,o.key,o.mode),m.elementType=o.elementType,m.type=o.type,m.stateNode=o.stateNode,m.alternate=o,o.alternate=m):(m.pendingProps=u,m.type=o.type,m.flags=0,m.subtreeFlags=0,m.deletions=null),m.flags=o.flags&65011712,m.childLanes=o.childLanes,m.lanes=o.lanes,m.child=o.child,m.memoizedProps=o.memoizedProps,m.memoizedState=o.memoizedState,m.updateQueue=o.updateQueue,u=o.dependencies,m.dependencies=u===null?null:{lanes:u.lanes,firstContext:u.firstContext},m.sibling=o.sibling,m.index=o.index,m.ref=o.ref,m.refCleanup=o.refCleanup,m}function CA(o,u){o.flags&=65011714;var m=o.alternate;return m===null?(o.childLanes=0,o.lanes=u,o.child=null,o.subtreeFlags=0,o.memoizedProps=null,o.memoizedState=null,o.updateQueue=null,o.dependencies=null,o.stateNode=null):(o.childLanes=m.childLanes,o.lanes=m.lanes,o.child=m.child,o.subtreeFlags=0,o.deletions=null,o.memoizedProps=m.memoizedProps,o.memoizedState=m.memoizedState,o.updateQueue=m.updateQueue,o.type=m.type,u=m.dependencies,o.dependencies=u===null?null:{lanes:u.lanes,firstContext:u.firstContext}),o}function sp(o,u,m,v,E,R){var I=0;if(v=o,typeof o=="function")tx(o)&&(I=1);else if(typeof o=="string")I=qK(o,m,$.current)?26:o==="html"||o==="head"||o==="body"?27:5;else e:switch(o){case M:return o=sr(31,m,u,E),o.elementType=M,o.lanes=R,o;case w:return pi(m.children,E,R,u);case b:I=8,E|=24;break;case x:return o=sr(12,m,u,E|2),o.elementType=x,o.lanes=R,o;case T:return o=sr(13,m,u,E),o.elementType=T,o.lanes=R,o;case A:return o=sr(19,m,u,E),o.elementType=A,o.lanes=R,o;default:if(typeof o=="object"&&o!==null)switch(o.$$typeof){case j:I=10;break e;case _:I=9;break e;case C:I=11;break e;case k:I=14;break e;case O:I=16,v=null;break e}I=29,m=Error(r(130,o===null?"null":typeof o,"")),v=null}return u=sr(I,m,u,E),u.elementType=o,u.type=v,u.lanes=R,u}function pi(o,u,m,v){return o=sr(7,o,v,u),o.lanes=m,o}function nx(o,u,m){return o=sr(6,o,null,u),o.lanes=m,o}function EA(o){var u=sr(18,null,null,0);return u.stateNode=o,u}function rx(o,u,m){return u=sr(4,o.children!==null?o.children:[],o.key,u),u.lanes=m,u.stateNode={containerInfo:o.containerInfo,pendingChildren:null,implementation:o.implementation},u}var TA=new WeakMap;function Cr(o,u){if(typeof o=="object"&&o!==null){var m=TA.get(o);return m!==void 0?m:(u={value:o,source:u,stack:Re(u)},TA.set(o,u),u)}return{value:o,source:u,stack:Re(u)}}var Bl=[],Vl=0,op=null,Bu=0,Er=[],Tr=0,Xs=null,ya=1,va="";function Ja(o,u){Bl[Vl++]=Bu,Bl[Vl++]=op,op=o,Bu=u}function AA(o,u,m){Er[Tr++]=ya,Er[Tr++]=va,Er[Tr++]=Xs,Xs=o;var v=ya;o=va;var E=32-Fn(v)-1;v&=~(1<<E),m+=1;var R=32-Fn(u)+E;if(30<R){var I=E-E%5;R=(v&(1<<I)-1).toString(32),v>>=I,E-=I,ya=1<<32-Fn(u)+E|m<<E|v,va=R+o}else ya=1<<R|m<<E|v,va=o}function ax(o){o.return!==null&&(Ja(o,1),AA(o,1,0))}function sx(o){for(;o===op;)op=Bl[--Vl],Bl[Vl]=null,Bu=Bl[--Vl],Bl[Vl]=null;for(;o===Xs;)Xs=Er[--Tr],Er[Tr]=null,va=Er[--Tr],Er[Tr]=null,ya=Er[--Tr],Er[Tr]=null}function RA(o,u){Er[Tr++]=ya,Er[Tr++]=va,Er[Tr++]=Xs,ya=u.id,va=u.overflow,Xs=o}var _n=null,Ot=null,rt=!1,Zs=null,Ar=!1,ox=Error(r(519));function Qs(o){var u=Error(r(418,1<arguments.length&&arguments[1]!==void 0&&arguments[1]?"text":"HTML",""));throw Vu(Cr(u,o)),ox}function kA(o){var u=o.stateNode,m=o.type,v=o.memoizedProps;switch(u[un]=o,u[kn]=v,m){case"dialog":Ze("cancel",u),Ze("close",u);break;case"iframe":case"object":case"embed":Ze("load",u);break;case"video":case"audio":for(m=0;m<hd.length;m++)Ze(hd[m],u);break;case"source":Ze("error",u);break;case"img":case"image":case"link":Ze("error",u),Ze("load",u);break;case"details":Ze("toggle",u);break;case"input":Ze("invalid",u),Gh(u,v.value,v.defaultValue,v.checked,v.defaultChecked,v.type,v.name,!0);break;case"select":Ze("invalid",u);break;case"textarea":Ze("invalid",u),WT(u,v.value,v.defaultValue,v.children)}m=v.children,typeof m!="string"&&typeof m!="number"&&typeof m!="bigint"||u.textContent===""+m||v.suppressHydrationWarning===!0||Kk(u.textContent,m)?(v.popover!=null&&(Ze("beforetoggle",u),Ze("toggle",u)),v.onScroll!=null&&Ze("scroll",u),v.onScrollEnd!=null&&Ze("scrollend",u),v.onClick!=null&&(u.onclick=Xa),u=!0):u=!1,u||Qs(o,!0)}function OA(o){for(_n=o.return;_n;)switch(_n.tag){case 5:case 31:case 13:Ar=!1;return;case 27:case 3:Ar=!0;return;default:_n=_n.return}}function Wl(o){if(o!==_n)return!1;if(!rt)return OA(o),rt=!0,!1;var u=o.tag,m;if((m=u!==3&&u!==27)&&((m=u===5)&&(m=o.type,m=!(m!=="form"&&m!=="button")||Nb(o.type,o.memoizedProps)),m=!m),m&&Ot&&Qs(o),OA(o),u===13){if(o=o.memoizedState,o=o!==null?o.dehydrated:null,!o)throw Error(r(317));Ot=rO(o)}else if(u===31){if(o=o.memoizedState,o=o!==null?o.dehydrated:null,!o)throw Error(r(317));Ot=rO(o)}else u===27?(u=Ot,ho(o.type)?(o=Ab,Ab=null,Ot=o):Ot=u):Ot=_n?kr(o.stateNode.nextSibling):null;return!0}function mi(){Ot=_n=null,rt=!1}function ix(){var o=Zs;return o!==null&&(Jn===null?Jn=o:Jn.push.apply(Jn,o),Zs=null),o}function Vu(o){Zs===null?Zs=[o]:Zs.push(o)}var lx=D(null),gi=null,es=null;function Js(o,u,m){B(lx,u._currentValue),u._currentValue=m}function ts(o){o._currentValue=lx.current,W(lx)}function cx(o,u,m){for(;o!==null;){var v=o.alternate;if((o.childLanes&u)!==u?(o.childLanes|=u,v!==null&&(v.childLanes|=u)):v!==null&&(v.childLanes&u)!==u&&(v.childLanes|=u),o===m)break;o=o.return}}function ux(o,u,m,v){var E=o.child;for(E!==null&&(E.return=o);E!==null;){var R=E.dependencies;if(R!==null){var I=E.child;R=R.firstContext;e:for(;R!==null;){var X=R;R=E;for(var oe=0;oe<u.length;oe++)if(X.context===u[oe]){R.lanes|=m,X=R.alternate,X!==null&&(X.lanes|=m),cx(R.return,m,o),v||(I=null);break e}R=X.next}}else if(E.tag===18){if(I=E.return,I===null)throw Error(r(341));I.lanes|=m,R=I.alternate,R!==null&&(R.lanes|=m),cx(I,m,o),I=null}else I=E.child;if(I!==null)I.return=E;else for(I=E;I!==null;){if(I===o){I=null;break}if(E=I.sibling,E!==null){E.return=I.return,I=E;break}I=I.return}E=I}}function Gl(o,u,m,v){o=null;for(var E=u,R=!1;E!==null;){if(!R){if((E.flags&524288)!==0)R=!0;else if((E.flags&262144)!==0)break}if(E.tag===10){var I=E.alternate;if(I===null)throw Error(r(387));if(I=I.memoizedProps,I!==null){var X=E.type;ar(E.pendingProps.value,I.value)||(o!==null?o.push(X):o=[X])}}else if(E===re.current){if(I=E.alternate,I===null)throw Error(r(387));I.memoizedState.memoizedState!==E.memoizedState.memoizedState&&(o!==null?o.push(vd):o=[vd])}E=E.return}o!==null&&ux(u,o,m,v),u.flags|=262144}function ip(o){for(o=o.firstContext;o!==null;){if(!ar(o.context._currentValue,o.memoizedValue))return!0;o=o.next}return!1}function yi(o){gi=o,es=null,o=o.dependencies,o!==null&&(o.firstContext=null)}function Nn(o){return MA(gi,o)}function lp(o,u){return gi===null&&yi(o),MA(o,u)}function MA(o,u){var m=u._currentValue;if(u={context:u,memoizedValue:m,next:null},es===null){if(o===null)throw Error(r(308));es=u,o.dependencies={lanes:0,firstContext:u},o.flags|=524288}else es=es.next=u;return m}var $G=typeof AbortController<"u"?AbortController:function(){var o=[],u=this.signal={aborted:!1,addEventListener:function(m,v){o.push(v)}};this.abort=function(){u.aborted=!0,o.forEach(function(m){return m()})}},IG=e.unstable_scheduleCallback,LG=e.unstable_NormalPriority,tn={$$typeof:j,Consumer:null,Provider:null,_currentValue:null,_currentValue2:null,_threadCount:0};function dx(){return{controller:new $G,data:new Map,refCount:0}}function Wu(o){o.refCount--,o.refCount===0&&IG(LG,function(){o.controller.abort()})}var Gu=null,fx=0,Kl=0,Yl=null;function zG(o,u){if(Gu===null){var m=Gu=[];fx=0,Kl=mb(),Yl={status:"pending",value:void 0,then:function(v){m.push(v)}}}return fx++,u.then(DA,DA),u}function DA(){if(--fx===0&&Gu!==null){Yl!==null&&(Yl.status="fulfilled");var o=Gu;Gu=null,Kl=0,Yl=null;for(var u=0;u<o.length;u++)(0,o[u])()}}function qG(o,u){var m=[],v={status:"pending",value:null,reason:null,then:function(E){m.push(E)}};return o.then(function(){v.status="fulfilled",v.value=u;for(var E=0;E<m.length;E++)(0,m[E])(u)},function(E){for(v.status="rejected",v.reason=E,E=0;E<m.length;E++)(0,m[E])(void 0)}),v}var PA=P.S;P.S=function(o,u){vk=Je(),typeof u=="object"&&u!==null&&typeof u.then=="function"&&zG(o,u),PA!==null&&PA(o,u)};var vi=D(null);function hx(){var o=vi.current;return o!==null?o:_t.pooledCache}function cp(o,u){u===null?B(vi,vi.current):B(vi,u.pool)}function $A(){var o=hx();return o===null?null:{parent:tn._currentValue,pool:o}}var Xl=Error(r(460)),px=Error(r(474)),up=Error(r(542)),dp={then:function(){}};function IA(o){return o=o.status,o==="fulfilled"||o==="rejected"}function LA(o,u,m){switch(m=o[m],m===void 0?o.push(u):m!==u&&(u.then(Xa,Xa),u=m),u.status){case"fulfilled":return u.value;case"rejected":throw o=u.reason,qA(o),o;default:if(typeof u.status=="string")u.then(Xa,Xa);else{if(o=_t,o!==null&&100<o.shellSuspendCounter)throw Error(r(482));o=u,o.status="pending",o.then(function(v){if(u.status==="pending"){var E=u;E.status="fulfilled",E.value=v}},function(v){if(u.status==="pending"){var E=u;E.status="rejected",E.reason=v}})}switch(u.status){case"fulfilled":return u.value;case"rejected":throw o=u.reason,qA(o),o}throw bi=u,Xl}}function xi(o){try{var u=o._init;return u(o._payload)}catch(m){throw m!==null&&typeof m=="object"&&typeof m.then=="function"?(bi=m,Xl):m}}var bi=null;function zA(){if(bi===null)throw Error(r(459));var o=bi;return bi=null,o}function qA(o){if(o===Xl||o===up)throw Error(r(483))}var Zl=null,Ku=0;function fp(o){var u=Ku;return Ku+=1,Zl===null&&(Zl=[]),LA(Zl,o,u)}function Yu(o,u){u=u.props.ref,o.ref=u!==void 0?u:null}function hp(o,u){throw u.$$typeof===g?Error(r(525)):(o=Object.prototype.toString.call(u),Error(r(31,o==="[object Object]"?"object with keys {"+Object.keys(u).join(", ")+"}":o)))}function FA(o){function u(ce,ie){if(o){var ue=ce.deletions;ue===null?(ce.deletions=[ie],ce.flags|=16):ue.push(ie)}}function m(ce,ie){if(!o)return null;for(;ie!==null;)u(ce,ie),ie=ie.sibling;return null}function v(ce){for(var ie=new Map;ce!==null;)ce.key!==null?ie.set(ce.key,ce):ie.set(ce.index,ce),ce=ce.sibling;return ie}function E(ce,ie){return ce=Qa(ce,ie),ce.index=0,ce.sibling=null,ce}function R(ce,ie,ue){return ce.index=ue,o?(ue=ce.alternate,ue!==null?(ue=ue.index,ue<ie?(ce.flags|=67108866,ie):ue):(ce.flags|=67108866,ie)):(ce.flags|=1048576,ie)}function I(ce){return o&&ce.alternate===null&&(ce.flags|=67108866),ce}function X(ce,ie,ue,xe){return ie===null||ie.tag!==6?(ie=nx(ue,ce.mode,xe),ie.return=ce,ie):(ie=E(ie,ue),ie.return=ce,ie)}function oe(ce,ie,ue,xe){var Pe=ue.type;return Pe===w?ge(ce,ie,ue.props.children,xe,ue.key):ie!==null&&(ie.elementType===Pe||typeof Pe=="object"&&Pe!==null&&Pe.$$typeof===O&&xi(Pe)===ie.type)?(ie=E(ie,ue.props),Yu(ie,ue),ie.return=ce,ie):(ie=sp(ue.type,ue.key,ue.props,null,ce.mode,xe),Yu(ie,ue),ie.return=ce,ie)}function de(ce,ie,ue,xe){return ie===null||ie.tag!==4||ie.stateNode.containerInfo!==ue.containerInfo||ie.stateNode.implementation!==ue.implementation?(ie=rx(ue,ce.mode,xe),ie.return=ce,ie):(ie=E(ie,ue.children||[]),ie.return=ce,ie)}function ge(ce,ie,ue,xe,Pe){return ie===null||ie.tag!==7?(ie=pi(ue,ce.mode,xe,Pe),ie.return=ce,ie):(ie=E(ie,ue),ie.return=ce,ie)}function be(ce,ie,ue){if(typeof ie=="string"&&ie!==""||typeof ie=="number"||typeof ie=="bigint")return ie=nx(""+ie,ce.mode,ue),ie.return=ce,ie;if(typeof ie=="object"&&ie!==null){switch(ie.$$typeof){case y:return ue=sp(ie.type,ie.key,ie.props,null,ce.mode,ue),Yu(ue,ie),ue.return=ce,ue;case S:return ie=rx(ie,ce.mode,ue),ie.return=ce,ie;case O:return ie=xi(ie),be(ce,ie,ue)}if(V(ie)||U(ie))return ie=pi(ie,ce.mode,ue,null),ie.return=ce,ie;if(typeof ie.then=="function")return be(ce,fp(ie),ue);if(ie.$$typeof===j)return be(ce,lp(ce,ie),ue);hp(ce,ie)}return null}function he(ce,ie,ue,xe){var Pe=ie!==null?ie.key:null;if(typeof ue=="string"&&ue!==""||typeof ue=="number"||typeof ue=="bigint")return Pe!==null?null:X(ce,ie,""+ue,xe);if(typeof ue=="object"&&ue!==null){switch(ue.$$typeof){case y:return ue.key===Pe?oe(ce,ie,ue,xe):null;case S:return ue.key===Pe?de(ce,ie,ue,xe):null;case O:return ue=xi(ue),he(ce,ie,ue,xe)}if(V(ue)||U(ue))return Pe!==null?null:ge(ce,ie,ue,xe,null);if(typeof ue.then=="function")return he(ce,ie,fp(ue),xe);if(ue.$$typeof===j)return he(ce,ie,lp(ce,ue),xe);hp(ce,ue)}return null}function pe(ce,ie,ue,xe,Pe){if(typeof xe=="string"&&xe!==""||typeof xe=="number"||typeof xe=="bigint")return ce=ce.get(ue)||null,X(ie,ce,""+xe,Pe);if(typeof xe=="object"&&xe!==null){switch(xe.$$typeof){case y:return ce=ce.get(xe.key===null?ue:xe.key)||null,oe(ie,ce,xe,Pe);case S:return ce=ce.get(xe.key===null?ue:xe.key)||null,de(ie,ce,xe,Pe);case O:return xe=xi(xe),pe(ce,ie,ue,xe,Pe)}if(V(xe)||U(xe))return ce=ce.get(ue)||null,ge(ie,ce,xe,Pe,null);if(typeof xe.then=="function")return pe(ce,ie,ue,fp(xe),Pe);if(xe.$$typeof===j)return pe(ce,ie,ue,lp(ie,xe),Pe);hp(ie,xe)}return null}function je(ce,ie,ue,xe){for(var Pe=null,it=null,ke=ie,Be=ie=0,tt=null;ke!==null&&Be<ue.length;Be++){ke.index>Be?(tt=ke,ke=null):tt=ke.sibling;var lt=he(ce,ke,ue[Be],xe);if(lt===null){ke===null&&(ke=tt);break}o&&ke&<.alternate===null&&u(ce,ke),ie=R(lt,ie,Be),it===null?Pe=lt:it.sibling=lt,it=lt,ke=tt}if(Be===ue.length)return m(ce,ke),rt&&Ja(ce,Be),Pe;if(ke===null){for(;Be<ue.length;Be++)ke=be(ce,ue[Be],xe),ke!==null&&(ie=R(ke,ie,Be),it===null?Pe=ke:it.sibling=ke,it=ke);return rt&&Ja(ce,Be),Pe}for(ke=v(ke);Be<ue.length;Be++)tt=pe(ke,ce,Be,ue[Be],xe),tt!==null&&(o&&tt.alternate!==null&&ke.delete(tt.key===null?Be:tt.key),ie=R(tt,ie,Be),it===null?Pe=tt:it.sibling=tt,it=tt);return o&&ke.forEach(function(vo){return u(ce,vo)}),rt&&Ja(ce,Be),Pe}function Ie(ce,ie,ue,xe){if(ue==null)throw Error(r(151));for(var Pe=null,it=null,ke=ie,Be=ie=0,tt=null,lt=ue.next();ke!==null&&!lt.done;Be++,lt=ue.next()){ke.index>Be?(tt=ke,ke=null):tt=ke.sibling;var vo=he(ce,ke,lt.value,xe);if(vo===null){ke===null&&(ke=tt);break}o&&ke&&vo.alternate===null&&u(ce,ke),ie=R(vo,ie,Be),it===null?Pe=vo:it.sibling=vo,it=vo,ke=tt}if(lt.done)return m(ce,ke),rt&&Ja(ce,Be),Pe;if(ke===null){for(;!lt.done;Be++,lt=ue.next())lt=be(ce,lt.value,xe),lt!==null&&(ie=R(lt,ie,Be),it===null?Pe=lt:it.sibling=lt,it=lt);return rt&&Ja(ce,Be),Pe}for(ke=v(ke);!lt.done;Be++,lt=ue.next())lt=pe(ke,ce,Be,lt.value,xe),lt!==null&&(o&<.alternate!==null&&ke.delete(lt.key===null?Be:lt.key),ie=R(lt,ie,Be),it===null?Pe=lt:it.sibling=lt,it=lt);return o&&ke.forEach(function(ZK){return u(ce,ZK)}),rt&&Ja(ce,Be),Pe}function wt(ce,ie,ue,xe){if(typeof ue=="object"&&ue!==null&&ue.type===w&&ue.key===null&&(ue=ue.props.children),typeof ue=="object"&&ue!==null){switch(ue.$$typeof){case y:e:{for(var Pe=ue.key;ie!==null;){if(ie.key===Pe){if(Pe=ue.type,Pe===w){if(ie.tag===7){m(ce,ie.sibling),xe=E(ie,ue.props.children),xe.return=ce,ce=xe;break e}}else if(ie.elementType===Pe||typeof Pe=="object"&&Pe!==null&&Pe.$$typeof===O&&xi(Pe)===ie.type){m(ce,ie.sibling),xe=E(ie,ue.props),Yu(xe,ue),xe.return=ce,ce=xe;break e}m(ce,ie);break}else u(ce,ie);ie=ie.sibling}ue.type===w?(xe=pi(ue.props.children,ce.mode,xe,ue.key),xe.return=ce,ce=xe):(xe=sp(ue.type,ue.key,ue.props,null,ce.mode,xe),Yu(xe,ue),xe.return=ce,ce=xe)}return I(ce);case S:e:{for(Pe=ue.key;ie!==null;){if(ie.key===Pe)if(ie.tag===4&&ie.stateNode.containerInfo===ue.containerInfo&&ie.stateNode.implementation===ue.implementation){m(ce,ie.sibling),xe=E(ie,ue.children||[]),xe.return=ce,ce=xe;break e}else{m(ce,ie);break}else u(ce,ie);ie=ie.sibling}xe=rx(ue,ce.mode,xe),xe.return=ce,ce=xe}return I(ce);case O:return ue=xi(ue),wt(ce,ie,ue,xe)}if(V(ue))return je(ce,ie,ue,xe);if(U(ue)){if(Pe=U(ue),typeof Pe!="function")throw Error(r(150));return ue=Pe.call(ue),Ie(ce,ie,ue,xe)}if(typeof ue.then=="function")return wt(ce,ie,fp(ue),xe);if(ue.$$typeof===j)return wt(ce,ie,lp(ce,ue),xe);hp(ce,ue)}return typeof ue=="string"&&ue!==""||typeof ue=="number"||typeof ue=="bigint"?(ue=""+ue,ie!==null&&ie.tag===6?(m(ce,ie.sibling),xe=E(ie,ue),xe.return=ce,ce=xe):(m(ce,ie),xe=nx(ue,ce.mode,xe),xe.return=ce,ce=xe),I(ce)):m(ce,ie)}return function(ce,ie,ue,xe){try{Ku=0;var Pe=wt(ce,ie,ue,xe);return Zl=null,Pe}catch(ke){if(ke===Xl||ke===up)throw ke;var it=sr(29,ke,null,ce.mode);return it.lanes=xe,it.return=ce,it}finally{}}}var wi=FA(!0),UA=FA(!1),eo=!1;function mx(o){o.updateQueue={baseState:o.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function gx(o,u){o=o.updateQueue,u.updateQueue===o&&(u.updateQueue={baseState:o.baseState,firstBaseUpdate:o.firstBaseUpdate,lastBaseUpdate:o.lastBaseUpdate,shared:o.shared,callbacks:null})}function to(o){return{lane:o,tag:0,payload:null,callback:null,next:null}}function no(o,u,m){var v=o.updateQueue;if(v===null)return null;if(v=v.shared,(ut&2)!==0){var E=v.pending;return E===null?u.next=u:(u.next=E.next,E.next=u),v.pending=u,u=ap(o),jA(o,null,m),u}return rp(o,v,u,m),ap(o)}function Xu(o,u,m){if(u=u.updateQueue,u!==null&&(u=u.shared,(m&4194048)!==0)){var v=u.lanes;v&=o.pendingLanes,m|=v,u.lanes=m,$h(o,m)}}function yx(o,u){var m=o.updateQueue,v=o.alternate;if(v!==null&&(v=v.updateQueue,m===v)){var E=null,R=null;if(m=m.firstBaseUpdate,m!==null){do{var I={lane:m.lane,tag:m.tag,payload:m.payload,callback:null,next:null};R===null?E=R=I:R=R.next=I,m=m.next}while(m!==null);R===null?E=R=u:R=R.next=u}else E=R=u;m={baseState:v.baseState,firstBaseUpdate:E,lastBaseUpdate:R,shared:v.shared,callbacks:v.callbacks},o.updateQueue=m;return}o=m.lastBaseUpdate,o===null?m.firstBaseUpdate=u:o.next=u,m.lastBaseUpdate=u}var vx=!1;function Zu(){if(vx){var o=Yl;if(o!==null)throw o}}function Qu(o,u,m,v){vx=!1;var E=o.updateQueue;eo=!1;var R=E.firstBaseUpdate,I=E.lastBaseUpdate,X=E.shared.pending;if(X!==null){E.shared.pending=null;var oe=X,de=oe.next;oe.next=null,I===null?R=de:I.next=de,I=oe;var ge=o.alternate;ge!==null&&(ge=ge.updateQueue,X=ge.lastBaseUpdate,X!==I&&(X===null?ge.firstBaseUpdate=de:X.next=de,ge.lastBaseUpdate=oe))}if(R!==null){var be=E.baseState;I=0,ge=de=oe=null,X=R;do{var he=X.lane&-536870913,pe=he!==X.lane;if(pe?(et&he)===he:(v&he)===he){he!==0&&he===Kl&&(vx=!0),ge!==null&&(ge=ge.next={lane:0,tag:X.tag,payload:X.payload,callback:null,next:null});e:{var je=o,Ie=X;he=u;var wt=m;switch(Ie.tag){case 1:if(je=Ie.payload,typeof je=="function"){be=je.call(wt,be,he);break e}be=je;break e;case 3:je.flags=je.flags&-65537|128;case 0:if(je=Ie.payload,he=typeof je=="function"?je.call(wt,be,he):je,he==null)break e;be=p({},be,he);break e;case 2:eo=!0}}he=X.callback,he!==null&&(o.flags|=64,pe&&(o.flags|=8192),pe=E.callbacks,pe===null?E.callbacks=[he]:pe.push(he))}else pe={lane:he,tag:X.tag,payload:X.payload,callback:X.callback,next:null},ge===null?(de=ge=pe,oe=be):ge=ge.next=pe,I|=he;if(X=X.next,X===null){if(X=E.shared.pending,X===null)break;pe=X,X=pe.next,pe.next=null,E.lastBaseUpdate=pe,E.shared.pending=null}}while(!0);ge===null&&(oe=be),E.baseState=oe,E.firstBaseUpdate=de,E.lastBaseUpdate=ge,R===null&&(E.shared.lanes=0),io|=I,o.lanes=I,o.memoizedState=be}}function HA(o,u){if(typeof o!="function")throw Error(r(191,o));o.call(u)}function BA(o,u){var m=o.callbacks;if(m!==null)for(o.callbacks=null,o=0;o<m.length;o++)HA(m[o],u)}var Ql=D(null),pp=D(0);function VA(o,u){o=us,B(pp,o),B(Ql,u),us=o|u.baseLanes}function xx(){B(pp,us),B(Ql,Ql.current)}function bx(){us=pp.current,W(Ql),W(pp)}var or=D(null),Rr=null;function ro(o){var u=o.alternate;B(Zt,Zt.current&1),B(or,o),Rr===null&&(u===null||Ql.current!==null||u.memoizedState!==null)&&(Rr=o)}function wx(o){B(Zt,Zt.current),B(or,o),Rr===null&&(Rr=o)}function WA(o){o.tag===22?(B(Zt,Zt.current),B(or,o),Rr===null&&(Rr=o)):ao()}function ao(){B(Zt,Zt.current),B(or,or.current)}function ir(o){W(or),Rr===o&&(Rr=null),W(Zt)}var Zt=D(0);function mp(o){for(var u=o;u!==null;){if(u.tag===13){var m=u.memoizedState;if(m!==null&&(m=m.dehydrated,m===null||Eb(m)||Tb(m)))return u}else if(u.tag===19&&(u.memoizedProps.revealOrder==="forwards"||u.memoizedProps.revealOrder==="backwards"||u.memoizedProps.revealOrder==="unstable_legacy-backwards"||u.memoizedProps.revealOrder==="together")){if((u.flags&128)!==0)return u}else if(u.child!==null){u.child.return=u,u=u.child;continue}if(u===o)break;for(;u.sibling===null;){if(u.return===null||u.return===o)return null;u=u.return}u.sibling.return=u.return,u=u.sibling}return null}var ns=0,He=null,xt=null,nn=null,gp=!1,Jl=!1,Si=!1,yp=0,Ju=0,ec=null,FG=0;function Wt(){throw Error(r(321))}function Sx(o,u){if(u===null)return!1;for(var m=0;m<u.length&&m<o.length;m++)if(!ar(o[m],u[m]))return!1;return!0}function _x(o,u,m,v,E,R){return ns=R,He=u,u.memoizedState=null,u.updateQueue=null,u.lanes=0,P.H=o===null||o.memoizedState===null?AR:Lx,Si=!1,R=m(v,E),Si=!1,Jl&&(R=KA(u,m,v,E)),GA(o),R}function GA(o){P.H=nd;var u=xt!==null&&xt.next!==null;if(ns=0,nn=xt=He=null,gp=!1,Ju=0,ec=null,u)throw Error(r(300));o===null||rn||(o=o.dependencies,o!==null&&ip(o)&&(rn=!0))}function KA(o,u,m,v){He=o;var E=0;do{if(Jl&&(ec=null),Ju=0,Jl=!1,25<=E)throw Error(r(301));if(E+=1,nn=xt=null,o.updateQueue!=null){var R=o.updateQueue;R.lastEffect=null,R.events=null,R.stores=null,R.memoCache!=null&&(R.memoCache.index=0)}P.H=RR,R=u(m,v)}while(Jl);return R}function UG(){var o=P.H,u=o.useState()[0];return u=typeof u.then=="function"?ed(u):u,o=o.useState()[0],(xt!==null?xt.memoizedState:null)!==o&&(He.flags|=1024),u}function Nx(){var o=yp!==0;return yp=0,o}function jx(o,u,m){u.updateQueue=o.updateQueue,u.flags&=-2053,o.lanes&=~m}function Cx(o){if(gp){for(o=o.memoizedState;o!==null;){var u=o.queue;u!==null&&(u.pending=null),o=o.next}gp=!1}ns=0,nn=xt=He=null,Jl=!1,Ju=yp=0,ec=null}function Un(){var o={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return nn===null?He.memoizedState=nn=o:nn=nn.next=o,nn}function Qt(){if(xt===null){var o=He.alternate;o=o!==null?o.memoizedState:null}else o=xt.next;var u=nn===null?He.memoizedState:nn.next;if(u!==null)nn=u,xt=o;else{if(o===null)throw He.alternate===null?Error(r(467)):Error(r(310));xt=o,o={memoizedState:xt.memoizedState,baseState:xt.baseState,baseQueue:xt.baseQueue,queue:xt.queue,next:null},nn===null?He.memoizedState=nn=o:nn=nn.next=o}return nn}function vp(){return{lastEffect:null,events:null,stores:null,memoCache:null}}function ed(o){var u=Ju;return Ju+=1,ec===null&&(ec=[]),o=LA(ec,o,u),u=He,(nn===null?u.memoizedState:nn.next)===null&&(u=u.alternate,P.H=u===null||u.memoizedState===null?AR:Lx),o}function xp(o){if(o!==null&&typeof o=="object"){if(typeof o.then=="function")return ed(o);if(o.$$typeof===j)return Nn(o)}throw Error(r(438,String(o)))}function Ex(o){var u=null,m=He.updateQueue;if(m!==null&&(u=m.memoCache),u==null){var v=He.alternate;v!==null&&(v=v.updateQueue,v!==null&&(v=v.memoCache,v!=null&&(u={data:v.data.map(function(E){return E.slice()}),index:0})))}if(u==null&&(u={data:[],index:0}),m===null&&(m=vp(),He.updateQueue=m),m.memoCache=u,m=u.data[u.index],m===void 0)for(m=u.data[u.index]=Array(o),v=0;v<o;v++)m[v]=z;return u.index++,m}function rs(o,u){return typeof u=="function"?u(o):u}function bp(o){var u=Qt();return Tx(u,xt,o)}function Tx(o,u,m){var v=o.queue;if(v===null)throw Error(r(311));v.lastRenderedReducer=m;var E=o.baseQueue,R=v.pending;if(R!==null){if(E!==null){var I=E.next;E.next=R.next,R.next=I}u.baseQueue=E=R,v.pending=null}if(R=o.baseState,E===null)o.memoizedState=R;else{u=E.next;var X=I=null,oe=null,de=u,ge=!1;do{var be=de.lane&-536870913;if(be!==de.lane?(et&be)===be:(ns&be)===be){var he=de.revertLane;if(he===0)oe!==null&&(oe=oe.next={lane:0,revertLane:0,gesture:null,action:de.action,hasEagerState:de.hasEagerState,eagerState:de.eagerState,next:null}),be===Kl&&(ge=!0);else if((ns&he)===he){de=de.next,he===Kl&&(ge=!0);continue}else be={lane:0,revertLane:de.revertLane,gesture:null,action:de.action,hasEagerState:de.hasEagerState,eagerState:de.eagerState,next:null},oe===null?(X=oe=be,I=R):oe=oe.next=be,He.lanes|=he,io|=he;be=de.action,Si&&m(R,be),R=de.hasEagerState?de.eagerState:m(R,be)}else he={lane:be,revertLane:de.revertLane,gesture:de.gesture,action:de.action,hasEagerState:de.hasEagerState,eagerState:de.eagerState,next:null},oe===null?(X=oe=he,I=R):oe=oe.next=he,He.lanes|=be,io|=be;de=de.next}while(de!==null&&de!==u);if(oe===null?I=R:oe.next=X,!ar(R,o.memoizedState)&&(rn=!0,ge&&(m=Yl,m!==null)))throw m;o.memoizedState=R,o.baseState=I,o.baseQueue=oe,v.lastRenderedState=R}return E===null&&(v.lanes=0),[o.memoizedState,v.dispatch]}function Ax(o){var u=Qt(),m=u.queue;if(m===null)throw Error(r(311));m.lastRenderedReducer=o;var v=m.dispatch,E=m.pending,R=u.memoizedState;if(E!==null){m.pending=null;var I=E=E.next;do R=o(R,I.action),I=I.next;while(I!==E);ar(R,u.memoizedState)||(rn=!0),u.memoizedState=R,u.baseQueue===null&&(u.baseState=R),m.lastRenderedState=R}return[R,v]}function YA(o,u,m){var v=He,E=Qt(),R=rt;if(R){if(m===void 0)throw Error(r(407));m=m()}else m=u();var I=!ar((xt||E).memoizedState,m);if(I&&(E.memoizedState=m,rn=!0),E=E.queue,Ox(QA.bind(null,v,E,o),[o]),E.getSnapshot!==u||I||nn!==null&&nn.memoizedState.tag&1){if(v.flags|=2048,tc(9,{destroy:void 0},ZA.bind(null,v,E,m,u),null),_t===null)throw Error(r(349));R||(ns&127)!==0||XA(v,u,m)}return m}function XA(o,u,m){o.flags|=16384,o={getSnapshot:u,value:m},u=He.updateQueue,u===null?(u=vp(),He.updateQueue=u,u.stores=[o]):(m=u.stores,m===null?u.stores=[o]:m.push(o))}function ZA(o,u,m,v){u.value=m,u.getSnapshot=v,JA(u)&&eR(o)}function QA(o,u,m){return m(function(){JA(u)&&eR(o)})}function JA(o){var u=o.getSnapshot;o=o.value;try{var m=u();return!ar(o,m)}catch{return!0}}function eR(o){var u=hi(o,2);u!==null&&er(u,o,2)}function Rx(o){var u=Un();if(typeof o=="function"){var m=o;if(o=m(),Si){ma(!0);try{m()}finally{ma(!1)}}}return u.memoizedState=u.baseState=o,u.queue={pending:null,lanes:0,dispatch:null,lastRenderedReducer:rs,lastRenderedState:o},u}function tR(o,u,m,v){return o.baseState=m,Tx(o,xt,typeof v=="function"?v:rs)}function HG(o,u,m,v,E){if(_p(o))throw Error(r(485));if(o=u.action,o!==null){var R={payload:E,action:o,next:null,isTransition:!0,status:"pending",value:null,reason:null,listeners:[],then:function(I){R.listeners.push(I)}};P.T!==null?m(!0):R.isTransition=!1,v(R),m=u.pending,m===null?(R.next=u.pending=R,nR(u,R)):(R.next=m.next,u.pending=m.next=R)}}function nR(o,u){var m=u.action,v=u.payload,E=o.state;if(u.isTransition){var R=P.T,I={};P.T=I;try{var X=m(E,v),oe=P.S;oe!==null&&oe(I,X),rR(o,u,X)}catch(de){kx(o,u,de)}finally{R!==null&&I.types!==null&&(R.types=I.types),P.T=R}}else try{R=m(E,v),rR(o,u,R)}catch(de){kx(o,u,de)}}function rR(o,u,m){m!==null&&typeof m=="object"&&typeof m.then=="function"?m.then(function(v){aR(o,u,v)},function(v){return kx(o,u,v)}):aR(o,u,m)}function aR(o,u,m){u.status="fulfilled",u.value=m,sR(u),o.state=m,u=o.pending,u!==null&&(m=u.next,m===u?o.pending=null:(m=m.next,u.next=m,nR(o,m)))}function kx(o,u,m){var v=o.pending;if(o.pending=null,v!==null){v=v.next;do u.status="rejected",u.reason=m,sR(u),u=u.next;while(u!==v)}o.action=null}function sR(o){o=o.listeners;for(var u=0;u<o.length;u++)(0,o[u])()}function oR(o,u){return u}function iR(o,u){if(rt){var m=_t.formState;if(m!==null){e:{var v=He;if(rt){if(Ot){t:{for(var E=Ot,R=Ar;E.nodeType!==8;){if(!R){E=null;break t}if(E=kr(E.nextSibling),E===null){E=null;break t}}R=E.data,E=R==="F!"||R==="F"?E:null}if(E){Ot=kr(E.nextSibling),v=E.data==="F!";break e}}Qs(v)}v=!1}v&&(u=m[0])}}return m=Un(),m.memoizedState=m.baseState=u,v={pending:null,lanes:0,dispatch:null,lastRenderedReducer:oR,lastRenderedState:u},m.queue=v,m=CR.bind(null,He,v),v.dispatch=m,v=Rx(!1),R=Ix.bind(null,He,!1,v.queue),v=Un(),E={state:u,dispatch:null,action:o,pending:null},v.queue=E,m=HG.bind(null,He,E,R,m),E.dispatch=m,v.memoizedState=o,[u,m,!1]}function lR(o){var u=Qt();return cR(u,xt,o)}function cR(o,u,m){if(u=Tx(o,u,oR)[0],o=bp(rs)[0],typeof u=="object"&&u!==null&&typeof u.then=="function")try{var v=ed(u)}catch(I){throw I===Xl?up:I}else v=u;u=Qt();var E=u.queue,R=E.dispatch;return m!==u.memoizedState&&(He.flags|=2048,tc(9,{destroy:void 0},BG.bind(null,E,m),null)),[v,R,o]}function BG(o,u){o.action=u}function uR(o){var u=Qt(),m=xt;if(m!==null)return cR(u,m,o);Qt(),u=u.memoizedState,m=Qt();var v=m.queue.dispatch;return m.memoizedState=o,[u,v,!1]}function tc(o,u,m,v){return o={tag:o,create:m,deps:v,inst:u,next:null},u=He.updateQueue,u===null&&(u=vp(),He.updateQueue=u),m=u.lastEffect,m===null?u.lastEffect=o.next=o:(v=m.next,m.next=o,o.next=v,u.lastEffect=o),o}function dR(){return Qt().memoizedState}function wp(o,u,m,v){var E=Un();He.flags|=o,E.memoizedState=tc(1|u,{destroy:void 0},m,v===void 0?null:v)}function Sp(o,u,m,v){var E=Qt();v=v===void 0?null:v;var R=E.memoizedState.inst;xt!==null&&v!==null&&Sx(v,xt.memoizedState.deps)?E.memoizedState=tc(u,R,m,v):(He.flags|=o,E.memoizedState=tc(1|u,R,m,v))}function fR(o,u){wp(8390656,8,o,u)}function Ox(o,u){Sp(2048,8,o,u)}function VG(o){He.flags|=4;var u=He.updateQueue;if(u===null)u=vp(),He.updateQueue=u,u.events=[o];else{var m=u.events;m===null?u.events=[o]:m.push(o)}}function hR(o){var u=Qt().memoizedState;return VG({ref:u,nextImpl:o}),function(){if((ut&2)!==0)throw Error(r(440));return u.impl.apply(void 0,arguments)}}function pR(o,u){return Sp(4,2,o,u)}function mR(o,u){return Sp(4,4,o,u)}function gR(o,u){if(typeof u=="function"){o=o();var m=u(o);return function(){typeof m=="function"?m():u(null)}}if(u!=null)return o=o(),u.current=o,function(){u.current=null}}function yR(o,u,m){m=m!=null?m.concat([o]):null,Sp(4,4,gR.bind(null,u,o),m)}function Mx(){}function vR(o,u){var m=Qt();u=u===void 0?null:u;var v=m.memoizedState;return u!==null&&Sx(u,v[1])?v[0]:(m.memoizedState=[o,u],o)}function xR(o,u){var m=Qt();u=u===void 0?null:u;var v=m.memoizedState;if(u!==null&&Sx(u,v[1]))return v[0];if(v=o(),Si){ma(!0);try{o()}finally{ma(!1)}}return m.memoizedState=[v,u],v}function Dx(o,u,m){return m===void 0||(ns&1073741824)!==0&&(et&261930)===0?o.memoizedState=u:(o.memoizedState=m,o=bk(),He.lanes|=o,io|=o,m)}function bR(o,u,m,v){return ar(m,u)?m:Ql.current!==null?(o=Dx(o,m,v),ar(o,u)||(rn=!0),o):(ns&42)===0||(ns&1073741824)!==0&&(et&261930)===0?(rn=!0,o.memoizedState=m):(o=bk(),He.lanes|=o,io|=o,u)}function wR(o,u,m,v,E){var R=K.p;K.p=R!==0&&8>R?R:8;var I=P.T,X={};P.T=X,Ix(o,!1,u,m);try{var oe=E(),de=P.S;if(de!==null&&de(X,oe),oe!==null&&typeof oe=="object"&&typeof oe.then=="function"){var ge=qG(oe,v);td(o,u,ge,ur(o))}else td(o,u,v,ur(o))}catch(be){td(o,u,{then:function(){},status:"rejected",reason:be},ur())}finally{K.p=R,I!==null&&X.types!==null&&(I.types=X.types),P.T=I}}function WG(){}function Px(o,u,m,v){if(o.tag!==5)throw Error(r(476));var E=SR(o).queue;wR(o,E,u,H,m===null?WG:function(){return _R(o),m(v)})}function SR(o){var u=o.memoizedState;if(u!==null)return u;u={memoizedState:H,baseState:H,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:rs,lastRenderedState:H},next:null};var m={};return u.next={memoizedState:m,baseState:m,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:rs,lastRenderedState:m},next:null},o.memoizedState=u,o=o.alternate,o!==null&&(o.memoizedState=u),u}function _R(o){var u=SR(o);u.next===null&&(u=o.alternate.memoizedState),td(o,u.next.queue,{},ur())}function $x(){return Nn(vd)}function NR(){return Qt().memoizedState}function jR(){return Qt().memoizedState}function GG(o){for(var u=o.return;u!==null;){switch(u.tag){case 24:case 3:var m=ur();o=to(m);var v=no(u,o,m);v!==null&&(er(v,u,m),Xu(v,u,m)),u={cache:dx()},o.payload=u;return}u=u.return}}function KG(o,u,m){var v=ur();m={lane:v,revertLane:0,gesture:null,action:m,hasEagerState:!1,eagerState:null,next:null},_p(o)?ER(u,m):(m=ex(o,u,m,v),m!==null&&(er(m,o,v),TR(m,u,v)))}function CR(o,u,m){var v=ur();td(o,u,m,v)}function td(o,u,m,v){var E={lane:v,revertLane:0,gesture:null,action:m,hasEagerState:!1,eagerState:null,next:null};if(_p(o))ER(u,E);else{var R=o.alternate;if(o.lanes===0&&(R===null||R.lanes===0)&&(R=u.lastRenderedReducer,R!==null))try{var I=u.lastRenderedState,X=R(I,m);if(E.hasEagerState=!0,E.eagerState=X,ar(X,I))return rp(o,u,E,0),_t===null&&np(),!1}catch{}finally{}if(m=ex(o,u,E,v),m!==null)return er(m,o,v),TR(m,u,v),!0}return!1}function Ix(o,u,m,v){if(v={lane:2,revertLane:mb(),gesture:null,action:v,hasEagerState:!1,eagerState:null,next:null},_p(o)){if(u)throw Error(r(479))}else u=ex(o,m,v,2),u!==null&&er(u,o,2)}function _p(o){var u=o.alternate;return o===He||u!==null&&u===He}function ER(o,u){Jl=gp=!0;var m=o.pending;m===null?u.next=u:(u.next=m.next,m.next=u),o.pending=u}function TR(o,u,m){if((m&4194048)!==0){var v=u.lanes;v&=o.pendingLanes,m|=v,u.lanes=m,$h(o,m)}}var nd={readContext:Nn,use:xp,useCallback:Wt,useContext:Wt,useEffect:Wt,useImperativeHandle:Wt,useLayoutEffect:Wt,useInsertionEffect:Wt,useMemo:Wt,useReducer:Wt,useRef:Wt,useState:Wt,useDebugValue:Wt,useDeferredValue:Wt,useTransition:Wt,useSyncExternalStore:Wt,useId:Wt,useHostTransitionStatus:Wt,useFormState:Wt,useActionState:Wt,useOptimistic:Wt,useMemoCache:Wt,useCacheRefresh:Wt};nd.useEffectEvent=Wt;var AR={readContext:Nn,use:xp,useCallback:function(o,u){return Un().memoizedState=[o,u===void 0?null:u],o},useContext:Nn,useEffect:fR,useImperativeHandle:function(o,u,m){m=m!=null?m.concat([o]):null,wp(4194308,4,gR.bind(null,u,o),m)},useLayoutEffect:function(o,u){return wp(4194308,4,o,u)},useInsertionEffect:function(o,u){wp(4,2,o,u)},useMemo:function(o,u){var m=Un();u=u===void 0?null:u;var v=o();if(Si){ma(!0);try{o()}finally{ma(!1)}}return m.memoizedState=[v,u],v},useReducer:function(o,u,m){var v=Un();if(m!==void 0){var E=m(u);if(Si){ma(!0);try{m(u)}finally{ma(!1)}}}else E=u;return v.memoizedState=v.baseState=E,o={pending:null,lanes:0,dispatch:null,lastRenderedReducer:o,lastRenderedState:E},v.queue=o,o=o.dispatch=KG.bind(null,He,o),[v.memoizedState,o]},useRef:function(o){var u=Un();return o={current:o},u.memoizedState=o},useState:function(o){o=Rx(o);var u=o.queue,m=CR.bind(null,He,u);return u.dispatch=m,[o.memoizedState,m]},useDebugValue:Mx,useDeferredValue:function(o,u){var m=Un();return Dx(m,o,u)},useTransition:function(){var o=Rx(!1);return o=wR.bind(null,He,o.queue,!0,!1),Un().memoizedState=o,[!1,o]},useSyncExternalStore:function(o,u,m){var v=He,E=Un();if(rt){if(m===void 0)throw Error(r(407));m=m()}else{if(m=u(),_t===null)throw Error(r(349));(et&127)!==0||XA(v,u,m)}E.memoizedState=m;var R={value:m,getSnapshot:u};return E.queue=R,fR(QA.bind(null,v,R,o),[o]),v.flags|=2048,tc(9,{destroy:void 0},ZA.bind(null,v,R,m,u),null),m},useId:function(){var o=Un(),u=_t.identifierPrefix;if(rt){var m=va,v=ya;m=(v&~(1<<32-Fn(v)-1)).toString(32)+m,u="_"+u+"R_"+m,m=yp++,0<m&&(u+="H"+m.toString(32)),u+="_"}else m=FG++,u="_"+u+"r_"+m.toString(32)+"_";return o.memoizedState=u},useHostTransitionStatus:$x,useFormState:iR,useActionState:iR,useOptimistic:function(o){var u=Un();u.memoizedState=u.baseState=o;var m={pending:null,lanes:0,dispatch:null,lastRenderedReducer:null,lastRenderedState:null};return u.queue=m,u=Ix.bind(null,He,!0,m),m.dispatch=u,[o,u]},useMemoCache:Ex,useCacheRefresh:function(){return Un().memoizedState=GG.bind(null,He)},useEffectEvent:function(o){var u=Un(),m={impl:o};return u.memoizedState=m,function(){if((ut&2)!==0)throw Error(r(440));return m.impl.apply(void 0,arguments)}}},Lx={readContext:Nn,use:xp,useCallback:vR,useContext:Nn,useEffect:Ox,useImperativeHandle:yR,useInsertionEffect:pR,useLayoutEffect:mR,useMemo:xR,useReducer:bp,useRef:dR,useState:function(){return bp(rs)},useDebugValue:Mx,useDeferredValue:function(o,u){var m=Qt();return bR(m,xt.memoizedState,o,u)},useTransition:function(){var o=bp(rs)[0],u=Qt().memoizedState;return[typeof o=="boolean"?o:ed(o),u]},useSyncExternalStore:YA,useId:NR,useHostTransitionStatus:$x,useFormState:lR,useActionState:lR,useOptimistic:function(o,u){var m=Qt();return tR(m,xt,o,u)},useMemoCache:Ex,useCacheRefresh:jR};Lx.useEffectEvent=hR;var RR={readContext:Nn,use:xp,useCallback:vR,useContext:Nn,useEffect:Ox,useImperativeHandle:yR,useInsertionEffect:pR,useLayoutEffect:mR,useMemo:xR,useReducer:Ax,useRef:dR,useState:function(){return Ax(rs)},useDebugValue:Mx,useDeferredValue:function(o,u){var m=Qt();return xt===null?Dx(m,o,u):bR(m,xt.memoizedState,o,u)},useTransition:function(){var o=Ax(rs)[0],u=Qt().memoizedState;return[typeof o=="boolean"?o:ed(o),u]},useSyncExternalStore:YA,useId:NR,useHostTransitionStatus:$x,useFormState:uR,useActionState:uR,useOptimistic:function(o,u){var m=Qt();return xt!==null?tR(m,xt,o,u):(m.baseState=o,[o,m.queue.dispatch])},useMemoCache:Ex,useCacheRefresh:jR};RR.useEffectEvent=hR;function zx(o,u,m,v){u=o.memoizedState,m=m(v,u),m=m==null?u:p({},u,m),o.memoizedState=m,o.lanes===0&&(o.updateQueue.baseState=m)}var qx={enqueueSetState:function(o,u,m){o=o._reactInternals;var v=ur(),E=to(v);E.payload=u,m!=null&&(E.callback=m),u=no(o,E,v),u!==null&&(er(u,o,v),Xu(u,o,v))},enqueueReplaceState:function(o,u,m){o=o._reactInternals;var v=ur(),E=to(v);E.tag=1,E.payload=u,m!=null&&(E.callback=m),u=no(o,E,v),u!==null&&(er(u,o,v),Xu(u,o,v))},enqueueForceUpdate:function(o,u){o=o._reactInternals;var m=ur(),v=to(m);v.tag=2,u!=null&&(v.callback=u),u=no(o,v,m),u!==null&&(er(u,o,m),Xu(u,o,m))}};function kR(o,u,m,v,E,R,I){return o=o.stateNode,typeof o.shouldComponentUpdate=="function"?o.shouldComponentUpdate(v,R,I):u.prototype&&u.prototype.isPureReactComponent?!Uu(m,v)||!Uu(E,R):!0}function OR(o,u,m,v){o=u.state,typeof u.componentWillReceiveProps=="function"&&u.componentWillReceiveProps(m,v),typeof u.UNSAFE_componentWillReceiveProps=="function"&&u.UNSAFE_componentWillReceiveProps(m,v),u.state!==o&&qx.enqueueReplaceState(u,u.state,null)}function _i(o,u){var m=u;if("ref"in u){m={};for(var v in u)v!=="ref"&&(m[v]=u[v])}if(o=o.defaultProps){m===u&&(m=p({},m));for(var E in o)m[E]===void 0&&(m[E]=o[E])}return m}function MR(o){tp(o)}function DR(o){console.error(o)}function PR(o){tp(o)}function Np(o,u){try{var m=o.onUncaughtError;m(u.value,{componentStack:u.stack})}catch(v){setTimeout(function(){throw v})}}function $R(o,u,m){try{var v=o.onCaughtError;v(m.value,{componentStack:m.stack,errorBoundary:u.tag===1?u.stateNode:null})}catch(E){setTimeout(function(){throw E})}}function Fx(o,u,m){return m=to(m),m.tag=3,m.payload={element:null},m.callback=function(){Np(o,u)},m}function IR(o){return o=to(o),o.tag=3,o}function LR(o,u,m,v){var E=m.type.getDerivedStateFromError;if(typeof E=="function"){var R=v.value;o.payload=function(){return E(R)},o.callback=function(){$R(u,m,v)}}var I=m.stateNode;I!==null&&typeof I.componentDidCatch=="function"&&(o.callback=function(){$R(u,m,v),typeof E!="function"&&(lo===null?lo=new Set([this]):lo.add(this));var X=v.stack;this.componentDidCatch(v.value,{componentStack:X!==null?X:""})})}function YG(o,u,m,v,E){if(m.flags|=32768,v!==null&&typeof v=="object"&&typeof v.then=="function"){if(u=m.alternate,u!==null&&Gl(u,m,E,!0),m=or.current,m!==null){switch(m.tag){case 31:case 13:return Rr===null?$p():m.alternate===null&&Gt===0&&(Gt=3),m.flags&=-257,m.flags|=65536,m.lanes=E,v===dp?m.flags|=16384:(u=m.updateQueue,u===null?m.updateQueue=new Set([v]):u.add(v),fb(o,v,E)),!1;case 22:return m.flags|=65536,v===dp?m.flags|=16384:(u=m.updateQueue,u===null?(u={transitions:null,markerInstances:null,retryQueue:new Set([v])},m.updateQueue=u):(m=u.retryQueue,m===null?u.retryQueue=new Set([v]):m.add(v)),fb(o,v,E)),!1}throw Error(r(435,m.tag))}return fb(o,v,E),$p(),!1}if(rt)return u=or.current,u!==null?((u.flags&65536)===0&&(u.flags|=256),u.flags|=65536,u.lanes=E,v!==ox&&(o=Error(r(422),{cause:v}),Vu(Cr(o,m)))):(v!==ox&&(u=Error(r(423),{cause:v}),Vu(Cr(u,m))),o=o.current.alternate,o.flags|=65536,E&=-E,o.lanes|=E,v=Cr(v,m),E=Fx(o.stateNode,v,E),yx(o,E),Gt!==4&&(Gt=2)),!1;var R=Error(r(520),{cause:v});if(R=Cr(R,m),ud===null?ud=[R]:ud.push(R),Gt!==4&&(Gt=2),u===null)return!0;v=Cr(v,m),m=u;do{switch(m.tag){case 3:return m.flags|=65536,o=E&-E,m.lanes|=o,o=Fx(m.stateNode,v,o),yx(m,o),!1;case 1:if(u=m.type,R=m.stateNode,(m.flags&128)===0&&(typeof u.getDerivedStateFromError=="function"||R!==null&&typeof R.componentDidCatch=="function"&&(lo===null||!lo.has(R))))return m.flags|=65536,E&=-E,m.lanes|=E,E=IR(E),LR(E,o,m,v),yx(m,E),!1}m=m.return}while(m!==null);return!1}var Ux=Error(r(461)),rn=!1;function jn(o,u,m,v){u.child=o===null?UA(u,null,m,v):wi(u,o.child,m,v)}function zR(o,u,m,v,E){m=m.render;var R=u.ref;if("ref"in v){var I={};for(var X in v)X!=="ref"&&(I[X]=v[X])}else I=v;return yi(u),v=_x(o,u,m,I,R,E),X=Nx(),o!==null&&!rn?(jx(o,u,E),as(o,u,E)):(rt&&X&&ax(u),u.flags|=1,jn(o,u,v,E),u.child)}function qR(o,u,m,v,E){if(o===null){var R=m.type;return typeof R=="function"&&!tx(R)&&R.defaultProps===void 0&&m.compare===null?(u.tag=15,u.type=R,FR(o,u,R,v,E)):(o=sp(m.type,null,v,u,u.mode,E),o.ref=u.ref,o.return=u,u.child=o)}if(R=o.child,!Xx(o,E)){var I=R.memoizedProps;if(m=m.compare,m=m!==null?m:Uu,m(I,v)&&o.ref===u.ref)return as(o,u,E)}return u.flags|=1,o=Qa(R,v),o.ref=u.ref,o.return=u,u.child=o}function FR(o,u,m,v,E){if(o!==null){var R=o.memoizedProps;if(Uu(R,v)&&o.ref===u.ref)if(rn=!1,u.pendingProps=v=R,Xx(o,E))(o.flags&131072)!==0&&(rn=!0);else return u.lanes=o.lanes,as(o,u,E)}return Hx(o,u,m,v,E)}function UR(o,u,m,v){var E=v.children,R=o!==null?o.memoizedState:null;if(o===null&&u.stateNode===null&&(u.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),v.mode==="hidden"){if((u.flags&128)!==0){if(R=R!==null?R.baseLanes|m:m,o!==null){for(v=u.child=o.child,E=0;v!==null;)E=E|v.lanes|v.childLanes,v=v.sibling;v=E&~R}else v=0,u.child=null;return HR(o,u,R,m,v)}if((m&536870912)!==0)u.memoizedState={baseLanes:0,cachePool:null},o!==null&&cp(u,R!==null?R.cachePool:null),R!==null?VA(u,R):xx(),WA(u);else return v=u.lanes=536870912,HR(o,u,R!==null?R.baseLanes|m:m,m,v)}else R!==null?(cp(u,R.cachePool),VA(u,R),ao(),u.memoizedState=null):(o!==null&&cp(u,null),xx(),ao());return jn(o,u,E,m),u.child}function rd(o,u){return o!==null&&o.tag===22||u.stateNode!==null||(u.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),u.sibling}function HR(o,u,m,v,E){var R=hx();return R=R===null?null:{parent:tn._currentValue,pool:R},u.memoizedState={baseLanes:m,cachePool:R},o!==null&&cp(u,null),xx(),WA(u),o!==null&&Gl(o,u,v,!0),u.childLanes=E,null}function jp(o,u){return u=Ep({mode:u.mode,children:u.children},o.mode),u.ref=o.ref,o.child=u,u.return=o,u}function BR(o,u,m){return wi(u,o.child,null,m),o=jp(u,u.pendingProps),o.flags|=2,ir(u),u.memoizedState=null,o}function XG(o,u,m){var v=u.pendingProps,E=(u.flags&128)!==0;if(u.flags&=-129,o===null){if(rt){if(v.mode==="hidden")return o=jp(u,v),u.lanes=536870912,rd(null,o);if(wx(u),(o=Ot)?(o=nO(o,Ar),o=o!==null&&o.data==="&"?o:null,o!==null&&(u.memoizedState={dehydrated:o,treeContext:Xs!==null?{id:ya,overflow:va}:null,retryLane:536870912,hydrationErrors:null},m=EA(o),m.return=u,u.child=m,_n=u,Ot=null)):o=null,o===null)throw Qs(u);return u.lanes=536870912,null}return jp(u,v)}var R=o.memoizedState;if(R!==null){var I=R.dehydrated;if(wx(u),E)if(u.flags&256)u.flags&=-257,u=BR(o,u,m);else if(u.memoizedState!==null)u.child=o.child,u.flags|=128,u=null;else throw Error(r(558));else if(rn||Gl(o,u,m,!1),E=(m&o.childLanes)!==0,rn||E){if(v=_t,v!==null&&(I=Ih(v,m),I!==0&&I!==R.retryLane))throw R.retryLane=I,hi(o,I),er(v,o,I),Ux;$p(),u=BR(o,u,m)}else o=R.treeContext,Ot=kr(I.nextSibling),_n=u,rt=!0,Zs=null,Ar=!1,o!==null&&RA(u,o),u=jp(u,v),u.flags|=4096;return u}return o=Qa(o.child,{mode:v.mode,children:v.children}),o.ref=u.ref,u.child=o,o.return=u,o}function Cp(o,u){var m=u.ref;if(m===null)o!==null&&o.ref!==null&&(u.flags|=4194816);else{if(typeof m!="function"&&typeof m!="object")throw Error(r(284));(o===null||o.ref!==m)&&(u.flags|=4194816)}}function Hx(o,u,m,v,E){return yi(u),m=_x(o,u,m,v,void 0,E),v=Nx(),o!==null&&!rn?(jx(o,u,E),as(o,u,E)):(rt&&v&&ax(u),u.flags|=1,jn(o,u,m,E),u.child)}function VR(o,u,m,v,E,R){return yi(u),u.updateQueue=null,m=KA(u,v,m,E),GA(o),v=Nx(),o!==null&&!rn?(jx(o,u,R),as(o,u,R)):(rt&&v&&ax(u),u.flags|=1,jn(o,u,m,R),u.child)}function WR(o,u,m,v,E){if(yi(u),u.stateNode===null){var R=Hl,I=m.contextType;typeof I=="object"&&I!==null&&(R=Nn(I)),R=new m(v,R),u.memoizedState=R.state!==null&&R.state!==void 0?R.state:null,R.updater=qx,u.stateNode=R,R._reactInternals=u,R=u.stateNode,R.props=v,R.state=u.memoizedState,R.refs={},mx(u),I=m.contextType,R.context=typeof I=="object"&&I!==null?Nn(I):Hl,R.state=u.memoizedState,I=m.getDerivedStateFromProps,typeof I=="function"&&(zx(u,m,I,v),R.state=u.memoizedState),typeof m.getDerivedStateFromProps=="function"||typeof R.getSnapshotBeforeUpdate=="function"||typeof R.UNSAFE_componentWillMount!="function"&&typeof R.componentWillMount!="function"||(I=R.state,typeof R.componentWillMount=="function"&&R.componentWillMount(),typeof R.UNSAFE_componentWillMount=="function"&&R.UNSAFE_componentWillMount(),I!==R.state&&qx.enqueueReplaceState(R,R.state,null),Qu(u,v,R,E),Zu(),R.state=u.memoizedState),typeof R.componentDidMount=="function"&&(u.flags|=4194308),v=!0}else if(o===null){R=u.stateNode;var X=u.memoizedProps,oe=_i(m,X);R.props=oe;var de=R.context,ge=m.contextType;I=Hl,typeof ge=="object"&&ge!==null&&(I=Nn(ge));var be=m.getDerivedStateFromProps;ge=typeof be=="function"||typeof R.getSnapshotBeforeUpdate=="function",X=u.pendingProps!==X,ge||typeof R.UNSAFE_componentWillReceiveProps!="function"&&typeof R.componentWillReceiveProps!="function"||(X||de!==I)&&OR(u,R,v,I),eo=!1;var he=u.memoizedState;R.state=he,Qu(u,v,R,E),Zu(),de=u.memoizedState,X||he!==de||eo?(typeof be=="function"&&(zx(u,m,be,v),de=u.memoizedState),(oe=eo||kR(u,m,oe,v,he,de,I))?(ge||typeof R.UNSAFE_componentWillMount!="function"&&typeof R.componentWillMount!="function"||(typeof R.componentWillMount=="function"&&R.componentWillMount(),typeof R.UNSAFE_componentWillMount=="function"&&R.UNSAFE_componentWillMount()),typeof R.componentDidMount=="function"&&(u.flags|=4194308)):(typeof R.componentDidMount=="function"&&(u.flags|=4194308),u.memoizedProps=v,u.memoizedState=de),R.props=v,R.state=de,R.context=I,v=oe):(typeof R.componentDidMount=="function"&&(u.flags|=4194308),v=!1)}else{R=u.stateNode,gx(o,u),I=u.memoizedProps,ge=_i(m,I),R.props=ge,be=u.pendingProps,he=R.context,de=m.contextType,oe=Hl,typeof de=="object"&&de!==null&&(oe=Nn(de)),X=m.getDerivedStateFromProps,(de=typeof X=="function"||typeof R.getSnapshotBeforeUpdate=="function")||typeof R.UNSAFE_componentWillReceiveProps!="function"&&typeof R.componentWillReceiveProps!="function"||(I!==be||he!==oe)&&OR(u,R,v,oe),eo=!1,he=u.memoizedState,R.state=he,Qu(u,v,R,E),Zu();var pe=u.memoizedState;I!==be||he!==pe||eo||o!==null&&o.dependencies!==null&&ip(o.dependencies)?(typeof X=="function"&&(zx(u,m,X,v),pe=u.memoizedState),(ge=eo||kR(u,m,ge,v,he,pe,oe)||o!==null&&o.dependencies!==null&&ip(o.dependencies))?(de||typeof R.UNSAFE_componentWillUpdate!="function"&&typeof R.componentWillUpdate!="function"||(typeof R.componentWillUpdate=="function"&&R.componentWillUpdate(v,pe,oe),typeof R.UNSAFE_componentWillUpdate=="function"&&R.UNSAFE_componentWillUpdate(v,pe,oe)),typeof R.componentDidUpdate=="function"&&(u.flags|=4),typeof R.getSnapshotBeforeUpdate=="function"&&(u.flags|=1024)):(typeof R.componentDidUpdate!="function"||I===o.memoizedProps&&he===o.memoizedState||(u.flags|=4),typeof R.getSnapshotBeforeUpdate!="function"||I===o.memoizedProps&&he===o.memoizedState||(u.flags|=1024),u.memoizedProps=v,u.memoizedState=pe),R.props=v,R.state=pe,R.context=oe,v=ge):(typeof R.componentDidUpdate!="function"||I===o.memoizedProps&&he===o.memoizedState||(u.flags|=4),typeof R.getSnapshotBeforeUpdate!="function"||I===o.memoizedProps&&he===o.memoizedState||(u.flags|=1024),v=!1)}return R=v,Cp(o,u),v=(u.flags&128)!==0,R||v?(R=u.stateNode,m=v&&typeof m.getDerivedStateFromError!="function"?null:R.render(),u.flags|=1,o!==null&&v?(u.child=wi(u,o.child,null,E),u.child=wi(u,null,m,E)):jn(o,u,m,E),u.memoizedState=R.state,o=u.child):o=as(o,u,E),o}function GR(o,u,m,v){return mi(),u.flags|=256,jn(o,u,m,v),u.child}var Bx={dehydrated:null,treeContext:null,retryLane:0,hydrationErrors:null};function Vx(o){return{baseLanes:o,cachePool:$A()}}function Wx(o,u,m){return o=o!==null?o.childLanes&~m:0,u&&(o|=cr),o}function KR(o,u,m){var v=u.pendingProps,E=!1,R=(u.flags&128)!==0,I;if((I=R)||(I=o!==null&&o.memoizedState===null?!1:(Zt.current&2)!==0),I&&(E=!0,u.flags&=-129),I=(u.flags&32)!==0,u.flags&=-33,o===null){if(rt){if(E?ro(u):ao(),(o=Ot)?(o=nO(o,Ar),o=o!==null&&o.data!=="&"?o:null,o!==null&&(u.memoizedState={dehydrated:o,treeContext:Xs!==null?{id:ya,overflow:va}:null,retryLane:536870912,hydrationErrors:null},m=EA(o),m.return=u,u.child=m,_n=u,Ot=null)):o=null,o===null)throw Qs(u);return Tb(o)?u.lanes=32:u.lanes=536870912,null}var X=v.children;return v=v.fallback,E?(ao(),E=u.mode,X=Ep({mode:"hidden",children:X},E),v=pi(v,E,m,null),X.return=u,v.return=u,X.sibling=v,u.child=X,v=u.child,v.memoizedState=Vx(m),v.childLanes=Wx(o,I,m),u.memoizedState=Bx,rd(null,v)):(ro(u),Gx(u,X))}var oe=o.memoizedState;if(oe!==null&&(X=oe.dehydrated,X!==null)){if(R)u.flags&256?(ro(u),u.flags&=-257,u=Kx(o,u,m)):u.memoizedState!==null?(ao(),u.child=o.child,u.flags|=128,u=null):(ao(),X=v.fallback,E=u.mode,v=Ep({mode:"visible",children:v.children},E),X=pi(X,E,m,null),X.flags|=2,v.return=u,X.return=u,v.sibling=X,u.child=v,wi(u,o.child,null,m),v=u.child,v.memoizedState=Vx(m),v.childLanes=Wx(o,I,m),u.memoizedState=Bx,u=rd(null,v));else if(ro(u),Tb(X)){if(I=X.nextSibling&&X.nextSibling.dataset,I)var de=I.dgst;I=de,v=Error(r(419)),v.stack="",v.digest=I,Vu({value:v,source:null,stack:null}),u=Kx(o,u,m)}else if(rn||Gl(o,u,m,!1),I=(m&o.childLanes)!==0,rn||I){if(I=_t,I!==null&&(v=Ih(I,m),v!==0&&v!==oe.retryLane))throw oe.retryLane=v,hi(o,v),er(I,o,v),Ux;Eb(X)||$p(),u=Kx(o,u,m)}else Eb(X)?(u.flags|=192,u.child=o.child,u=null):(o=oe.treeContext,Ot=kr(X.nextSibling),_n=u,rt=!0,Zs=null,Ar=!1,o!==null&&RA(u,o),u=Gx(u,v.children),u.flags|=4096);return u}return E?(ao(),X=v.fallback,E=u.mode,oe=o.child,de=oe.sibling,v=Qa(oe,{mode:"hidden",children:v.children}),v.subtreeFlags=oe.subtreeFlags&65011712,de!==null?X=Qa(de,X):(X=pi(X,E,m,null),X.flags|=2),X.return=u,v.return=u,v.sibling=X,u.child=v,rd(null,v),v=u.child,X=o.child.memoizedState,X===null?X=Vx(m):(E=X.cachePool,E!==null?(oe=tn._currentValue,E=E.parent!==oe?{parent:oe,pool:oe}:E):E=$A(),X={baseLanes:X.baseLanes|m,cachePool:E}),v.memoizedState=X,v.childLanes=Wx(o,I,m),u.memoizedState=Bx,rd(o.child,v)):(ro(u),m=o.child,o=m.sibling,m=Qa(m,{mode:"visible",children:v.children}),m.return=u,m.sibling=null,o!==null&&(I=u.deletions,I===null?(u.deletions=[o],u.flags|=16):I.push(o)),u.child=m,u.memoizedState=null,m)}function Gx(o,u){return u=Ep({mode:"visible",children:u},o.mode),u.return=o,o.child=u}function Ep(o,u){return o=sr(22,o,null,u),o.lanes=0,o}function Kx(o,u,m){return wi(u,o.child,null,m),o=Gx(u,u.pendingProps.children),o.flags|=2,u.memoizedState=null,o}function YR(o,u,m){o.lanes|=u;var v=o.alternate;v!==null&&(v.lanes|=u),cx(o.return,u,m)}function Yx(o,u,m,v,E,R){var I=o.memoizedState;I===null?o.memoizedState={isBackwards:u,rendering:null,renderingStartTime:0,last:v,tail:m,tailMode:E,treeForkCount:R}:(I.isBackwards=u,I.rendering=null,I.renderingStartTime=0,I.last=v,I.tail=m,I.tailMode=E,I.treeForkCount=R)}function XR(o,u,m){var v=u.pendingProps,E=v.revealOrder,R=v.tail;v=v.children;var I=Zt.current,X=(I&2)!==0;if(X?(I=I&1|2,u.flags|=128):I&=1,B(Zt,I),jn(o,u,v,m),v=rt?Bu:0,!X&&o!==null&&(o.flags&128)!==0)e:for(o=u.child;o!==null;){if(o.tag===13)o.memoizedState!==null&&YR(o,m,u);else if(o.tag===19)YR(o,m,u);else if(o.child!==null){o.child.return=o,o=o.child;continue}if(o===u)break e;for(;o.sibling===null;){if(o.return===null||o.return===u)break e;o=o.return}o.sibling.return=o.return,o=o.sibling}switch(E){case"forwards":for(m=u.child,E=null;m!==null;)o=m.alternate,o!==null&&mp(o)===null&&(E=m),m=m.sibling;m=E,m===null?(E=u.child,u.child=null):(E=m.sibling,m.sibling=null),Yx(u,!1,E,m,R,v);break;case"backwards":case"unstable_legacy-backwards":for(m=null,E=u.child,u.child=null;E!==null;){if(o=E.alternate,o!==null&&mp(o)===null){u.child=E;break}o=E.sibling,E.sibling=m,m=E,E=o}Yx(u,!0,m,null,R,v);break;case"together":Yx(u,!1,null,null,void 0,v);break;default:u.memoizedState=null}return u.child}function as(o,u,m){if(o!==null&&(u.dependencies=o.dependencies),io|=u.lanes,(m&u.childLanes)===0)if(o!==null){if(Gl(o,u,m,!1),(m&u.childLanes)===0)return null}else return null;if(o!==null&&u.child!==o.child)throw Error(r(153));if(u.child!==null){for(o=u.child,m=Qa(o,o.pendingProps),u.child=m,m.return=u;o.sibling!==null;)o=o.sibling,m=m.sibling=Qa(o,o.pendingProps),m.return=u;m.sibling=null}return u.child}function Xx(o,u){return(o.lanes&u)!==0?!0:(o=o.dependencies,!!(o!==null&&ip(o)))}function ZG(o,u,m){switch(u.tag){case 3:ne(u,u.stateNode.containerInfo),Js(u,tn,o.memoizedState.cache),mi();break;case 27:case 5:ae(u);break;case 4:ne(u,u.stateNode.containerInfo);break;case 10:Js(u,u.type,u.memoizedProps.value);break;case 31:if(u.memoizedState!==null)return u.flags|=128,wx(u),null;break;case 13:var v=u.memoizedState;if(v!==null)return v.dehydrated!==null?(ro(u),u.flags|=128,null):(m&u.child.childLanes)!==0?KR(o,u,m):(ro(u),o=as(o,u,m),o!==null?o.sibling:null);ro(u);break;case 19:var E=(o.flags&128)!==0;if(v=(m&u.childLanes)!==0,v||(Gl(o,u,m,!1),v=(m&u.childLanes)!==0),E){if(v)return XR(o,u,m);u.flags|=128}if(E=u.memoizedState,E!==null&&(E.rendering=null,E.tail=null,E.lastEffect=null),B(Zt,Zt.current),v)break;return null;case 22:return u.lanes=0,UR(o,u,m,u.pendingProps);case 24:Js(u,tn,o.memoizedState.cache)}return as(o,u,m)}function ZR(o,u,m){if(o!==null)if(o.memoizedProps!==u.pendingProps)rn=!0;else{if(!Xx(o,m)&&(u.flags&128)===0)return rn=!1,ZG(o,u,m);rn=(o.flags&131072)!==0}else rn=!1,rt&&(u.flags&1048576)!==0&&AA(u,Bu,u.index);switch(u.lanes=0,u.tag){case 16:e:{var v=u.pendingProps;if(o=xi(u.elementType),u.type=o,typeof o=="function")tx(o)?(v=_i(o,v),u.tag=1,u=WR(null,u,o,v,m)):(u.tag=0,u=Hx(null,u,o,v,m));else{if(o!=null){var E=o.$$typeof;if(E===C){u.tag=11,u=zR(null,u,o,v,m);break e}else if(E===k){u.tag=14,u=qR(null,u,o,v,m);break e}}throw u=q(o)||o,Error(r(306,u,""))}}return u;case 0:return Hx(o,u,u.type,u.pendingProps,m);case 1:return v=u.type,E=_i(v,u.pendingProps),WR(o,u,v,E,m);case 3:e:{if(ne(u,u.stateNode.containerInfo),o===null)throw Error(r(387));v=u.pendingProps;var R=u.memoizedState;E=R.element,gx(o,u),Qu(u,v,null,m);var I=u.memoizedState;if(v=I.cache,Js(u,tn,v),v!==R.cache&&ux(u,[tn],m,!0),Zu(),v=I.element,R.isDehydrated)if(R={element:v,isDehydrated:!1,cache:I.cache},u.updateQueue.baseState=R,u.memoizedState=R,u.flags&256){u=GR(o,u,v,m);break e}else if(v!==E){E=Cr(Error(r(424)),u),Vu(E),u=GR(o,u,v,m);break e}else{switch(o=u.stateNode.containerInfo,o.nodeType){case 9:o=o.body;break;default:o=o.nodeName==="HTML"?o.ownerDocument.body:o}for(Ot=kr(o.firstChild),_n=u,rt=!0,Zs=null,Ar=!0,m=UA(u,null,v,m),u.child=m;m;)m.flags=m.flags&-3|4096,m=m.sibling}else{if(mi(),v===E){u=as(o,u,m);break e}jn(o,u,v,m)}u=u.child}return u;case 26:return Cp(o,u),o===null?(m=lO(u.type,null,u.pendingProps,null))?u.memoizedState=m:rt||(m=u.type,o=u.pendingProps,v=Hp(ee.current).createElement(m),v[un]=u,v[kn]=o,Cn(v,m,o),en(v),u.stateNode=v):u.memoizedState=lO(u.type,o.memoizedProps,u.pendingProps,o.memoizedState),null;case 27:return ae(u),o===null&&rt&&(v=u.stateNode=sO(u.type,u.pendingProps,ee.current),_n=u,Ar=!0,E=Ot,ho(u.type)?(Ab=E,Ot=kr(v.firstChild)):Ot=E),jn(o,u,u.pendingProps.children,m),Cp(o,u),o===null&&(u.flags|=4194304),u.child;case 5:return o===null&&rt&&((E=v=Ot)&&(v=EK(v,u.type,u.pendingProps,Ar),v!==null?(u.stateNode=v,_n=u,Ot=kr(v.firstChild),Ar=!1,E=!0):E=!1),E||Qs(u)),ae(u),E=u.type,R=u.pendingProps,I=o!==null?o.memoizedProps:null,v=R.children,Nb(E,R)?v=null:I!==null&&Nb(E,I)&&(u.flags|=32),u.memoizedState!==null&&(E=_x(o,u,UG,null,null,m),vd._currentValue=E),Cp(o,u),jn(o,u,v,m),u.child;case 6:return o===null&&rt&&((o=m=Ot)&&(m=TK(m,u.pendingProps,Ar),m!==null?(u.stateNode=m,_n=u,Ot=null,o=!0):o=!1),o||Qs(u)),null;case 13:return KR(o,u,m);case 4:return ne(u,u.stateNode.containerInfo),v=u.pendingProps,o===null?u.child=wi(u,null,v,m):jn(o,u,v,m),u.child;case 11:return zR(o,u,u.type,u.pendingProps,m);case 7:return jn(o,u,u.pendingProps,m),u.child;case 8:return jn(o,u,u.pendingProps.children,m),u.child;case 12:return jn(o,u,u.pendingProps.children,m),u.child;case 10:return v=u.pendingProps,Js(u,u.type,v.value),jn(o,u,v.children,m),u.child;case 9:return E=u.type._context,v=u.pendingProps.children,yi(u),E=Nn(E),v=v(E),u.flags|=1,jn(o,u,v,m),u.child;case 14:return qR(o,u,u.type,u.pendingProps,m);case 15:return FR(o,u,u.type,u.pendingProps,m);case 19:return XR(o,u,m);case 31:return XG(o,u,m);case 22:return UR(o,u,m,u.pendingProps);case 24:return yi(u),v=Nn(tn),o===null?(E=hx(),E===null&&(E=_t,R=dx(),E.pooledCache=R,R.refCount++,R!==null&&(E.pooledCacheLanes|=m),E=R),u.memoizedState={parent:v,cache:E},mx(u),Js(u,tn,E)):((o.lanes&m)!==0&&(gx(o,u),Qu(u,null,null,m),Zu()),E=o.memoizedState,R=u.memoizedState,E.parent!==v?(E={parent:v,cache:v},u.memoizedState=E,u.lanes===0&&(u.memoizedState=u.updateQueue.baseState=E),Js(u,tn,v)):(v=R.cache,Js(u,tn,v),v!==E.cache&&ux(u,[tn],m,!0))),jn(o,u,u.pendingProps.children,m),u.child;case 29:throw u.pendingProps}throw Error(r(156,u.tag))}function ss(o){o.flags|=4}function Zx(o,u,m,v,E){if((u=(o.mode&32)!==0)&&(u=!1),u){if(o.flags|=16777216,(E&335544128)===E)if(o.stateNode.complete)o.flags|=8192;else if(Nk())o.flags|=8192;else throw bi=dp,px}else o.flags&=-16777217}function QR(o,u){if(u.type!=="stylesheet"||(u.state.loading&4)!==0)o.flags&=-16777217;else if(o.flags|=16777216,!hO(u))if(Nk())o.flags|=8192;else throw bi=dp,px}function Tp(o,u){u!==null&&(o.flags|=4),o.flags&16384&&(u=o.tag!==22?Dh():536870912,o.lanes|=u,sc|=u)}function ad(o,u){if(!rt)switch(o.tailMode){case"hidden":u=o.tail;for(var m=null;u!==null;)u.alternate!==null&&(m=u),u=u.sibling;m===null?o.tail=null:m.sibling=null;break;case"collapsed":m=o.tail;for(var v=null;m!==null;)m.alternate!==null&&(v=m),m=m.sibling;v===null?u||o.tail===null?o.tail=null:o.tail.sibling=null:v.sibling=null}}function Mt(o){var u=o.alternate!==null&&o.alternate.child===o.child,m=0,v=0;if(u)for(var E=o.child;E!==null;)m|=E.lanes|E.childLanes,v|=E.subtreeFlags&65011712,v|=E.flags&65011712,E.return=o,E=E.sibling;else for(E=o.child;E!==null;)m|=E.lanes|E.childLanes,v|=E.subtreeFlags,v|=E.flags,E.return=o,E=E.sibling;return o.subtreeFlags|=v,o.childLanes=m,u}function QG(o,u,m){var v=u.pendingProps;switch(sx(u),u.tag){case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return Mt(u),null;case 1:return Mt(u),null;case 3:return m=u.stateNode,v=null,o!==null&&(v=o.memoizedState.cache),u.memoizedState.cache!==v&&(u.flags|=2048),ts(tn),Q(),m.pendingContext&&(m.context=m.pendingContext,m.pendingContext=null),(o===null||o.child===null)&&(Wl(u)?ss(u):o===null||o.memoizedState.isDehydrated&&(u.flags&256)===0||(u.flags|=1024,ix())),Mt(u),null;case 26:var E=u.type,R=u.memoizedState;return o===null?(ss(u),R!==null?(Mt(u),QR(u,R)):(Mt(u),Zx(u,E,null,v,m))):R?R!==o.memoizedState?(ss(u),Mt(u),QR(u,R)):(Mt(u),u.flags&=-16777217):(o=o.memoizedProps,o!==v&&ss(u),Mt(u),Zx(u,E,o,v,m)),null;case 27:if(Y(u),m=ee.current,E=u.type,o!==null&&u.stateNode!=null)o.memoizedProps!==v&&ss(u);else{if(!v){if(u.stateNode===null)throw Error(r(166));return Mt(u),null}o=$.current,Wl(u)?kA(u):(o=sO(E,v,m),u.stateNode=o,ss(u))}return Mt(u),null;case 5:if(Y(u),E=u.type,o!==null&&u.stateNode!=null)o.memoizedProps!==v&&ss(u);else{if(!v){if(u.stateNode===null)throw Error(r(166));return Mt(u),null}if(R=$.current,Wl(u))kA(u);else{var I=Hp(ee.current);switch(R){case 1:R=I.createElementNS("http://www.w3.org/2000/svg",E);break;case 2:R=I.createElementNS("http://www.w3.org/1998/Math/MathML",E);break;default:switch(E){case"svg":R=I.createElementNS("http://www.w3.org/2000/svg",E);break;case"math":R=I.createElementNS("http://www.w3.org/1998/Math/MathML",E);break;case"script":R=I.createElement("div"),R.innerHTML="<script><\/script>",R=R.removeChild(R.firstChild);break;case"select":R=typeof v.is=="string"?I.createElement("select",{is:v.is}):I.createElement("select"),v.multiple?R.multiple=!0:v.size&&(R.size=v.size);break;default:R=typeof v.is=="string"?I.createElement(E,{is:v.is}):I.createElement(E)}}R[un]=u,R[kn]=v;e:for(I=u.child;I!==null;){if(I.tag===5||I.tag===6)R.appendChild(I.stateNode);else if(I.tag!==4&&I.tag!==27&&I.child!==null){I.child.return=I,I=I.child;continue}if(I===u)break e;for(;I.sibling===null;){if(I.return===null||I.return===u)break e;I=I.return}I.sibling.return=I.return,I=I.sibling}u.stateNode=R;e:switch(Cn(R,E,v),E){case"button":case"input":case"select":case"textarea":v=!!v.autoFocus;break e;case"img":v=!0;break e;default:v=!1}v&&ss(u)}}return Mt(u),Zx(u,u.type,o===null?null:o.memoizedProps,u.pendingProps,m),null;case 6:if(o&&u.stateNode!=null)o.memoizedProps!==v&&ss(u);else{if(typeof v!="string"&&u.stateNode===null)throw Error(r(166));if(o=ee.current,Wl(u)){if(o=u.stateNode,m=u.memoizedProps,v=null,E=_n,E!==null)switch(E.tag){case 27:case 5:v=E.memoizedProps}o[un]=u,o=!!(o.nodeValue===m||v!==null&&v.suppressHydrationWarning===!0||Kk(o.nodeValue,m)),o||Qs(u,!0)}else o=Hp(o).createTextNode(v),o[un]=u,u.stateNode=o}return Mt(u),null;case 31:if(m=u.memoizedState,o===null||o.memoizedState!==null){if(v=Wl(u),m!==null){if(o===null){if(!v)throw Error(r(318));if(o=u.memoizedState,o=o!==null?o.dehydrated:null,!o)throw Error(r(557));o[un]=u}else mi(),(u.flags&128)===0&&(u.memoizedState=null),u.flags|=4;Mt(u),o=!1}else m=ix(),o!==null&&o.memoizedState!==null&&(o.memoizedState.hydrationErrors=m),o=!0;if(!o)return u.flags&256?(ir(u),u):(ir(u),null);if((u.flags&128)!==0)throw Error(r(558))}return Mt(u),null;case 13:if(v=u.memoizedState,o===null||o.memoizedState!==null&&o.memoizedState.dehydrated!==null){if(E=Wl(u),v!==null&&v.dehydrated!==null){if(o===null){if(!E)throw Error(r(318));if(E=u.memoizedState,E=E!==null?E.dehydrated:null,!E)throw Error(r(317));E[un]=u}else mi(),(u.flags&128)===0&&(u.memoizedState=null),u.flags|=4;Mt(u),E=!1}else E=ix(),o!==null&&o.memoizedState!==null&&(o.memoizedState.hydrationErrors=E),E=!0;if(!E)return u.flags&256?(ir(u),u):(ir(u),null)}return ir(u),(u.flags&128)!==0?(u.lanes=m,u):(m=v!==null,o=o!==null&&o.memoizedState!==null,m&&(v=u.child,E=null,v.alternate!==null&&v.alternate.memoizedState!==null&&v.alternate.memoizedState.cachePool!==null&&(E=v.alternate.memoizedState.cachePool.pool),R=null,v.memoizedState!==null&&v.memoizedState.cachePool!==null&&(R=v.memoizedState.cachePool.pool),R!==E&&(v.flags|=2048)),m!==o&&m&&(u.child.flags|=8192),Tp(u,u.updateQueue),Mt(u),null);case 4:return Q(),o===null&&xb(u.stateNode.containerInfo),Mt(u),null;case 10:return ts(u.type),Mt(u),null;case 19:if(W(Zt),v=u.memoizedState,v===null)return Mt(u),null;if(E=(u.flags&128)!==0,R=v.rendering,R===null)if(E)ad(v,!1);else{if(Gt!==0||o!==null&&(o.flags&128)!==0)for(o=u.child;o!==null;){if(R=mp(o),R!==null){for(u.flags|=128,ad(v,!1),o=R.updateQueue,u.updateQueue=o,Tp(u,o),u.subtreeFlags=0,o=m,m=u.child;m!==null;)CA(m,o),m=m.sibling;return B(Zt,Zt.current&1|2),rt&&Ja(u,v.treeForkCount),u.child}o=o.sibling}v.tail!==null&&Je()>Mp&&(u.flags|=128,E=!0,ad(v,!1),u.lanes=4194304)}else{if(!E)if(o=mp(R),o!==null){if(u.flags|=128,E=!0,o=o.updateQueue,u.updateQueue=o,Tp(u,o),ad(v,!0),v.tail===null&&v.tailMode==="hidden"&&!R.alternate&&!rt)return Mt(u),null}else 2*Je()-v.renderingStartTime>Mp&&m!==536870912&&(u.flags|=128,E=!0,ad(v,!1),u.lanes=4194304);v.isBackwards?(R.sibling=u.child,u.child=R):(o=v.last,o!==null?o.sibling=R:u.child=R,v.last=R)}return v.tail!==null?(o=v.tail,v.rendering=o,v.tail=o.sibling,v.renderingStartTime=Je(),o.sibling=null,m=Zt.current,B(Zt,E?m&1|2:m&1),rt&&Ja(u,v.treeForkCount),o):(Mt(u),null);case 22:case 23:return ir(u),bx(),v=u.memoizedState!==null,o!==null?o.memoizedState!==null!==v&&(u.flags|=8192):v&&(u.flags|=8192),v?(m&536870912)!==0&&(u.flags&128)===0&&(Mt(u),u.subtreeFlags&6&&(u.flags|=8192)):Mt(u),m=u.updateQueue,m!==null&&Tp(u,m.retryQueue),m=null,o!==null&&o.memoizedState!==null&&o.memoizedState.cachePool!==null&&(m=o.memoizedState.cachePool.pool),v=null,u.memoizedState!==null&&u.memoizedState.cachePool!==null&&(v=u.memoizedState.cachePool.pool),v!==m&&(u.flags|=2048),o!==null&&W(vi),null;case 24:return m=null,o!==null&&(m=o.memoizedState.cache),u.memoizedState.cache!==m&&(u.flags|=2048),ts(tn),Mt(u),null;case 25:return null;case 30:return null}throw Error(r(156,u.tag))}function JG(o,u){switch(sx(u),u.tag){case 1:return o=u.flags,o&65536?(u.flags=o&-65537|128,u):null;case 3:return ts(tn),Q(),o=u.flags,(o&65536)!==0&&(o&128)===0?(u.flags=o&-65537|128,u):null;case 26:case 27:case 5:return Y(u),null;case 31:if(u.memoizedState!==null){if(ir(u),u.alternate===null)throw Error(r(340));mi()}return o=u.flags,o&65536?(u.flags=o&-65537|128,u):null;case 13:if(ir(u),o=u.memoizedState,o!==null&&o.dehydrated!==null){if(u.alternate===null)throw Error(r(340));mi()}return o=u.flags,o&65536?(u.flags=o&-65537|128,u):null;case 19:return W(Zt),null;case 4:return Q(),null;case 10:return ts(u.type),null;case 22:case 23:return ir(u),bx(),o!==null&&W(vi),o=u.flags,o&65536?(u.flags=o&-65537|128,u):null;case 24:return ts(tn),null;case 25:return null;default:return null}}function JR(o,u){switch(sx(u),u.tag){case 3:ts(tn),Q();break;case 26:case 27:case 5:Y(u);break;case 4:Q();break;case 31:u.memoizedState!==null&&ir(u);break;case 13:ir(u);break;case 19:W(Zt);break;case 10:ts(u.type);break;case 22:case 23:ir(u),bx(),o!==null&&W(vi);break;case 24:ts(tn)}}function sd(o,u){try{var m=u.updateQueue,v=m!==null?m.lastEffect:null;if(v!==null){var E=v.next;m=E;do{if((m.tag&o)===o){v=void 0;var R=m.create,I=m.inst;v=R(),I.destroy=v}m=m.next}while(m!==E)}}catch(X){gt(u,u.return,X)}}function so(o,u,m){try{var v=u.updateQueue,E=v!==null?v.lastEffect:null;if(E!==null){var R=E.next;v=R;do{if((v.tag&o)===o){var I=v.inst,X=I.destroy;if(X!==void 0){I.destroy=void 0,E=u;var oe=m,de=X;try{de()}catch(ge){gt(E,oe,ge)}}}v=v.next}while(v!==R)}}catch(ge){gt(u,u.return,ge)}}function ek(o){var u=o.updateQueue;if(u!==null){var m=o.stateNode;try{BA(u,m)}catch(v){gt(o,o.return,v)}}}function tk(o,u,m){m.props=_i(o.type,o.memoizedProps),m.state=o.memoizedState;try{m.componentWillUnmount()}catch(v){gt(o,u,v)}}function od(o,u){try{var m=o.ref;if(m!==null){switch(o.tag){case 26:case 27:case 5:var v=o.stateNode;break;case 30:v=o.stateNode;break;default:v=o.stateNode}typeof m=="function"?o.refCleanup=m(v):m.current=v}}catch(E){gt(o,u,E)}}function xa(o,u){var m=o.ref,v=o.refCleanup;if(m!==null)if(typeof v=="function")try{v()}catch(E){gt(o,u,E)}finally{o.refCleanup=null,o=o.alternate,o!=null&&(o.refCleanup=null)}else if(typeof m=="function")try{m(null)}catch(E){gt(o,u,E)}else m.current=null}function nk(o){var u=o.type,m=o.memoizedProps,v=o.stateNode;try{e:switch(u){case"button":case"input":case"select":case"textarea":m.autoFocus&&v.focus();break e;case"img":m.src?v.src=m.src:m.srcSet&&(v.srcset=m.srcSet)}}catch(E){gt(o,o.return,E)}}function Qx(o,u,m){try{var v=o.stateNode;wK(v,o.type,m,u),v[kn]=u}catch(E){gt(o,o.return,E)}}function rk(o){return o.tag===5||o.tag===3||o.tag===26||o.tag===27&&ho(o.type)||o.tag===4}function Jx(o){e:for(;;){for(;o.sibling===null;){if(o.return===null||rk(o.return))return null;o=o.return}for(o.sibling.return=o.return,o=o.sibling;o.tag!==5&&o.tag!==6&&o.tag!==18;){if(o.tag===27&&ho(o.type)||o.flags&2||o.child===null||o.tag===4)continue e;o.child.return=o,o=o.child}if(!(o.flags&2))return o.stateNode}}function eb(o,u,m){var v=o.tag;if(v===5||v===6)o=o.stateNode,u?(m.nodeType===9?m.body:m.nodeName==="HTML"?m.ownerDocument.body:m).insertBefore(o,u):(u=m.nodeType===9?m.body:m.nodeName==="HTML"?m.ownerDocument.body:m,u.appendChild(o),m=m._reactRootContainer,m!=null||u.onclick!==null||(u.onclick=Xa));else if(v!==4&&(v===27&&ho(o.type)&&(m=o.stateNode,u=null),o=o.child,o!==null))for(eb(o,u,m),o=o.sibling;o!==null;)eb(o,u,m),o=o.sibling}function Ap(o,u,m){var v=o.tag;if(v===5||v===6)o=o.stateNode,u?m.insertBefore(o,u):m.appendChild(o);else if(v!==4&&(v===27&&ho(o.type)&&(m=o.stateNode),o=o.child,o!==null))for(Ap(o,u,m),o=o.sibling;o!==null;)Ap(o,u,m),o=o.sibling}function ak(o){var u=o.stateNode,m=o.memoizedProps;try{for(var v=o.type,E=u.attributes;E.length;)u.removeAttributeNode(E[0]);Cn(u,v,m),u[un]=o,u[kn]=m}catch(R){gt(o,o.return,R)}}var os=!1,an=!1,tb=!1,sk=typeof WeakSet=="function"?WeakSet:Set,vn=null;function eK(o,u){if(o=o.containerInfo,Sb=Xp,o=yA(o),K0(o)){if("selectionStart"in o)var m={start:o.selectionStart,end:o.selectionEnd};else e:{m=(m=o.ownerDocument)&&m.defaultView||window;var v=m.getSelection&&m.getSelection();if(v&&v.rangeCount!==0){m=v.anchorNode;var E=v.anchorOffset,R=v.focusNode;v=v.focusOffset;try{m.nodeType,R.nodeType}catch{m=null;break e}var I=0,X=-1,oe=-1,de=0,ge=0,be=o,he=null;t:for(;;){for(var pe;be!==m||E!==0&&be.nodeType!==3||(X=I+E),be!==R||v!==0&&be.nodeType!==3||(oe=I+v),be.nodeType===3&&(I+=be.nodeValue.length),(pe=be.firstChild)!==null;)he=be,be=pe;for(;;){if(be===o)break t;if(he===m&&++de===E&&(X=I),he===R&&++ge===v&&(oe=I),(pe=be.nextSibling)!==null)break;be=he,he=be.parentNode}be=pe}m=X===-1||oe===-1?null:{start:X,end:oe}}else m=null}m=m||{start:0,end:0}}else m=null;for(_b={focusedElem:o,selectionRange:m},Xp=!1,vn=u;vn!==null;)if(u=vn,o=u.child,(u.subtreeFlags&1028)!==0&&o!==null)o.return=u,vn=o;else for(;vn!==null;){switch(u=vn,R=u.alternate,o=u.flags,u.tag){case 0:if((o&4)!==0&&(o=u.updateQueue,o=o!==null?o.events:null,o!==null))for(m=0;m<o.length;m++)E=o[m],E.ref.impl=E.nextImpl;break;case 11:case 15:break;case 1:if((o&1024)!==0&&R!==null){o=void 0,m=u,E=R.memoizedProps,R=R.memoizedState,v=m.stateNode;try{var je=_i(m.type,E);o=v.getSnapshotBeforeUpdate(je,R),v.__reactInternalSnapshotBeforeUpdate=o}catch(Ie){gt(m,m.return,Ie)}}break;case 3:if((o&1024)!==0){if(o=u.stateNode.containerInfo,m=o.nodeType,m===9)Cb(o);else if(m===1)switch(o.nodeName){case"HEAD":case"HTML":case"BODY":Cb(o);break;default:o.textContent=""}}break;case 5:case 26:case 27:case 6:case 4:case 17:break;default:if((o&1024)!==0)throw Error(r(163))}if(o=u.sibling,o!==null){o.return=u.return,vn=o;break}vn=u.return}}function ok(o,u,m){var v=m.flags;switch(m.tag){case 0:case 11:case 15:ls(o,m),v&4&&sd(5,m);break;case 1:if(ls(o,m),v&4)if(o=m.stateNode,u===null)try{o.componentDidMount()}catch(I){gt(m,m.return,I)}else{var E=_i(m.type,u.memoizedProps);u=u.memoizedState;try{o.componentDidUpdate(E,u,o.__reactInternalSnapshotBeforeUpdate)}catch(I){gt(m,m.return,I)}}v&64&&ek(m),v&512&&od(m,m.return);break;case 3:if(ls(o,m),v&64&&(o=m.updateQueue,o!==null)){if(u=null,m.child!==null)switch(m.child.tag){case 27:case 5:u=m.child.stateNode;break;case 1:u=m.child.stateNode}try{BA(o,u)}catch(I){gt(m,m.return,I)}}break;case 27:u===null&&v&4&&ak(m);case 26:case 5:ls(o,m),u===null&&v&4&&nk(m),v&512&&od(m,m.return);break;case 12:ls(o,m);break;case 31:ls(o,m),v&4&&ck(o,m);break;case 13:ls(o,m),v&4&&uk(o,m),v&64&&(o=m.memoizedState,o!==null&&(o=o.dehydrated,o!==null&&(m=cK.bind(null,m),AK(o,m))));break;case 22:if(v=m.memoizedState!==null||os,!v){u=u!==null&&u.memoizedState!==null||an,E=os;var R=an;os=v,(an=u)&&!R?cs(o,m,(m.subtreeFlags&8772)!==0):ls(o,m),os=E,an=R}break;case 30:break;default:ls(o,m)}}function ik(o){var u=o.alternate;u!==null&&(o.alternate=null,ik(u)),o.child=null,o.deletions=null,o.sibling=null,o.tag===5&&(u=o.stateNode,u!==null&&Ou(u)),o.stateNode=null,o.return=null,o.dependencies=null,o.memoizedProps=null,o.memoizedState=null,o.pendingProps=null,o.stateNode=null,o.updateQueue=null}var It=null,Xn=!1;function is(o,u,m){for(m=m.child;m!==null;)lk(o,u,m),m=m.sibling}function lk(o,u,m){if(Ft&&typeof Ft.onCommitFiberUnmount=="function")try{Ft.onCommitFiberUnmount(Rn,m)}catch{}switch(m.tag){case 26:an||xa(m,u),is(o,u,m),m.memoizedState?m.memoizedState.count--:m.stateNode&&(m=m.stateNode,m.parentNode.removeChild(m));break;case 27:an||xa(m,u);var v=It,E=Xn;ho(m.type)&&(It=m.stateNode,Xn=!1),is(o,u,m),md(m.stateNode),It=v,Xn=E;break;case 5:an||xa(m,u);case 6:if(v=It,E=Xn,It=null,is(o,u,m),It=v,Xn=E,It!==null)if(Xn)try{(It.nodeType===9?It.body:It.nodeName==="HTML"?It.ownerDocument.body:It).removeChild(m.stateNode)}catch(R){gt(m,u,R)}else try{It.removeChild(m.stateNode)}catch(R){gt(m,u,R)}break;case 18:It!==null&&(Xn?(o=It,eO(o.nodeType===9?o.body:o.nodeName==="HTML"?o.ownerDocument.body:o,m.stateNode),hc(o)):eO(It,m.stateNode));break;case 4:v=It,E=Xn,It=m.stateNode.containerInfo,Xn=!0,is(o,u,m),It=v,Xn=E;break;case 0:case 11:case 14:case 15:so(2,m,u),an||so(4,m,u),is(o,u,m);break;case 1:an||(xa(m,u),v=m.stateNode,typeof v.componentWillUnmount=="function"&&tk(m,u,v)),is(o,u,m);break;case 21:is(o,u,m);break;case 22:an=(v=an)||m.memoizedState!==null,is(o,u,m),an=v;break;default:is(o,u,m)}}function ck(o,u){if(u.memoizedState===null&&(o=u.alternate,o!==null&&(o=o.memoizedState,o!==null))){o=o.dehydrated;try{hc(o)}catch(m){gt(u,u.return,m)}}}function uk(o,u){if(u.memoizedState===null&&(o=u.alternate,o!==null&&(o=o.memoizedState,o!==null&&(o=o.dehydrated,o!==null))))try{hc(o)}catch(m){gt(u,u.return,m)}}function tK(o){switch(o.tag){case 31:case 13:case 19:var u=o.stateNode;return u===null&&(u=o.stateNode=new sk),u;case 22:return o=o.stateNode,u=o._retryCache,u===null&&(u=o._retryCache=new sk),u;default:throw Error(r(435,o.tag))}}function Rp(o,u){var m=tK(o);u.forEach(function(v){if(!m.has(v)){m.add(v);var E=uK.bind(null,o,v);v.then(E,E)}})}function Zn(o,u){var m=u.deletions;if(m!==null)for(var v=0;v<m.length;v++){var E=m[v],R=o,I=u,X=I;e:for(;X!==null;){switch(X.tag){case 27:if(ho(X.type)){It=X.stateNode,Xn=!1;break e}break;case 5:It=X.stateNode,Xn=!1;break e;case 3:case 4:It=X.stateNode.containerInfo,Xn=!0;break e}X=X.return}if(It===null)throw Error(r(160));lk(R,I,E),It=null,Xn=!1,R=E.alternate,R!==null&&(R.return=null),E.return=null}if(u.subtreeFlags&13886)for(u=u.child;u!==null;)dk(u,o),u=u.sibling}var Br=null;function dk(o,u){var m=o.alternate,v=o.flags;switch(o.tag){case 0:case 11:case 14:case 15:Zn(u,o),Qn(o),v&4&&(so(3,o,o.return),sd(3,o),so(5,o,o.return));break;case 1:Zn(u,o),Qn(o),v&512&&(an||m===null||xa(m,m.return)),v&64&&os&&(o=o.updateQueue,o!==null&&(v=o.callbacks,v!==null&&(m=o.shared.hiddenCallbacks,o.shared.hiddenCallbacks=m===null?v:m.concat(v))));break;case 26:var E=Br;if(Zn(u,o),Qn(o),v&512&&(an||m===null||xa(m,m.return)),v&4){var R=m!==null?m.memoizedState:null;if(v=o.memoizedState,m===null)if(v===null)if(o.stateNode===null){e:{v=o.type,m=o.memoizedProps,E=E.ownerDocument||E;t:switch(v){case"title":R=E.getElementsByTagName("title")[0],(!R||R[ci]||R[un]||R.namespaceURI==="http://www.w3.org/2000/svg"||R.hasAttribute("itemprop"))&&(R=E.createElement(v),E.head.insertBefore(R,E.querySelector("head > title"))),Cn(R,v,m),R[un]=o,en(R),v=R;break e;case"link":var I=dO("link","href",E).get(v+(m.href||""));if(I){for(var X=0;X<I.length;X++)if(R=I[X],R.getAttribute("href")===(m.href==null||m.href===""?null:m.href)&&R.getAttribute("rel")===(m.rel==null?null:m.rel)&&R.getAttribute("title")===(m.title==null?null:m.title)&&R.getAttribute("crossorigin")===(m.crossOrigin==null?null:m.crossOrigin)){I.splice(X,1);break t}}R=E.createElement(v),Cn(R,v,m),E.head.appendChild(R);break;case"meta":if(I=dO("meta","content",E).get(v+(m.content||""))){for(X=0;X<I.length;X++)if(R=I[X],R.getAttribute("content")===(m.content==null?null:""+m.content)&&R.getAttribute("name")===(m.name==null?null:m.name)&&R.getAttribute("property")===(m.property==null?null:m.property)&&R.getAttribute("http-equiv")===(m.httpEquiv==null?null:m.httpEquiv)&&R.getAttribute("charset")===(m.charSet==null?null:m.charSet)){I.splice(X,1);break t}}R=E.createElement(v),Cn(R,v,m),E.head.appendChild(R);break;default:throw Error(r(468,v))}R[un]=o,en(R),v=R}o.stateNode=v}else fO(E,o.type,o.stateNode);else o.stateNode=uO(E,v,o.memoizedProps);else R!==v?(R===null?m.stateNode!==null&&(m=m.stateNode,m.parentNode.removeChild(m)):R.count--,v===null?fO(E,o.type,o.stateNode):uO(E,v,o.memoizedProps)):v===null&&o.stateNode!==null&&Qx(o,o.memoizedProps,m.memoizedProps)}break;case 27:Zn(u,o),Qn(o),v&512&&(an||m===null||xa(m,m.return)),m!==null&&v&4&&Qx(o,o.memoizedProps,m.memoizedProps);break;case 5:if(Zn(u,o),Qn(o),v&512&&(an||m===null||xa(m,m.return)),o.flags&32){E=o.stateNode;try{$l(E,"")}catch(je){gt(o,o.return,je)}}v&4&&o.stateNode!=null&&(E=o.memoizedProps,Qx(o,E,m!==null?m.memoizedProps:E)),v&1024&&(tb=!0);break;case 6:if(Zn(u,o),Qn(o),v&4){if(o.stateNode===null)throw Error(r(162));v=o.memoizedProps,m=o.stateNode;try{m.nodeValue=v}catch(je){gt(o,o.return,je)}}break;case 3:if(Wp=null,E=Br,Br=Bp(u.containerInfo),Zn(u,o),Br=E,Qn(o),v&4&&m!==null&&m.memoizedState.isDehydrated)try{hc(u.containerInfo)}catch(je){gt(o,o.return,je)}tb&&(tb=!1,fk(o));break;case 4:v=Br,Br=Bp(o.stateNode.containerInfo),Zn(u,o),Qn(o),Br=v;break;case 12:Zn(u,o),Qn(o);break;case 31:Zn(u,o),Qn(o),v&4&&(v=o.updateQueue,v!==null&&(o.updateQueue=null,Rp(o,v)));break;case 13:Zn(u,o),Qn(o),o.child.flags&8192&&o.memoizedState!==null!=(m!==null&&m.memoizedState!==null)&&(Op=Je()),v&4&&(v=o.updateQueue,v!==null&&(o.updateQueue=null,Rp(o,v)));break;case 22:E=o.memoizedState!==null;var oe=m!==null&&m.memoizedState!==null,de=os,ge=an;if(os=de||E,an=ge||oe,Zn(u,o),an=ge,os=de,Qn(o),v&8192)e:for(u=o.stateNode,u._visibility=E?u._visibility&-2:u._visibility|1,E&&(m===null||oe||os||an||Ni(o)),m=null,u=o;;){if(u.tag===5||u.tag===26){if(m===null){oe=m=u;try{if(R=oe.stateNode,E)I=R.style,typeof I.setProperty=="function"?I.setProperty("display","none","important"):I.display="none";else{X=oe.stateNode;var be=oe.memoizedProps.style,he=be!=null&&be.hasOwnProperty("display")?be.display:null;X.style.display=he==null||typeof he=="boolean"?"":(""+he).trim()}}catch(je){gt(oe,oe.return,je)}}}else if(u.tag===6){if(m===null){oe=u;try{oe.stateNode.nodeValue=E?"":oe.memoizedProps}catch(je){gt(oe,oe.return,je)}}}else if(u.tag===18){if(m===null){oe=u;try{var pe=oe.stateNode;E?tO(pe,!0):tO(oe.stateNode,!1)}catch(je){gt(oe,oe.return,je)}}}else if((u.tag!==22&&u.tag!==23||u.memoizedState===null||u===o)&&u.child!==null){u.child.return=u,u=u.child;continue}if(u===o)break e;for(;u.sibling===null;){if(u.return===null||u.return===o)break e;m===u&&(m=null),u=u.return}m===u&&(m=null),u.sibling.return=u.return,u=u.sibling}v&4&&(v=o.updateQueue,v!==null&&(m=v.retryQueue,m!==null&&(v.retryQueue=null,Rp(o,m))));break;case 19:Zn(u,o),Qn(o),v&4&&(v=o.updateQueue,v!==null&&(o.updateQueue=null,Rp(o,v)));break;case 30:break;case 21:break;default:Zn(u,o),Qn(o)}}function Qn(o){var u=o.flags;if(u&2){try{for(var m,v=o.return;v!==null;){if(rk(v)){m=v;break}v=v.return}if(m==null)throw Error(r(160));switch(m.tag){case 27:var E=m.stateNode,R=Jx(o);Ap(o,R,E);break;case 5:var I=m.stateNode;m.flags&32&&($l(I,""),m.flags&=-33);var X=Jx(o);Ap(o,X,I);break;case 3:case 4:var oe=m.stateNode.containerInfo,de=Jx(o);eb(o,de,oe);break;default:throw Error(r(161))}}catch(ge){gt(o,o.return,ge)}o.flags&=-3}u&4096&&(o.flags&=-4097)}function fk(o){if(o.subtreeFlags&1024)for(o=o.child;o!==null;){var u=o;fk(u),u.tag===5&&u.flags&1024&&u.stateNode.reset(),o=o.sibling}}function ls(o,u){if(u.subtreeFlags&8772)for(u=u.child;u!==null;)ok(o,u.alternate,u),u=u.sibling}function Ni(o){for(o=o.child;o!==null;){var u=o;switch(u.tag){case 0:case 11:case 14:case 15:so(4,u,u.return),Ni(u);break;case 1:xa(u,u.return);var m=u.stateNode;typeof m.componentWillUnmount=="function"&&tk(u,u.return,m),Ni(u);break;case 27:md(u.stateNode);case 26:case 5:xa(u,u.return),Ni(u);break;case 22:u.memoizedState===null&&Ni(u);break;case 30:Ni(u);break;default:Ni(u)}o=o.sibling}}function cs(o,u,m){for(m=m&&(u.subtreeFlags&8772)!==0,u=u.child;u!==null;){var v=u.alternate,E=o,R=u,I=R.flags;switch(R.tag){case 0:case 11:case 15:cs(E,R,m),sd(4,R);break;case 1:if(cs(E,R,m),v=R,E=v.stateNode,typeof E.componentDidMount=="function")try{E.componentDidMount()}catch(de){gt(v,v.return,de)}if(v=R,E=v.updateQueue,E!==null){var X=v.stateNode;try{var oe=E.shared.hiddenCallbacks;if(oe!==null)for(E.shared.hiddenCallbacks=null,E=0;E<oe.length;E++)HA(oe[E],X)}catch(de){gt(v,v.return,de)}}m&&I&64&&ek(R),od(R,R.return);break;case 27:ak(R);case 26:case 5:cs(E,R,m),m&&v===null&&I&4&&nk(R),od(R,R.return);break;case 12:cs(E,R,m);break;case 31:cs(E,R,m),m&&I&4&&ck(E,R);break;case 13:cs(E,R,m),m&&I&4&&uk(E,R);break;case 22:R.memoizedState===null&&cs(E,R,m),od(R,R.return);break;case 30:break;default:cs(E,R,m)}u=u.sibling}}function nb(o,u){var m=null;o!==null&&o.memoizedState!==null&&o.memoizedState.cachePool!==null&&(m=o.memoizedState.cachePool.pool),o=null,u.memoizedState!==null&&u.memoizedState.cachePool!==null&&(o=u.memoizedState.cachePool.pool),o!==m&&(o!=null&&o.refCount++,m!=null&&Wu(m))}function rb(o,u){o=null,u.alternate!==null&&(o=u.alternate.memoizedState.cache),u=u.memoizedState.cache,u!==o&&(u.refCount++,o!=null&&Wu(o))}function Vr(o,u,m,v){if(u.subtreeFlags&10256)for(u=u.child;u!==null;)hk(o,u,m,v),u=u.sibling}function hk(o,u,m,v){var E=u.flags;switch(u.tag){case 0:case 11:case 15:Vr(o,u,m,v),E&2048&&sd(9,u);break;case 1:Vr(o,u,m,v);break;case 3:Vr(o,u,m,v),E&2048&&(o=null,u.alternate!==null&&(o=u.alternate.memoizedState.cache),u=u.memoizedState.cache,u!==o&&(u.refCount++,o!=null&&Wu(o)));break;case 12:if(E&2048){Vr(o,u,m,v),o=u.stateNode;try{var R=u.memoizedProps,I=R.id,X=R.onPostCommit;typeof X=="function"&&X(I,u.alternate===null?"mount":"update",o.passiveEffectDuration,-0)}catch(oe){gt(u,u.return,oe)}}else Vr(o,u,m,v);break;case 31:Vr(o,u,m,v);break;case 13:Vr(o,u,m,v);break;case 23:break;case 22:R=u.stateNode,I=u.alternate,u.memoizedState!==null?R._visibility&2?Vr(o,u,m,v):id(o,u):R._visibility&2?Vr(o,u,m,v):(R._visibility|=2,nc(o,u,m,v,(u.subtreeFlags&10256)!==0||!1)),E&2048&&nb(I,u);break;case 24:Vr(o,u,m,v),E&2048&&rb(u.alternate,u);break;default:Vr(o,u,m,v)}}function nc(o,u,m,v,E){for(E=E&&((u.subtreeFlags&10256)!==0||!1),u=u.child;u!==null;){var R=o,I=u,X=m,oe=v,de=I.flags;switch(I.tag){case 0:case 11:case 15:nc(R,I,X,oe,E),sd(8,I);break;case 23:break;case 22:var ge=I.stateNode;I.memoizedState!==null?ge._visibility&2?nc(R,I,X,oe,E):id(R,I):(ge._visibility|=2,nc(R,I,X,oe,E)),E&&de&2048&&nb(I.alternate,I);break;case 24:nc(R,I,X,oe,E),E&&de&2048&&rb(I.alternate,I);break;default:nc(R,I,X,oe,E)}u=u.sibling}}function id(o,u){if(u.subtreeFlags&10256)for(u=u.child;u!==null;){var m=o,v=u,E=v.flags;switch(v.tag){case 22:id(m,v),E&2048&&nb(v.alternate,v);break;case 24:id(m,v),E&2048&&rb(v.alternate,v);break;default:id(m,v)}u=u.sibling}}var ld=8192;function rc(o,u,m){if(o.subtreeFlags&ld)for(o=o.child;o!==null;)pk(o,u,m),o=o.sibling}function pk(o,u,m){switch(o.tag){case 26:rc(o,u,m),o.flags&ld&&o.memoizedState!==null&&FK(m,Br,o.memoizedState,o.memoizedProps);break;case 5:rc(o,u,m);break;case 3:case 4:var v=Br;Br=Bp(o.stateNode.containerInfo),rc(o,u,m),Br=v;break;case 22:o.memoizedState===null&&(v=o.alternate,v!==null&&v.memoizedState!==null?(v=ld,ld=16777216,rc(o,u,m),ld=v):rc(o,u,m));break;default:rc(o,u,m)}}function mk(o){var u=o.alternate;if(u!==null&&(o=u.child,o!==null)){u.child=null;do u=o.sibling,o.sibling=null,o=u;while(o!==null)}}function cd(o){var u=o.deletions;if((o.flags&16)!==0){if(u!==null)for(var m=0;m<u.length;m++){var v=u[m];vn=v,yk(v,o)}mk(o)}if(o.subtreeFlags&10256)for(o=o.child;o!==null;)gk(o),o=o.sibling}function gk(o){switch(o.tag){case 0:case 11:case 15:cd(o),o.flags&2048&&so(9,o,o.return);break;case 3:cd(o);break;case 12:cd(o);break;case 22:var u=o.stateNode;o.memoizedState!==null&&u._visibility&2&&(o.return===null||o.return.tag!==13)?(u._visibility&=-3,kp(o)):cd(o);break;default:cd(o)}}function kp(o){var u=o.deletions;if((o.flags&16)!==0){if(u!==null)for(var m=0;m<u.length;m++){var v=u[m];vn=v,yk(v,o)}mk(o)}for(o=o.child;o!==null;){switch(u=o,u.tag){case 0:case 11:case 15:so(8,u,u.return),kp(u);break;case 22:m=u.stateNode,m._visibility&2&&(m._visibility&=-3,kp(u));break;default:kp(u)}o=o.sibling}}function yk(o,u){for(;vn!==null;){var m=vn;switch(m.tag){case 0:case 11:case 15:so(8,m,u);break;case 23:case 22:if(m.memoizedState!==null&&m.memoizedState.cachePool!==null){var v=m.memoizedState.cachePool.pool;v!=null&&v.refCount++}break;case 24:Wu(m.memoizedState.cache)}if(v=m.child,v!==null)v.return=m,vn=v;else e:for(m=o;vn!==null;){v=vn;var E=v.sibling,R=v.return;if(ik(v),v===m){vn=null;break e}if(E!==null){E.return=R,vn=E;break e}vn=R}}}var nK={getCacheForType:function(o){var u=Nn(tn),m=u.data.get(o);return m===void 0&&(m=o(),u.data.set(o,m)),m},cacheSignal:function(){return Nn(tn).controller.signal}},rK=typeof WeakMap=="function"?WeakMap:Map,ut=0,_t=null,Xe=null,et=0,mt=0,lr=null,oo=!1,ac=!1,ab=!1,us=0,Gt=0,io=0,ji=0,sb=0,cr=0,sc=0,ud=null,Jn=null,ob=!1,Op=0,vk=0,Mp=1/0,Dp=null,lo=null,dn=0,co=null,oc=null,ds=0,ib=0,lb=null,xk=null,dd=0,cb=null;function ur(){return(ut&2)!==0&&et!==0?et&-et:P.T!==null?mb():Lh()}function bk(){if(cr===0)if((et&536870912)===0||rt){var o=El;El<<=1,(El&3932160)===0&&(El=262144),cr=o}else cr=536870912;return o=or.current,o!==null&&(o.flags|=32),cr}function er(o,u,m){(o===_t&&(mt===2||mt===9)||o.cancelPendingCommit!==null)&&(ic(o,0),uo(o,et,cr,!1)),li(o,m),((ut&2)===0||o!==_t)&&(o===_t&&((ut&2)===0&&(ji|=m),Gt===4&&uo(o,et,cr,!1)),ba(o))}function wk(o,u,m){if((ut&6)!==0)throw Error(r(327));var v=!m&&(u&127)===0&&(u&o.expiredLanes)===0||ii(o,u),E=v?oK(o,u):db(o,u,!0),R=v;do{if(E===0){ac&&!v&&uo(o,u,0,!1);break}else{if(m=o.current.alternate,R&&!aK(m)){E=db(o,u,!1),R=!1;continue}if(E===2){if(R=u,o.errorRecoveryDisabledLanes&R)var I=0;else I=o.pendingLanes&-536870913,I=I!==0?I:I&536870912?536870912:0;if(I!==0){u=I;e:{var X=o;E=ud;var oe=X.current.memoizedState.isDehydrated;if(oe&&(ic(X,I).flags|=256),I=db(X,I,!1),I!==2){if(ab&&!oe){X.errorRecoveryDisabledLanes|=R,ji|=R,E=4;break e}R=Jn,Jn=E,R!==null&&(Jn===null?Jn=R:Jn.push.apply(Jn,R))}E=I}if(R=!1,E!==2)continue}}if(E===1){ic(o,0),uo(o,u,0,!0);break}e:{switch(v=o,R=E,R){case 0:case 1:throw Error(r(345));case 4:if((u&4194048)!==u)break;case 6:uo(v,u,cr,!oo);break e;case 2:Jn=null;break;case 3:case 5:break;default:throw Error(r(329))}if((u&62914560)===u&&(E=Op+300-Je(),10<E)){if(uo(v,u,cr,!oo),Al(v,0,!0)!==0)break e;ds=u,v.timeoutHandle=Qk(Sk.bind(null,v,m,Jn,Dp,ob,u,cr,ji,sc,oo,R,"Throttled",-0,0),E);break e}Sk(v,m,Jn,Dp,ob,u,cr,ji,sc,oo,R,null,-0,0)}}break}while(!0);ba(o)}function Sk(o,u,m,v,E,R,I,X,oe,de,ge,be,he,pe){if(o.timeoutHandle=-1,be=u.subtreeFlags,be&8192||(be&16785408)===16785408){be={stylesheets:null,count:0,imgCount:0,imgBytes:0,suspenseyImages:[],waitingForImages:!0,waitingForViewTransition:!1,unsuspend:Xa},pk(u,R,be);var je=(R&62914560)===R?Op-Je():(R&4194048)===R?vk-Je():0;if(je=UK(be,je),je!==null){ds=R,o.cancelPendingCommit=je(Rk.bind(null,o,u,R,m,v,E,I,X,oe,ge,be,null,he,pe)),uo(o,R,I,!de);return}}Rk(o,u,R,m,v,E,I,X,oe)}function aK(o){for(var u=o;;){var m=u.tag;if((m===0||m===11||m===15)&&u.flags&16384&&(m=u.updateQueue,m!==null&&(m=m.stores,m!==null)))for(var v=0;v<m.length;v++){var E=m[v],R=E.getSnapshot;E=E.value;try{if(!ar(R(),E))return!1}catch{return!1}}if(m=u.child,u.subtreeFlags&16384&&m!==null)m.return=u,u=m;else{if(u===o)break;for(;u.sibling===null;){if(u.return===null||u.return===o)return!0;u=u.return}u.sibling.return=u.return,u=u.sibling}}return!0}function uo(o,u,m,v){u&=~sb,u&=~ji,o.suspendedLanes|=u,o.pingedLanes&=~u,v&&(o.warmLanes|=u),v=o.expirationTimes;for(var E=u;0<E;){var R=31-Fn(E),I=1<<R;v[R]=-1,E&=~I}m!==0&&Ph(o,m,u)}function Pp(){return(ut&6)===0?(fd(0),!1):!0}function ub(){if(Xe!==null){if(mt===0)var o=Xe.return;else o=Xe,es=gi=null,Cx(o),Zl=null,Ku=0,o=Xe;for(;o!==null;)JR(o.alternate,o),o=o.return;Xe=null}}function ic(o,u){var m=o.timeoutHandle;m!==-1&&(o.timeoutHandle=-1,NK(m)),m=o.cancelPendingCommit,m!==null&&(o.cancelPendingCommit=null,m()),ds=0,ub(),_t=o,Xe=m=Qa(o.current,null),et=u,mt=0,lr=null,oo=!1,ac=ii(o,u),ab=!1,sc=cr=sb=ji=io=Gt=0,Jn=ud=null,ob=!1,(u&8)!==0&&(u|=u&32);var v=o.entangledLanes;if(v!==0)for(o=o.entanglements,v&=u;0<v;){var E=31-Fn(v),R=1<<E;u|=o[E],v&=~R}return us=u,np(),m}function _k(o,u){He=null,P.H=nd,u===Xl||u===up?(u=zA(),mt=3):u===px?(u=zA(),mt=4):mt=u===Ux?8:u!==null&&typeof u=="object"&&typeof u.then=="function"?6:1,lr=u,Xe===null&&(Gt=1,Np(o,Cr(u,o.current)))}function Nk(){var o=or.current;return o===null?!0:(et&4194048)===et?Rr===null:(et&62914560)===et||(et&536870912)!==0?o===Rr:!1}function jk(){var o=P.H;return P.H=nd,o===null?nd:o}function Ck(){var o=P.A;return P.A=nK,o}function $p(){Gt=4,oo||(et&4194048)!==et&&or.current!==null||(ac=!0),(io&134217727)===0&&(ji&134217727)===0||_t===null||uo(_t,et,cr,!1)}function db(o,u,m){var v=ut;ut|=2;var E=jk(),R=Ck();(_t!==o||et!==u)&&(Dp=null,ic(o,u)),u=!1;var I=Gt;e:do try{if(mt!==0&&Xe!==null){var X=Xe,oe=lr;switch(mt){case 8:ub(),I=6;break e;case 3:case 2:case 9:case 6:or.current===null&&(u=!0);var de=mt;if(mt=0,lr=null,lc(o,X,oe,de),m&&ac){I=0;break e}break;default:de=mt,mt=0,lr=null,lc(o,X,oe,de)}}sK(),I=Gt;break}catch(ge){_k(o,ge)}while(!0);return u&&o.shellSuspendCounter++,es=gi=null,ut=v,P.H=E,P.A=R,Xe===null&&(_t=null,et=0,np()),I}function sK(){for(;Xe!==null;)Ek(Xe)}function oK(o,u){var m=ut;ut|=2;var v=jk(),E=Ck();_t!==o||et!==u?(Dp=null,Mp=Je()+500,ic(o,u)):ac=ii(o,u);e:do try{if(mt!==0&&Xe!==null){u=Xe;var R=lr;t:switch(mt){case 1:mt=0,lr=null,lc(o,u,R,1);break;case 2:case 9:if(IA(R)){mt=0,lr=null,Tk(u);break}u=function(){mt!==2&&mt!==9||_t!==o||(mt=7),ba(o)},R.then(u,u);break e;case 3:mt=7;break e;case 4:mt=5;break e;case 7:IA(R)?(mt=0,lr=null,Tk(u)):(mt=0,lr=null,lc(o,u,R,7));break;case 5:var I=null;switch(Xe.tag){case 26:I=Xe.memoizedState;case 5:case 27:var X=Xe;if(I?hO(I):X.stateNode.complete){mt=0,lr=null;var oe=X.sibling;if(oe!==null)Xe=oe;else{var de=X.return;de!==null?(Xe=de,Ip(de)):Xe=null}break t}}mt=0,lr=null,lc(o,u,R,5);break;case 6:mt=0,lr=null,lc(o,u,R,6);break;case 8:ub(),Gt=6;break e;default:throw Error(r(462))}}iK();break}catch(ge){_k(o,ge)}while(!0);return es=gi=null,P.H=v,P.A=E,ut=m,Xe!==null?0:(_t=null,et=0,np(),Gt)}function iK(){for(;Xe!==null&&!$e();)Ek(Xe)}function Ek(o){var u=ZR(o.alternate,o,us);o.memoizedProps=o.pendingProps,u===null?Ip(o):Xe=u}function Tk(o){var u=o,m=u.alternate;switch(u.tag){case 15:case 0:u=VR(m,u,u.pendingProps,u.type,void 0,et);break;case 11:u=VR(m,u,u.pendingProps,u.type.render,u.ref,et);break;case 5:Cx(u);default:JR(m,u),u=Xe=CA(u,us),u=ZR(m,u,us)}o.memoizedProps=o.pendingProps,u===null?Ip(o):Xe=u}function lc(o,u,m,v){es=gi=null,Cx(u),Zl=null,Ku=0;var E=u.return;try{if(YG(o,E,u,m,et)){Gt=1,Np(o,Cr(m,o.current)),Xe=null;return}}catch(R){if(E!==null)throw Xe=E,R;Gt=1,Np(o,Cr(m,o.current)),Xe=null;return}u.flags&32768?(rt||v===1?o=!0:ac||(et&536870912)!==0?o=!1:(oo=o=!0,(v===2||v===9||v===3||v===6)&&(v=or.current,v!==null&&v.tag===13&&(v.flags|=16384))),Ak(u,o)):Ip(u)}function Ip(o){var u=o;do{if((u.flags&32768)!==0){Ak(u,oo);return}o=u.return;var m=QG(u.alternate,u,us);if(m!==null){Xe=m;return}if(u=u.sibling,u!==null){Xe=u;return}Xe=u=o}while(u!==null);Gt===0&&(Gt=5)}function Ak(o,u){do{var m=JG(o.alternate,o);if(m!==null){m.flags&=32767,Xe=m;return}if(m=o.return,m!==null&&(m.flags|=32768,m.subtreeFlags=0,m.deletions=null),!u&&(o=o.sibling,o!==null)){Xe=o;return}Xe=o=m}while(o!==null);Gt=6,Xe=null}function Rk(o,u,m,v,E,R,I,X,oe){o.cancelPendingCommit=null;do Lp();while(dn!==0);if((ut&6)!==0)throw Error(r(327));if(u!==null){if(u===o.current)throw Error(r(177));if(R=u.lanes|u.childLanes,R|=J0,A0(o,m,R,I,X,oe),o===_t&&(Xe=_t=null,et=0),oc=u,co=o,ds=m,ib=R,lb=E,xk=v,(u.subtreeFlags&10256)!==0||(u.flags&10256)!==0?(o.callbackNode=null,o.callbackPriority=0,dK(cn,function(){return Pk(),null})):(o.callbackNode=null,o.callbackPriority=0),v=(u.flags&13878)!==0,(u.subtreeFlags&13878)!==0||v){v=P.T,P.T=null,E=K.p,K.p=2,I=ut,ut|=4;try{eK(o,u,m)}finally{ut=I,K.p=E,P.T=v}}dn=1,kk(),Ok(),Mk()}}function kk(){if(dn===1){dn=0;var o=co,u=oc,m=(u.flags&13878)!==0;if((u.subtreeFlags&13878)!==0||m){m=P.T,P.T=null;var v=K.p;K.p=2;var E=ut;ut|=4;try{dk(u,o);var R=_b,I=yA(o.containerInfo),X=R.focusedElem,oe=R.selectionRange;if(I!==X&&X&&X.ownerDocument&&gA(X.ownerDocument.documentElement,X)){if(oe!==null&&K0(X)){var de=oe.start,ge=oe.end;if(ge===void 0&&(ge=de),"selectionStart"in X)X.selectionStart=de,X.selectionEnd=Math.min(ge,X.value.length);else{var be=X.ownerDocument||document,he=be&&be.defaultView||window;if(he.getSelection){var pe=he.getSelection(),je=X.textContent.length,Ie=Math.min(oe.start,je),wt=oe.end===void 0?Ie:Math.min(oe.end,je);!pe.extend&&Ie>wt&&(I=wt,wt=Ie,Ie=I);var ce=mA(X,Ie),ie=mA(X,wt);if(ce&&ie&&(pe.rangeCount!==1||pe.anchorNode!==ce.node||pe.anchorOffset!==ce.offset||pe.focusNode!==ie.node||pe.focusOffset!==ie.offset)){var ue=be.createRange();ue.setStart(ce.node,ce.offset),pe.removeAllRanges(),Ie>wt?(pe.addRange(ue),pe.extend(ie.node,ie.offset)):(ue.setEnd(ie.node,ie.offset),pe.addRange(ue))}}}}for(be=[],pe=X;pe=pe.parentNode;)pe.nodeType===1&&be.push({element:pe,left:pe.scrollLeft,top:pe.scrollTop});for(typeof X.focus=="function"&&X.focus(),X=0;X<be.length;X++){var xe=be[X];xe.element.scrollLeft=xe.left,xe.element.scrollTop=xe.top}}Xp=!!Sb,_b=Sb=null}finally{ut=E,K.p=v,P.T=m}}o.current=u,dn=2}}function Ok(){if(dn===2){dn=0;var o=co,u=oc,m=(u.flags&8772)!==0;if((u.subtreeFlags&8772)!==0||m){m=P.T,P.T=null;var v=K.p;K.p=2;var E=ut;ut|=4;try{ok(o,u.alternate,u)}finally{ut=E,K.p=v,P.T=m}}dn=3}}function Mk(){if(dn===4||dn===3){dn=0,qe();var o=co,u=oc,m=ds,v=xk;(u.subtreeFlags&10256)!==0||(u.flags&10256)!==0?dn=5:(dn=0,oc=co=null,Dk(o,o.pendingLanes));var E=o.pendingLanes;if(E===0&&(lo=null),ku(m),u=u.stateNode,Ft&&typeof Ft.onCommitFiberRoot=="function")try{Ft.onCommitFiberRoot(Rn,u,void 0,(u.current.flags&128)===128)}catch{}if(v!==null){u=P.T,E=K.p,K.p=2,P.T=null;try{for(var R=o.onRecoverableError,I=0;I<v.length;I++){var X=v[I];R(X.value,{componentStack:X.stack})}}finally{P.T=u,K.p=E}}(ds&3)!==0&&Lp(),ba(o),E=o.pendingLanes,(m&261930)!==0&&(E&42)!==0?o===cb?dd++:(dd=0,cb=o):dd=0,fd(0)}}function Dk(o,u){(o.pooledCacheLanes&=u)===0&&(u=o.pooledCache,u!=null&&(o.pooledCache=null,Wu(u)))}function Lp(){return kk(),Ok(),Mk(),Pk()}function Pk(){if(dn!==5)return!1;var o=co,u=ib;ib=0;var m=ku(ds),v=P.T,E=K.p;try{K.p=32>m?32:m,P.T=null,m=lb,lb=null;var R=co,I=ds;if(dn=0,oc=co=null,ds=0,(ut&6)!==0)throw Error(r(331));var X=ut;if(ut|=4,gk(R.current),hk(R,R.current,I,m),ut=X,fd(0,!1),Ft&&typeof Ft.onPostCommitFiberRoot=="function")try{Ft.onPostCommitFiberRoot(Rn,R)}catch{}return!0}finally{K.p=E,P.T=v,Dk(o,u)}}function $k(o,u,m){u=Cr(m,u),u=Fx(o.stateNode,u,2),o=no(o,u,2),o!==null&&(li(o,2),ba(o))}function gt(o,u,m){if(o.tag===3)$k(o,o,m);else for(;u!==null;){if(u.tag===3){$k(u,o,m);break}else if(u.tag===1){var v=u.stateNode;if(typeof u.type.getDerivedStateFromError=="function"||typeof v.componentDidCatch=="function"&&(lo===null||!lo.has(v))){o=Cr(m,o),m=IR(2),v=no(u,m,2),v!==null&&(LR(m,v,u,o),li(v,2),ba(v));break}}u=u.return}}function fb(o,u,m){var v=o.pingCache;if(v===null){v=o.pingCache=new rK;var E=new Set;v.set(u,E)}else E=v.get(u),E===void 0&&(E=new Set,v.set(u,E));E.has(m)||(ab=!0,E.add(m),o=lK.bind(null,o,u,m),u.then(o,o))}function lK(o,u,m){var v=o.pingCache;v!==null&&v.delete(u),o.pingedLanes|=o.suspendedLanes&m,o.warmLanes&=~m,_t===o&&(et&m)===m&&(Gt===4||Gt===3&&(et&62914560)===et&&300>Je()-Op?(ut&2)===0&&ic(o,0):sb|=m,sc===et&&(sc=0)),ba(o)}function Ik(o,u){u===0&&(u=Dh()),o=hi(o,u),o!==null&&(li(o,u),ba(o))}function cK(o){var u=o.memoizedState,m=0;u!==null&&(m=u.retryLane),Ik(o,m)}function uK(o,u){var m=0;switch(o.tag){case 31:case 13:var v=o.stateNode,E=o.memoizedState;E!==null&&(m=E.retryLane);break;case 19:v=o.stateNode;break;case 22:v=o.stateNode._retryCache;break;default:throw Error(r(314))}v!==null&&v.delete(u),Ik(o,m)}function dK(o,u){return Ve(o,u)}var zp=null,cc=null,hb=!1,qp=!1,pb=!1,fo=0;function ba(o){o!==cc&&o.next===null&&(cc===null?zp=cc=o:cc=cc.next=o),qp=!0,hb||(hb=!0,hK())}function fd(o,u){if(!pb&&qp){pb=!0;do for(var m=!1,v=zp;v!==null;){if(o!==0){var E=v.pendingLanes;if(E===0)var R=0;else{var I=v.suspendedLanes,X=v.pingedLanes;R=(1<<31-Fn(42|o)+1)-1,R&=E&~(I&~X),R=R&201326741?R&201326741|1:R?R|2:0}R!==0&&(m=!0,Fk(v,R))}else R=et,R=Al(v,v===_t?R:0,v.cancelPendingCommit!==null||v.timeoutHandle!==-1),(R&3)===0||ii(v,R)||(m=!0,Fk(v,R));v=v.next}while(m);pb=!1}}function fK(){Lk()}function Lk(){qp=hb=!1;var o=0;fo!==0&&_K()&&(o=fo);for(var u=Je(),m=null,v=zp;v!==null;){var E=v.next,R=zk(v,u);R===0?(v.next=null,m===null?zp=E:m.next=E,E===null&&(cc=m)):(m=v,(o!==0||(R&3)!==0)&&(qp=!0)),v=E}dn!==0&&dn!==5||fd(o),fo!==0&&(fo=0)}function zk(o,u){for(var m=o.suspendedLanes,v=o.pingedLanes,E=o.expirationTimes,R=o.pendingLanes&-62914561;0<R;){var I=31-Fn(R),X=1<<I,oe=E[I];oe===-1?((X&m)===0||(X&v)!==0)&&(E[I]=T0(X,u)):oe<=u&&(o.expiredLanes|=X),R&=~X}if(u=_t,m=et,m=Al(o,o===u?m:0,o.cancelPendingCommit!==null||o.timeoutHandle!==-1),v=o.callbackNode,m===0||o===u&&(mt===2||mt===9)||o.cancelPendingCommit!==null)return v!==null&&v!==null&&Le(v),o.callbackNode=null,o.callbackPriority=0;if((m&3)===0||ii(o,m)){if(u=m&-m,u===o.callbackPriority)return u;switch(v!==null&&Le(v),ku(m)){case 2:case 8:m=Sn;break;case 32:m=cn;break;case 268435456:m=Fr;break;default:m=cn}return v=qk.bind(null,o),m=Ve(m,v),o.callbackPriority=u,o.callbackNode=m,u}return v!==null&&v!==null&&Le(v),o.callbackPriority=2,o.callbackNode=null,2}function qk(o,u){if(dn!==0&&dn!==5)return o.callbackNode=null,o.callbackPriority=0,null;var m=o.callbackNode;if(Lp()&&o.callbackNode!==m)return null;var v=et;return v=Al(o,o===_t?v:0,o.cancelPendingCommit!==null||o.timeoutHandle!==-1),v===0?null:(wk(o,v,u),zk(o,Je()),o.callbackNode!=null&&o.callbackNode===m?qk.bind(null,o):null)}function Fk(o,u){if(Lp())return null;wk(o,u,!0)}function hK(){jK(function(){(ut&6)!==0?Ve(ln,fK):Lk()})}function mb(){if(fo===0){var o=Kl;o===0&&(o=Cl,Cl<<=1,(Cl&261888)===0&&(Cl=256)),fo=o}return fo}function Uk(o){return o==null||typeof o=="symbol"||typeof o=="boolean"?null:typeof o=="function"?o:Kh(""+o)}function Hk(o,u){var m=u.ownerDocument.createElement("input");return m.name=u.name,m.value=u.value,o.id&&m.setAttribute("form",o.id),u.parentNode.insertBefore(m,u),o=new FormData(o),m.parentNode.removeChild(m),o}function pK(o,u,m,v,E){if(u==="submit"&&m&&m.stateNode===E){var R=Uk((E[kn]||null).action),I=v.submitter;I&&(u=(u=I[kn]||null)?Uk(u.formAction):I.getAttribute("formAction"),u!==null&&(R=u,I=null));var X=new Qh("action","action",null,v,E);o.push({event:X,listeners:[{instance:null,listener:function(){if(v.defaultPrevented){if(fo!==0){var oe=I?Hk(E,I):new FormData(E);Px(m,{pending:!0,data:oe,method:E.method,action:R},null,oe)}}else typeof R=="function"&&(X.preventDefault(),oe=I?Hk(E,I):new FormData(E),Px(m,{pending:!0,data:oe,method:E.method,action:R},R,oe))},currentTarget:E}]})}}for(var gb=0;gb<Q0.length;gb++){var yb=Q0[gb],mK=yb.toLowerCase(),gK=yb[0].toUpperCase()+yb.slice(1);Hr(mK,"on"+gK)}Hr(bA,"onAnimationEnd"),Hr(wA,"onAnimationIteration"),Hr(SA,"onAnimationStart"),Hr("dblclick","onDoubleClick"),Hr("focusin","onFocus"),Hr("focusout","onBlur"),Hr(OG,"onTransitionRun"),Hr(MG,"onTransitionStart"),Hr(DG,"onTransitionCancel"),Hr(_A,"onTransitionEnd"),Gs("onMouseEnter",["mouseout","mouseover"]),Gs("onMouseLeave",["mouseout","mouseover"]),Gs("onPointerEnter",["pointerout","pointerover"]),Gs("onPointerLeave",["pointerout","pointerover"]),Ya("onChange","change click focusin focusout input keydown keyup selectionchange".split(" ")),Ya("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" ")),Ya("onBeforeInput",["compositionend","keypress","textInput","paste"]),Ya("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" ")),Ya("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" ")),Ya("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var hd="abort canplay canplaythrough durationchange emptied encrypted ended error loadeddata loadedmetadata loadstart pause play playing progress ratechange resize seeked seeking stalled suspend timeupdate volumechange waiting".split(" "),yK=new Set("beforetoggle cancel close invalid load scroll scrollend toggle".split(" ").concat(hd));function Bk(o,u){u=(u&4)!==0;for(var m=0;m<o.length;m++){var v=o[m],E=v.event;v=v.listeners;e:{var R=void 0;if(u)for(var I=v.length-1;0<=I;I--){var X=v[I],oe=X.instance,de=X.currentTarget;if(X=X.listener,oe!==R&&E.isPropagationStopped())break e;R=X,E.currentTarget=de;try{R(E)}catch(ge){tp(ge)}E.currentTarget=null,R=oe}else for(I=0;I<v.length;I++){if(X=v[I],oe=X.instance,de=X.currentTarget,X=X.listener,oe!==R&&E.isPropagationStopped())break e;R=X,E.currentTarget=de;try{R(E)}catch(ge){tp(ge)}E.currentTarget=null,R=oe}}}}function Ze(o,u){var m=u[Rl];m===void 0&&(m=u[Rl]=new Set);var v=o+"__bubble";m.has(v)||(Vk(u,o,2,!1),m.add(v))}function vb(o,u,m){var v=0;u&&(v|=4),Vk(m,o,v,u)}var Fp="_reactListening"+Math.random().toString(36).slice(2);function xb(o){if(!o[Fp]){o[Fp]=!0,Uh.forEach(function(m){m!=="selectionchange"&&(yK.has(m)||vb(m,!1,o),vb(m,!0,o))});var u=o.nodeType===9?o:o.ownerDocument;u===null||u[Fp]||(u[Fp]=!0,vb("selectionchange",!1,u))}}function Vk(o,u,m,v){switch(bO(u)){case 2:var E=VK;break;case 8:E=WK;break;default:E=Db}m=E.bind(null,u,m,o),E=void 0,!z0||u!=="touchstart"&&u!=="touchmove"&&u!=="wheel"||(E=!0),v?E!==void 0?o.addEventListener(u,m,{capture:!0,passive:E}):o.addEventListener(u,m,!0):E!==void 0?o.addEventListener(u,m,{passive:E}):o.addEventListener(u,m,!1)}function bb(o,u,m,v,E){var R=v;if((u&1)===0&&(u&2)===0&&v!==null)e:for(;;){if(v===null)return;var I=v.tag;if(I===3||I===4){var X=v.stateNode.containerInfo;if(X===E)break;if(I===4)for(I=v.return;I!==null;){var oe=I.tag;if((oe===3||oe===4)&&I.stateNode.containerInfo===E)return;I=I.return}for(;X!==null;){if(I=Hs(X),I===null)return;if(oe=I.tag,oe===5||oe===6||oe===26||oe===27){v=R=I;continue e}X=X.parentNode}}v=v.return}XT(function(){var de=R,ge=I0(m),be=[];e:{var he=NA.get(o);if(he!==void 0){var pe=Qh,je=o;switch(o){case"keypress":if(Xh(m)===0)break e;case"keydown":case"keyup":pe=uG;break;case"focusin":je="focus",pe=H0;break;case"focusout":je="blur",pe=H0;break;case"beforeblur":case"afterblur":pe=H0;break;case"click":if(m.button===2)break e;case"auxclick":case"dblclick":case"mousedown":case"mousemove":case"mouseup":case"mouseout":case"mouseover":case"contextmenu":pe=JT;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":pe=QW;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":pe=hG;break;case bA:case wA:case SA:pe=tG;break;case _A:pe=mG;break;case"scroll":case"scrollend":pe=XW;break;case"wheel":pe=yG;break;case"copy":case"cut":case"paste":pe=rG;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":pe=tA;break;case"toggle":case"beforetoggle":pe=xG}var Ie=(u&4)!==0,wt=!Ie&&(o==="scroll"||o==="scrollend"),ce=Ie?he!==null?he+"Capture":null:he;Ie=[];for(var ie=de,ue;ie!==null;){var xe=ie;if(ue=xe.stateNode,xe=xe.tag,xe!==5&&xe!==26&&xe!==27||ue===null||ce===null||(xe=Pu(ie,ce),xe!=null&&Ie.push(pd(ie,xe,ue))),wt)break;ie=ie.return}0<Ie.length&&(he=new pe(he,je,null,m,ge),be.push({event:he,listeners:Ie}))}}if((u&7)===0){e:{if(he=o==="mouseover"||o==="pointerover",pe=o==="mouseout"||o==="pointerout",he&&m!==$0&&(je=m.relatedTarget||m.fromElement)&&(Hs(je)||je[Ka]))break e;if((pe||he)&&(he=ge.window===ge?ge:(he=ge.ownerDocument)?he.defaultView||he.parentWindow:window,pe?(je=m.relatedTarget||m.toElement,pe=de,je=je?Hs(je):null,je!==null&&(wt=s(je),Ie=je.tag,je!==wt||Ie!==5&&Ie!==27&&Ie!==6)&&(je=null)):(pe=null,je=de),pe!==je)){if(Ie=JT,xe="onMouseLeave",ce="onMouseEnter",ie="mouse",(o==="pointerout"||o==="pointerover")&&(Ie=tA,xe="onPointerLeave",ce="onPointerEnter",ie="pointer"),wt=pe==null?he:Vs(pe),ue=je==null?he:Vs(je),he=new Ie(xe,ie+"leave",pe,m,ge),he.target=wt,he.relatedTarget=ue,xe=null,Hs(ge)===de&&(Ie=new Ie(ce,ie+"enter",je,m,ge),Ie.target=ue,Ie.relatedTarget=wt,xe=Ie),wt=xe,pe&&je)t:{for(Ie=vK,ce=pe,ie=je,ue=0,xe=ce;xe;xe=Ie(xe))ue++;xe=0;for(var Pe=ie;Pe;Pe=Ie(Pe))xe++;for(;0<ue-xe;)ce=Ie(ce),ue--;for(;0<xe-ue;)ie=Ie(ie),xe--;for(;ue--;){if(ce===ie||ie!==null&&ce===ie.alternate){Ie=ce;break t}ce=Ie(ce),ie=Ie(ie)}Ie=null}else Ie=null;pe!==null&&Wk(be,he,pe,Ie,!1),je!==null&&wt!==null&&Wk(be,wt,je,Ie,!0)}}e:{if(he=de?Vs(de):window,pe=he.nodeName&&he.nodeName.toLowerCase(),pe==="select"||pe==="input"&&he.type==="file")var it=cA;else if(iA(he))if(uA)it=AG;else{it=EG;var ke=CG}else pe=he.nodeName,!pe||pe.toLowerCase()!=="input"||he.type!=="checkbox"&&he.type!=="radio"?de&&P0(de.elementType)&&(it=cA):it=TG;if(it&&(it=it(o,de))){lA(be,it,m,ge);break e}ke&&ke(o,he,de),o==="focusout"&&de&&he.type==="number"&&de.memoizedProps.value!=null&&Dl(he,"number",he.value)}switch(ke=de?Vs(de):window,o){case"focusin":(iA(ke)||ke.contentEditable==="true")&&(ql=ke,Y0=de,Hu=null);break;case"focusout":Hu=Y0=ql=null;break;case"mousedown":X0=!0;break;case"contextmenu":case"mouseup":case"dragend":X0=!1,vA(be,m,ge);break;case"selectionchange":if(kG)break;case"keydown":case"keyup":vA(be,m,ge)}var Be;if(V0)e:{switch(o){case"compositionstart":var tt="onCompositionStart";break e;case"compositionend":tt="onCompositionEnd";break e;case"compositionupdate":tt="onCompositionUpdate";break e}tt=void 0}else zl?sA(o,m)&&(tt="onCompositionEnd"):o==="keydown"&&m.keyCode===229&&(tt="onCompositionStart");tt&&(nA&&m.locale!=="ko"&&(zl||tt!=="onCompositionStart"?tt==="onCompositionEnd"&&zl&&(Be=ZT()):(Ys=ge,q0="value"in Ys?Ys.value:Ys.textContent,zl=!0)),ke=Up(de,tt),0<ke.length&&(tt=new eA(tt,o,null,m,ge),be.push({event:tt,listeners:ke}),Be?tt.data=Be:(Be=oA(m),Be!==null&&(tt.data=Be)))),(Be=wG?SG(o,m):_G(o,m))&&(tt=Up(de,"onBeforeInput"),0<tt.length&&(ke=new eA("onBeforeInput","beforeinput",null,m,ge),be.push({event:ke,listeners:tt}),ke.data=Be)),pK(be,o,de,m,ge)}Bk(be,u)})}function pd(o,u,m){return{instance:o,listener:u,currentTarget:m}}function Up(o,u){for(var m=u+"Capture",v=[];o!==null;){var E=o,R=E.stateNode;if(E=E.tag,E!==5&&E!==26&&E!==27||R===null||(E=Pu(o,m),E!=null&&v.unshift(pd(o,E,R)),E=Pu(o,u),E!=null&&v.push(pd(o,E,R))),o.tag===3)return v;o=o.return}return[]}function vK(o){if(o===null)return null;do o=o.return;while(o&&o.tag!==5&&o.tag!==27);return o||null}function Wk(o,u,m,v,E){for(var R=u._reactName,I=[];m!==null&&m!==v;){var X=m,oe=X.alternate,de=X.stateNode;if(X=X.tag,oe!==null&&oe===v)break;X!==5&&X!==26&&X!==27||de===null||(oe=de,E?(de=Pu(m,R),de!=null&&I.unshift(pd(m,de,oe))):E||(de=Pu(m,R),de!=null&&I.push(pd(m,de,oe)))),m=m.return}I.length!==0&&o.push({event:u,listeners:I})}var xK=/\r\n?/g,bK=/\u0000|\uFFFD/g;function Gk(o){return(typeof o=="string"?o:""+o).replace(xK,`
|
|
49
|
+
`).replace(bK,"")}function Kk(o,u){return u=Gk(u),Gk(o)===u}function bt(o,u,m,v,E,R){switch(m){case"children":typeof v=="string"?u==="body"||u==="textarea"&&v===""||$l(o,v):(typeof v=="number"||typeof v=="bigint")&&u!=="body"&&$l(o,""+v);break;case"className":Ol(o,"class",v);break;case"tabIndex":Ol(o,"tabindex",v);break;case"dir":case"role":case"viewBox":case"width":case"height":Ol(o,m,v);break;case"style":KT(o,v,R);break;case"data":if(u!=="object"){Ol(o,"data",v);break}case"src":case"href":if(v===""&&(u!=="a"||m!=="href")){o.removeAttribute(m);break}if(v==null||typeof v=="function"||typeof v=="symbol"||typeof v=="boolean"){o.removeAttribute(m);break}v=Kh(""+v),o.setAttribute(m,v);break;case"action":case"formAction":if(typeof v=="function"){o.setAttribute(m,"javascript:throw new Error('A React form was unexpectedly submitted. If you called form.submit() manually, consider using form.requestSubmit() instead. If you\\'re trying to use event.stopPropagation() in a submit event handler, consider also calling event.preventDefault().')");break}else typeof R=="function"&&(m==="formAction"?(u!=="input"&&bt(o,u,"name",E.name,E,null),bt(o,u,"formEncType",E.formEncType,E,null),bt(o,u,"formMethod",E.formMethod,E,null),bt(o,u,"formTarget",E.formTarget,E,null)):(bt(o,u,"encType",E.encType,E,null),bt(o,u,"method",E.method,E,null),bt(o,u,"target",E.target,E,null)));if(v==null||typeof v=="symbol"||typeof v=="boolean"){o.removeAttribute(m);break}v=Kh(""+v),o.setAttribute(m,v);break;case"onClick":v!=null&&(o.onclick=Xa);break;case"onScroll":v!=null&&Ze("scroll",o);break;case"onScrollEnd":v!=null&&Ze("scrollend",o);break;case"dangerouslySetInnerHTML":if(v!=null){if(typeof v!="object"||!("__html"in v))throw Error(r(61));if(m=v.__html,m!=null){if(E.children!=null)throw Error(r(60));o.innerHTML=m}}break;case"multiple":o.multiple=v&&typeof v!="function"&&typeof v!="symbol";break;case"muted":o.muted=v&&typeof v!="function"&&typeof v!="symbol";break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"defaultValue":case"defaultChecked":case"innerHTML":case"ref":break;case"autoFocus":break;case"xlinkHref":if(v==null||typeof v=="function"||typeof v=="boolean"||typeof v=="symbol"){o.removeAttribute("xlink:href");break}m=Kh(""+v),o.setAttributeNS("http://www.w3.org/1999/xlink","xlink:href",m);break;case"contentEditable":case"spellCheck":case"draggable":case"value":case"autoReverse":case"externalResourcesRequired":case"focusable":case"preserveAlpha":v!=null&&typeof v!="function"&&typeof v!="symbol"?o.setAttribute(m,""+v):o.removeAttribute(m);break;case"inert":case"allowFullScreen":case"async":case"autoPlay":case"controls":case"default":case"defer":case"disabled":case"disablePictureInPicture":case"disableRemotePlayback":case"formNoValidate":case"hidden":case"loop":case"noModule":case"noValidate":case"open":case"playsInline":case"readOnly":case"required":case"reversed":case"scoped":case"seamless":case"itemScope":v&&typeof v!="function"&&typeof v!="symbol"?o.setAttribute(m,""):o.removeAttribute(m);break;case"capture":case"download":v===!0?o.setAttribute(m,""):v!==!1&&v!=null&&typeof v!="function"&&typeof v!="symbol"?o.setAttribute(m,v):o.removeAttribute(m);break;case"cols":case"rows":case"size":case"span":v!=null&&typeof v!="function"&&typeof v!="symbol"&&!isNaN(v)&&1<=v?o.setAttribute(m,v):o.removeAttribute(m);break;case"rowSpan":case"start":v==null||typeof v=="function"||typeof v=="symbol"||isNaN(v)?o.removeAttribute(m):o.setAttribute(m,v);break;case"popover":Ze("beforetoggle",o),Ze("toggle",o),kl(o,"popover",v);break;case"xlinkActuate":Ur(o,"http://www.w3.org/1999/xlink","xlink:actuate",v);break;case"xlinkArcrole":Ur(o,"http://www.w3.org/1999/xlink","xlink:arcrole",v);break;case"xlinkRole":Ur(o,"http://www.w3.org/1999/xlink","xlink:role",v);break;case"xlinkShow":Ur(o,"http://www.w3.org/1999/xlink","xlink:show",v);break;case"xlinkTitle":Ur(o,"http://www.w3.org/1999/xlink","xlink:title",v);break;case"xlinkType":Ur(o,"http://www.w3.org/1999/xlink","xlink:type",v);break;case"xmlBase":Ur(o,"http://www.w3.org/XML/1998/namespace","xml:base",v);break;case"xmlLang":Ur(o,"http://www.w3.org/XML/1998/namespace","xml:lang",v);break;case"xmlSpace":Ur(o,"http://www.w3.org/XML/1998/namespace","xml:space",v);break;case"is":kl(o,"is",v);break;case"innerText":case"textContent":break;default:(!(2<m.length)||m[0]!=="o"&&m[0]!=="O"||m[1]!=="n"&&m[1]!=="N")&&(m=KW.get(m)||m,kl(o,m,v))}}function wb(o,u,m,v,E,R){switch(m){case"style":KT(o,v,R);break;case"dangerouslySetInnerHTML":if(v!=null){if(typeof v!="object"||!("__html"in v))throw Error(r(61));if(m=v.__html,m!=null){if(E.children!=null)throw Error(r(60));o.innerHTML=m}}break;case"children":typeof v=="string"?$l(o,v):(typeof v=="number"||typeof v=="bigint")&&$l(o,""+v);break;case"onScroll":v!=null&&Ze("scroll",o);break;case"onScrollEnd":v!=null&&Ze("scrollend",o);break;case"onClick":v!=null&&(o.onclick=Xa);break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"innerHTML":case"ref":break;case"innerText":case"textContent":break;default:if(!Hh.hasOwnProperty(m))e:{if(m[0]==="o"&&m[1]==="n"&&(E=m.endsWith("Capture"),u=m.slice(2,E?m.length-7:void 0),R=o[kn]||null,R=R!=null?R[m]:null,typeof R=="function"&&o.removeEventListener(u,R,E),typeof v=="function")){typeof R!="function"&&R!==null&&(m in o?o[m]=null:o.hasAttribute(m)&&o.removeAttribute(m)),o.addEventListener(u,v,E);break e}m in o?o[m]=v:v===!0?o.setAttribute(m,""):kl(o,m,v)}}}function Cn(o,u,m){switch(u){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"img":Ze("error",o),Ze("load",o);var v=!1,E=!1,R;for(R in m)if(m.hasOwnProperty(R)){var I=m[R];if(I!=null)switch(R){case"src":v=!0;break;case"srcSet":E=!0;break;case"children":case"dangerouslySetInnerHTML":throw Error(r(137,u));default:bt(o,u,R,I,m,null)}}E&&bt(o,u,"srcSet",m.srcSet,m,null),v&&bt(o,u,"src",m.src,m,null);return;case"input":Ze("invalid",o);var X=R=I=E=null,oe=null,de=null;for(v in m)if(m.hasOwnProperty(v)){var ge=m[v];if(ge!=null)switch(v){case"name":E=ge;break;case"type":I=ge;break;case"checked":oe=ge;break;case"defaultChecked":de=ge;break;case"value":R=ge;break;case"defaultValue":X=ge;break;case"children":case"dangerouslySetInnerHTML":if(ge!=null)throw Error(r(137,u));break;default:bt(o,u,v,ge,m,null)}}Gh(o,R,X,oe,de,I,E,!1);return;case"select":Ze("invalid",o),v=I=R=null;for(E in m)if(m.hasOwnProperty(E)&&(X=m[E],X!=null))switch(E){case"value":R=X;break;case"defaultValue":I=X;break;case"multiple":v=X;default:bt(o,u,E,X,m,null)}u=R,m=I,o.multiple=!!v,u!=null?Pl(o,!!v,u,!1):m!=null&&Pl(o,!!v,m,!0);return;case"textarea":Ze("invalid",o),R=E=v=null;for(I in m)if(m.hasOwnProperty(I)&&(X=m[I],X!=null))switch(I){case"value":v=X;break;case"defaultValue":E=X;break;case"children":R=X;break;case"dangerouslySetInnerHTML":if(X!=null)throw Error(r(91));break;default:bt(o,u,I,X,m,null)}WT(o,v,E,R);return;case"option":for(oe in m)if(m.hasOwnProperty(oe)&&(v=m[oe],v!=null))switch(oe){case"selected":o.selected=v&&typeof v!="function"&&typeof v!="symbol";break;default:bt(o,u,oe,v,m,null)}return;case"dialog":Ze("beforetoggle",o),Ze("toggle",o),Ze("cancel",o),Ze("close",o);break;case"iframe":case"object":Ze("load",o);break;case"video":case"audio":for(v=0;v<hd.length;v++)Ze(hd[v],o);break;case"image":Ze("error",o),Ze("load",o);break;case"details":Ze("toggle",o);break;case"embed":case"source":case"link":Ze("error",o),Ze("load",o);case"area":case"base":case"br":case"col":case"hr":case"keygen":case"meta":case"param":case"track":case"wbr":case"menuitem":for(de in m)if(m.hasOwnProperty(de)&&(v=m[de],v!=null))switch(de){case"children":case"dangerouslySetInnerHTML":throw Error(r(137,u));default:bt(o,u,de,v,m,null)}return;default:if(P0(u)){for(ge in m)m.hasOwnProperty(ge)&&(v=m[ge],v!==void 0&&wb(o,u,ge,v,m,void 0));return}}for(X in m)m.hasOwnProperty(X)&&(v=m[X],v!=null&&bt(o,u,X,v,m,null))}function wK(o,u,m,v){switch(u){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"input":var E=null,R=null,I=null,X=null,oe=null,de=null,ge=null;for(pe in m){var be=m[pe];if(m.hasOwnProperty(pe)&&be!=null)switch(pe){case"checked":break;case"value":break;case"defaultValue":oe=be;default:v.hasOwnProperty(pe)||bt(o,u,pe,null,v,be)}}for(var he in v){var pe=v[he];if(be=m[he],v.hasOwnProperty(he)&&(pe!=null||be!=null))switch(he){case"type":R=pe;break;case"name":E=pe;break;case"checked":de=pe;break;case"defaultChecked":ge=pe;break;case"value":I=pe;break;case"defaultValue":X=pe;break;case"children":case"dangerouslySetInnerHTML":if(pe!=null)throw Error(r(137,u));break;default:pe!==be&&bt(o,u,he,pe,v,be)}}Du(o,I,X,oe,de,ge,R,E);return;case"select":pe=I=X=he=null;for(R in m)if(oe=m[R],m.hasOwnProperty(R)&&oe!=null)switch(R){case"value":break;case"multiple":pe=oe;default:v.hasOwnProperty(R)||bt(o,u,R,null,v,oe)}for(E in v)if(R=v[E],oe=m[E],v.hasOwnProperty(E)&&(R!=null||oe!=null))switch(E){case"value":he=R;break;case"defaultValue":X=R;break;case"multiple":I=R;default:R!==oe&&bt(o,u,E,R,v,oe)}u=X,m=I,v=pe,he!=null?Pl(o,!!m,he,!1):!!v!=!!m&&(u!=null?Pl(o,!!m,u,!0):Pl(o,!!m,m?[]:"",!1));return;case"textarea":pe=he=null;for(X in m)if(E=m[X],m.hasOwnProperty(X)&&E!=null&&!v.hasOwnProperty(X))switch(X){case"value":break;case"children":break;default:bt(o,u,X,null,v,E)}for(I in v)if(E=v[I],R=m[I],v.hasOwnProperty(I)&&(E!=null||R!=null))switch(I){case"value":he=E;break;case"defaultValue":pe=E;break;case"children":break;case"dangerouslySetInnerHTML":if(E!=null)throw Error(r(91));break;default:E!==R&&bt(o,u,I,E,v,R)}VT(o,he,pe);return;case"option":for(var je in m)if(he=m[je],m.hasOwnProperty(je)&&he!=null&&!v.hasOwnProperty(je))switch(je){case"selected":o.selected=!1;break;default:bt(o,u,je,null,v,he)}for(oe in v)if(he=v[oe],pe=m[oe],v.hasOwnProperty(oe)&&he!==pe&&(he!=null||pe!=null))switch(oe){case"selected":o.selected=he&&typeof he!="function"&&typeof he!="symbol";break;default:bt(o,u,oe,he,v,pe)}return;case"img":case"link":case"area":case"base":case"br":case"col":case"embed":case"hr":case"keygen":case"meta":case"param":case"source":case"track":case"wbr":case"menuitem":for(var Ie in m)he=m[Ie],m.hasOwnProperty(Ie)&&he!=null&&!v.hasOwnProperty(Ie)&&bt(o,u,Ie,null,v,he);for(de in v)if(he=v[de],pe=m[de],v.hasOwnProperty(de)&&he!==pe&&(he!=null||pe!=null))switch(de){case"children":case"dangerouslySetInnerHTML":if(he!=null)throw Error(r(137,u));break;default:bt(o,u,de,he,v,pe)}return;default:if(P0(u)){for(var wt in m)he=m[wt],m.hasOwnProperty(wt)&&he!==void 0&&!v.hasOwnProperty(wt)&&wb(o,u,wt,void 0,v,he);for(ge in v)he=v[ge],pe=m[ge],!v.hasOwnProperty(ge)||he===pe||he===void 0&&pe===void 0||wb(o,u,ge,he,v,pe);return}}for(var ce in m)he=m[ce],m.hasOwnProperty(ce)&&he!=null&&!v.hasOwnProperty(ce)&&bt(o,u,ce,null,v,he);for(be in v)he=v[be],pe=m[be],!v.hasOwnProperty(be)||he===pe||he==null&&pe==null||bt(o,u,be,he,v,pe)}function Yk(o){switch(o){case"css":case"script":case"font":case"img":case"image":case"input":case"link":return!0;default:return!1}}function SK(){if(typeof performance.getEntriesByType=="function"){for(var o=0,u=0,m=performance.getEntriesByType("resource"),v=0;v<m.length;v++){var E=m[v],R=E.transferSize,I=E.initiatorType,X=E.duration;if(R&&X&&Yk(I)){for(I=0,X=E.responseEnd,v+=1;v<m.length;v++){var oe=m[v],de=oe.startTime;if(de>X)break;var ge=oe.transferSize,be=oe.initiatorType;ge&&Yk(be)&&(oe=oe.responseEnd,I+=ge*(oe<X?1:(X-de)/(oe-de)))}if(--v,u+=8*(R+I)/(E.duration/1e3),o++,10<o)break}}if(0<o)return u/o/1e6}return navigator.connection&&(o=navigator.connection.downlink,typeof o=="number")?o:5}var Sb=null,_b=null;function Hp(o){return o.nodeType===9?o:o.ownerDocument}function Xk(o){switch(o){case"http://www.w3.org/2000/svg":return 1;case"http://www.w3.org/1998/Math/MathML":return 2;default:return 0}}function Zk(o,u){if(o===0)switch(u){case"svg":return 1;case"math":return 2;default:return 0}return o===1&&u==="foreignObject"?0:o}function Nb(o,u){return o==="textarea"||o==="noscript"||typeof u.children=="string"||typeof u.children=="number"||typeof u.children=="bigint"||typeof u.dangerouslySetInnerHTML=="object"&&u.dangerouslySetInnerHTML!==null&&u.dangerouslySetInnerHTML.__html!=null}var jb=null;function _K(){var o=window.event;return o&&o.type==="popstate"?o===jb?!1:(jb=o,!0):(jb=null,!1)}var Qk=typeof setTimeout=="function"?setTimeout:void 0,NK=typeof clearTimeout=="function"?clearTimeout:void 0,Jk=typeof Promise=="function"?Promise:void 0,jK=typeof queueMicrotask=="function"?queueMicrotask:typeof Jk<"u"?function(o){return Jk.resolve(null).then(o).catch(CK)}:Qk;function CK(o){setTimeout(function(){throw o})}function ho(o){return o==="head"}function eO(o,u){var m=u,v=0;do{var E=m.nextSibling;if(o.removeChild(m),E&&E.nodeType===8)if(m=E.data,m==="/$"||m==="/&"){if(v===0){o.removeChild(E),hc(u);return}v--}else if(m==="$"||m==="$?"||m==="$~"||m==="$!"||m==="&")v++;else if(m==="html")md(o.ownerDocument.documentElement);else if(m==="head"){m=o.ownerDocument.head,md(m);for(var R=m.firstChild;R;){var I=R.nextSibling,X=R.nodeName;R[ci]||X==="SCRIPT"||X==="STYLE"||X==="LINK"&&R.rel.toLowerCase()==="stylesheet"||m.removeChild(R),R=I}}else m==="body"&&md(o.ownerDocument.body);m=E}while(m);hc(u)}function tO(o,u){var m=o;o=0;do{var v=m.nextSibling;if(m.nodeType===1?u?(m._stashedDisplay=m.style.display,m.style.display="none"):(m.style.display=m._stashedDisplay||"",m.getAttribute("style")===""&&m.removeAttribute("style")):m.nodeType===3&&(u?(m._stashedText=m.nodeValue,m.nodeValue=""):m.nodeValue=m._stashedText||""),v&&v.nodeType===8)if(m=v.data,m==="/$"){if(o===0)break;o--}else m!=="$"&&m!=="$?"&&m!=="$~"&&m!=="$!"||o++;m=v}while(m)}function Cb(o){var u=o.firstChild;for(u&&u.nodeType===10&&(u=u.nextSibling);u;){var m=u;switch(u=u.nextSibling,m.nodeName){case"HTML":case"HEAD":case"BODY":Cb(m),Ou(m);continue;case"SCRIPT":case"STYLE":continue;case"LINK":if(m.rel.toLowerCase()==="stylesheet")continue}o.removeChild(m)}}function EK(o,u,m,v){for(;o.nodeType===1;){var E=m;if(o.nodeName.toLowerCase()!==u.toLowerCase()){if(!v&&(o.nodeName!=="INPUT"||o.type!=="hidden"))break}else if(v){if(!o[ci])switch(u){case"meta":if(!o.hasAttribute("itemprop"))break;return o;case"link":if(R=o.getAttribute("rel"),R==="stylesheet"&&o.hasAttribute("data-precedence"))break;if(R!==E.rel||o.getAttribute("href")!==(E.href==null||E.href===""?null:E.href)||o.getAttribute("crossorigin")!==(E.crossOrigin==null?null:E.crossOrigin)||o.getAttribute("title")!==(E.title==null?null:E.title))break;return o;case"style":if(o.hasAttribute("data-precedence"))break;return o;case"script":if(R=o.getAttribute("src"),(R!==(E.src==null?null:E.src)||o.getAttribute("type")!==(E.type==null?null:E.type)||o.getAttribute("crossorigin")!==(E.crossOrigin==null?null:E.crossOrigin))&&R&&o.hasAttribute("async")&&!o.hasAttribute("itemprop"))break;return o;default:return o}}else if(u==="input"&&o.type==="hidden"){var R=E.name==null?null:""+E.name;if(E.type==="hidden"&&o.getAttribute("name")===R)return o}else return o;if(o=kr(o.nextSibling),o===null)break}return null}function TK(o,u,m){if(u==="")return null;for(;o.nodeType!==3;)if((o.nodeType!==1||o.nodeName!=="INPUT"||o.type!=="hidden")&&!m||(o=kr(o.nextSibling),o===null))return null;return o}function nO(o,u){for(;o.nodeType!==8;)if((o.nodeType!==1||o.nodeName!=="INPUT"||o.type!=="hidden")&&!u||(o=kr(o.nextSibling),o===null))return null;return o}function Eb(o){return o.data==="$?"||o.data==="$~"}function Tb(o){return o.data==="$!"||o.data==="$?"&&o.ownerDocument.readyState!=="loading"}function AK(o,u){var m=o.ownerDocument;if(o.data==="$~")o._reactRetry=u;else if(o.data!=="$?"||m.readyState!=="loading")u();else{var v=function(){u(),m.removeEventListener("DOMContentLoaded",v)};m.addEventListener("DOMContentLoaded",v),o._reactRetry=v}}function kr(o){for(;o!=null;o=o.nextSibling){var u=o.nodeType;if(u===1||u===3)break;if(u===8){if(u=o.data,u==="$"||u==="$!"||u==="$?"||u==="$~"||u==="&"||u==="F!"||u==="F")break;if(u==="/$"||u==="/&")return null}}return o}var Ab=null;function rO(o){o=o.nextSibling;for(var u=0;o;){if(o.nodeType===8){var m=o.data;if(m==="/$"||m==="/&"){if(u===0)return kr(o.nextSibling);u--}else m!=="$"&&m!=="$!"&&m!=="$?"&&m!=="$~"&&m!=="&"||u++}o=o.nextSibling}return null}function aO(o){o=o.previousSibling;for(var u=0;o;){if(o.nodeType===8){var m=o.data;if(m==="$"||m==="$!"||m==="$?"||m==="$~"||m==="&"){if(u===0)return o;u--}else m!=="/$"&&m!=="/&"||u++}o=o.previousSibling}return null}function sO(o,u,m){switch(u=Hp(m),o){case"html":if(o=u.documentElement,!o)throw Error(r(452));return o;case"head":if(o=u.head,!o)throw Error(r(453));return o;case"body":if(o=u.body,!o)throw Error(r(454));return o;default:throw Error(r(451))}}function md(o){for(var u=o.attributes;u.length;)o.removeAttributeNode(u[0]);Ou(o)}var Or=new Map,oO=new Set;function Bp(o){return typeof o.getRootNode=="function"?o.getRootNode():o.nodeType===9?o:o.ownerDocument}var fs=K.d;K.d={f:RK,r:kK,D:OK,C:MK,L:DK,m:PK,X:IK,S:$K,M:LK};function RK(){var o=fs.f(),u=Pp();return o||u}function kK(o){var u=Bs(o);u!==null&&u.tag===5&&u.type==="form"?_R(u):fs.r(o)}var uc=typeof document>"u"?null:document;function iO(o,u,m){var v=uc;if(v&&typeof u=="string"&&u){var E=On(u);E='link[rel="'+o+'"][href="'+E+'"]',typeof m=="string"&&(E+='[crossorigin="'+m+'"]'),oO.has(E)||(oO.add(E),o={rel:o,crossOrigin:m,href:u},v.querySelector(E)===null&&(u=v.createElement("link"),Cn(u,"link",o),en(u),v.head.appendChild(u)))}}function OK(o){fs.D(o),iO("dns-prefetch",o,null)}function MK(o,u){fs.C(o,u),iO("preconnect",o,u)}function DK(o,u,m){fs.L(o,u,m);var v=uc;if(v&&o&&u){var E='link[rel="preload"][as="'+On(u)+'"]';u==="image"&&m&&m.imageSrcSet?(E+='[imagesrcset="'+On(m.imageSrcSet)+'"]',typeof m.imageSizes=="string"&&(E+='[imagesizes="'+On(m.imageSizes)+'"]')):E+='[href="'+On(o)+'"]';var R=E;switch(u){case"style":R=dc(o);break;case"script":R=fc(o)}Or.has(R)||(o=p({rel:"preload",href:u==="image"&&m&&m.imageSrcSet?void 0:o,as:u},m),Or.set(R,o),v.querySelector(E)!==null||u==="style"&&v.querySelector(gd(R))||u==="script"&&v.querySelector(yd(R))||(u=v.createElement("link"),Cn(u,"link",o),en(u),v.head.appendChild(u)))}}function PK(o,u){fs.m(o,u);var m=uc;if(m&&o){var v=u&&typeof u.as=="string"?u.as:"script",E='link[rel="modulepreload"][as="'+On(v)+'"][href="'+On(o)+'"]',R=E;switch(v){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":R=fc(o)}if(!Or.has(R)&&(o=p({rel:"modulepreload",href:o},u),Or.set(R,o),m.querySelector(E)===null)){switch(v){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":if(m.querySelector(yd(R)))return}v=m.createElement("link"),Cn(v,"link",o),en(v),m.head.appendChild(v)}}}function $K(o,u,m){fs.S(o,u,m);var v=uc;if(v&&o){var E=Ws(v).hoistableStyles,R=dc(o);u=u||"default";var I=E.get(R);if(!I){var X={loading:0,preload:null};if(I=v.querySelector(gd(R)))X.loading=5;else{o=p({rel:"stylesheet",href:o,"data-precedence":u},m),(m=Or.get(R))&&Rb(o,m);var oe=I=v.createElement("link");en(oe),Cn(oe,"link",o),oe._p=new Promise(function(de,ge){oe.onload=de,oe.onerror=ge}),oe.addEventListener("load",function(){X.loading|=1}),oe.addEventListener("error",function(){X.loading|=2}),X.loading|=4,Vp(I,u,v)}I={type:"stylesheet",instance:I,count:1,state:X},E.set(R,I)}}}function IK(o,u){fs.X(o,u);var m=uc;if(m&&o){var v=Ws(m).hoistableScripts,E=fc(o),R=v.get(E);R||(R=m.querySelector(yd(E)),R||(o=p({src:o,async:!0},u),(u=Or.get(E))&&kb(o,u),R=m.createElement("script"),en(R),Cn(R,"link",o),m.head.appendChild(R)),R={type:"script",instance:R,count:1,state:null},v.set(E,R))}}function LK(o,u){fs.M(o,u);var m=uc;if(m&&o){var v=Ws(m).hoistableScripts,E=fc(o),R=v.get(E);R||(R=m.querySelector(yd(E)),R||(o=p({src:o,async:!0,type:"module"},u),(u=Or.get(E))&&kb(o,u),R=m.createElement("script"),en(R),Cn(R,"link",o),m.head.appendChild(R)),R={type:"script",instance:R,count:1,state:null},v.set(E,R))}}function lO(o,u,m,v){var E=(E=ee.current)?Bp(E):null;if(!E)throw Error(r(446));switch(o){case"meta":case"title":return null;case"style":return typeof m.precedence=="string"&&typeof m.href=="string"?(u=dc(m.href),m=Ws(E).hoistableStyles,v=m.get(u),v||(v={type:"style",instance:null,count:0,state:null},m.set(u,v)),v):{type:"void",instance:null,count:0,state:null};case"link":if(m.rel==="stylesheet"&&typeof m.href=="string"&&typeof m.precedence=="string"){o=dc(m.href);var R=Ws(E).hoistableStyles,I=R.get(o);if(I||(E=E.ownerDocument||E,I={type:"stylesheet",instance:null,count:0,state:{loading:0,preload:null}},R.set(o,I),(R=E.querySelector(gd(o)))&&!R._p&&(I.instance=R,I.state.loading=5),Or.has(o)||(m={rel:"preload",as:"style",href:m.href,crossOrigin:m.crossOrigin,integrity:m.integrity,media:m.media,hrefLang:m.hrefLang,referrerPolicy:m.referrerPolicy},Or.set(o,m),R||zK(E,o,m,I.state))),u&&v===null)throw Error(r(528,""));return I}if(u&&v!==null)throw Error(r(529,""));return null;case"script":return u=m.async,m=m.src,typeof m=="string"&&u&&typeof u!="function"&&typeof u!="symbol"?(u=fc(m),m=Ws(E).hoistableScripts,v=m.get(u),v||(v={type:"script",instance:null,count:0,state:null},m.set(u,v)),v):{type:"void",instance:null,count:0,state:null};default:throw Error(r(444,o))}}function dc(o){return'href="'+On(o)+'"'}function gd(o){return'link[rel="stylesheet"]['+o+"]"}function cO(o){return p({},o,{"data-precedence":o.precedence,precedence:null})}function zK(o,u,m,v){o.querySelector('link[rel="preload"][as="style"]['+u+"]")?v.loading=1:(u=o.createElement("link"),v.preload=u,u.addEventListener("load",function(){return v.loading|=1}),u.addEventListener("error",function(){return v.loading|=2}),Cn(u,"link",m),en(u),o.head.appendChild(u))}function fc(o){return'[src="'+On(o)+'"]'}function yd(o){return"script[async]"+o}function uO(o,u,m){if(u.count++,u.instance===null)switch(u.type){case"style":var v=o.querySelector('style[data-href~="'+On(m.href)+'"]');if(v)return u.instance=v,en(v),v;var E=p({},m,{"data-href":m.href,"data-precedence":m.precedence,href:null,precedence:null});return v=(o.ownerDocument||o).createElement("style"),en(v),Cn(v,"style",E),Vp(v,m.precedence,o),u.instance=v;case"stylesheet":E=dc(m.href);var R=o.querySelector(gd(E));if(R)return u.state.loading|=4,u.instance=R,en(R),R;v=cO(m),(E=Or.get(E))&&Rb(v,E),R=(o.ownerDocument||o).createElement("link"),en(R);var I=R;return I._p=new Promise(function(X,oe){I.onload=X,I.onerror=oe}),Cn(R,"link",v),u.state.loading|=4,Vp(R,m.precedence,o),u.instance=R;case"script":return R=fc(m.src),(E=o.querySelector(yd(R)))?(u.instance=E,en(E),E):(v=m,(E=Or.get(R))&&(v=p({},m),kb(v,E)),o=o.ownerDocument||o,E=o.createElement("script"),en(E),Cn(E,"link",v),o.head.appendChild(E),u.instance=E);case"void":return null;default:throw Error(r(443,u.type))}else u.type==="stylesheet"&&(u.state.loading&4)===0&&(v=u.instance,u.state.loading|=4,Vp(v,m.precedence,o));return u.instance}function Vp(o,u,m){for(var v=m.querySelectorAll('link[rel="stylesheet"][data-precedence],style[data-precedence]'),E=v.length?v[v.length-1]:null,R=E,I=0;I<v.length;I++){var X=v[I];if(X.dataset.precedence===u)R=X;else if(R!==E)break}R?R.parentNode.insertBefore(o,R.nextSibling):(u=m.nodeType===9?m.head:m,u.insertBefore(o,u.firstChild))}function Rb(o,u){o.crossOrigin==null&&(o.crossOrigin=u.crossOrigin),o.referrerPolicy==null&&(o.referrerPolicy=u.referrerPolicy),o.title==null&&(o.title=u.title)}function kb(o,u){o.crossOrigin==null&&(o.crossOrigin=u.crossOrigin),o.referrerPolicy==null&&(o.referrerPolicy=u.referrerPolicy),o.integrity==null&&(o.integrity=u.integrity)}var Wp=null;function dO(o,u,m){if(Wp===null){var v=new Map,E=Wp=new Map;E.set(m,v)}else E=Wp,v=E.get(m),v||(v=new Map,E.set(m,v));if(v.has(o))return v;for(v.set(o,null),m=m.getElementsByTagName(o),E=0;E<m.length;E++){var R=m[E];if(!(R[ci]||R[un]||o==="link"&&R.getAttribute("rel")==="stylesheet")&&R.namespaceURI!=="http://www.w3.org/2000/svg"){var I=R.getAttribute(u)||"";I=o+I;var X=v.get(I);X?X.push(R):v.set(I,[R])}}return v}function fO(o,u,m){o=o.ownerDocument||o,o.head.insertBefore(m,u==="title"?o.querySelector("head > title"):null)}function qK(o,u,m){if(m===1||u.itemProp!=null)return!1;switch(o){case"meta":case"title":return!0;case"style":if(typeof u.precedence!="string"||typeof u.href!="string"||u.href==="")break;return!0;case"link":if(typeof u.rel!="string"||typeof u.href!="string"||u.href===""||u.onLoad||u.onError)break;switch(u.rel){case"stylesheet":return o=u.disabled,typeof u.precedence=="string"&&o==null;default:return!0}case"script":if(u.async&&typeof u.async!="function"&&typeof u.async!="symbol"&&!u.onLoad&&!u.onError&&u.src&&typeof u.src=="string")return!0}return!1}function hO(o){return!(o.type==="stylesheet"&&(o.state.loading&3)===0)}function FK(o,u,m,v){if(m.type==="stylesheet"&&(typeof v.media!="string"||matchMedia(v.media).matches!==!1)&&(m.state.loading&4)===0){if(m.instance===null){var E=dc(v.href),R=u.querySelector(gd(E));if(R){u=R._p,u!==null&&typeof u=="object"&&typeof u.then=="function"&&(o.count++,o=Gp.bind(o),u.then(o,o)),m.state.loading|=4,m.instance=R,en(R);return}R=u.ownerDocument||u,v=cO(v),(E=Or.get(E))&&Rb(v,E),R=R.createElement("link"),en(R);var I=R;I._p=new Promise(function(X,oe){I.onload=X,I.onerror=oe}),Cn(R,"link",v),m.instance=R}o.stylesheets===null&&(o.stylesheets=new Map),o.stylesheets.set(m,u),(u=m.state.preload)&&(m.state.loading&3)===0&&(o.count++,m=Gp.bind(o),u.addEventListener("load",m),u.addEventListener("error",m))}}var Ob=0;function UK(o,u){return o.stylesheets&&o.count===0&&Yp(o,o.stylesheets),0<o.count||0<o.imgCount?function(m){var v=setTimeout(function(){if(o.stylesheets&&Yp(o,o.stylesheets),o.unsuspend){var R=o.unsuspend;o.unsuspend=null,R()}},6e4+u);0<o.imgBytes&&Ob===0&&(Ob=62500*SK());var E=setTimeout(function(){if(o.waitingForImages=!1,o.count===0&&(o.stylesheets&&Yp(o,o.stylesheets),o.unsuspend)){var R=o.unsuspend;o.unsuspend=null,R()}},(o.imgBytes>Ob?50:800)+u);return o.unsuspend=m,function(){o.unsuspend=null,clearTimeout(v),clearTimeout(E)}}:null}function Gp(){if(this.count--,this.count===0&&(this.imgCount===0||!this.waitingForImages)){if(this.stylesheets)Yp(this,this.stylesheets);else if(this.unsuspend){var o=this.unsuspend;this.unsuspend=null,o()}}}var Kp=null;function Yp(o,u){o.stylesheets=null,o.unsuspend!==null&&(o.count++,Kp=new Map,u.forEach(HK,o),Kp=null,Gp.call(o))}function HK(o,u){if(!(u.state.loading&4)){var m=Kp.get(o);if(m)var v=m.get(null);else{m=new Map,Kp.set(o,m);for(var E=o.querySelectorAll("link[data-precedence],style[data-precedence]"),R=0;R<E.length;R++){var I=E[R];(I.nodeName==="LINK"||I.getAttribute("media")!=="not all")&&(m.set(I.dataset.precedence,I),v=I)}v&&m.set(null,v)}E=u.instance,I=E.getAttribute("data-precedence"),R=m.get(I)||v,R===v&&m.set(null,E),m.set(I,E),this.count++,v=Gp.bind(this),E.addEventListener("load",v),E.addEventListener("error",v),R?R.parentNode.insertBefore(E,R.nextSibling):(o=o.nodeType===9?o.head:o,o.insertBefore(E,o.firstChild)),u.state.loading|=4}}var vd={$$typeof:j,Provider:null,Consumer:null,_currentValue:H,_currentValue2:H,_threadCount:0};function BK(o,u,m,v,E,R,I,X,oe){this.tag=1,this.containerInfo=o,this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.callbackNode=this.next=this.pendingContext=this.context=this.cancelPendingCommit=null,this.callbackPriority=0,this.expirationTimes=Au(-1),this.entangledLanes=this.shellSuspendCounter=this.errorRecoveryDisabledLanes=this.expiredLanes=this.warmLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=Au(0),this.hiddenUpdates=Au(null),this.identifierPrefix=v,this.onUncaughtError=E,this.onCaughtError=R,this.onRecoverableError=I,this.pooledCache=null,this.pooledCacheLanes=0,this.formState=oe,this.incompleteTransitions=new Map}function pO(o,u,m,v,E,R,I,X,oe,de,ge,be){return o=new BK(o,u,m,I,oe,de,ge,be,X),u=1,R===!0&&(u|=24),R=sr(3,null,null,u),o.current=R,R.stateNode=o,u=dx(),u.refCount++,o.pooledCache=u,u.refCount++,R.memoizedState={element:v,isDehydrated:m,cache:u},mx(R),o}function mO(o){return o?(o=Hl,o):Hl}function gO(o,u,m,v,E,R){E=mO(E),v.context===null?v.context=E:v.pendingContext=E,v=to(u),v.payload={element:m},R=R===void 0?null:R,R!==null&&(v.callback=R),m=no(o,v,u),m!==null&&(er(m,o,u),Xu(m,o,u))}function yO(o,u){if(o=o.memoizedState,o!==null&&o.dehydrated!==null){var m=o.retryLane;o.retryLane=m!==0&&m<u?m:u}}function Mb(o,u){yO(o,u),(o=o.alternate)&&yO(o,u)}function vO(o){if(o.tag===13||o.tag===31){var u=hi(o,67108864);u!==null&&er(u,o,67108864),Mb(o,67108864)}}function xO(o){if(o.tag===13||o.tag===31){var u=ur();u=Ru(u);var m=hi(o,u);m!==null&&er(m,o,u),Mb(o,u)}}var Xp=!0;function VK(o,u,m,v){var E=P.T;P.T=null;var R=K.p;try{K.p=2,Db(o,u,m,v)}finally{K.p=R,P.T=E}}function WK(o,u,m,v){var E=P.T;P.T=null;var R=K.p;try{K.p=8,Db(o,u,m,v)}finally{K.p=R,P.T=E}}function Db(o,u,m,v){if(Xp){var E=Pb(v);if(E===null)bb(o,u,v,Zp,m),wO(o,v);else if(KK(E,o,u,m,v))v.stopPropagation();else if(wO(o,v),u&4&&-1<GK.indexOf(o)){for(;E!==null;){var R=Bs(E);if(R!==null)switch(R.tag){case 3:if(R=R.stateNode,R.current.memoizedState.isDehydrated){var I=Ga(R.pendingLanes);if(I!==0){var X=R;for(X.pendingLanes|=2,X.entangledLanes|=2;I;){var oe=1<<31-Fn(I);X.entanglements[1]|=oe,I&=~oe}ba(R),(ut&6)===0&&(Mp=Je()+500,fd(0))}}break;case 31:case 13:X=hi(R,2),X!==null&&er(X,R,2),Pp(),Mb(R,2)}if(R=Pb(v),R===null&&bb(o,u,v,Zp,m),R===E)break;E=R}E!==null&&v.stopPropagation()}else bb(o,u,v,null,m)}}function Pb(o){return o=I0(o),$b(o)}var Zp=null;function $b(o){if(Zp=null,o=Hs(o),o!==null){var u=s(o);if(u===null)o=null;else{var m=u.tag;if(m===13){if(o=i(u),o!==null)return o;o=null}else if(m===31){if(o=l(u),o!==null)return o;o=null}else if(m===3){if(u.stateNode.current.memoizedState.isDehydrated)return u.tag===3?u.stateNode.containerInfo:null;o=null}else u!==o&&(o=null)}}return Zp=o,null}function bO(o){switch(o){case"beforetoggle":case"cancel":case"click":case"close":case"contextmenu":case"copy":case"cut":case"auxclick":case"dblclick":case"dragend":case"dragstart":case"drop":case"focusin":case"focusout":case"input":case"invalid":case"keydown":case"keypress":case"keyup":case"mousedown":case"mouseup":case"paste":case"pause":case"play":case"pointercancel":case"pointerdown":case"pointerup":case"ratechange":case"reset":case"resize":case"seeked":case"submit":case"toggle":case"touchcancel":case"touchend":case"touchstart":case"volumechange":case"change":case"selectionchange":case"textInput":case"compositionstart":case"compositionend":case"compositionupdate":case"beforeblur":case"afterblur":case"beforeinput":case"blur":case"fullscreenchange":case"focus":case"hashchange":case"popstate":case"select":case"selectstart":return 2;case"drag":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"mousemove":case"mouseout":case"mouseover":case"pointermove":case"pointerout":case"pointerover":case"scroll":case"touchmove":case"wheel":case"mouseenter":case"mouseleave":case"pointerenter":case"pointerleave":return 8;case"message":switch(qt()){case ln:return 2;case Sn:return 8;case cn:case Wa:return 32;case Fr:return 268435456;default:return 32}default:return 32}}var Ib=!1,po=null,mo=null,go=null,xd=new Map,bd=new Map,yo=[],GK="mousedown mouseup touchcancel touchend touchstart auxclick dblclick pointercancel pointerdown pointerup dragend dragstart drop compositionend compositionstart keydown keypress keyup input textInput copy cut paste click change contextmenu reset".split(" ");function wO(o,u){switch(o){case"focusin":case"focusout":po=null;break;case"dragenter":case"dragleave":mo=null;break;case"mouseover":case"mouseout":go=null;break;case"pointerover":case"pointerout":xd.delete(u.pointerId);break;case"gotpointercapture":case"lostpointercapture":bd.delete(u.pointerId)}}function wd(o,u,m,v,E,R){return o===null||o.nativeEvent!==R?(o={blockedOn:u,domEventName:m,eventSystemFlags:v,nativeEvent:R,targetContainers:[E]},u!==null&&(u=Bs(u),u!==null&&vO(u)),o):(o.eventSystemFlags|=v,u=o.targetContainers,E!==null&&u.indexOf(E)===-1&&u.push(E),o)}function KK(o,u,m,v,E){switch(u){case"focusin":return po=wd(po,o,u,m,v,E),!0;case"dragenter":return mo=wd(mo,o,u,m,v,E),!0;case"mouseover":return go=wd(go,o,u,m,v,E),!0;case"pointerover":var R=E.pointerId;return xd.set(R,wd(xd.get(R)||null,o,u,m,v,E)),!0;case"gotpointercapture":return R=E.pointerId,bd.set(R,wd(bd.get(R)||null,o,u,m,v,E)),!0}return!1}function SO(o){var u=Hs(o.target);if(u!==null){var m=s(u);if(m!==null){if(u=m.tag,u===13){if(u=i(m),u!==null){o.blockedOn=u,zh(o.priority,function(){xO(m)});return}}else if(u===31){if(u=l(m),u!==null){o.blockedOn=u,zh(o.priority,function(){xO(m)});return}}else if(u===3&&m.stateNode.current.memoizedState.isDehydrated){o.blockedOn=m.tag===3?m.stateNode.containerInfo:null;return}}}o.blockedOn=null}function Qp(o){if(o.blockedOn!==null)return!1;for(var u=o.targetContainers;0<u.length;){var m=Pb(o.nativeEvent);if(m===null){m=o.nativeEvent;var v=new m.constructor(m.type,m);$0=v,m.target.dispatchEvent(v),$0=null}else return u=Bs(m),u!==null&&vO(u),o.blockedOn=m,!1;u.shift()}return!0}function _O(o,u,m){Qp(o)&&m.delete(u)}function YK(){Ib=!1,po!==null&&Qp(po)&&(po=null),mo!==null&&Qp(mo)&&(mo=null),go!==null&&Qp(go)&&(go=null),xd.forEach(_O),bd.forEach(_O)}function Jp(o,u){o.blockedOn===u&&(o.blockedOn=null,Ib||(Ib=!0,e.unstable_scheduleCallback(e.unstable_NormalPriority,YK)))}var em=null;function NO(o){em!==o&&(em=o,e.unstable_scheduleCallback(e.unstable_NormalPriority,function(){em===o&&(em=null);for(var u=0;u<o.length;u+=3){var m=o[u],v=o[u+1],E=o[u+2];if(typeof v!="function"){if($b(v||m)===null)continue;break}var R=Bs(m);R!==null&&(o.splice(u,3),u-=3,Px(R,{pending:!0,data:E,method:m.method,action:v},v,E))}}))}function hc(o){function u(oe){return Jp(oe,o)}po!==null&&Jp(po,o),mo!==null&&Jp(mo,o),go!==null&&Jp(go,o),xd.forEach(u),bd.forEach(u);for(var m=0;m<yo.length;m++){var v=yo[m];v.blockedOn===o&&(v.blockedOn=null)}for(;0<yo.length&&(m=yo[0],m.blockedOn===null);)SO(m),m.blockedOn===null&&yo.shift();if(m=(o.ownerDocument||o).$$reactFormReplay,m!=null)for(v=0;v<m.length;v+=3){var E=m[v],R=m[v+1],I=E[kn]||null;if(typeof R=="function")I||NO(m);else if(I){var X=null;if(R&&R.hasAttribute("formAction")){if(E=R,I=R[kn]||null)X=I.formAction;else if($b(E)!==null)continue}else X=I.action;typeof X=="function"?m[v+1]=X:(m.splice(v,3),v-=3),NO(m)}}}function jO(){function o(R){R.canIntercept&&R.info==="react-transition"&&R.intercept({handler:function(){return new Promise(function(I){return E=I})},focusReset:"manual",scroll:"manual"})}function u(){E!==null&&(E(),E=null),v||setTimeout(m,20)}function m(){if(!v&&!navigation.transition){var R=navigation.currentEntry;R&&R.url!=null&&navigation.navigate(R.url,{state:R.getState(),info:"react-transition",history:"replace"})}}if(typeof navigation=="object"){var v=!1,E=null;return navigation.addEventListener("navigate",o),navigation.addEventListener("navigatesuccess",u),navigation.addEventListener("navigateerror",u),setTimeout(m,100),function(){v=!0,navigation.removeEventListener("navigate",o),navigation.removeEventListener("navigatesuccess",u),navigation.removeEventListener("navigateerror",u),E!==null&&(E(),E=null)}}}function Lb(o){this._internalRoot=o}tm.prototype.render=Lb.prototype.render=function(o){var u=this._internalRoot;if(u===null)throw Error(r(409));var m=u.current,v=ur();gO(m,v,o,u,null,null)},tm.prototype.unmount=Lb.prototype.unmount=function(){var o=this._internalRoot;if(o!==null){this._internalRoot=null;var u=o.containerInfo;gO(o.current,2,null,o,null,null),Pp(),u[Ka]=null}};function tm(o){this._internalRoot=o}tm.prototype.unstable_scheduleHydration=function(o){if(o){var u=Lh();o={blockedOn:null,target:o,priority:u};for(var m=0;m<yo.length&&u!==0&&u<yo[m].priority;m++);yo.splice(m,0,o),m===0&&SO(o)}};var CO=t.version;if(CO!=="19.2.0")throw Error(r(527,CO,"19.2.0"));K.findDOMNode=function(o){var u=o._reactInternals;if(u===void 0)throw typeof o.render=="function"?Error(r(188)):(o=Object.keys(o).join(","),Error(r(268,o)));return o=f(u),o=o!==null?h(o):null,o=o===null?null:o.stateNode,o};var XK={bundleType:0,version:"19.2.0",rendererPackageName:"react-dom",currentDispatcherRef:P,reconcilerVersion:"19.2.0"};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"){var nm=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!nm.isDisabled&&nm.supportsFiber)try{Rn=nm.inject(XK),Ft=nm}catch{}}return _d.createRoot=function(o,u){if(!a(o))throw Error(r(299));var m=!1,v="",E=MR,R=DR,I=PR;return u!=null&&(u.unstable_strictMode===!0&&(m=!0),u.identifierPrefix!==void 0&&(v=u.identifierPrefix),u.onUncaughtError!==void 0&&(E=u.onUncaughtError),u.onCaughtError!==void 0&&(R=u.onCaughtError),u.onRecoverableError!==void 0&&(I=u.onRecoverableError)),u=pO(o,1,!1,null,null,m,v,null,E,R,I,jO),o[Ka]=u.current,xb(o),new Lb(u)},_d.hydrateRoot=function(o,u,m){if(!a(o))throw Error(r(299));var v=!1,E="",R=MR,I=DR,X=PR,oe=null;return m!=null&&(m.unstable_strictMode===!0&&(v=!0),m.identifierPrefix!==void 0&&(E=m.identifierPrefix),m.onUncaughtError!==void 0&&(R=m.onUncaughtError),m.onCaughtError!==void 0&&(I=m.onCaughtError),m.onRecoverableError!==void 0&&(X=m.onRecoverableError),m.formState!==void 0&&(oe=m.formState)),u=pO(o,1,!0,u,m??null,v,E,oe,R,I,X,jO),u.context=mO(null),m=u.current,v=ur(),v=Ru(v),E=to(v),E.callback=null,no(m,E,v),m=v,u.current.lanes=m,li(u,m),ba(u),o[Ka]=u.current,xb(o),new tm(u)},_d.version="19.2.0",_d}var $O;function cY(){if($O)return Ub.exports;$O=1;function e(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(e)}catch(t){console.error(t)}}return e(),Ub.exports=lY(),Ub.exports}var uY=cY();/**
|
|
50
|
+
* react-router v7.9.5
|
|
51
|
+
*
|
|
52
|
+
* Copyright (c) Remix Software Inc.
|
|
53
|
+
*
|
|
54
|
+
* This source code is licensed under the MIT license found in the
|
|
55
|
+
* LICENSE.md file in the root directory of this source tree.
|
|
56
|
+
*
|
|
57
|
+
* @license MIT
|
|
58
|
+
*/var IO="popstate";function dY(e={}){function t(r,a){let{pathname:s,search:i,hash:l}=r.location;return Rj("",{pathname:s,search:i,hash:l},a.state&&a.state.usr||null,a.state&&a.state.key||"default")}function n(r,a){return typeof a=="string"?a:df(a)}return hY(t,n,null,e)}function Ut(e,t){if(e===!1||e===null||typeof e>"u")throw new Error(t)}function Oa(e,t){if(!e){typeof console<"u"&&console.warn(t);try{throw new Error(t)}catch{}}}function fY(){return Math.random().toString(36).substring(2,10)}function LO(e,t){return{usr:e.state,key:e.key,idx:t}}function Rj(e,t,n=null,r){return{pathname:typeof e=="string"?e:e.pathname,search:"",hash:"",...typeof t=="string"?lu(t):t,state:n,key:t&&t.key||r||fY()}}function df({pathname:e="/",search:t="",hash:n=""}){return t&&t!=="?"&&(e+=t.charAt(0)==="?"?t:"?"+t),n&&n!=="#"&&(e+=n.charAt(0)==="#"?n:"#"+n),e}function lu(e){let t={};if(e){let n=e.indexOf("#");n>=0&&(t.hash=e.substring(n),e=e.substring(0,n));let r=e.indexOf("?");r>=0&&(t.search=e.substring(r),e=e.substring(0,r)),e&&(t.pathname=e)}return t}function hY(e,t,n,r={}){let{window:a=document.defaultView,v5Compat:s=!1}=r,i=a.history,l="POP",d=null,f=h();f==null&&(f=0,i.replaceState({...i.state,idx:f},""));function h(){return(i.state||{idx:null}).idx}function p(){l="POP";let b=h(),x=b==null?null:b-f;f=b,d&&d({action:l,location:w.location,delta:x})}function g(b,x){l="PUSH";let _=Rj(w.location,b,x);f=h()+1;let j=LO(_,f),C=w.createHref(_);try{i.pushState(j,"",C)}catch(T){if(T instanceof DOMException&&T.name==="DataCloneError")throw T;a.location.assign(C)}s&&d&&d({action:l,location:w.location,delta:1})}function y(b,x){l="REPLACE";let _=Rj(w.location,b,x);f=h();let j=LO(_,f),C=w.createHref(_);i.replaceState(j,"",C),s&&d&&d({action:l,location:w.location,delta:0})}function S(b){return pY(b)}let w={get action(){return l},get location(){return e(a,i)},listen(b){if(d)throw new Error("A history only accepts one active listener");return a.addEventListener(IO,p),d=b,()=>{a.removeEventListener(IO,p),d=null}},createHref(b){return t(a,b)},createURL:S,encodeLocation(b){let x=S(b);return{pathname:x.pathname,search:x.search,hash:x.hash}},push:g,replace:y,go(b){return i.go(b)}};return w}function pY(e,t=!1){let n="http://localhost";typeof window<"u"&&(n=window.location.origin!=="null"?window.location.origin:window.location.href),Ut(n,"No window.location.(origin|href) available to create URL");let r=typeof e=="string"?e:df(e);return r=r.replace(/ $/,"%20"),!t&&r.startsWith("//")&&(r=n+r),new URL(r,n)}function dz(e,t,n="/"){return mY(e,t,n,!1)}function mY(e,t,n,r){let a=typeof t=="string"?lu(t):t,s=As(a.pathname||"/",n);if(s==null)return null;let i=fz(e);gY(i);let l=null;for(let d=0;l==null&&d<i.length;++d){let f=EY(s);l=jY(i[d],f,r)}return l}function fz(e,t=[],n=[],r="",a=!1){let s=(i,l,d=a,f)=>{let h={relativePath:f===void 0?i.path||"":f,caseSensitive:i.caseSensitive===!0,childrenIndex:l,route:i};if(h.relativePath.startsWith("/")){if(!h.relativePath.startsWith(r)&&d)return;Ut(h.relativePath.startsWith(r),`Absolute route path "${h.relativePath}" nested under path "${r}" is not valid. An absolute child route path must start with the combined path of all its parent routes.`),h.relativePath=h.relativePath.slice(r.length)}let p=Cs([r,h.relativePath]),g=n.concat(h);i.children&&i.children.length>0&&(Ut(i.index!==!0,`Index routes must not have child routes. Please remove all child routes from route path "${p}".`),fz(i.children,t,g,p,d)),!(i.path==null&&!i.index)&&t.push({path:p,score:_Y(p,i.index),routesMeta:g})};return e.forEach((i,l)=>{var d;if(i.path===""||!((d=i.path)!=null&&d.includes("?")))s(i,l);else for(let f of hz(i.path))s(i,l,!0,f)}),t}function hz(e){let t=e.split("/");if(t.length===0)return[];let[n,...r]=t,a=n.endsWith("?"),s=n.replace(/\?$/,"");if(r.length===0)return a?[s,""]:[s];let i=hz(r.join("/")),l=[];return l.push(...i.map(d=>d===""?s:[s,d].join("/"))),a&&l.push(...i),l.map(d=>e.startsWith("/")&&d===""?"/":d)}function gY(e){e.sort((t,n)=>t.score!==n.score?n.score-t.score:NY(t.routesMeta.map(r=>r.childrenIndex),n.routesMeta.map(r=>r.childrenIndex)))}var yY=/^:[\w-]+$/,vY=3,xY=2,bY=1,wY=10,SY=-2,zO=e=>e==="*";function _Y(e,t){let n=e.split("/"),r=n.length;return n.some(zO)&&(r+=SY),t&&(r+=xY),n.filter(a=>!zO(a)).reduce((a,s)=>a+(yY.test(s)?vY:s===""?bY:wY),r)}function NY(e,t){return e.length===t.length&&e.slice(0,-1).every((r,a)=>r===t[a])?e[e.length-1]-t[t.length-1]:0}function jY(e,t,n=!1){let{routesMeta:r}=e,a={},s="/",i=[];for(let l=0;l<r.length;++l){let d=r[l],f=l===r.length-1,h=s==="/"?t:t.slice(s.length)||"/",p=Wg({path:d.relativePath,caseSensitive:d.caseSensitive,end:f},h),g=d.route;if(!p&&f&&n&&!r[r.length-1].route.index&&(p=Wg({path:d.relativePath,caseSensitive:d.caseSensitive,end:!1},h)),!p)return null;Object.assign(a,p.params),i.push({params:a,pathname:Cs([s,p.pathname]),pathnameBase:kY(Cs([s,p.pathnameBase])),route:g}),p.pathnameBase!=="/"&&(s=Cs([s,p.pathnameBase]))}return i}function Wg(e,t){typeof e=="string"&&(e={path:e,caseSensitive:!1,end:!0});let[n,r]=CY(e.path,e.caseSensitive,e.end),a=t.match(n);if(!a)return null;let s=a[0],i=s.replace(/(.)\/+$/,"$1"),l=a.slice(1);return{params:r.reduce((f,{paramName:h,isOptional:p},g)=>{if(h==="*"){let S=l[g]||"";i=s.slice(0,s.length-S.length).replace(/(.)\/+$/,"$1")}const y=l[g];return p&&!y?f[h]=void 0:f[h]=(y||"").replace(/%2F/g,"/"),f},{}),pathname:s,pathnameBase:i,pattern:e}}function CY(e,t=!1,n=!0){Oa(e==="*"||!e.endsWith("*")||e.endsWith("/*"),`Route path "${e}" will be treated as if it were "${e.replace(/\*$/,"/*")}" because the \`*\` character must always follow a \`/\` in the pattern. To get rid of this warning, please change the route path to "${e.replace(/\*$/,"/*")}".`);let r=[],a="^"+e.replace(/\/*\*?$/,"").replace(/^\/*/,"/").replace(/[\\.*+^${}|()[\]]/g,"\\$&").replace(/\/:([\w-]+)(\?)?/g,(i,l,d)=>(r.push({paramName:l,isOptional:d!=null}),d?"/?([^\\/]+)?":"/([^\\/]+)")).replace(/\/([\w-]+)\?(\/|$)/g,"(/$1)?$2");return e.endsWith("*")?(r.push({paramName:"*"}),a+=e==="*"||e==="/*"?"(.*)$":"(?:\\/(.+)|\\/*)$"):n?a+="\\/*$":e!==""&&e!=="/"&&(a+="(?:(?=\\/|$))"),[new RegExp(a,t?void 0:"i"),r]}function EY(e){try{return e.split("/").map(t=>decodeURIComponent(t).replace(/\//g,"%2F")).join("/")}catch(t){return Oa(!1,`The URL path "${e}" could not be decoded because it is a malformed URL segment. This is probably due to a bad percent encoding (${t}).`),e}}function As(e,t){if(t==="/")return e;if(!e.toLowerCase().startsWith(t.toLowerCase()))return null;let n=t.endsWith("/")?t.length-1:t.length,r=e.charAt(n);return r&&r!=="/"?null:e.slice(n)||"/"}function TY(e,t="/"){let{pathname:n,search:r="",hash:a=""}=typeof e=="string"?lu(e):e;return{pathname:n?n.startsWith("/")?n:AY(n,t):t,search:OY(r),hash:MY(a)}}function AY(e,t){let n=t.replace(/\/+$/,"").split("/");return e.split("/").forEach(a=>{a===".."?n.length>1&&n.pop():a!=="."&&n.push(a)}),n.length>1?n.join("/"):"/"}function Vb(e,t,n,r){return`Cannot include a '${e}' character in a manually specified \`to.${t}\` field [${JSON.stringify(r)}]. Please separate it out to the \`to.${n}\` field. Alternatively you may provide the full path as a string in <Link to="..."> and the router will parse it for you.`}function RY(e){return e.filter((t,n)=>n===0||t.route.path&&t.route.path.length>0)}function pz(e){let t=RY(e);return t.map((n,r)=>r===t.length-1?n.pathname:n.pathnameBase)}function mz(e,t,n,r=!1){let a;typeof e=="string"?a=lu(e):(a={...e},Ut(!a.pathname||!a.pathname.includes("?"),Vb("?","pathname","search",a)),Ut(!a.pathname||!a.pathname.includes("#"),Vb("#","pathname","hash",a)),Ut(!a.search||!a.search.includes("#"),Vb("#","search","hash",a)));let s=e===""||a.pathname==="",i=s?"/":a.pathname,l;if(i==null)l=n;else{let p=t.length-1;if(!r&&i.startsWith("..")){let g=i.split("/");for(;g[0]==="..";)g.shift(),p-=1;a.pathname=g.join("/")}l=p>=0?t[p]:"/"}let d=TY(a,l),f=i&&i!=="/"&&i.endsWith("/"),h=(s||i===".")&&n.endsWith("/");return!d.pathname.endsWith("/")&&(f||h)&&(d.pathname+="/"),d}var Cs=e=>e.join("/").replace(/\/\/+/g,"/"),kY=e=>e.replace(/\/+$/,"").replace(/^\/*/,"/"),OY=e=>!e||e==="?"?"":e.startsWith("?")?e:"?"+e,MY=e=>!e||e==="#"?"":e.startsWith("#")?e:"#"+e;function DY(e){return e!=null&&typeof e.status=="number"&&typeof e.statusText=="string"&&typeof e.internal=="boolean"&&"data"in e}Object.getOwnPropertyNames(Object.prototype).sort().join("\0");var gz=["POST","PUT","PATCH","DELETE"];new Set(gz);var PY=["GET",...gz];new Set(PY);var cu=N.createContext(null);cu.displayName="DataRouter";var Oy=N.createContext(null);Oy.displayName="DataRouterState";N.createContext(!1);var yz=N.createContext({isTransitioning:!1});yz.displayName="ViewTransition";var $Y=N.createContext(new Map);$Y.displayName="Fetchers";var IY=N.createContext(null);IY.displayName="Await";var $a=N.createContext(null);$a.displayName="Navigation";var Uf=N.createContext(null);Uf.displayName="Location";var Ia=N.createContext({outlet:null,matches:[],isDataRoute:!1});Ia.displayName="Route";var HC=N.createContext(null);HC.displayName="RouteError";function LY(e,{relative:t}={}){Ut(Hf(),"useHref() may be used only in the context of a <Router> component.");let{basename:n,navigator:r}=N.useContext($a),{hash:a,pathname:s,search:i}=Bf(e,{relative:t}),l=s;return n!=="/"&&(l=s==="/"?n:Cs([n,s])),r.createHref({pathname:l,search:i,hash:a})}function Hf(){return N.useContext(Uf)!=null}function il(){return Ut(Hf(),"useLocation() may be used only in the context of a <Router> component."),N.useContext(Uf).location}var vz="You should call navigate() in a React.useEffect(), not when your component is first rendered.";function xz(e){N.useContext($a).static||N.useLayoutEffect(e)}function My(){let{isDataRoute:e}=N.useContext(Ia);return e?ZY():zY()}function zY(){Ut(Hf(),"useNavigate() may be used only in the context of a <Router> component.");let e=N.useContext(cu),{basename:t,navigator:n}=N.useContext($a),{matches:r}=N.useContext(Ia),{pathname:a}=il(),s=JSON.stringify(pz(r)),i=N.useRef(!1);return xz(()=>{i.current=!0}),N.useCallback((d,f={})=>{if(Oa(i.current,vz),!i.current)return;if(typeof d=="number"){n.go(d);return}let h=mz(d,JSON.parse(s),a,f.relative==="path");e==null&&t!=="/"&&(h.pathname=h.pathname==="/"?t:Cs([t,h.pathname])),(f.replace?n.replace:n.push)(h,f.state,f)},[t,n,s,a,e])}N.createContext(null);function Dy(){let{matches:e}=N.useContext(Ia),t=e[e.length-1];return t?t.params:{}}function Bf(e,{relative:t}={}){let{matches:n}=N.useContext(Ia),{pathname:r}=il(),a=JSON.stringify(pz(n));return N.useMemo(()=>mz(e,JSON.parse(a),r,t==="path"),[e,a,r,t])}function qY(e,t){return bz(e,t)}function bz(e,t,n,r,a){var _;Ut(Hf(),"useRoutes() may be used only in the context of a <Router> component.");let{navigator:s}=N.useContext($a),{matches:i}=N.useContext(Ia),l=i[i.length-1],d=l?l.params:{},f=l?l.pathname:"/",h=l?l.pathnameBase:"/",p=l&&l.route;{let j=p&&p.path||"";wz(f,!p||j.endsWith("*")||j.endsWith("*?"),`You rendered descendant <Routes> (or called \`useRoutes()\`) at "${f}" (under <Route path="${j}">) but the parent route path has no trailing "*". This means if you navigate deeper, the parent won't match anymore and therefore the child routes will never render.
|
|
59
|
+
|
|
60
|
+
Please change the parent <Route path="${j}"> to <Route path="${j==="/"?"*":`${j}/*`}">.`)}let g=il(),y;if(t){let j=typeof t=="string"?lu(t):t;Ut(h==="/"||((_=j.pathname)==null?void 0:_.startsWith(h)),`When overriding the location using \`<Routes location>\` or \`useRoutes(routes, location)\`, the location pathname must begin with the portion of the URL pathname that was matched by all parent routes. The current pathname base is "${h}" but pathname "${j.pathname}" was given in the \`location\` prop.`),y=j}else y=g;let S=y.pathname||"/",w=S;if(h!=="/"){let j=h.replace(/^\//,"").split("/");w="/"+S.replace(/^\//,"").split("/").slice(j.length).join("/")}let b=dz(e,{pathname:w});Oa(p||b!=null,`No routes matched location "${y.pathname}${y.search}${y.hash}" `),Oa(b==null||b[b.length-1].route.element!==void 0||b[b.length-1].route.Component!==void 0||b[b.length-1].route.lazy!==void 0,`Matched leaf route at location "${y.pathname}${y.search}${y.hash}" does not have an element or Component. This means it will render an <Outlet /> with a null value by default resulting in an "empty" page.`);let x=VY(b&&b.map(j=>Object.assign({},j,{params:Object.assign({},d,j.params),pathname:Cs([h,s.encodeLocation?s.encodeLocation(j.pathname.replace(/\?/g,"%3F").replace(/#/g,"%23")).pathname:j.pathname]),pathnameBase:j.pathnameBase==="/"?h:Cs([h,s.encodeLocation?s.encodeLocation(j.pathnameBase.replace(/\?/g,"%3F").replace(/#/g,"%23")).pathname:j.pathnameBase])})),i,n,r,a);return t&&x?N.createElement(Uf.Provider,{value:{location:{pathname:"/",search:"",hash:"",state:null,key:"default",...y},navigationType:"POP"}},x):x}function FY(){let e=XY(),t=DY(e)?`${e.status} ${e.statusText}`:e instanceof Error?e.message:JSON.stringify(e),n=e instanceof Error?e.stack:null,r="rgba(200,200,200, 0.5)",a={padding:"0.5rem",backgroundColor:r},s={padding:"2px 4px",backgroundColor:r},i=null;return console.error("Error handled by React Router default ErrorBoundary:",e),i=N.createElement(N.Fragment,null,N.createElement("p",null,"💿 Hey developer 👋"),N.createElement("p",null,"You can provide a way better UX than this when your app throws errors by providing your own ",N.createElement("code",{style:s},"ErrorBoundary")," or"," ",N.createElement("code",{style:s},"errorElement")," prop on your route.")),N.createElement(N.Fragment,null,N.createElement("h2",null,"Unexpected Application Error!"),N.createElement("h3",{style:{fontStyle:"italic"}},t),n?N.createElement("pre",{style:a},n):null,i)}var UY=N.createElement(FY,null),HY=class extends N.Component{constructor(e){super(e),this.state={location:e.location,revalidation:e.revalidation,error:e.error}}static getDerivedStateFromError(e){return{error:e}}static getDerivedStateFromProps(e,t){return t.location!==e.location||t.revalidation!=="idle"&&e.revalidation==="idle"?{error:e.error,location:e.location,revalidation:e.revalidation}:{error:e.error!==void 0?e.error:t.error,location:t.location,revalidation:e.revalidation||t.revalidation}}componentDidCatch(e,t){this.props.unstable_onError?this.props.unstable_onError(e,t):console.error("React Router caught the following error during render",e)}render(){return this.state.error!==void 0?N.createElement(Ia.Provider,{value:this.props.routeContext},N.createElement(HC.Provider,{value:this.state.error,children:this.props.component})):this.props.children}};function BY({routeContext:e,match:t,children:n}){let r=N.useContext(cu);return r&&r.static&&r.staticContext&&(t.route.errorElement||t.route.ErrorBoundary)&&(r.staticContext._deepestRenderedBoundaryId=t.route.id),N.createElement(Ia.Provider,{value:e},n)}function VY(e,t=[],n=null,r=null,a=null){if(e==null){if(!n)return null;if(n.errors)e=n.matches;else if(t.length===0&&!n.initialized&&n.matches.length>0)e=n.matches;else return null}let s=e,i=n==null?void 0:n.errors;if(i!=null){let f=s.findIndex(h=>h.route.id&&(i==null?void 0:i[h.route.id])!==void 0);Ut(f>=0,`Could not find a matching route for errors on route IDs: ${Object.keys(i).join(",")}`),s=s.slice(0,Math.min(s.length,f+1))}let l=!1,d=-1;if(n)for(let f=0;f<s.length;f++){let h=s[f];if((h.route.HydrateFallback||h.route.hydrateFallbackElement)&&(d=f),h.route.id){let{loaderData:p,errors:g}=n,y=h.route.loader&&!p.hasOwnProperty(h.route.id)&&(!g||g[h.route.id]===void 0);if(h.route.lazy||y){l=!0,d>=0?s=s.slice(0,d+1):s=[s[0]];break}}}return s.reduceRight((f,h,p)=>{let g,y=!1,S=null,w=null;n&&(g=i&&h.route.id?i[h.route.id]:void 0,S=h.route.errorElement||UY,l&&(d<0&&p===0?(wz("route-fallback",!1,"No `HydrateFallback` element provided to render during initial hydration"),y=!0,w=null):d===p&&(y=!0,w=h.route.hydrateFallbackElement||null)));let b=t.concat(s.slice(0,p+1)),x=()=>{let _;return g?_=S:y?_=w:h.route.Component?_=N.createElement(h.route.Component,null):h.route.element?_=h.route.element:_=f,N.createElement(BY,{match:h,routeContext:{outlet:f,matches:b,isDataRoute:n!=null},children:_})};return n&&(h.route.ErrorBoundary||h.route.errorElement||p===0)?N.createElement(HY,{location:n.location,revalidation:n.revalidation,component:S,error:g,children:x(),routeContext:{outlet:null,matches:b,isDataRoute:!0},unstable_onError:r}):x()},null)}function BC(e){return`${e} must be used within a data router. See https://reactrouter.com/en/main/routers/picking-a-router.`}function WY(e){let t=N.useContext(cu);return Ut(t,BC(e)),t}function GY(e){let t=N.useContext(Oy);return Ut(t,BC(e)),t}function KY(e){let t=N.useContext(Ia);return Ut(t,BC(e)),t}function VC(e){let t=KY(e),n=t.matches[t.matches.length-1];return Ut(n.route.id,`${e} can only be used on routes that contain a unique "id"`),n.route.id}function YY(){return VC("useRouteId")}function XY(){var r;let e=N.useContext(HC),t=GY("useRouteError"),n=VC("useRouteError");return e!==void 0?e:(r=t.errors)==null?void 0:r[n]}function ZY(){let{router:e}=WY("useNavigate"),t=VC("useNavigate"),n=N.useRef(!1);return xz(()=>{n.current=!0}),N.useCallback(async(a,s={})=>{Oa(n.current,vz),n.current&&(typeof a=="number"?e.navigate(a):await e.navigate(a,{fromRouteId:t,...s}))},[e,t])}var qO={};function wz(e,t,n){!t&&!qO[e]&&(qO[e]=!0,Oa(!1,n))}N.memo(QY);function QY({routes:e,future:t,state:n,unstable_onError:r}){return bz(e,void 0,n,r,t)}function Qr(e){Ut(!1,"A <Route> is only ever to be used as the child of <Routes> element, never rendered directly. Please wrap your <Route> in a <Routes>.")}function JY({basename:e="/",children:t=null,location:n,navigationType:r="POP",navigator:a,static:s=!1}){Ut(!Hf(),"You cannot render a <Router> inside another <Router>. You should never have more than one in your app.");let i=e.replace(/^\/*/,"/"),l=N.useMemo(()=>({basename:i,navigator:a,static:s,future:{}}),[i,a,s]);typeof n=="string"&&(n=lu(n));let{pathname:d="/",search:f="",hash:h="",state:p=null,key:g="default"}=n,y=N.useMemo(()=>{let S=As(d,i);return S==null?null:{location:{pathname:S,search:f,hash:h,state:p,key:g},navigationType:r}},[i,d,f,h,p,g,r]);return Oa(y!=null,`<Router basename="${i}"> is not able to match the URL "${d}${f}${h}" because it does not start with the basename, so the <Router> won't render anything.`),y==null?null:N.createElement($a.Provider,{value:l},N.createElement(Uf.Provider,{children:t,value:y}))}function eX({children:e,location:t}){return qY(kj(e),t)}function kj(e,t=[]){let n=[];return N.Children.forEach(e,(r,a)=>{if(!N.isValidElement(r))return;let s=[...t,a];if(r.type===N.Fragment){n.push.apply(n,kj(r.props.children,s));return}Ut(r.type===Qr,`[${typeof r.type=="string"?r.type:r.type.name}] is not a <Route> component. All component children of <Routes> must be a <Route> or <React.Fragment>`),Ut(!r.props.index||!r.props.children,"An index route cannot have child routes.");let i={id:r.props.id||s.join("-"),caseSensitive:r.props.caseSensitive,element:r.props.element,Component:r.props.Component,index:r.props.index,path:r.props.path,middleware:r.props.middleware,loader:r.props.loader,action:r.props.action,hydrateFallbackElement:r.props.hydrateFallbackElement,HydrateFallback:r.props.HydrateFallback,errorElement:r.props.errorElement,ErrorBoundary:r.props.ErrorBoundary,hasErrorBoundary:r.props.hasErrorBoundary===!0||r.props.ErrorBoundary!=null||r.props.errorElement!=null,shouldRevalidate:r.props.shouldRevalidate,handle:r.props.handle,lazy:r.props.lazy};r.props.children&&(i.children=kj(r.props.children,s)),n.push(i)}),n}var bg="get",wg="application/x-www-form-urlencoded";function Py(e){return e!=null&&typeof e.tagName=="string"}function tX(e){return Py(e)&&e.tagName.toLowerCase()==="button"}function nX(e){return Py(e)&&e.tagName.toLowerCase()==="form"}function rX(e){return Py(e)&&e.tagName.toLowerCase()==="input"}function aX(e){return!!(e.metaKey||e.altKey||e.ctrlKey||e.shiftKey)}function sX(e,t){return e.button===0&&(!t||t==="_self")&&!aX(e)}var am=null;function oX(){if(am===null)try{new FormData(document.createElement("form"),0),am=!1}catch{am=!0}return am}var iX=new Set(["application/x-www-form-urlencoded","multipart/form-data","text/plain"]);function Wb(e){return e!=null&&!iX.has(e)?(Oa(!1,`"${e}" is not a valid \`encType\` for \`<Form>\`/\`<fetcher.Form>\` and will default to "${wg}"`),null):e}function lX(e,t){let n,r,a,s,i;if(nX(e)){let l=e.getAttribute("action");r=l?As(l,t):null,n=e.getAttribute("method")||bg,a=Wb(e.getAttribute("enctype"))||wg,s=new FormData(e)}else if(tX(e)||rX(e)&&(e.type==="submit"||e.type==="image")){let l=e.form;if(l==null)throw new Error('Cannot submit a <button> or <input type="submit"> without a <form>');let d=e.getAttribute("formaction")||l.getAttribute("action");if(r=d?As(d,t):null,n=e.getAttribute("formmethod")||l.getAttribute("method")||bg,a=Wb(e.getAttribute("formenctype"))||Wb(l.getAttribute("enctype"))||wg,s=new FormData(l,e),!oX()){let{name:f,type:h,value:p}=e;if(h==="image"){let g=f?`${f}.`:"";s.append(`${g}x`,"0"),s.append(`${g}y`,"0")}else f&&s.append(f,p)}}else{if(Py(e))throw new Error('Cannot submit element that is not <form>, <button>, or <input type="submit|image">');n=bg,r=null,a=wg,i=e}return s&&a==="text/plain"&&(i=s,s=void 0),{action:r,method:n.toLowerCase(),encType:a,formData:s,body:i}}Object.getOwnPropertyNames(Object.prototype).sort().join("\0");function WC(e,t){if(e===!1||e===null||typeof e>"u")throw new Error(t)}function cX(e,t,n){let r=typeof e=="string"?new URL(e,typeof window>"u"?"server://singlefetch/":window.location.origin):e;return r.pathname==="/"?r.pathname=`_root.${n}`:t&&As(r.pathname,t)==="/"?r.pathname=`${t.replace(/\/$/,"")}/_root.${n}`:r.pathname=`${r.pathname.replace(/\/$/,"")}.${n}`,r}async function uX(e,t){if(e.id in t)return t[e.id];try{let n=await import(e.module);return t[e.id]=n,n}catch(n){return console.error(`Error loading route module \`${e.module}\`, reloading page...`),console.error(n),window.__reactRouterContext&&window.__reactRouterContext.isSpaMode,window.location.reload(),new Promise(()=>{})}}function dX(e){return e==null?!1:e.href==null?e.rel==="preload"&&typeof e.imageSrcSet=="string"&&typeof e.imageSizes=="string":typeof e.rel=="string"&&typeof e.href=="string"}async function fX(e,t,n){let r=await Promise.all(e.map(async a=>{let s=t.routes[a.route.id];if(s){let i=await uX(s,n);return i.links?i.links():[]}return[]}));return gX(r.flat(1).filter(dX).filter(a=>a.rel==="stylesheet"||a.rel==="preload").map(a=>a.rel==="stylesheet"?{...a,rel:"prefetch",as:"style"}:{...a,rel:"prefetch"}))}function FO(e,t,n,r,a,s){let i=(d,f)=>n[f]?d.route.id!==n[f].route.id:!0,l=(d,f)=>{var h;return n[f].pathname!==d.pathname||((h=n[f].route.path)==null?void 0:h.endsWith("*"))&&n[f].params["*"]!==d.params["*"]};return s==="assets"?t.filter((d,f)=>i(d,f)||l(d,f)):s==="data"?t.filter((d,f)=>{var p;let h=r.routes[d.route.id];if(!h||!h.hasLoader)return!1;if(i(d,f)||l(d,f))return!0;if(d.route.shouldRevalidate){let g=d.route.shouldRevalidate({currentUrl:new URL(a.pathname+a.search+a.hash,window.origin),currentParams:((p=n[0])==null?void 0:p.params)||{},nextUrl:new URL(e,window.origin),nextParams:d.params,defaultShouldRevalidate:!0});if(typeof g=="boolean")return g}return!0}):[]}function hX(e,t,{includeHydrateFallback:n}={}){return pX(e.map(r=>{let a=t.routes[r.route.id];if(!a)return[];let s=[a.module];return a.clientActionModule&&(s=s.concat(a.clientActionModule)),a.clientLoaderModule&&(s=s.concat(a.clientLoaderModule)),n&&a.hydrateFallbackModule&&(s=s.concat(a.hydrateFallbackModule)),a.imports&&(s=s.concat(a.imports)),s}).flat(1))}function pX(e){return[...new Set(e)]}function mX(e){let t={},n=Object.keys(e).sort();for(let r of n)t[r]=e[r];return t}function gX(e,t){let n=new Set;return new Set(t),e.reduce((r,a)=>{let s=JSON.stringify(mX(a));return n.has(s)||(n.add(s),r.push({key:s,link:a})),r},[])}function Sz(){let e=N.useContext(cu);return WC(e,"You must render this element inside a <DataRouterContext.Provider> element"),e}function yX(){let e=N.useContext(Oy);return WC(e,"You must render this element inside a <DataRouterStateContext.Provider> element"),e}var GC=N.createContext(void 0);GC.displayName="FrameworkContext";function _z(){let e=N.useContext(GC);return WC(e,"You must render this element inside a <HydratedRouter> element"),e}function vX(e,t){let n=N.useContext(GC),[r,a]=N.useState(!1),[s,i]=N.useState(!1),{onFocus:l,onBlur:d,onMouseEnter:f,onMouseLeave:h,onTouchStart:p}=t,g=N.useRef(null);N.useEffect(()=>{if(e==="render"&&i(!0),e==="viewport"){let w=x=>{x.forEach(_=>{i(_.isIntersecting)})},b=new IntersectionObserver(w,{threshold:.5});return g.current&&b.observe(g.current),()=>{b.disconnect()}}},[e]),N.useEffect(()=>{if(r){let w=setTimeout(()=>{i(!0)},100);return()=>{clearTimeout(w)}}},[r]);let y=()=>{a(!0)},S=()=>{a(!1),i(!1)};return n?e!=="intent"?[s,g,{}]:[s,g,{onFocus:Nd(l,y),onBlur:Nd(d,S),onMouseEnter:Nd(f,y),onMouseLeave:Nd(h,S),onTouchStart:Nd(p,y)}]:[!1,g,{}]}function Nd(e,t){return n=>{e&&e(n),n.defaultPrevented||t(n)}}function xX({page:e,...t}){let{router:n}=Sz(),r=N.useMemo(()=>dz(n.routes,e,n.basename),[n.routes,e,n.basename]);return r?N.createElement(wX,{page:e,matches:r,...t}):null}function bX(e){let{manifest:t,routeModules:n}=_z(),[r,a]=N.useState([]);return N.useEffect(()=>{let s=!1;return fX(e,t,n).then(i=>{s||a(i)}),()=>{s=!0}},[e,t,n]),r}function wX({page:e,matches:t,...n}){let r=il(),{manifest:a,routeModules:s}=_z(),{basename:i}=Sz(),{loaderData:l,matches:d}=yX(),f=N.useMemo(()=>FO(e,t,d,a,r,"data"),[e,t,d,a,r]),h=N.useMemo(()=>FO(e,t,d,a,r,"assets"),[e,t,d,a,r]),p=N.useMemo(()=>{if(e===r.pathname+r.search+r.hash)return[];let S=new Set,w=!1;if(t.forEach(x=>{var j;let _=a.routes[x.route.id];!_||!_.hasLoader||(!f.some(C=>C.route.id===x.route.id)&&x.route.id in l&&((j=s[x.route.id])!=null&&j.shouldRevalidate)||_.hasClientLoader?w=!0:S.add(x.route.id))}),S.size===0)return[];let b=cX(e,i,"data");return w&&S.size>0&&b.searchParams.set("_routes",t.filter(x=>S.has(x.route.id)).map(x=>x.route.id).join(",")),[b.pathname+b.search]},[i,l,r,a,f,t,e,s]),g=N.useMemo(()=>hX(h,a),[h,a]),y=bX(h);return N.createElement(N.Fragment,null,p.map(S=>N.createElement("link",{key:S,rel:"prefetch",as:"fetch",href:S,...n})),g.map(S=>N.createElement("link",{key:S,rel:"modulepreload",href:S,...n})),y.map(({key:S,link:w})=>N.createElement("link",{key:S,nonce:n.nonce,...w})))}function SX(...e){return t=>{e.forEach(n=>{typeof n=="function"?n(t):n!=null&&(n.current=t)})}}var Nz=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u";try{Nz&&(window.__reactRouterVersion="7.9.5")}catch{}function _X({basename:e,children:t,window:n}){let r=N.useRef();r.current==null&&(r.current=dY({window:n,v5Compat:!0}));let a=r.current,[s,i]=N.useState({action:a.action,location:a.location}),l=N.useCallback(d=>{N.startTransition(()=>i(d))},[i]);return N.useLayoutEffect(()=>a.listen(l),[a,l]),N.createElement(JY,{basename:e,children:t,location:s.location,navigationType:s.action,navigator:a})}var jz=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,pn=N.forwardRef(function({onClick:t,discover:n="render",prefetch:r="none",relative:a,reloadDocument:s,replace:i,state:l,target:d,to:f,preventScrollReset:h,viewTransition:p,...g},y){let{basename:S}=N.useContext($a),w=typeof f=="string"&&jz.test(f),b,x=!1;if(typeof f=="string"&&w&&(b=f,Nz))try{let M=new URL(window.location.href),z=f.startsWith("//")?new URL(M.protocol+f):new URL(f),L=As(z.pathname,S);z.origin===M.origin&&L!=null?f=L+z.search+z.hash:x=!0}catch{Oa(!1,`<Link to="${f}"> contains an invalid URL which will probably break when clicked - please update to a valid URL path.`)}let _=LY(f,{relative:a}),[j,C,T]=vX(r,g),A=EX(f,{replace:i,state:l,target:d,preventScrollReset:h,relative:a,viewTransition:p});function k(M){t&&t(M),M.defaultPrevented||A(M)}let O=N.createElement("a",{...g,...T,href:b||_,onClick:x||s?t:k,ref:SX(y,C),target:d,"data-discover":!w&&n==="render"?"true":void 0});return j&&!w?N.createElement(N.Fragment,null,O,N.createElement(xX,{page:_})):O});pn.displayName="Link";var NX=N.forwardRef(function({"aria-current":t="page",caseSensitive:n=!1,className:r="",end:a=!1,style:s,to:i,viewTransition:l,children:d,...f},h){let p=Bf(i,{relative:f.relative}),g=il(),y=N.useContext(Oy),{navigator:S,basename:w}=N.useContext($a),b=y!=null&&OX(p)&&l===!0,x=S.encodeLocation?S.encodeLocation(p).pathname:p.pathname,_=g.pathname,j=y&&y.navigation&&y.navigation.location?y.navigation.location.pathname:null;n||(_=_.toLowerCase(),j=j?j.toLowerCase():null,x=x.toLowerCase()),j&&w&&(j=As(j,w)||j);const C=x!=="/"&&x.endsWith("/")?x.length-1:x.length;let T=_===x||!a&&_.startsWith(x)&&_.charAt(C)==="/",A=j!=null&&(j===x||!a&&j.startsWith(x)&&j.charAt(x.length)==="/"),k={isActive:T,isPending:A,isTransitioning:b},O=T?t:void 0,M;typeof r=="function"?M=r(k):M=[r,T?"active":null,A?"pending":null,b?"transitioning":null].filter(Boolean).join(" ");let z=typeof s=="function"?s(k):s;return N.createElement(pn,{...f,"aria-current":O,className:M,ref:h,style:z,to:i,viewTransition:l},typeof d=="function"?d(k):d)});NX.displayName="NavLink";var jX=N.forwardRef(({discover:e="render",fetcherKey:t,navigate:n,reloadDocument:r,replace:a,state:s,method:i=bg,action:l,onSubmit:d,relative:f,preventScrollReset:h,viewTransition:p,...g},y)=>{let S=RX(),w=kX(l,{relative:f}),b=i.toLowerCase()==="get"?"get":"post",x=typeof l=="string"&&jz.test(l),_=j=>{if(d&&d(j),j.defaultPrevented)return;j.preventDefault();let C=j.nativeEvent.submitter,T=(C==null?void 0:C.getAttribute("formmethod"))||i;S(C||j.currentTarget,{fetcherKey:t,method:T,navigate:n,replace:a,state:s,relative:f,preventScrollReset:h,viewTransition:p})};return N.createElement("form",{ref:y,method:b,action:w,onSubmit:r?d:_,...g,"data-discover":!x&&e==="render"?"true":void 0})});jX.displayName="Form";function CX(e){return`${e} must be used within a data router. See https://reactrouter.com/en/main/routers/picking-a-router.`}function Cz(e){let t=N.useContext(cu);return Ut(t,CX(e)),t}function EX(e,{target:t,replace:n,state:r,preventScrollReset:a,relative:s,viewTransition:i}={}){let l=My(),d=il(),f=Bf(e,{relative:s});return N.useCallback(h=>{if(sX(h,t)){h.preventDefault();let p=n!==void 0?n:df(d)===df(f);l(e,{replace:p,state:r,preventScrollReset:a,relative:s,viewTransition:i})}},[d,l,f,n,r,t,e,a,s,i])}var TX=0,AX=()=>`__${String(++TX)}__`;function RX(){let{router:e}=Cz("useSubmit"),{basename:t}=N.useContext($a),n=YY();return N.useCallback(async(r,a={})=>{let{action:s,method:i,encType:l,formData:d,body:f}=lX(r,t);if(a.navigate===!1){let h=a.fetcherKey||AX();await e.fetch(h,n,a.action||s,{preventScrollReset:a.preventScrollReset,formData:d,body:f,formMethod:a.method||i,formEncType:a.encType||l,flushSync:a.flushSync})}else await e.navigate(a.action||s,{preventScrollReset:a.preventScrollReset,formData:d,body:f,formMethod:a.method||i,formEncType:a.encType||l,replace:a.replace,state:a.state,fromRouteId:n,flushSync:a.flushSync,viewTransition:a.viewTransition})},[e,t,n])}function kX(e,{relative:t}={}){let{basename:n}=N.useContext($a),r=N.useContext(Ia);Ut(r,"useFormAction must be used inside a RouteContext");let[a]=r.matches.slice(-1),s={...Bf(e||".",{relative:t})},i=il();if(e==null){s.search=i.search;let l=new URLSearchParams(s.search),d=l.getAll("index");if(d.some(h=>h==="")){l.delete("index"),d.filter(p=>p).forEach(p=>l.append("index",p));let h=l.toString();s.search=h?`?${h}`:""}}return(!e||e===".")&&a.route.index&&(s.search=s.search?s.search.replace(/^\?/,"?index&"):"?index"),n!=="/"&&(s.pathname=s.pathname==="/"?n:Cs([n,s.pathname])),df(s)}function OX(e,{relative:t}={}){let n=N.useContext(yz);Ut(n!=null,"`useViewTransitionState` must be used within `react-router-dom`'s `RouterProvider`. Did you accidentally import `RouterProvider` from `react-router`?");let{basename:r}=Cz("useViewTransitionState"),a=Bf(e,{relative:t});if(!n.isTransitioning)return!1;let s=As(n.currentLocation.pathname,r)||n.currentLocation.pathname,i=As(n.nextLocation.pathname,r)||n.nextLocation.pathname;return Wg(a.pathname,i)!=null||Wg(a.pathname,s)!=null}/**
|
|
61
|
+
* @license lucide-react v0.477.0 - ISC
|
|
62
|
+
*
|
|
63
|
+
* This source code is licensed under the ISC license.
|
|
64
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
65
|
+
*/const MX=e=>e.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase(),Ez=(...e)=>e.filter((t,n,r)=>!!t&&t.trim()!==""&&r.indexOf(t)===n).join(" ").trim();/**
|
|
66
|
+
* @license lucide-react v0.477.0 - ISC
|
|
67
|
+
*
|
|
68
|
+
* This source code is licensed under the ISC license.
|
|
69
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
70
|
+
*/var DX={xmlns:"http://www.w3.org/2000/svg",width:24,height:24,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"};/**
|
|
71
|
+
* @license lucide-react v0.477.0 - ISC
|
|
72
|
+
*
|
|
73
|
+
* This source code is licensed under the ISC license.
|
|
74
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
75
|
+
*/const PX=N.forwardRef(({color:e="currentColor",size:t=24,strokeWidth:n=2,absoluteStrokeWidth:r,className:a="",children:s,iconNode:i,...l},d)=>N.createElement("svg",{ref:d,...DX,width:t,height:t,stroke:e,strokeWidth:r?Number(n)*24/Number(t):n,className:Ez("lucide",a),...l},[...i.map(([f,h])=>N.createElement(f,h)),...Array.isArray(s)?s:[s]]));/**
|
|
76
|
+
* @license lucide-react v0.477.0 - ISC
|
|
77
|
+
*
|
|
78
|
+
* This source code is licensed under the ISC license.
|
|
79
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
80
|
+
*/const we=(e,t)=>{const n=N.forwardRef(({className:r,...a},s)=>N.createElement(PX,{ref:s,iconNode:t,className:Ez(`lucide-${MX(e)}`,r),...a}));return n.displayName=`${e}`,n};/**
|
|
81
|
+
* @license lucide-react v0.477.0 - ISC
|
|
82
|
+
*
|
|
83
|
+
* This source code is licensed under the ISC license.
|
|
84
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
85
|
+
*/const $X=[["path",{d:"M12 5v14",key:"s699le"}],["path",{d:"m19 12-7 7-7-7",key:"1idqje"}]],IX=we("ArrowDown",$X);/**
|
|
86
|
+
* @license lucide-react v0.477.0 - ISC
|
|
87
|
+
*
|
|
88
|
+
* This source code is licensed under the ISC license.
|
|
89
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
90
|
+
*/const LX=[["path",{d:"m12 19-7-7 7-7",key:"1l729n"}],["path",{d:"M19 12H5",key:"x3x0zl"}]],Gg=we("ArrowLeft",LX);/**
|
|
91
|
+
* @license lucide-react v0.477.0 - ISC
|
|
92
|
+
*
|
|
93
|
+
* This source code is licensed under the ISC license.
|
|
94
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
95
|
+
*/const zX=[["path",{d:"m16 3 4 4-4 4",key:"1x1c3m"}],["path",{d:"M20 7H4",key:"zbl0bi"}],["path",{d:"m8 21-4-4 4-4",key:"h9nckh"}],["path",{d:"M4 17h16",key:"g4d7ey"}]],qX=we("ArrowRightLeft",zX);/**
|
|
96
|
+
* @license lucide-react v0.477.0 - ISC
|
|
97
|
+
*
|
|
98
|
+
* This source code is licensed under the ISC license.
|
|
99
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
100
|
+
*/const FX=[["path",{d:"m21 16-4 4-4-4",key:"f6ql7i"}],["path",{d:"M17 20V4",key:"1ejh1v"}],["path",{d:"m3 8 4-4 4 4",key:"11wl7u"}],["path",{d:"M7 4v16",key:"1glfcx"}]],UO=we("ArrowUpDown",FX);/**
|
|
101
|
+
* @license lucide-react v0.477.0 - ISC
|
|
102
|
+
*
|
|
103
|
+
* This source code is licensed under the ISC license.
|
|
104
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
105
|
+
*/const UX=[["path",{d:"m5 12 7-7 7 7",key:"hav0vg"}],["path",{d:"M12 19V5",key:"x0mq9r"}]],HX=we("ArrowUp",UX);/**
|
|
106
|
+
* @license lucide-react v0.477.0 - ISC
|
|
107
|
+
*
|
|
108
|
+
* This source code is licensed under the ISC license.
|
|
109
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
110
|
+
*/const BX=[["path",{d:"M10.268 21a2 2 0 0 0 3.464 0",key:"vwvbt9"}],["path",{d:"M3.262 15.326A1 1 0 0 0 4 17h16a1 1 0 0 0 .74-1.673C19.41 13.956 18 12.499 18 8A6 6 0 0 0 6 8c0 4.499-1.411 5.956-2.738 7.326",key:"11g9vi"}]],VX=we("Bell",BX);/**
|
|
111
|
+
* @license lucide-react v0.477.0 - ISC
|
|
112
|
+
*
|
|
113
|
+
* This source code is licensed under the ISC license.
|
|
114
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
115
|
+
*/const WX=[["path",{d:"M12 7v14",key:"1akyts"}],["path",{d:"M3 18a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h5a4 4 0 0 1 4 4 4 4 0 0 1 4-4h5a1 1 0 0 1 1 1v13a1 1 0 0 1-1 1h-6a3 3 0 0 0-3 3 3 3 0 0 0-3-3z",key:"ruj8y"}]],GX=we("BookOpen",WX);/**
|
|
116
|
+
* @license lucide-react v0.477.0 - ISC
|
|
117
|
+
*
|
|
118
|
+
* This source code is licensed under the ISC license.
|
|
119
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
120
|
+
*/const KX=[["path",{d:"M12 8V4H8",key:"hb8ula"}],["rect",{width:"16",height:"12",x:"4",y:"8",rx:"2",key:"enze0r"}],["path",{d:"M2 14h2",key:"vft8re"}],["path",{d:"M20 14h2",key:"4cs60a"}],["path",{d:"M15 13v2",key:"1xurst"}],["path",{d:"M9 13v2",key:"rq6x2g"}]],YX=we("Bot",KX);/**
|
|
121
|
+
* @license lucide-react v0.477.0 - ISC
|
|
122
|
+
*
|
|
123
|
+
* This source code is licensed under the ISC license.
|
|
124
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
125
|
+
*/const XX=[["path",{d:"M16 20V4a2 2 0 0 0-2-2h-4a2 2 0 0 0-2 2v16",key:"jecpp"}],["rect",{width:"20",height:"14",x:"2",y:"6",rx:"2",key:"i6l2r4"}]],ZX=we("Briefcase",XX);/**
|
|
126
|
+
* @license lucide-react v0.477.0 - ISC
|
|
127
|
+
*
|
|
128
|
+
* This source code is licensed under the ISC license.
|
|
129
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
130
|
+
*/const QX=[["path",{d:"m8 2 1.88 1.88",key:"fmnt4t"}],["path",{d:"M14.12 3.88 16 2",key:"qol33r"}],["path",{d:"M9 7.13v-1a3.003 3.003 0 1 1 6 0v1",key:"d7y7pr"}],["path",{d:"M12 20c-3.3 0-6-2.7-6-6v-3a4 4 0 0 1 4-4h4a4 4 0 0 1 4 4v3c0 3.3-2.7 6-6 6",key:"xs1cw7"}],["path",{d:"M12 20v-9",key:"1qisl0"}],["path",{d:"M6.53 9C4.6 8.8 3 7.1 3 5",key:"32zzws"}],["path",{d:"M6 13H2",key:"82j7cp"}],["path",{d:"M3 21c0-2.1 1.7-3.9 3.8-4",key:"4p0ekp"}],["path",{d:"M20.97 5c0 2.1-1.6 3.8-3.5 4",key:"18gb23"}],["path",{d:"M22 13h-4",key:"1jl80f"}],["path",{d:"M17.2 17c2.1.1 3.8 1.9 3.8 4",key:"k3fwyw"}]],JX=we("Bug",QX);/**
|
|
131
|
+
* @license lucide-react v0.477.0 - ISC
|
|
132
|
+
*
|
|
133
|
+
* This source code is licensed under the ISC license.
|
|
134
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
135
|
+
*/const eZ=[["path",{d:"M21 7.5V6a2 2 0 0 0-2-2H5a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h3.5",key:"1osxxc"}],["path",{d:"M16 2v4",key:"4m81vk"}],["path",{d:"M8 2v4",key:"1cmpym"}],["path",{d:"M3 10h5",key:"r794hk"}],["path",{d:"M17.5 17.5 16 16.3V14",key:"akvzfd"}],["circle",{cx:"16",cy:"16",r:"6",key:"qoo3c4"}]],tZ=we("CalendarClock",eZ);/**
|
|
136
|
+
* @license lucide-react v0.477.0 - ISC
|
|
137
|
+
*
|
|
138
|
+
* This source code is licensed under the ISC license.
|
|
139
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
140
|
+
*/const nZ=[["path",{d:"M8 2v4",key:"1cmpym"}],["path",{d:"M16 2v4",key:"4m81vk"}],["rect",{width:"18",height:"18",x:"3",y:"4",rx:"2",key:"1hopcy"}],["path",{d:"M3 10h18",key:"8toen8"}]],rZ=we("Calendar",nZ);/**
|
|
141
|
+
* @license lucide-react v0.477.0 - ISC
|
|
142
|
+
*
|
|
143
|
+
* This source code is licensed under the ISC license.
|
|
144
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
145
|
+
*/const aZ=[["path",{d:"M3 3v16a2 2 0 0 0 2 2h16",key:"c24i48"}],["path",{d:"m19 9-5 5-4-4-3 3",key:"2osh9i"}]],sZ=we("ChartLine",aZ);/**
|
|
146
|
+
* @license lucide-react v0.477.0 - ISC
|
|
147
|
+
*
|
|
148
|
+
* This source code is licensed under the ISC license.
|
|
149
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
150
|
+
*/const oZ=[["line",{x1:"12",x2:"12",y1:"20",y2:"10",key:"1vz5eb"}],["line",{x1:"18",x2:"18",y1:"20",y2:"4",key:"cun8e5"}],["line",{x1:"6",x2:"6",y1:"20",y2:"16",key:"hq0ia6"}]],Sg=we("ChartNoAxesColumnIncreasing",oZ);/**
|
|
151
|
+
* @license lucide-react v0.477.0 - ISC
|
|
152
|
+
*
|
|
153
|
+
* This source code is licensed under the ISC license.
|
|
154
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
155
|
+
*/const iZ=[["line",{x1:"18",x2:"18",y1:"20",y2:"10",key:"1xfpm4"}],["line",{x1:"12",x2:"12",y1:"20",y2:"4",key:"be30l9"}],["line",{x1:"6",x2:"6",y1:"20",y2:"14",key:"1r4le6"}]],lZ=we("ChartNoAxesColumn",iZ);/**
|
|
156
|
+
* @license lucide-react v0.477.0 - ISC
|
|
157
|
+
*
|
|
158
|
+
* This source code is licensed under the ISC license.
|
|
159
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
160
|
+
*/const cZ=[["path",{d:"M21 12c.552 0 1.005-.449.95-.998a10 10 0 0 0-8.953-8.951c-.55-.055-.998.398-.998.95v8a1 1 0 0 0 1 1z",key:"pzmjnu"}],["path",{d:"M21.21 15.89A10 10 0 1 1 8 2.83",key:"k2fpak"}]],uZ=we("ChartPie",cZ);/**
|
|
161
|
+
* @license lucide-react v0.477.0 - ISC
|
|
162
|
+
*
|
|
163
|
+
* This source code is licensed under the ISC license.
|
|
164
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
165
|
+
*/const dZ=[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]],Is=we("Check",dZ);/**
|
|
166
|
+
* @license lucide-react v0.477.0 - ISC
|
|
167
|
+
*
|
|
168
|
+
* This source code is licensed under the ISC license.
|
|
169
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
170
|
+
*/const fZ=[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]],uu=we("ChevronDown",fZ);/**
|
|
171
|
+
* @license lucide-react v0.477.0 - ISC
|
|
172
|
+
*
|
|
173
|
+
* This source code is licensed under the ISC license.
|
|
174
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
175
|
+
*/const hZ=[["path",{d:"m15 18-6-6 6-6",key:"1wnfg3"}]],ff=we("ChevronLeft",hZ);/**
|
|
176
|
+
* @license lucide-react v0.477.0 - ISC
|
|
177
|
+
*
|
|
178
|
+
* This source code is licensed under the ISC license.
|
|
179
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
180
|
+
*/const pZ=[["path",{d:"m9 18 6-6-6-6",key:"mthhwq"}]],Io=we("ChevronRight",pZ);/**
|
|
181
|
+
* @license lucide-react v0.477.0 - ISC
|
|
182
|
+
*
|
|
183
|
+
* This source code is licensed under the ISC license.
|
|
184
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
185
|
+
*/const mZ=[["path",{d:"m18 15-6-6-6 6",key:"153udz"}]],gZ=we("ChevronUp",mZ);/**
|
|
186
|
+
* @license lucide-react v0.477.0 - ISC
|
|
187
|
+
*
|
|
188
|
+
* This source code is licensed under the ISC license.
|
|
189
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
190
|
+
*/const yZ=[["path",{d:"m7 20 5-5 5 5",key:"13a0gw"}],["path",{d:"m7 4 5 5 5-5",key:"1kwcof"}]],vZ=we("ChevronsDownUp",yZ);/**
|
|
191
|
+
* @license lucide-react v0.477.0 - ISC
|
|
192
|
+
*
|
|
193
|
+
* This source code is licensed under the ISC license.
|
|
194
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
195
|
+
*/const xZ=[["path",{d:"m7 15 5 5 5-5",key:"1hf1tw"}],["path",{d:"m7 9 5-5 5 5",key:"sgt6xg"}]],bZ=we("ChevronsUpDown",xZ);/**
|
|
196
|
+
* @license lucide-react v0.477.0 - ISC
|
|
197
|
+
*
|
|
198
|
+
* This source code is licensed under the ISC license.
|
|
199
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
200
|
+
*/const wZ=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["line",{x1:"12",x2:"12",y1:"8",y2:"12",key:"1pkeuh"}],["line",{x1:"12",x2:"12.01",y1:"16",y2:"16",key:"4dfq90"}]],$y=we("CircleAlert",wZ);/**
|
|
201
|
+
* @license lucide-react v0.477.0 - ISC
|
|
202
|
+
*
|
|
203
|
+
* This source code is licensed under the ISC license.
|
|
204
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
205
|
+
*/const SZ=[["path",{d:"M21.801 10A10 10 0 1 1 17 3.335",key:"yps3ct"}],["path",{d:"m9 11 3 3L22 4",key:"1pflzl"}]],Tz=we("CircleCheckBig",SZ);/**
|
|
206
|
+
* @license lucide-react v0.477.0 - ISC
|
|
207
|
+
*
|
|
208
|
+
* This source code is licensed under the ISC license.
|
|
209
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
210
|
+
*/const _Z=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m9 12 2 2 4-4",key:"dzmm74"}]],Az=we("CircleCheck",_Z);/**
|
|
211
|
+
* @license lucide-react v0.477.0 - ISC
|
|
212
|
+
*
|
|
213
|
+
* This source code is licensed under the ISC license.
|
|
214
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
215
|
+
*/const NZ=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["circle",{cx:"12",cy:"12",r:"1",key:"41hilf"}]],jZ=we("CircleDot",NZ);/**
|
|
216
|
+
* @license lucide-react v0.477.0 - ISC
|
|
217
|
+
*
|
|
218
|
+
* This source code is licensed under the ISC license.
|
|
219
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
220
|
+
*/const CZ=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M9.09 9a3 3 0 0 1 5.83 1c0 2-3 3-3 3",key:"1u773s"}],["path",{d:"M12 17h.01",key:"p32p05"}]],KC=we("CircleHelp",CZ);/**
|
|
221
|
+
* @license lucide-react v0.477.0 - ISC
|
|
222
|
+
*
|
|
223
|
+
* This source code is licensed under the ISC license.
|
|
224
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
225
|
+
*/const EZ=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["polygon",{points:"10 8 16 12 10 16 10 8",key:"1cimsy"}]],Gb=we("CirclePlay",EZ);/**
|
|
226
|
+
* @license lucide-react v0.477.0 - ISC
|
|
227
|
+
*
|
|
228
|
+
* This source code is licensed under the ISC license.
|
|
229
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
230
|
+
*/const TZ=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}]],YC=we("Circle",TZ);/**
|
|
231
|
+
* @license lucide-react v0.477.0 - ISC
|
|
232
|
+
*
|
|
233
|
+
* This source code is licensed under the ISC license.
|
|
234
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
235
|
+
*/const AZ=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["polyline",{points:"12 6 12 12 16 14",key:"68esgv"}]],Bi=we("Clock",AZ);/**
|
|
236
|
+
* @license lucide-react v0.477.0 - ISC
|
|
237
|
+
*
|
|
238
|
+
* This source code is licensed under the ISC license.
|
|
239
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
240
|
+
*/const RZ=[["path",{d:"m18 16 4-4-4-4",key:"1inbqp"}],["path",{d:"m6 8-4 4 4 4",key:"15zrgr"}],["path",{d:"m14.5 4-5 16",key:"e7oirm"}]],kZ=we("CodeXml",RZ);/**
|
|
241
|
+
* @license lucide-react v0.477.0 - ISC
|
|
242
|
+
*
|
|
243
|
+
* This source code is licensed under the ISC license.
|
|
244
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
245
|
+
*/const OZ=[["polyline",{points:"16 18 22 12 16 6",key:"z7tu5w"}],["polyline",{points:"8 6 2 12 8 18",key:"1eg1df"}]],Jd=we("Code",OZ);/**
|
|
246
|
+
* @license lucide-react v0.477.0 - ISC
|
|
247
|
+
*
|
|
248
|
+
* This source code is licensed under the ISC license.
|
|
249
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
250
|
+
*/const MZ=[["circle",{cx:"8",cy:"8",r:"6",key:"3yglwk"}],["path",{d:"M18.09 10.37A6 6 0 1 1 10.34 18",key:"t5s6rm"}],["path",{d:"M7 6h1v4",key:"1obek4"}],["path",{d:"m16.71 13.88.7.71-2.82 2.82",key:"1rbuyh"}]],DZ=we("Coins",MZ);/**
|
|
251
|
+
* @license lucide-react v0.477.0 - ISC
|
|
252
|
+
*
|
|
253
|
+
* This source code is licensed under the ISC license.
|
|
254
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
255
|
+
*/const PZ=[["path",{d:"M15 6v12a3 3 0 1 0 3-3H6a3 3 0 1 0 3 3V6a3 3 0 1 0-3 3h12a3 3 0 1 0-3-3",key:"11bfej"}]],$Z=we("Command",PZ);/**
|
|
256
|
+
* @license lucide-react v0.477.0 - ISC
|
|
257
|
+
*
|
|
258
|
+
* This source code is licensed under the ISC license.
|
|
259
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
260
|
+
*/const IZ=[["rect",{width:"14",height:"14",x:"8",y:"8",rx:"2",ry:"2",key:"17jyea"}],["path",{d:"M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2",key:"zix9uf"}]],Lo=we("Copy",IZ);/**
|
|
261
|
+
* @license lucide-react v0.477.0 - ISC
|
|
262
|
+
*
|
|
263
|
+
* This source code is licensed under the ISC license.
|
|
264
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
265
|
+
*/const LZ=[["ellipse",{cx:"12",cy:"5",rx:"9",ry:"3",key:"msslwz"}],["path",{d:"M3 5V19A9 3 0 0 0 21 19V5",key:"1wlel7"}],["path",{d:"M3 12A9 3 0 0 0 21 12",key:"mv7ke4"}]],Oj=we("Database",LZ);/**
|
|
266
|
+
* @license lucide-react v0.477.0 - ISC
|
|
267
|
+
*
|
|
268
|
+
* This source code is licensed under the ISC license.
|
|
269
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
270
|
+
*/const zZ=[["path",{d:"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4",key:"ih7n3h"}],["polyline",{points:"7 10 12 15 17 10",key:"2ggqvy"}],["line",{x1:"12",x2:"12",y1:"15",y2:"3",key:"1vk2je"}]],Mj=we("Download",zZ);/**
|
|
271
|
+
* @license lucide-react v0.477.0 - ISC
|
|
272
|
+
*
|
|
273
|
+
* This source code is licensed under the ISC license.
|
|
274
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
275
|
+
*/const qZ=[["circle",{cx:"12",cy:"12",r:"1",key:"41hilf"}],["circle",{cx:"19",cy:"12",r:"1",key:"1wjl8i"}],["circle",{cx:"5",cy:"12",r:"1",key:"1pcz8c"}]],Vf=we("Ellipsis",qZ);/**
|
|
276
|
+
* @license lucide-react v0.477.0 - ISC
|
|
277
|
+
*
|
|
278
|
+
* This source code is licensed under the ISC license.
|
|
279
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
280
|
+
*/const FZ=[["path",{d:"M10.733 5.076a10.744 10.744 0 0 1 11.205 6.575 1 1 0 0 1 0 .696 10.747 10.747 0 0 1-1.444 2.49",key:"ct8e1f"}],["path",{d:"M14.084 14.158a3 3 0 0 1-4.242-4.242",key:"151rxh"}],["path",{d:"M17.479 17.499a10.75 10.75 0 0 1-15.417-5.151 1 1 0 0 1 0-.696 10.75 10.75 0 0 1 4.446-5.143",key:"13bj9a"}],["path",{d:"m2 2 20 20",key:"1ooewy"}]],UZ=we("EyeOff",FZ);/**
|
|
281
|
+
* @license lucide-react v0.477.0 - ISC
|
|
282
|
+
*
|
|
283
|
+
* This source code is licensed under the ISC license.
|
|
284
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
285
|
+
*/const HZ=[["path",{d:"M2.062 12.348a1 1 0 0 1 0-.696 10.75 10.75 0 0 1 19.876 0 1 1 0 0 1 0 .696 10.75 10.75 0 0 1-19.876 0",key:"1nclc0"}],["circle",{cx:"12",cy:"12",r:"3",key:"1v7zrd"}]],BZ=we("Eye",HZ);/**
|
|
286
|
+
* @license lucide-react v0.477.0 - ISC
|
|
287
|
+
*
|
|
288
|
+
* This source code is licensed under the ISC license.
|
|
289
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
290
|
+
*/const VZ=[["path",{d:"M15 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V7Z",key:"1rqfz7"}],["path",{d:"M14 2v4a2 2 0 0 0 2 2h4",key:"tnqrlb"}],["path",{d:"M12 18v-6",key:"17g6i2"}],["path",{d:"m9 15 3 3 3-3",key:"1npd3o"}]],Rz=we("FileDown",VZ);/**
|
|
291
|
+
* @license lucide-react v0.477.0 - ISC
|
|
292
|
+
*
|
|
293
|
+
* This source code is licensed under the ISC license.
|
|
294
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
295
|
+
*/const WZ=[["path",{d:"M15 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V7Z",key:"1rqfz7"}],["path",{d:"M14 2v4a2 2 0 0 0 2 2h4",key:"tnqrlb"}],["path",{d:"M10 12a1 1 0 0 0-1 1v1a1 1 0 0 1-1 1 1 1 0 0 1 1 1v1a1 1 0 0 0 1 1",key:"1oajmo"}],["path",{d:"M14 18a1 1 0 0 0 1-1v-1a1 1 0 0 1 1-1 1 1 0 0 1-1-1v-1a1 1 0 0 0-1-1",key:"mpwhp6"}]],kz=we("FileJson",WZ);/**
|
|
296
|
+
* @license lucide-react v0.477.0 - ISC
|
|
297
|
+
*
|
|
298
|
+
* This source code is licensed under the ISC license.
|
|
299
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
300
|
+
*/const GZ=[["path",{d:"M15 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V7Z",key:"1rqfz7"}],["path",{d:"M14 2v4a2 2 0 0 0 2 2h4",key:"tnqrlb"}],["path",{d:"M10 9H8",key:"b1mrlr"}],["path",{d:"M16 13H8",key:"t4e002"}],["path",{d:"M16 17H8",key:"z1uh3a"}]],KZ=we("FileText",GZ);/**
|
|
301
|
+
* @license lucide-react v0.477.0 - ISC
|
|
302
|
+
*
|
|
303
|
+
* This source code is licensed under the ISC license.
|
|
304
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
305
|
+
*/const YZ=[["polygon",{points:"22 3 2 3 10 12.46 10 19 14 21 14 12.46 22 3",key:"1yg77f"}]],Kg=we("Filter",YZ);/**
|
|
306
|
+
* @license lucide-react v0.477.0 - ISC
|
|
307
|
+
*
|
|
308
|
+
* This source code is licensed under the ISC license.
|
|
309
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
310
|
+
*/const XZ=[["path",{d:"M12 10v6",key:"1bos4e"}],["path",{d:"M9 13h6",key:"1uhe8q"}],["path",{d:"M20 20a2 2 0 0 0 2-2V8a2 2 0 0 0-2-2h-7.9a2 2 0 0 1-1.69-.9L9.6 3.9A2 2 0 0 0 7.93 3H4a2 2 0 0 0-2 2v13a2 2 0 0 0 2 2Z",key:"1kt360"}]],Oz=we("FolderPlus",XZ);/**
|
|
311
|
+
* @license lucide-react v0.477.0 - ISC
|
|
312
|
+
*
|
|
313
|
+
* This source code is licensed under the ISC license.
|
|
314
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
315
|
+
*/const ZZ=[["path",{d:"M20 20a2 2 0 0 0 2-2V8a2 2 0 0 0-2-2h-7.9a2 2 0 0 1-1.69-.9L9.6 3.9A2 2 0 0 0 7.93 3H4a2 2 0 0 0-2 2v13a2 2 0 0 0 2 2Z",key:"1kt360"}]],Mz=we("Folder",ZZ);/**
|
|
316
|
+
* @license lucide-react v0.477.0 - ISC
|
|
317
|
+
*
|
|
318
|
+
* This source code is licensed under the ISC license.
|
|
319
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
320
|
+
*/const QZ=[["line",{x1:"6",x2:"6",y1:"3",y2:"15",key:"17qcm7"}],["circle",{cx:"18",cy:"6",r:"3",key:"1h7g24"}],["circle",{cx:"6",cy:"18",r:"3",key:"fqmcym"}],["path",{d:"M18 9a9 9 0 0 1-9 9",key:"n2h4wq"}]],hf=we("GitBranch",QZ);/**
|
|
321
|
+
* @license lucide-react v0.477.0 - ISC
|
|
322
|
+
*
|
|
323
|
+
* This source code is licensed under the ISC license.
|
|
324
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
325
|
+
*/const JZ=[["circle",{cx:"12",cy:"12",r:"3",key:"1v7zrd"}],["line",{x1:"3",x2:"9",y1:"12",y2:"12",key:"1dyftd"}],["line",{x1:"15",x2:"21",y1:"12",y2:"12",key:"oup4p8"}]],eQ=we("GitCommitHorizontal",JZ);/**
|
|
326
|
+
* @license lucide-react v0.477.0 - ISC
|
|
327
|
+
*
|
|
328
|
+
* This source code is licensed under the ISC license.
|
|
329
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
330
|
+
*/const tQ=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 2a14.5 14.5 0 0 0 0 20 14.5 14.5 0 0 0 0-20",key:"13o1zl"}],["path",{d:"M2 12h20",key:"9i4pu4"}]],_g=we("Globe",tQ);/**
|
|
331
|
+
* @license lucide-react v0.477.0 - ISC
|
|
332
|
+
*
|
|
333
|
+
* This source code is licensed under the ISC license.
|
|
334
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
335
|
+
*/const nQ=[["circle",{cx:"9",cy:"12",r:"1",key:"1vctgf"}],["circle",{cx:"9",cy:"5",r:"1",key:"hp0tcf"}],["circle",{cx:"9",cy:"19",r:"1",key:"fkjjf6"}],["circle",{cx:"15",cy:"12",r:"1",key:"1tmaij"}],["circle",{cx:"15",cy:"5",r:"1",key:"19l28e"}],["circle",{cx:"15",cy:"19",r:"1",key:"f4zoj3"}]],rQ=we("GripVertical",nQ);/**
|
|
336
|
+
* @license lucide-react v0.477.0 - ISC
|
|
337
|
+
*
|
|
338
|
+
* This source code is licensed under the ISC license.
|
|
339
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
340
|
+
*/const aQ=[["path",{d:"M18 11V6a2 2 0 0 0-2-2a2 2 0 0 0-2 2",key:"1fvzgz"}],["path",{d:"M14 10V4a2 2 0 0 0-2-2a2 2 0 0 0-2 2v2",key:"1kc0my"}],["path",{d:"M10 10.5V6a2 2 0 0 0-2-2a2 2 0 0 0-2 2v8",key:"10h0bg"}],["path",{d:"M18 8a2 2 0 1 1 4 0v6a8 8 0 0 1-8 8h-2c-2.8 0-4.5-.86-5.99-2.34l-3.6-3.6a2 2 0 0 1 2.83-2.82L7 15",key:"1s1gnw"}]],sQ=we("Hand",aQ);/**
|
|
341
|
+
* @license lucide-react v0.477.0 - ISC
|
|
342
|
+
*
|
|
343
|
+
* This source code is licensed under the ISC license.
|
|
344
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
345
|
+
*/const oQ=[["path",{d:"M3 12a9 9 0 1 0 9-9 9.75 9.75 0 0 0-6.74 2.74L3 8",key:"1357e3"}],["path",{d:"M3 3v5h5",key:"1xhq8a"}],["path",{d:"M12 7v5l4 2",key:"1fdv2h"}]],Dz=we("History",oQ);/**
|
|
346
|
+
* @license lucide-react v0.477.0 - ISC
|
|
347
|
+
*
|
|
348
|
+
* This source code is licensed under the ISC license.
|
|
349
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
350
|
+
*/const iQ=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 16v-4",key:"1dtifu"}],["path",{d:"M12 8h.01",key:"e9boi3"}]],lQ=we("Info",iQ);/**
|
|
351
|
+
* @license lucide-react v0.477.0 - ISC
|
|
352
|
+
*
|
|
353
|
+
* This source code is licensed under the ISC license.
|
|
354
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
355
|
+
*/const cQ=[["path",{d:"m15.5 7.5 2.3 2.3a1 1 0 0 0 1.4 0l2.1-2.1a1 1 0 0 0 0-1.4L19 4",key:"g0fldk"}],["path",{d:"m21 2-9.6 9.6",key:"1j0ho8"}],["circle",{cx:"7.5",cy:"15.5",r:"5.5",key:"yqb3hr"}]],Pz=we("Key",cQ);/**
|
|
356
|
+
* @license lucide-react v0.477.0 - ISC
|
|
357
|
+
*
|
|
358
|
+
* This source code is licensed under the ISC license.
|
|
359
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
360
|
+
*/const uQ=[["path",{d:"M20 16V7a2 2 0 0 0-2-2H6a2 2 0 0 0-2 2v9m16 0H4m16 0 1.28 2.55a1 1 0 0 1-.9 1.45H3.62a1 1 0 0 1-.9-1.45L4 16",key:"tarvll"}]],dQ=we("Laptop",uQ);/**
|
|
361
|
+
* @license lucide-react v0.477.0 - ISC
|
|
362
|
+
*
|
|
363
|
+
* This source code is licensed under the ISC license.
|
|
364
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
365
|
+
*/const fQ=[["path",{d:"M10 13a5 5 0 0 0 7.54.54l3-3a5 5 0 0 0-7.07-7.07l-1.72 1.71",key:"1cjeqo"}],["path",{d:"M14 11a5 5 0 0 0-7.54-.54l-3 3a5 5 0 0 0 7.07 7.07l1.71-1.71",key:"19qd67"}]],hQ=we("Link",fQ);/**
|
|
366
|
+
* @license lucide-react v0.477.0 - ISC
|
|
367
|
+
*
|
|
368
|
+
* This source code is licensed under the ISC license.
|
|
369
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
370
|
+
*/const pQ=[["path",{d:"M16 8a6 6 0 0 1 6 6v7h-4v-7a2 2 0 0 0-2-2 2 2 0 0 0-2 2v7h-4v-7a6 6 0 0 1 6-6z",key:"c2jq9f"}],["rect",{width:"4",height:"12",x:"2",y:"9",key:"mk3on5"}],["circle",{cx:"4",cy:"4",r:"2",key:"bt5ra8"}]],mQ=we("Linkedin",pQ);/**
|
|
371
|
+
* @license lucide-react v0.477.0 - ISC
|
|
372
|
+
*
|
|
373
|
+
* This source code is licensed under the ISC license.
|
|
374
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
375
|
+
*/const gQ=[["path",{d:"M21 12a9 9 0 1 1-6.219-8.56",key:"13zald"}]],zo=we("LoaderCircle",gQ);/**
|
|
376
|
+
* @license lucide-react v0.477.0 - ISC
|
|
377
|
+
*
|
|
378
|
+
* This source code is licensed under the ISC license.
|
|
379
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
380
|
+
*/const yQ=[["rect",{width:"18",height:"11",x:"3",y:"11",rx:"2",ry:"2",key:"1w4ew1"}],["path",{d:"M7 11V7a5 5 0 0 1 10 0v4",key:"fwvmzm"}]],vQ=we("Lock",yQ);/**
|
|
381
|
+
* @license lucide-react v0.477.0 - ISC
|
|
382
|
+
*
|
|
383
|
+
* This source code is licensed under the ISC license.
|
|
384
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
385
|
+
*/const xQ=[["path",{d:"M9 21H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h4",key:"1uf3rs"}],["polyline",{points:"16 17 21 12 16 7",key:"1gabdz"}],["line",{x1:"21",x2:"9",y1:"12",y2:"12",key:"1uyos4"}]],bQ=we("LogOut",xQ);/**
|
|
386
|
+
* @license lucide-react v0.477.0 - ISC
|
|
387
|
+
*
|
|
388
|
+
* This source code is licensed under the ISC license.
|
|
389
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
390
|
+
*/const wQ=[["rect",{width:"20",height:"16",x:"2",y:"4",rx:"2",key:"18n3k1"}],["path",{d:"m22 7-8.97 5.7a1.94 1.94 0 0 1-2.06 0L2 7",key:"1ocrg3"}]],SQ=we("Mail",wQ);/**
|
|
391
|
+
* @license lucide-react v0.477.0 - ISC
|
|
392
|
+
*
|
|
393
|
+
* This source code is licensed under the ISC license.
|
|
394
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
395
|
+
*/const _Q=[["polyline",{points:"15 3 21 3 21 9",key:"mznyad"}],["polyline",{points:"9 21 3 21 3 15",key:"1avn1i"}],["line",{x1:"21",x2:"14",y1:"3",y2:"10",key:"ota7mn"}],["line",{x1:"3",x2:"10",y1:"21",y2:"14",key:"1atl0r"}]],NQ=we("Maximize2",_Q);/**
|
|
396
|
+
* @license lucide-react v0.477.0 - ISC
|
|
397
|
+
*
|
|
398
|
+
* This source code is licensed under the ISC license.
|
|
399
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
400
|
+
*/const jQ=[["path",{d:"M7.9 20A9 9 0 1 0 4 16.1L2 22Z",key:"vv11sd"}]],CQ=we("MessageCircle",jQ);/**
|
|
401
|
+
* @license lucide-react v0.477.0 - ISC
|
|
402
|
+
*
|
|
403
|
+
* This source code is licensed under the ISC license.
|
|
404
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
405
|
+
*/const EQ=[["path",{d:"M21 15a2 2 0 0 1-2 2H7l-4 4V5a2 2 0 0 1 2-2h14a2 2 0 0 1 2 2z",key:"1lielz"}]],Ea=we("MessageSquare",EQ);/**
|
|
406
|
+
* @license lucide-react v0.477.0 - ISC
|
|
407
|
+
*
|
|
408
|
+
* This source code is licensed under the ISC license.
|
|
409
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
410
|
+
*/const TQ=[["polyline",{points:"4 14 10 14 10 20",key:"11kfnr"}],["polyline",{points:"20 10 14 10 14 4",key:"rlmsce"}],["line",{x1:"14",x2:"21",y1:"10",y2:"3",key:"o5lafz"}],["line",{x1:"3",x2:"10",y1:"21",y2:"14",key:"1atl0r"}]],AQ=we("Minimize2",TQ);/**
|
|
411
|
+
* @license lucide-react v0.477.0 - ISC
|
|
412
|
+
*
|
|
413
|
+
* This source code is licensed under the ISC license.
|
|
414
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
415
|
+
*/const RQ=[["path",{d:"M8 3v3a2 2 0 0 1-2 2H3",key:"hohbtr"}],["path",{d:"M21 8h-3a2 2 0 0 1-2-2V3",key:"5jw1f3"}],["path",{d:"M3 16h3a2 2 0 0 1 2 2v3",key:"198tvr"}],["path",{d:"M16 21v-3a2 2 0 0 1 2-2h3",key:"ph8mxp"}]],$z=we("Minimize",RQ);/**
|
|
416
|
+
* @license lucide-react v0.477.0 - ISC
|
|
417
|
+
*
|
|
418
|
+
* This source code is licensed under the ISC license.
|
|
419
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
420
|
+
*/const kQ=[["rect",{width:"20",height:"14",x:"2",y:"3",rx:"2",key:"48i651"}],["line",{x1:"8",x2:"16",y1:"21",y2:"21",key:"1svkeh"}],["line",{x1:"12",x2:"12",y1:"17",y2:"21",key:"vw1qmm"}]],Iz=we("Monitor",kQ);/**
|
|
421
|
+
* @license lucide-react v0.477.0 - ISC
|
|
422
|
+
*
|
|
423
|
+
* This source code is licensed under the ISC license.
|
|
424
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
425
|
+
*/const OQ=[["path",{d:"M12 3a6 6 0 0 0 9 9 9 9 0 1 1-9-9Z",key:"a7tn18"}]],Lz=we("Moon",OQ);/**
|
|
426
|
+
* @license lucide-react v0.477.0 - ISC
|
|
427
|
+
*
|
|
428
|
+
* This source code is licensed under the ISC license.
|
|
429
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
430
|
+
*/const MQ=[["path",{d:"m18 8 4 4-4 4",key:"1ak13k"}],["path",{d:"M2 12h20",key:"9i4pu4"}],["path",{d:"m6 8-4 4 4 4",key:"15zrgr"}]],DQ=we("MoveHorizontal",MQ);/**
|
|
431
|
+
* @license lucide-react v0.477.0 - ISC
|
|
432
|
+
*
|
|
433
|
+
* This source code is licensed under the ISC license.
|
|
434
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
435
|
+
*/const PQ=[["circle",{cx:"13.5",cy:"6.5",r:".5",fill:"currentColor",key:"1okk4w"}],["circle",{cx:"17.5",cy:"10.5",r:".5",fill:"currentColor",key:"f64h9f"}],["circle",{cx:"8.5",cy:"7.5",r:".5",fill:"currentColor",key:"fotxhn"}],["circle",{cx:"6.5",cy:"12.5",r:".5",fill:"currentColor",key:"qy21gx"}],["path",{d:"M12 2C6.5 2 2 6.5 2 12s4.5 10 10 10c.926 0 1.648-.746 1.648-1.688 0-.437-.18-.835-.437-1.125-.29-.289-.438-.652-.438-1.125a1.64 1.64 0 0 1 1.668-1.668h1.996c3.051 0 5.555-2.503 5.555-5.554C21.965 6.012 17.461 2 12 2z",key:"12rzf8"}]],zz=we("Palette",PQ);/**
|
|
436
|
+
* @license lucide-react v0.477.0 - ISC
|
|
437
|
+
*
|
|
438
|
+
* This source code is licensed under the ISC license.
|
|
439
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
440
|
+
*/const $Q=[["rect",{x:"14",y:"4",width:"4",height:"16",rx:"1",key:"zuxfzm"}],["rect",{x:"6",y:"4",width:"4",height:"16",rx:"1",key:"1okwgv"}]],IQ=we("Pause",$Q);/**
|
|
441
|
+
* @license lucide-react v0.477.0 - ISC
|
|
442
|
+
*
|
|
443
|
+
* This source code is licensed under the ISC license.
|
|
444
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
445
|
+
*/const LQ=[["path",{d:"M21.174 6.812a1 1 0 0 0-3.986-3.987L3.842 16.174a2 2 0 0 0-.5.83l-1.321 4.352a.5.5 0 0 0 .623.622l4.353-1.32a2 2 0 0 0 .83-.497z",key:"1a8usu"}],["path",{d:"m15 5 4 4",key:"1mk7zo"}]],Dj=we("Pencil",LQ);/**
|
|
446
|
+
* @license lucide-react v0.477.0 - ISC
|
|
447
|
+
*
|
|
448
|
+
* This source code is licensed under the ISC license.
|
|
449
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
450
|
+
*/const zQ=[["polygon",{points:"6 3 20 12 6 21 6 3",key:"1oa8hb"}]],Wf=we("Play",zQ);/**
|
|
451
|
+
* @license lucide-react v0.477.0 - ISC
|
|
452
|
+
*
|
|
453
|
+
* This source code is licensed under the ISC license.
|
|
454
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
455
|
+
*/const qQ=[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"M12 5v14",key:"s699le"}]],ll=we("Plus",qQ);/**
|
|
456
|
+
* @license lucide-react v0.477.0 - ISC
|
|
457
|
+
*
|
|
458
|
+
* This source code is licensed under the ISC license.
|
|
459
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
460
|
+
*/const FQ=[["path",{d:"M15.39 4.39a1 1 0 0 0 1.68-.474 2.5 2.5 0 1 1 3.014 3.015 1 1 0 0 0-.474 1.68l1.683 1.682a2.414 2.414 0 0 1 0 3.414L19.61 15.39a1 1 0 0 1-1.68-.474 2.5 2.5 0 1 0-3.014 3.015 1 1 0 0 1 .474 1.68l-1.683 1.682a2.414 2.414 0 0 1-3.414 0L8.61 19.61a1 1 0 0 0-1.68.474 2.5 2.5 0 1 1-3.014-3.015 1 1 0 0 0 .474-1.68l-1.683-1.682a2.414 2.414 0 0 1 0-3.414L4.39 8.61a1 1 0 0 1 1.68.474 2.5 2.5 0 1 0 3.014-3.015 1 1 0 0 1-.474-1.68l1.683-1.682a2.414 2.414 0 0 1 3.414 0z",key:"w46dr5"}]],UQ=we("Puzzle",FQ);/**
|
|
461
|
+
* @license lucide-react v0.477.0 - ISC
|
|
462
|
+
*
|
|
463
|
+
* This source code is licensed under the ISC license.
|
|
464
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
465
|
+
*/const HQ=[["path",{d:"M21 12a9 9 0 0 0-9-9 9.75 9.75 0 0 0-6.74 2.74L3 8",key:"14sxne"}],["path",{d:"M3 3v5h5",key:"1xhq8a"}],["path",{d:"M3 12a9 9 0 0 0 9 9 9.75 9.75 0 0 0 6.74-2.74L21 16",key:"1hlbsb"}],["path",{d:"M16 16h5v5",key:"ccwih5"}]],qz=we("RefreshCcw",HQ);/**
|
|
466
|
+
* @license lucide-react v0.477.0 - ISC
|
|
467
|
+
*
|
|
468
|
+
* This source code is licensed under the ISC license.
|
|
469
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
470
|
+
*/const BQ=[["path",{d:"M3 12a9 9 0 0 1 9-9 9.75 9.75 0 0 1 6.74 2.74L21 8",key:"v9h5vc"}],["path",{d:"M21 3v5h-5",key:"1q7to0"}],["path",{d:"M21 12a9 9 0 0 1-9 9 9.75 9.75 0 0 1-6.74-2.74L3 16",key:"3uifl3"}],["path",{d:"M8 16H3v5",key:"1cv678"}]],XC=we("RefreshCw",BQ);/**
|
|
471
|
+
* @license lucide-react v0.477.0 - ISC
|
|
472
|
+
*
|
|
473
|
+
* This source code is licensed under the ISC license.
|
|
474
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
475
|
+
*/const VQ=[["path",{d:"M3 12a9 9 0 1 0 9-9 9.75 9.75 0 0 0-6.74 2.74L3 8",key:"1357e3"}],["path",{d:"M3 3v5h5",key:"1xhq8a"}]],Fz=we("RotateCcw",VQ);/**
|
|
476
|
+
* @license lucide-react v0.477.0 - ISC
|
|
477
|
+
*
|
|
478
|
+
* This source code is licensed under the ISC license.
|
|
479
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
480
|
+
*/const WQ=[["path",{d:"M21 12a9 9 0 1 1-9-9c2.52 0 4.93 1 6.74 2.74L21 8",key:"1p45f6"}],["path",{d:"M21 3v5h-5",key:"1q7to0"}]],ZC=we("RotateCw",WQ);/**
|
|
481
|
+
* @license lucide-react v0.477.0 - ISC
|
|
482
|
+
*
|
|
483
|
+
* This source code is licensed under the ISC license.
|
|
484
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
485
|
+
*/const GQ=[["path",{d:"M15.2 3a2 2 0 0 1 1.4.6l3.8 3.8a2 2 0 0 1 .6 1.4V19a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2z",key:"1c8476"}],["path",{d:"M17 21v-7a1 1 0 0 0-1-1H8a1 1 0 0 0-1 1v7",key:"1ydtos"}],["path",{d:"M7 3v4a1 1 0 0 0 1 1h7",key:"t51u73"}]],Uz=we("Save",GQ);/**
|
|
486
|
+
* @license lucide-react v0.477.0 - ISC
|
|
487
|
+
*
|
|
488
|
+
* This source code is licensed under the ISC license.
|
|
489
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
490
|
+
*/const KQ=[["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}],["path",{d:"m21 21-4.3-4.3",key:"1qie3q"}]],ia=we("Search",KQ);/**
|
|
491
|
+
* @license lucide-react v0.477.0 - ISC
|
|
492
|
+
*
|
|
493
|
+
* This source code is licensed under the ISC license.
|
|
494
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
495
|
+
*/const YQ=[["path",{d:"M12.22 2h-.44a2 2 0 0 0-2 2v.18a2 2 0 0 1-1 1.73l-.43.25a2 2 0 0 1-2 0l-.15-.08a2 2 0 0 0-2.73.73l-.22.38a2 2 0 0 0 .73 2.73l.15.1a2 2 0 0 1 1 1.72v.51a2 2 0 0 1-1 1.74l-.15.09a2 2 0 0 0-.73 2.73l.22.38a2 2 0 0 0 2.73.73l.15-.08a2 2 0 0 1 2 0l.43.25a2 2 0 0 1 1 1.73V20a2 2 0 0 0 2 2h.44a2 2 0 0 0 2-2v-.18a2 2 0 0 1 1-1.73l.43-.25a2 2 0 0 1 2 0l.15.08a2 2 0 0 0 2.73-.73l.22-.39a2 2 0 0 0-.73-2.73l-.15-.08a2 2 0 0 1-1-1.74v-.5a2 2 0 0 1 1-1.74l.15-.09a2 2 0 0 0 .73-2.73l-.22-.38a2 2 0 0 0-2.73-.73l-.15.08a2 2 0 0 1-2 0l-.43-.25a2 2 0 0 1-1-1.73V4a2 2 0 0 0-2-2z",key:"1qme2f"}],["circle",{cx:"12",cy:"12",r:"3",key:"1v7zrd"}]],Iy=we("Settings",YQ);/**
|
|
496
|
+
* @license lucide-react v0.477.0 - ISC
|
|
497
|
+
*
|
|
498
|
+
* This source code is licensed under the ISC license.
|
|
499
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
500
|
+
*/const XQ=[["path",{d:"M4 12v8a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2v-8",key:"1b2hhj"}],["polyline",{points:"16 6 12 2 8 6",key:"m901s6"}],["line",{x1:"12",x2:"12",y1:"2",y2:"15",key:"1p0rca"}]],ZQ=we("Share",XQ);/**
|
|
501
|
+
* @license lucide-react v0.477.0 - ISC
|
|
502
|
+
*
|
|
503
|
+
* This source code is licensed under the ISC license.
|
|
504
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
505
|
+
*/const QQ=[["path",{d:"M20 13c0 5-3.5 7.5-7.66 8.95a1 1 0 0 1-.67-.01C7.5 20.5 4 18 4 13V6a1 1 0 0 1 1-1c2 0 4.5-1.2 6.24-2.72a1.17 1.17 0 0 1 1.52 0C14.51 3.81 17 5 19 5a1 1 0 0 1 1 1z",key:"oel41y"}],["path",{d:"m9 12 2 2 4-4",key:"dzmm74"}]],JQ=we("ShieldCheck",QQ);/**
|
|
506
|
+
* @license lucide-react v0.477.0 - ISC
|
|
507
|
+
*
|
|
508
|
+
* This source code is licensed under the ISC license.
|
|
509
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
510
|
+
*/const eJ=[["path",{d:"M20 13c0 5-3.5 7.5-7.66 8.95a1 1 0 0 1-.67-.01C7.5 20.5 4 18 4 13V6a1 1 0 0 1 1-1c2 0 4.5-1.2 6.24-2.72a1.17 1.17 0 0 1 1.52 0C14.51 3.81 17 5 19 5a1 1 0 0 1 1 1z",key:"oel41y"}]],tJ=we("Shield",eJ);/**
|
|
511
|
+
* @license lucide-react v0.477.0 - ISC
|
|
512
|
+
*
|
|
513
|
+
* This source code is licensed under the ISC license.
|
|
514
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
515
|
+
*/const nJ=[["line",{x1:"4",x2:"4",y1:"21",y2:"14",key:"1p332r"}],["line",{x1:"4",x2:"4",y1:"10",y2:"3",key:"gb41h5"}],["line",{x1:"12",x2:"12",y1:"21",y2:"12",key:"hf2csr"}],["line",{x1:"12",x2:"12",y1:"8",y2:"3",key:"1kfi7u"}],["line",{x1:"20",x2:"20",y1:"21",y2:"16",key:"1lhrwl"}],["line",{x1:"20",x2:"20",y1:"12",y2:"3",key:"16vvfq"}],["line",{x1:"2",x2:"6",y1:"14",y2:"14",key:"1uebub"}],["line",{x1:"10",x2:"14",y1:"8",y2:"8",key:"1yglbp"}],["line",{x1:"18",x2:"22",y1:"16",y2:"16",key:"1jxqpz"}]],rJ=we("SlidersVertical",nJ);/**
|
|
516
|
+
* @license lucide-react v0.477.0 - ISC
|
|
517
|
+
*
|
|
518
|
+
* This source code is licensed under the ISC license.
|
|
519
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
520
|
+
*/const aJ=[["path",{d:"M9.937 15.5A2 2 0 0 0 8.5 14.063l-6.135-1.582a.5.5 0 0 1 0-.962L8.5 9.936A2 2 0 0 0 9.937 8.5l1.582-6.135a.5.5 0 0 1 .963 0L14.063 8.5A2 2 0 0 0 15.5 9.937l6.135 1.581a.5.5 0 0 1 0 .964L15.5 14.063a2 2 0 0 0-1.437 1.437l-1.582 6.135a.5.5 0 0 1-.963 0z",key:"4pj2yx"}],["path",{d:"M20 3v4",key:"1olli1"}],["path",{d:"M22 5h-4",key:"1gvqau"}],["path",{d:"M4 17v2",key:"vumght"}],["path",{d:"M5 18H3",key:"zchphs"}]],Ng=we("Sparkles",aJ);/**
|
|
521
|
+
* @license lucide-react v0.477.0 - ISC
|
|
522
|
+
*
|
|
523
|
+
* This source code is licensed under the ISC license.
|
|
524
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
525
|
+
*/const sJ=[["path",{d:"M12 3H5a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h14a2 2 0 0 0 2-2v-7",key:"1m0v6g"}],["path",{d:"M18.375 2.625a1 1 0 0 1 3 3l-9.013 9.014a2 2 0 0 1-.853.505l-2.873.84a.5.5 0 0 1-.62-.62l.84-2.873a2 2 0 0 1 .506-.852z",key:"ohrbg2"}]],oJ=we("SquarePen",sJ);/**
|
|
526
|
+
* @license lucide-react v0.477.0 - ISC
|
|
527
|
+
*
|
|
528
|
+
* This source code is licensed under the ISC license.
|
|
529
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
530
|
+
*/const iJ=[["path",{d:"m7 11 2-2-2-2",key:"1lz0vl"}],["path",{d:"M11 13h4",key:"1p7l4v"}],["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",ry:"2",key:"1m3agn"}]],lJ=we("SquareTerminal",iJ);/**
|
|
531
|
+
* @license lucide-react v0.477.0 - ISC
|
|
532
|
+
*
|
|
533
|
+
* This source code is licensed under the ISC license.
|
|
534
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
535
|
+
*/const cJ=[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}]],Hz=we("Square",cJ);/**
|
|
536
|
+
* @license lucide-react v0.477.0 - ISC
|
|
537
|
+
*
|
|
538
|
+
* This source code is licensed under the ISC license.
|
|
539
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
540
|
+
*/const uJ=[["path",{d:"M11.525 2.295a.53.53 0 0 1 .95 0l2.31 4.679a2.123 2.123 0 0 0 1.595 1.16l5.166.756a.53.53 0 0 1 .294.904l-3.736 3.638a2.123 2.123 0 0 0-.611 1.878l.882 5.14a.53.53 0 0 1-.771.56l-4.618-2.428a2.122 2.122 0 0 0-1.973 0L6.396 21.01a.53.53 0 0 1-.77-.56l.881-5.139a2.122 2.122 0 0 0-.611-1.879L2.16 9.795a.53.53 0 0 1 .294-.906l5.165-.755a2.122 2.122 0 0 0 1.597-1.16z",key:"r04s7s"}]],dJ=we("Star",uJ);/**
|
|
541
|
+
* @license lucide-react v0.477.0 - ISC
|
|
542
|
+
*
|
|
543
|
+
* This source code is licensed under the ISC license.
|
|
544
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
545
|
+
*/const fJ=[["path",{d:"M16 3H5a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h14a2 2 0 0 0 2-2V8Z",key:"qazsjp"}],["path",{d:"M15 3v4a2 2 0 0 0 2 2h4",key:"40519r"}]],hJ=we("StickyNote",fJ);/**
|
|
546
|
+
* @license lucide-react v0.477.0 - ISC
|
|
547
|
+
*
|
|
548
|
+
* This source code is licensed under the ISC license.
|
|
549
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
550
|
+
*/const pJ=[["circle",{cx:"12",cy:"12",r:"4",key:"4exip2"}],["path",{d:"M12 2v2",key:"tus03m"}],["path",{d:"M12 20v2",key:"1lh1kg"}],["path",{d:"m4.93 4.93 1.41 1.41",key:"149t6j"}],["path",{d:"m17.66 17.66 1.41 1.41",key:"ptbguv"}],["path",{d:"M2 12h2",key:"1t8f8n"}],["path",{d:"M20 12h2",key:"1q8mjw"}],["path",{d:"m6.34 17.66-1.41 1.41",key:"1m8zz5"}],["path",{d:"m19.07 4.93-1.41 1.41",key:"1shlcs"}]],Bz=we("Sun",pJ);/**
|
|
551
|
+
* @license lucide-react v0.477.0 - ISC
|
|
552
|
+
*
|
|
553
|
+
* This source code is licensed under the ISC license.
|
|
554
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
555
|
+
*/const mJ=[["path",{d:"M12 3v18",key:"108xh3"}],["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}],["path",{d:"M3 9h18",key:"1pudct"}],["path",{d:"M3 15h18",key:"5xshup"}]],Vz=we("Table",mJ);/**
|
|
556
|
+
* @license lucide-react v0.477.0 - ISC
|
|
557
|
+
*
|
|
558
|
+
* This source code is licensed under the ISC license.
|
|
559
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
560
|
+
*/const gJ=[["path",{d:"m15 5 6.3 6.3a2.4 2.4 0 0 1 0 3.4L17 19",key:"1cbfv1"}],["path",{d:"M9.586 5.586A2 2 0 0 0 8.172 5H3a1 1 0 0 0-1 1v5.172a2 2 0 0 0 .586 1.414L8.29 18.29a2.426 2.426 0 0 0 3.42 0l3.58-3.58a2.426 2.426 0 0 0 0-3.42z",key:"135mg7"}],["circle",{cx:"6.5",cy:"9.5",r:".5",fill:"currentColor",key:"5pm5xn"}]],yJ=we("Tags",gJ);/**
|
|
561
|
+
* @license lucide-react v0.477.0 - ISC
|
|
562
|
+
*
|
|
563
|
+
* This source code is licensed under the ISC license.
|
|
564
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
565
|
+
*/const vJ=[["rect",{width:"20",height:"12",x:"2",y:"6",rx:"6",ry:"6",key:"f2vt7d"}],["circle",{cx:"8",cy:"12",r:"2",key:"1nvbw3"}]],xJ=we("ToggleLeft",vJ);/**
|
|
566
|
+
* @license lucide-react v0.477.0 - ISC
|
|
567
|
+
*
|
|
568
|
+
* This source code is licensed under the ISC license.
|
|
569
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
570
|
+
*/const bJ=[["path",{d:"M3 6h18",key:"d0wm0j"}],["path",{d:"M19 6v14c0 1-1 2-2 2H7c-1 0-2-1-2-2V6",key:"4alrt4"}],["path",{d:"M8 6V4c0-1 1-2 2-2h4c1 0 2 1 2 2v2",key:"v07s0e"}],["line",{x1:"10",x2:"10",y1:"11",y2:"17",key:"1uufr5"}],["line",{x1:"14",x2:"14",y1:"11",y2:"17",key:"xtxkd"}]],QC=we("Trash2",bJ);/**
|
|
571
|
+
* @license lucide-react v0.477.0 - ISC
|
|
572
|
+
*
|
|
573
|
+
* This source code is licensed under the ISC license.
|
|
574
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
575
|
+
*/const wJ=[["path",{d:"M3 6h18",key:"d0wm0j"}],["path",{d:"M19 6v14c0 1-1 2-2 2H7c-1 0-2-1-2-2V6",key:"4alrt4"}],["path",{d:"M8 6V4c0-1 1-2 2-2h4c1 0 2 1 2 2v2",key:"v07s0e"}]],Ly=we("Trash",wJ);/**
|
|
576
|
+
* @license lucide-react v0.477.0 - ISC
|
|
577
|
+
*
|
|
578
|
+
* This source code is licensed under the ISC license.
|
|
579
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
580
|
+
*/const SJ=[["path",{d:"m21.73 18-8-14a2 2 0 0 0-3.48 0l-8 14A2 2 0 0 0 4 21h16a2 2 0 0 0 1.73-3",key:"wmoenq"}],["path",{d:"M12 9v4",key:"juzpu7"}],["path",{d:"M12 17h.01",key:"p32p05"}]],JC=we("TriangleAlert",SJ);/**
|
|
581
|
+
* @license lucide-react v0.477.0 - ISC
|
|
582
|
+
*
|
|
583
|
+
* This source code is licensed under the ISC license.
|
|
584
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
585
|
+
*/const _J=[["path",{d:"M22 4s-.7 2.1-2 3.4c1.6 10-9.4 17.3-18 11.6 2.2.1 4.4-.6 6-2C3 15.5.5 9.6 3 5c2.2 2.6 5.6 4.1 9 4-.9-4.2 4-6.6 7-3.8 1.1 0 3-1.2 3-1.2z",key:"pff0z6"}]],NJ=we("Twitter",_J);/**
|
|
586
|
+
* @license lucide-react v0.477.0 - ISC
|
|
587
|
+
*
|
|
588
|
+
* This source code is licensed under the ISC license.
|
|
589
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
590
|
+
*/const jJ=[["path",{d:"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4",key:"ih7n3h"}],["polyline",{points:"17 8 12 3 7 8",key:"t8dd8p"}],["line",{x1:"12",x2:"12",y1:"3",y2:"15",key:"widbto"}]],CJ=we("Upload",jJ);/**
|
|
591
|
+
* @license lucide-react v0.477.0 - ISC
|
|
592
|
+
*
|
|
593
|
+
* This source code is licensed under the ISC license.
|
|
594
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
595
|
+
*/const EJ=[["path",{d:"M19 21v-2a4 4 0 0 0-4-4H9a4 4 0 0 0-4 4v2",key:"975kel"}],["circle",{cx:"12",cy:"7",r:"4",key:"17ys0d"}]],Pj=we("User",EJ);/**
|
|
596
|
+
* @license lucide-react v0.477.0 - ISC
|
|
597
|
+
*
|
|
598
|
+
* This source code is licensed under the ISC license.
|
|
599
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
600
|
+
*/const TJ=[["path",{d:"M16 21v-2a4 4 0 0 0-4-4H6a4 4 0 0 0-4 4v2",key:"1yyitq"}],["circle",{cx:"9",cy:"7",r:"4",key:"nufk8"}],["path",{d:"M22 21v-2a4 4 0 0 0-3-3.87",key:"kshegd"}],["path",{d:"M16 3.13a4 4 0 0 1 0 7.75",key:"1da9ce"}]],Wz=we("Users",TJ);/**
|
|
601
|
+
* @license lucide-react v0.477.0 - ISC
|
|
602
|
+
*
|
|
603
|
+
* This source code is licensed under the ISC license.
|
|
604
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
605
|
+
*/const AJ=[["path",{d:"M8 21s-4-3-4-9 4-9 4-9",key:"uto9ud"}],["path",{d:"M16 3s4 3 4 9-4 9-4 9",key:"4w2vsq"}],["line",{x1:"15",x2:"9",y1:"9",y2:"15",key:"f7djnv"}],["line",{x1:"9",x2:"15",y1:"9",y2:"15",key:"1shsy8"}]],RJ=we("Variable",AJ);/**
|
|
606
|
+
* @license lucide-react v0.477.0 - ISC
|
|
607
|
+
*
|
|
608
|
+
* This source code is licensed under the ISC license.
|
|
609
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
610
|
+
*/const kJ=[["path",{d:"m16 13 5.223 3.482a.5.5 0 0 0 .777-.416V7.87a.5.5 0 0 0-.752-.432L16 10.5",key:"ftymec"}],["rect",{x:"2",y:"6",width:"14",height:"12",rx:"2",key:"158x01"}]],OJ=we("Video",kJ);/**
|
|
611
|
+
* @license lucide-react v0.477.0 - ISC
|
|
612
|
+
*
|
|
613
|
+
* This source code is licensed under the ISC license.
|
|
614
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
615
|
+
*/const MJ=[["path",{d:"M14.7 6.3a1 1 0 0 0 0 1.4l1.6 1.6a1 1 0 0 0 1.4 0l3.77-3.77a6 6 0 0 1-7.94 7.94l-6.91 6.91a2.12 2.12 0 0 1-3-3l6.91-6.91a6 6 0 0 1 7.94-7.94l-3.76 3.76z",key:"cbrjhi"}]],DJ=we("Wrench",MJ);/**
|
|
616
|
+
* @license lucide-react v0.477.0 - ISC
|
|
617
|
+
*
|
|
618
|
+
* This source code is licensed under the ISC license.
|
|
619
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
620
|
+
*/const PJ=[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]],la=we("X",PJ);/**
|
|
621
|
+
* @license lucide-react v0.477.0 - ISC
|
|
622
|
+
*
|
|
623
|
+
* This source code is licensed under the ISC license.
|
|
624
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
625
|
+
*/const $J=[["path",{d:"M4 14a1 1 0 0 1-.78-1.63l9.9-10.2a.5.5 0 0 1 .86.46l-1.92 6.02A1 1 0 0 0 13 10h7a1 1 0 0 1 .78 1.63l-9.9 10.2a.5.5 0 0 1-.86-.46l1.92-6.02A1 1 0 0 0 11 14z",key:"1xq2db"}]],Gf=we("Zap",$J);function HO(e,t){if(typeof e=="function")return e(t);e!=null&&(e.current=t)}function La(...e){return t=>{let n=!1;const r=e.map(a=>{const s=HO(a,t);return!n&&typeof s=="function"&&(n=!0),s});if(n)return()=>{for(let a=0;a<r.length;a++){const s=r[a];typeof s=="function"?s():HO(e[a],null)}}}}function ze(...e){return N.useCallback(La(...e),e)}var IJ=Symbol.for("react.lazy"),Yg=ky[" use ".trim().toString()];function LJ(e){return typeof e=="object"&&e!==null&&"then"in e}function Gz(e){return e!=null&&typeof e=="object"&&"$$typeof"in e&&e.$$typeof===IJ&&"_payload"in e&&LJ(e._payload)}function zy(e){const t=qJ(e),n=N.forwardRef((r,a)=>{let{children:s,...i}=r;Gz(s)&&typeof Yg=="function"&&(s=Yg(s._payload));const l=N.Children.toArray(s),d=l.find(UJ);if(d){const f=d.props.children,h=l.map(p=>p===d?N.Children.count(f)>1?N.Children.only(null):N.isValidElement(f)?f.props.children:null:p);return c.jsx(t,{...i,ref:a,children:N.isValidElement(f)?N.cloneElement(f,void 0,h):null})}return c.jsx(t,{...i,ref:a,children:s})});return n.displayName=`${e}.Slot`,n}var zJ=zy("Slot");function qJ(e){const t=N.forwardRef((n,r)=>{let{children:a,...s}=n;if(Gz(a)&&typeof Yg=="function"&&(a=Yg(a._payload)),N.isValidElement(a)){const i=BJ(a),l=HJ(s,a.props);return a.type!==N.Fragment&&(l.ref=r?La(r,i):i),N.cloneElement(a,l)}return N.Children.count(a)>1?N.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var FJ=Symbol("radix.slottable");function UJ(e){return N.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===FJ}function HJ(e,t){const n={...t};for(const r in t){const a=e[r],s=t[r];/^on[A-Z]/.test(r)?a&&s?n[r]=(...l)=>{const d=s(...l);return a(...l),d}:a&&(n[r]=a):r==="style"?n[r]={...a,...s}:r==="className"&&(n[r]=[a,s].filter(Boolean).join(" "))}return{...e,...n}}function BJ(e){var r,a;let t=(r=Object.getOwnPropertyDescriptor(e.props,"ref"))==null?void 0:r.get,n=t&&"isReactWarning"in t&&t.isReactWarning;return n?e.ref:(t=(a=Object.getOwnPropertyDescriptor(e,"ref"))==null?void 0:a.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}function Kz(e){var t,n,r="";if(typeof e=="string"||typeof e=="number")r+=e;else if(typeof e=="object")if(Array.isArray(e)){var a=e.length;for(t=0;t<a;t++)e[t]&&(n=Kz(e[t]))&&(r&&(r+=" "),r+=n)}else for(n in e)e[n]&&(r&&(r+=" "),r+=n);return r}function Yz(){for(var e,t,n=0,r="",a=arguments.length;n<a;n++)(e=arguments[n])&&(t=Kz(e))&&(r&&(r+=" "),r+=t);return r}const BO=e=>typeof e=="boolean"?`${e}`:e===0?"0":e,VO=Yz,Kf=(e,t)=>n=>{var r;if((t==null?void 0:t.variants)==null)return VO(e,n==null?void 0:n.class,n==null?void 0:n.className);const{variants:a,defaultVariants:s}=t,i=Object.keys(a).map(f=>{const h=n==null?void 0:n[f],p=s==null?void 0:s[f];if(h===null)return null;const g=BO(h)||BO(p);return a[f][g]}),l=n&&Object.entries(n).reduce((f,h)=>{let[p,g]=h;return g===void 0||(f[p]=g),f},{}),d=t==null||(r=t.compoundVariants)===null||r===void 0?void 0:r.reduce((f,h)=>{let{class:p,className:g,...y}=h;return Object.entries(y).every(S=>{let[w,b]=S;return Array.isArray(b)?b.includes({...s,...l}[w]):{...s,...l}[w]===b})?[...f,p,g]:f},[]);return VO(e,i,d,n==null?void 0:n.class,n==null?void 0:n.className)},e2="-",VJ=e=>{const t=GJ(e),{conflictingClassGroups:n,conflictingClassGroupModifiers:r}=e;return{getClassGroupId:i=>{const l=i.split(e2);return l[0]===""&&l.length!==1&&l.shift(),Xz(l,t)||WJ(i)},getConflictingClassGroupIds:(i,l)=>{const d=n[i]||[];return l&&r[i]?[...d,...r[i]]:d}}},Xz=(e,t)=>{var i;if(e.length===0)return t.classGroupId;const n=e[0],r=t.nextPart.get(n),a=r?Xz(e.slice(1),r):void 0;if(a)return a;if(t.validators.length===0)return;const s=e.join(e2);return(i=t.validators.find(({validator:l})=>l(s)))==null?void 0:i.classGroupId},WO=/^\[(.+)\]$/,WJ=e=>{if(WO.test(e)){const t=WO.exec(e)[1],n=t==null?void 0:t.substring(0,t.indexOf(":"));if(n)return"arbitrary.."+n}},GJ=e=>{const{theme:t,classGroups:n}=e,r={nextPart:new Map,validators:[]};for(const a in n)$j(n[a],r,a,t);return r},$j=(e,t,n,r)=>{e.forEach(a=>{if(typeof a=="string"){const s=a===""?t:GO(t,a);s.classGroupId=n;return}if(typeof a=="function"){if(KJ(a)){$j(a(r),t,n,r);return}t.validators.push({validator:a,classGroupId:n});return}Object.entries(a).forEach(([s,i])=>{$j(i,GO(t,s),n,r)})})},GO=(e,t)=>{let n=e;return t.split(e2).forEach(r=>{n.nextPart.has(r)||n.nextPart.set(r,{nextPart:new Map,validators:[]}),n=n.nextPart.get(r)}),n},KJ=e=>e.isThemeGetter,YJ=e=>{if(e<1)return{get:()=>{},set:()=>{}};let t=0,n=new Map,r=new Map;const a=(s,i)=>{n.set(s,i),t++,t>e&&(t=0,r=n,n=new Map)};return{get(s){let i=n.get(s);if(i!==void 0)return i;if((i=r.get(s))!==void 0)return a(s,i),i},set(s,i){n.has(s)?n.set(s,i):a(s,i)}}},Ij="!",Lj=":",XJ=Lj.length,ZJ=e=>{const{prefix:t,experimentalParseClassName:n}=e;let r=a=>{const s=[];let i=0,l=0,d=0,f;for(let S=0;S<a.length;S++){let w=a[S];if(i===0&&l===0){if(w===Lj){s.push(a.slice(d,S)),d=S+XJ;continue}if(w==="/"){f=S;continue}}w==="["?i++:w==="]"?i--:w==="("?l++:w===")"&&l--}const h=s.length===0?a:a.substring(d),p=QJ(h),g=p!==h,y=f&&f>d?f-d:void 0;return{modifiers:s,hasImportantModifier:g,baseClassName:p,maybePostfixModifierPosition:y}};if(t){const a=t+Lj,s=r;r=i=>i.startsWith(a)?s(i.substring(a.length)):{isExternal:!0,modifiers:[],hasImportantModifier:!1,baseClassName:i,maybePostfixModifierPosition:void 0}}if(n){const a=r;r=s=>n({className:s,parseClassName:a})}return r},QJ=e=>e.endsWith(Ij)?e.substring(0,e.length-1):e.startsWith(Ij)?e.substring(1):e,JJ=e=>{const t=Object.fromEntries(e.orderSensitiveModifiers.map(r=>[r,!0]));return r=>{if(r.length<=1)return r;const a=[];let s=[];return r.forEach(i=>{i[0]==="["||t[i]?(a.push(...s.sort(),i),s=[]):s.push(i)}),a.push(...s.sort()),a}},eee=e=>({cache:YJ(e.cacheSize),parseClassName:ZJ(e),sortModifiers:JJ(e),...VJ(e)}),tee=/\s+/,nee=(e,t)=>{const{parseClassName:n,getClassGroupId:r,getConflictingClassGroupIds:a,sortModifiers:s}=t,i=[],l=e.trim().split(tee);let d="";for(let f=l.length-1;f>=0;f-=1){const h=l[f],{isExternal:p,modifiers:g,hasImportantModifier:y,baseClassName:S,maybePostfixModifierPosition:w}=n(h);if(p){d=h+(d.length>0?" "+d:d);continue}let b=!!w,x=r(b?S.substring(0,w):S);if(!x){if(!b){d=h+(d.length>0?" "+d:d);continue}if(x=r(S),!x){d=h+(d.length>0?" "+d:d);continue}b=!1}const _=s(g).join(":"),j=y?_+Ij:_,C=j+x;if(i.includes(C))continue;i.push(C);const T=a(x,b);for(let A=0;A<T.length;++A){const k=T[A];i.push(j+k)}d=h+(d.length>0?" "+d:d)}return d};function ree(){let e=0,t,n,r="";for(;e<arguments.length;)(t=arguments[e++])&&(n=Zz(t))&&(r&&(r+=" "),r+=n);return r}const Zz=e=>{if(typeof e=="string")return e;let t,n="";for(let r=0;r<e.length;r++)e[r]&&(t=Zz(e[r]))&&(n&&(n+=" "),n+=t);return n};function aee(e,...t){let n,r,a,s=i;function i(d){const f=t.reduce((h,p)=>p(h),e());return n=eee(f),r=n.cache.get,a=n.cache.set,s=l,l(d)}function l(d){const f=r(d);if(f)return f;const h=nee(d,n);return a(d,h),h}return function(){return s(ree.apply(null,arguments))}}const fn=e=>{const t=n=>n[e]||[];return t.isThemeGetter=!0,t},Qz=/^\[(?:(\w[\w-]*):)?(.+)\]$/i,Jz=/^\((?:(\w[\w-]*):)?(.+)\)$/i,see=/^\d+\/\d+$/,oee=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,iee=/\d+(%|px|r?em|[sdl]?v([hwib]|min|max)|pt|pc|in|cm|mm|cap|ch|ex|r?lh|cq(w|h|i|b|min|max))|\b(calc|min|max|clamp)\(.+\)|^0$/,lee=/^(rgba?|hsla?|hwb|(ok)?(lab|lch)|color-mix)\(.+\)$/,cee=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,uee=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,pc=e=>see.test(e),Ke=e=>!!e&&!Number.isNaN(Number(e)),xo=e=>!!e&&Number.isInteger(Number(e)),Kb=e=>e.endsWith("%")&&Ke(e.slice(0,-1)),hs=e=>oee.test(e),dee=()=>!0,fee=e=>iee.test(e)&&!lee.test(e),e6=()=>!1,hee=e=>cee.test(e),pee=e=>uee.test(e),mee=e=>!Ce(e)&&!Ee(e),gee=e=>du(e,r6,e6),Ce=e=>Qz.test(e),Ci=e=>du(e,a6,fee),Yb=e=>du(e,wee,Ke),KO=e=>du(e,t6,e6),yee=e=>du(e,n6,pee),sm=e=>du(e,s6,hee),Ee=e=>Jz.test(e),jd=e=>fu(e,a6),vee=e=>fu(e,See),YO=e=>fu(e,t6),xee=e=>fu(e,r6),bee=e=>fu(e,n6),om=e=>fu(e,s6,!0),du=(e,t,n)=>{const r=Qz.exec(e);return r?r[1]?t(r[1]):n(r[2]):!1},fu=(e,t,n=!1)=>{const r=Jz.exec(e);return r?r[1]?t(r[1]):n:!1},t6=e=>e==="position"||e==="percentage",n6=e=>e==="image"||e==="url",r6=e=>e==="length"||e==="size"||e==="bg-size",a6=e=>e==="length",wee=e=>e==="number",See=e=>e==="family-name",s6=e=>e==="shadow",_ee=()=>{const e=fn("color"),t=fn("font"),n=fn("text"),r=fn("font-weight"),a=fn("tracking"),s=fn("leading"),i=fn("breakpoint"),l=fn("container"),d=fn("spacing"),f=fn("radius"),h=fn("shadow"),p=fn("inset-shadow"),g=fn("text-shadow"),y=fn("drop-shadow"),S=fn("blur"),w=fn("perspective"),b=fn("aspect"),x=fn("ease"),_=fn("animate"),j=()=>["auto","avoid","all","avoid-page","page","left","right","column"],C=()=>["center","top","bottom","left","right","top-left","left-top","top-right","right-top","bottom-right","right-bottom","bottom-left","left-bottom"],T=()=>[...C(),Ee,Ce],A=()=>["auto","hidden","clip","visible","scroll"],k=()=>["auto","contain","none"],O=()=>[Ee,Ce,d],M=()=>[pc,"full","auto",...O()],z=()=>[xo,"none","subgrid",Ee,Ce],L=()=>["auto",{span:["full",xo,Ee,Ce]},xo,Ee,Ce],U=()=>[xo,"auto",Ee,Ce],F=()=>["auto","min","max","fr",Ee,Ce],q=()=>["start","end","center","between","around","evenly","stretch","baseline","center-safe","end-safe"],V=()=>["start","end","center","stretch","center-safe","end-safe"],P=()=>["auto",...O()],K=()=>[pc,"auto","full","dvw","dvh","lvw","lvh","svw","svh","min","max","fit",...O()],H=()=>[e,Ee,Ce],Z=()=>[...C(),YO,KO,{position:[Ee,Ce]}],J=()=>["no-repeat",{repeat:["","x","y","space","round"]}],D=()=>["auto","cover","contain",xee,gee,{size:[Ee,Ce]}],W=()=>[Kb,jd,Ci],B=()=>["","none","full",f,Ee,Ce],$=()=>["",Ke,jd,Ci],G=()=>["solid","dashed","dotted","double"],ee=()=>["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity"],re=()=>[Ke,Kb,YO,KO],ne=()=>["","none",S,Ee,Ce],Q=()=>["none",Ke,Ee,Ce],ae=()=>["none",Ke,Ee,Ce],Y=()=>[Ke,Ee,Ce],te=()=>[pc,"full",...O()];return{cacheSize:500,theme:{animate:["spin","ping","pulse","bounce"],aspect:["video"],blur:[hs],breakpoint:[hs],color:[dee],container:[hs],"drop-shadow":[hs],ease:["in","out","in-out"],font:[mee],"font-weight":["thin","extralight","light","normal","medium","semibold","bold","extrabold","black"],"inset-shadow":[hs],leading:["none","tight","snug","normal","relaxed","loose"],perspective:["dramatic","near","normal","midrange","distant","none"],radius:[hs],shadow:[hs],spacing:["px",Ke],text:[hs],"text-shadow":[hs],tracking:["tighter","tight","normal","wide","wider","widest"]},classGroups:{aspect:[{aspect:["auto","square",pc,Ce,Ee,b]}],container:["container"],columns:[{columns:[Ke,Ce,Ee,l]}],"break-after":[{"break-after":j()}],"break-before":[{"break-before":j()}],"break-inside":[{"break-inside":["auto","avoid","avoid-page","avoid-column"]}],"box-decoration":[{"box-decoration":["slice","clone"]}],box:[{box:["border","content"]}],display:["block","inline-block","inline","flex","inline-flex","table","inline-table","table-caption","table-cell","table-column","table-column-group","table-footer-group","table-header-group","table-row-group","table-row","flow-root","grid","inline-grid","contents","list-item","hidden"],sr:["sr-only","not-sr-only"],float:[{float:["right","left","none","start","end"]}],clear:[{clear:["left","right","both","none","start","end"]}],isolation:["isolate","isolation-auto"],"object-fit":[{object:["contain","cover","fill","none","scale-down"]}],"object-position":[{object:T()}],overflow:[{overflow:A()}],"overflow-x":[{"overflow-x":A()}],"overflow-y":[{"overflow-y":A()}],overscroll:[{overscroll:k()}],"overscroll-x":[{"overscroll-x":k()}],"overscroll-y":[{"overscroll-y":k()}],position:["static","fixed","absolute","relative","sticky"],inset:[{inset:M()}],"inset-x":[{"inset-x":M()}],"inset-y":[{"inset-y":M()}],start:[{start:M()}],end:[{end:M()}],top:[{top:M()}],right:[{right:M()}],bottom:[{bottom:M()}],left:[{left:M()}],visibility:["visible","invisible","collapse"],z:[{z:[xo,"auto",Ee,Ce]}],basis:[{basis:[pc,"full","auto",l,...O()]}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["nowrap","wrap","wrap-reverse"]}],flex:[{flex:[Ke,pc,"auto","initial","none",Ce]}],grow:[{grow:["",Ke,Ee,Ce]}],shrink:[{shrink:["",Ke,Ee,Ce]}],order:[{order:[xo,"first","last","none",Ee,Ce]}],"grid-cols":[{"grid-cols":z()}],"col-start-end":[{col:L()}],"col-start":[{"col-start":U()}],"col-end":[{"col-end":U()}],"grid-rows":[{"grid-rows":z()}],"row-start-end":[{row:L()}],"row-start":[{"row-start":U()}],"row-end":[{"row-end":U()}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":F()}],"auto-rows":[{"auto-rows":F()}],gap:[{gap:O()}],"gap-x":[{"gap-x":O()}],"gap-y":[{"gap-y":O()}],"justify-content":[{justify:[...q(),"normal"]}],"justify-items":[{"justify-items":[...V(),"normal"]}],"justify-self":[{"justify-self":["auto",...V()]}],"align-content":[{content:["normal",...q()]}],"align-items":[{items:[...V(),{baseline:["","last"]}]}],"align-self":[{self:["auto",...V(),{baseline:["","last"]}]}],"place-content":[{"place-content":q()}],"place-items":[{"place-items":[...V(),"baseline"]}],"place-self":[{"place-self":["auto",...V()]}],p:[{p:O()}],px:[{px:O()}],py:[{py:O()}],ps:[{ps:O()}],pe:[{pe:O()}],pt:[{pt:O()}],pr:[{pr:O()}],pb:[{pb:O()}],pl:[{pl:O()}],m:[{m:P()}],mx:[{mx:P()}],my:[{my:P()}],ms:[{ms:P()}],me:[{me:P()}],mt:[{mt:P()}],mr:[{mr:P()}],mb:[{mb:P()}],ml:[{ml:P()}],"space-x":[{"space-x":O()}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":O()}],"space-y-reverse":["space-y-reverse"],size:[{size:K()}],w:[{w:[l,"screen",...K()]}],"min-w":[{"min-w":[l,"screen","none",...K()]}],"max-w":[{"max-w":[l,"screen","none","prose",{screen:[i]},...K()]}],h:[{h:["screen","lh",...K()]}],"min-h":[{"min-h":["screen","lh","none",...K()]}],"max-h":[{"max-h":["screen","lh",...K()]}],"font-size":[{text:["base",n,jd,Ci]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:[r,Ee,Yb]}],"font-stretch":[{"font-stretch":["ultra-condensed","extra-condensed","condensed","semi-condensed","normal","semi-expanded","expanded","extra-expanded","ultra-expanded",Kb,Ce]}],"font-family":[{font:[vee,Ce,t]}],"fvn-normal":["normal-nums"],"fvn-ordinal":["ordinal"],"fvn-slashed-zero":["slashed-zero"],"fvn-figure":["lining-nums","oldstyle-nums"],"fvn-spacing":["proportional-nums","tabular-nums"],"fvn-fraction":["diagonal-fractions","stacked-fractions"],tracking:[{tracking:[a,Ee,Ce]}],"line-clamp":[{"line-clamp":[Ke,"none",Ee,Yb]}],leading:[{leading:[s,...O()]}],"list-image":[{"list-image":["none",Ee,Ce]}],"list-style-position":[{list:["inside","outside"]}],"list-style-type":[{list:["disc","decimal","none",Ee,Ce]}],"text-alignment":[{text:["left","center","right","justify","start","end"]}],"placeholder-color":[{placeholder:H()}],"text-color":[{text:H()}],"text-decoration":["underline","overline","line-through","no-underline"],"text-decoration-style":[{decoration:[...G(),"wavy"]}],"text-decoration-thickness":[{decoration:[Ke,"from-font","auto",Ee,Ci]}],"text-decoration-color":[{decoration:H()}],"underline-offset":[{"underline-offset":[Ke,"auto",Ee,Ce]}],"text-transform":["uppercase","lowercase","capitalize","normal-case"],"text-overflow":["truncate","text-ellipsis","text-clip"],"text-wrap":[{text:["wrap","nowrap","balance","pretty"]}],indent:[{indent:O()}],"vertical-align":[{align:["baseline","top","middle","bottom","text-top","text-bottom","sub","super",Ee,Ce]}],whitespace:[{whitespace:["normal","nowrap","pre","pre-line","pre-wrap","break-spaces"]}],break:[{break:["normal","words","all","keep"]}],wrap:[{wrap:["break-word","anywhere","normal"]}],hyphens:[{hyphens:["none","manual","auto"]}],content:[{content:["none",Ee,Ce]}],"bg-attachment":[{bg:["fixed","local","scroll"]}],"bg-clip":[{"bg-clip":["border","padding","content","text"]}],"bg-origin":[{"bg-origin":["border","padding","content"]}],"bg-position":[{bg:Z()}],"bg-repeat":[{bg:J()}],"bg-size":[{bg:D()}],"bg-image":[{bg:["none",{linear:[{to:["t","tr","r","br","b","bl","l","tl"]},xo,Ee,Ce],radial:["",Ee,Ce],conic:[xo,Ee,Ce]},bee,yee]}],"bg-color":[{bg:H()}],"gradient-from-pos":[{from:W()}],"gradient-via-pos":[{via:W()}],"gradient-to-pos":[{to:W()}],"gradient-from":[{from:H()}],"gradient-via":[{via:H()}],"gradient-to":[{to:H()}],rounded:[{rounded:B()}],"rounded-s":[{"rounded-s":B()}],"rounded-e":[{"rounded-e":B()}],"rounded-t":[{"rounded-t":B()}],"rounded-r":[{"rounded-r":B()}],"rounded-b":[{"rounded-b":B()}],"rounded-l":[{"rounded-l":B()}],"rounded-ss":[{"rounded-ss":B()}],"rounded-se":[{"rounded-se":B()}],"rounded-ee":[{"rounded-ee":B()}],"rounded-es":[{"rounded-es":B()}],"rounded-tl":[{"rounded-tl":B()}],"rounded-tr":[{"rounded-tr":B()}],"rounded-br":[{"rounded-br":B()}],"rounded-bl":[{"rounded-bl":B()}],"border-w":[{border:$()}],"border-w-x":[{"border-x":$()}],"border-w-y":[{"border-y":$()}],"border-w-s":[{"border-s":$()}],"border-w-e":[{"border-e":$()}],"border-w-t":[{"border-t":$()}],"border-w-r":[{"border-r":$()}],"border-w-b":[{"border-b":$()}],"border-w-l":[{"border-l":$()}],"divide-x":[{"divide-x":$()}],"divide-x-reverse":["divide-x-reverse"],"divide-y":[{"divide-y":$()}],"divide-y-reverse":["divide-y-reverse"],"border-style":[{border:[...G(),"hidden","none"]}],"divide-style":[{divide:[...G(),"hidden","none"]}],"border-color":[{border:H()}],"border-color-x":[{"border-x":H()}],"border-color-y":[{"border-y":H()}],"border-color-s":[{"border-s":H()}],"border-color-e":[{"border-e":H()}],"border-color-t":[{"border-t":H()}],"border-color-r":[{"border-r":H()}],"border-color-b":[{"border-b":H()}],"border-color-l":[{"border-l":H()}],"divide-color":[{divide:H()}],"outline-style":[{outline:[...G(),"none","hidden"]}],"outline-offset":[{"outline-offset":[Ke,Ee,Ce]}],"outline-w":[{outline:["",Ke,jd,Ci]}],"outline-color":[{outline:H()}],shadow:[{shadow:["","none",h,om,sm]}],"shadow-color":[{shadow:H()}],"inset-shadow":[{"inset-shadow":["none",p,om,sm]}],"inset-shadow-color":[{"inset-shadow":H()}],"ring-w":[{ring:$()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:H()}],"ring-offset-w":[{"ring-offset":[Ke,Ci]}],"ring-offset-color":[{"ring-offset":H()}],"inset-ring-w":[{"inset-ring":$()}],"inset-ring-color":[{"inset-ring":H()}],"text-shadow":[{"text-shadow":["none",g,om,sm]}],"text-shadow-color":[{"text-shadow":H()}],opacity:[{opacity:[Ke,Ee,Ce]}],"mix-blend":[{"mix-blend":[...ee(),"plus-darker","plus-lighter"]}],"bg-blend":[{"bg-blend":ee()}],"mask-clip":[{"mask-clip":["border","padding","content","fill","stroke","view"]},"mask-no-clip"],"mask-composite":[{mask:["add","subtract","intersect","exclude"]}],"mask-image-linear-pos":[{"mask-linear":[Ke]}],"mask-image-linear-from-pos":[{"mask-linear-from":re()}],"mask-image-linear-to-pos":[{"mask-linear-to":re()}],"mask-image-linear-from-color":[{"mask-linear-from":H()}],"mask-image-linear-to-color":[{"mask-linear-to":H()}],"mask-image-t-from-pos":[{"mask-t-from":re()}],"mask-image-t-to-pos":[{"mask-t-to":re()}],"mask-image-t-from-color":[{"mask-t-from":H()}],"mask-image-t-to-color":[{"mask-t-to":H()}],"mask-image-r-from-pos":[{"mask-r-from":re()}],"mask-image-r-to-pos":[{"mask-r-to":re()}],"mask-image-r-from-color":[{"mask-r-from":H()}],"mask-image-r-to-color":[{"mask-r-to":H()}],"mask-image-b-from-pos":[{"mask-b-from":re()}],"mask-image-b-to-pos":[{"mask-b-to":re()}],"mask-image-b-from-color":[{"mask-b-from":H()}],"mask-image-b-to-color":[{"mask-b-to":H()}],"mask-image-l-from-pos":[{"mask-l-from":re()}],"mask-image-l-to-pos":[{"mask-l-to":re()}],"mask-image-l-from-color":[{"mask-l-from":H()}],"mask-image-l-to-color":[{"mask-l-to":H()}],"mask-image-x-from-pos":[{"mask-x-from":re()}],"mask-image-x-to-pos":[{"mask-x-to":re()}],"mask-image-x-from-color":[{"mask-x-from":H()}],"mask-image-x-to-color":[{"mask-x-to":H()}],"mask-image-y-from-pos":[{"mask-y-from":re()}],"mask-image-y-to-pos":[{"mask-y-to":re()}],"mask-image-y-from-color":[{"mask-y-from":H()}],"mask-image-y-to-color":[{"mask-y-to":H()}],"mask-image-radial":[{"mask-radial":[Ee,Ce]}],"mask-image-radial-from-pos":[{"mask-radial-from":re()}],"mask-image-radial-to-pos":[{"mask-radial-to":re()}],"mask-image-radial-from-color":[{"mask-radial-from":H()}],"mask-image-radial-to-color":[{"mask-radial-to":H()}],"mask-image-radial-shape":[{"mask-radial":["circle","ellipse"]}],"mask-image-radial-size":[{"mask-radial":[{closest:["side","corner"],farthest:["side","corner"]}]}],"mask-image-radial-pos":[{"mask-radial-at":C()}],"mask-image-conic-pos":[{"mask-conic":[Ke]}],"mask-image-conic-from-pos":[{"mask-conic-from":re()}],"mask-image-conic-to-pos":[{"mask-conic-to":re()}],"mask-image-conic-from-color":[{"mask-conic-from":H()}],"mask-image-conic-to-color":[{"mask-conic-to":H()}],"mask-mode":[{mask:["alpha","luminance","match"]}],"mask-origin":[{"mask-origin":["border","padding","content","fill","stroke","view"]}],"mask-position":[{mask:Z()}],"mask-repeat":[{mask:J()}],"mask-size":[{mask:D()}],"mask-type":[{"mask-type":["alpha","luminance"]}],"mask-image":[{mask:["none",Ee,Ce]}],filter:[{filter:["","none",Ee,Ce]}],blur:[{blur:ne()}],brightness:[{brightness:[Ke,Ee,Ce]}],contrast:[{contrast:[Ke,Ee,Ce]}],"drop-shadow":[{"drop-shadow":["","none",y,om,sm]}],"drop-shadow-color":[{"drop-shadow":H()}],grayscale:[{grayscale:["",Ke,Ee,Ce]}],"hue-rotate":[{"hue-rotate":[Ke,Ee,Ce]}],invert:[{invert:["",Ke,Ee,Ce]}],saturate:[{saturate:[Ke,Ee,Ce]}],sepia:[{sepia:["",Ke,Ee,Ce]}],"backdrop-filter":[{"backdrop-filter":["","none",Ee,Ce]}],"backdrop-blur":[{"backdrop-blur":ne()}],"backdrop-brightness":[{"backdrop-brightness":[Ke,Ee,Ce]}],"backdrop-contrast":[{"backdrop-contrast":[Ke,Ee,Ce]}],"backdrop-grayscale":[{"backdrop-grayscale":["",Ke,Ee,Ce]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[Ke,Ee,Ce]}],"backdrop-invert":[{"backdrop-invert":["",Ke,Ee,Ce]}],"backdrop-opacity":[{"backdrop-opacity":[Ke,Ee,Ce]}],"backdrop-saturate":[{"backdrop-saturate":[Ke,Ee,Ce]}],"backdrop-sepia":[{"backdrop-sepia":["",Ke,Ee,Ce]}],"border-collapse":[{border:["collapse","separate"]}],"border-spacing":[{"border-spacing":O()}],"border-spacing-x":[{"border-spacing-x":O()}],"border-spacing-y":[{"border-spacing-y":O()}],"table-layout":[{table:["auto","fixed"]}],caption:[{caption:["top","bottom"]}],transition:[{transition:["","all","colors","opacity","shadow","transform","none",Ee,Ce]}],"transition-behavior":[{transition:["normal","discrete"]}],duration:[{duration:[Ke,"initial",Ee,Ce]}],ease:[{ease:["linear","initial",x,Ee,Ce]}],delay:[{delay:[Ke,Ee,Ce]}],animate:[{animate:["none",_,Ee,Ce]}],backface:[{backface:["hidden","visible"]}],perspective:[{perspective:[w,Ee,Ce]}],"perspective-origin":[{"perspective-origin":T()}],rotate:[{rotate:Q()}],"rotate-x":[{"rotate-x":Q()}],"rotate-y":[{"rotate-y":Q()}],"rotate-z":[{"rotate-z":Q()}],scale:[{scale:ae()}],"scale-x":[{"scale-x":ae()}],"scale-y":[{"scale-y":ae()}],"scale-z":[{"scale-z":ae()}],"scale-3d":["scale-3d"],skew:[{skew:Y()}],"skew-x":[{"skew-x":Y()}],"skew-y":[{"skew-y":Y()}],transform:[{transform:[Ee,Ce,"","none","gpu","cpu"]}],"transform-origin":[{origin:T()}],"transform-style":[{transform:["3d","flat"]}],translate:[{translate:te()}],"translate-x":[{"translate-x":te()}],"translate-y":[{"translate-y":te()}],"translate-z":[{"translate-z":te()}],"translate-none":["translate-none"],accent:[{accent:H()}],appearance:[{appearance:["none","auto"]}],"caret-color":[{caret:H()}],"color-scheme":[{scheme:["normal","dark","light","light-dark","only-dark","only-light"]}],cursor:[{cursor:["auto","default","pointer","wait","text","move","help","not-allowed","none","context-menu","progress","cell","crosshair","vertical-text","alias","copy","no-drop","grab","grabbing","all-scroll","col-resize","row-resize","n-resize","e-resize","s-resize","w-resize","ne-resize","nw-resize","se-resize","sw-resize","ew-resize","ns-resize","nesw-resize","nwse-resize","zoom-in","zoom-out",Ee,Ce]}],"field-sizing":[{"field-sizing":["fixed","content"]}],"pointer-events":[{"pointer-events":["auto","none"]}],resize:[{resize:["none","","y","x"]}],"scroll-behavior":[{scroll:["auto","smooth"]}],"scroll-m":[{"scroll-m":O()}],"scroll-mx":[{"scroll-mx":O()}],"scroll-my":[{"scroll-my":O()}],"scroll-ms":[{"scroll-ms":O()}],"scroll-me":[{"scroll-me":O()}],"scroll-mt":[{"scroll-mt":O()}],"scroll-mr":[{"scroll-mr":O()}],"scroll-mb":[{"scroll-mb":O()}],"scroll-ml":[{"scroll-ml":O()}],"scroll-p":[{"scroll-p":O()}],"scroll-px":[{"scroll-px":O()}],"scroll-py":[{"scroll-py":O()}],"scroll-ps":[{"scroll-ps":O()}],"scroll-pe":[{"scroll-pe":O()}],"scroll-pt":[{"scroll-pt":O()}],"scroll-pr":[{"scroll-pr":O()}],"scroll-pb":[{"scroll-pb":O()}],"scroll-pl":[{"scroll-pl":O()}],"snap-align":[{snap:["start","end","center","align-none"]}],"snap-stop":[{snap:["normal","always"]}],"snap-type":[{snap:["none","x","y","both"]}],"snap-strictness":[{snap:["mandatory","proximity"]}],touch:[{touch:["auto","none","manipulation"]}],"touch-x":[{"touch-pan":["x","left","right"]}],"touch-y":[{"touch-pan":["y","up","down"]}],"touch-pz":["touch-pinch-zoom"],select:[{select:["none","text","all","auto"]}],"will-change":[{"will-change":["auto","scroll","contents","transform",Ee,Ce]}],fill:[{fill:["none",...H()]}],"stroke-w":[{stroke:[Ke,jd,Ci,Yb]}],stroke:[{stroke:["none",...H()]}],"forced-color-adjust":[{"forced-color-adjust":["auto","none"]}]},conflictingClassGroups:{overflow:["overflow-x","overflow-y"],overscroll:["overscroll-x","overscroll-y"],inset:["inset-x","inset-y","start","end","top","right","bottom","left"],"inset-x":["right","left"],"inset-y":["top","bottom"],flex:["basis","grow","shrink"],gap:["gap-x","gap-y"],p:["px","py","ps","pe","pt","pr","pb","pl"],px:["pr","pl"],py:["pt","pb"],m:["mx","my","ms","me","mt","mr","mb","ml"],mx:["mr","ml"],my:["mt","mb"],size:["w","h"],"font-size":["leading"],"fvn-normal":["fvn-ordinal","fvn-slashed-zero","fvn-figure","fvn-spacing","fvn-fraction"],"fvn-ordinal":["fvn-normal"],"fvn-slashed-zero":["fvn-normal"],"fvn-figure":["fvn-normal"],"fvn-spacing":["fvn-normal"],"fvn-fraction":["fvn-normal"],"line-clamp":["display","overflow"],rounded:["rounded-s","rounded-e","rounded-t","rounded-r","rounded-b","rounded-l","rounded-ss","rounded-se","rounded-ee","rounded-es","rounded-tl","rounded-tr","rounded-br","rounded-bl"],"rounded-s":["rounded-ss","rounded-es"],"rounded-e":["rounded-se","rounded-ee"],"rounded-t":["rounded-tl","rounded-tr"],"rounded-r":["rounded-tr","rounded-br"],"rounded-b":["rounded-br","rounded-bl"],"rounded-l":["rounded-tl","rounded-bl"],"border-spacing":["border-spacing-x","border-spacing-y"],"border-w":["border-w-x","border-w-y","border-w-s","border-w-e","border-w-t","border-w-r","border-w-b","border-w-l"],"border-w-x":["border-w-r","border-w-l"],"border-w-y":["border-w-t","border-w-b"],"border-color":["border-color-x","border-color-y","border-color-s","border-color-e","border-color-t","border-color-r","border-color-b","border-color-l"],"border-color-x":["border-color-r","border-color-l"],"border-color-y":["border-color-t","border-color-b"],translate:["translate-x","translate-y","translate-none"],"translate-none":["translate","translate-x","translate-y","translate-z"],"scroll-m":["scroll-mx","scroll-my","scroll-ms","scroll-me","scroll-mt","scroll-mr","scroll-mb","scroll-ml"],"scroll-mx":["scroll-mr","scroll-ml"],"scroll-my":["scroll-mt","scroll-mb"],"scroll-p":["scroll-px","scroll-py","scroll-ps","scroll-pe","scroll-pt","scroll-pr","scroll-pb","scroll-pl"],"scroll-px":["scroll-pr","scroll-pl"],"scroll-py":["scroll-pt","scroll-pb"],touch:["touch-x","touch-y","touch-pz"],"touch-x":["touch"],"touch-y":["touch"],"touch-pz":["touch"]},conflictingClassGroupModifiers:{"font-size":["leading"]},orderSensitiveModifiers:["*","**","after","backdrop","before","details-content","file","first-letter","first-line","marker","placeholder","selection"]}},Nee=aee(_ee);function ye(...e){return Nee(Yz(e))}const o6=Kf("inline-flex items-center justify-center gap-2 whitespace-nowrap rounded-md text-sm font-medium transition-colors focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:pointer-events-none disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:size-4 [&_svg]:shrink-0",{variants:{variant:{default:"bg-primary text-primary-foreground shadow hover:bg-primary/90",destructive:"bg-destructive text-destructive-foreground shadow-sm hover:bg-destructive/90",outline:"border border-input bg-background shadow-sm hover:bg-accent hover:text-accent-foreground",secondary:"bg-secondary text-secondary-foreground shadow-sm hover:bg-secondary/80",ghost:"hover:bg-accent hover:text-accent-foreground",link:"text-primary underline-offset-4 hover:underline"},size:{default:"h-9 px-4 py-2",sm:"h-8 rounded-md px-3 text-xs",lg:"h-10 rounded-md px-8",icon:"h-9 w-9"}},defaultVariants:{variant:"default",size:"default"}}),me=N.forwardRef(({className:e,variant:t,size:n,asChild:r=!1,...a},s)=>{const i=r?zJ:"button";return c.jsx(i,{className:ye(o6({variant:t,size:n,className:e})),ref:s,...a})});me.displayName="Button";function _e(e,t,{checkForDefaultPrevented:n=!0}={}){return function(a){if(e==null||e(a),n===!1||!a.defaultPrevented)return t==null?void 0:t(a)}}function jee(e,t){const n=N.createContext(t),r=s=>{const{children:i,...l}=s,d=N.useMemo(()=>l,Object.values(l));return c.jsx(n.Provider,{value:d,children:i})};r.displayName=e+"Provider";function a(s){const i=N.useContext(n);if(i)return i;if(t!==void 0)return t;throw new Error(`\`${s}\` must be used within \`${e}\``)}return[r,a]}function wn(e,t=[]){let n=[];function r(s,i){const l=N.createContext(i),d=n.length;n=[...n,i];const f=p=>{var x;const{scope:g,children:y,...S}=p,w=((x=g==null?void 0:g[e])==null?void 0:x[d])||l,b=N.useMemo(()=>S,Object.values(S));return c.jsx(w.Provider,{value:b,children:y})};f.displayName=s+"Provider";function h(p,g){var w;const y=((w=g==null?void 0:g[e])==null?void 0:w[d])||l,S=N.useContext(y);if(S)return S;if(i!==void 0)return i;throw new Error(`\`${p}\` must be used within \`${s}\``)}return[f,h]}const a=()=>{const s=n.map(i=>N.createContext(i));return function(l){const d=(l==null?void 0:l[e])||s;return N.useMemo(()=>({[`__scope${e}`]:{...l,[e]:d}}),[l,d])}};return a.scopeName=e,[r,Cee(a,...t)]}function Cee(...e){const t=e[0];if(e.length===1)return t;const n=()=>{const r=e.map(a=>({useScope:a(),scopeName:a.scopeName}));return function(s){const i=r.reduce((l,{useScope:d,scopeName:f})=>{const p=d(s)[`__scope${f}`];return{...l,...p}},{});return N.useMemo(()=>({[`__scope${t.scopeName}`]:i}),[i])}};return n.scopeName=t.scopeName,n}var Jt=globalThis!=null&&globalThis.document?N.useLayoutEffect:()=>{},Eee=ky[" useInsertionEffect ".trim().toString()]||Jt;function bn({prop:e,defaultProp:t,onChange:n=()=>{},caller:r}){const[a,s,i]=Tee({defaultProp:t,onChange:n}),l=e!==void 0,d=l?e:a;{const h=N.useRef(e!==void 0);N.useEffect(()=>{const p=h.current;p!==l&&console.warn(`${r} is changing from ${p?"controlled":"uncontrolled"} to ${l?"controlled":"uncontrolled"}. Components should not switch from controlled to uncontrolled (or vice versa). Decide between using a controlled or uncontrolled value for the lifetime of the component.`),h.current=l},[l,r])}const f=N.useCallback(h=>{var p;if(l){const g=Aee(h)?h(e):h;g!==e&&((p=i.current)==null||p.call(i,g))}else s(h)},[l,e,s,i]);return[d,f]}function Tee({defaultProp:e,onChange:t}){const[n,r]=N.useState(e),a=N.useRef(n),s=N.useRef(t);return Eee(()=>{s.current=t},[t]),N.useEffect(()=>{var i;a.current!==n&&((i=s.current)==null||i.call(s,n),a.current=n)},[n,a]),[n,r,s]}function Aee(e){return typeof e=="function"}function Ree(e){const t=kee(e),n=N.forwardRef((r,a)=>{const{children:s,...i}=r,l=N.Children.toArray(s),d=l.find(Mee);if(d){const f=d.props.children,h=l.map(p=>p===d?N.Children.count(f)>1?N.Children.only(null):N.isValidElement(f)?f.props.children:null:p);return c.jsx(t,{...i,ref:a,children:N.isValidElement(f)?N.cloneElement(f,void 0,h):null})}return c.jsx(t,{...i,ref:a,children:s})});return n.displayName=`${e}.Slot`,n}function kee(e){const t=N.forwardRef((n,r)=>{const{children:a,...s}=n;if(N.isValidElement(a)){const i=Pee(a),l=Dee(s,a.props);return a.type!==N.Fragment&&(l.ref=r?La(r,i):i),N.cloneElement(a,l)}return N.Children.count(a)>1?N.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var Oee=Symbol("radix.slottable");function Mee(e){return N.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===Oee}function Dee(e,t){const n={...t};for(const r in t){const a=e[r],s=t[r];/^on[A-Z]/.test(r)?a&&s?n[r]=(...l)=>{const d=s(...l);return a(...l),d}:a&&(n[r]=a):r==="style"?n[r]={...a,...s}:r==="className"&&(n[r]=[a,s].filter(Boolean).join(" "))}return{...e,...n}}function Pee(e){var r,a;let t=(r=Object.getOwnPropertyDescriptor(e.props,"ref"))==null?void 0:r.get,n=t&&"isReactWarning"in t&&t.isReactWarning;return n?e.ref:(t=(a=Object.getOwnPropertyDescriptor(e,"ref"))==null?void 0:a.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}var $ee=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],Ae=$ee.reduce((e,t)=>{const n=Ree(`Primitive.${t}`),r=N.forwardRef((a,s)=>{const{asChild:i,...l}=a,d=i?n:t;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),c.jsx(d,{...l,ref:s})});return r.displayName=`Primitive.${t}`,{...e,[t]:r}},{});function i6(e,t){e&&ol.flushSync(()=>e.dispatchEvent(t))}function XO(e){const t=Iee(e),n=N.forwardRef((r,a)=>{const{children:s,...i}=r,l=N.Children.toArray(s),d=l.find(zee);if(d){const f=d.props.children,h=l.map(p=>p===d?N.Children.count(f)>1?N.Children.only(null):N.isValidElement(f)?f.props.children:null:p);return c.jsx(t,{...i,ref:a,children:N.isValidElement(f)?N.cloneElement(f,void 0,h):null})}return c.jsx(t,{...i,ref:a,children:s})});return n.displayName=`${e}.Slot`,n}function Iee(e){const t=N.forwardRef((n,r)=>{const{children:a,...s}=n;if(N.isValidElement(a)){const i=Fee(a),l=qee(s,a.props);return a.type!==N.Fragment&&(l.ref=r?La(r,i):i),N.cloneElement(a,l)}return N.Children.count(a)>1?N.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var Lee=Symbol("radix.slottable");function zee(e){return N.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===Lee}function qee(e,t){const n={...t};for(const r in t){const a=e[r],s=t[r];/^on[A-Z]/.test(r)?a&&s?n[r]=(...l)=>{const d=s(...l);return a(...l),d}:a&&(n[r]=a):r==="style"?n[r]={...a,...s}:r==="className"&&(n[r]=[a,s].filter(Boolean).join(" "))}return{...e,...n}}function Fee(e){var r,a;let t=(r=Object.getOwnPropertyDescriptor(e.props,"ref"))==null?void 0:r.get,n=t&&"isReactWarning"in t&&t.isReactWarning;return n?e.ref:(t=(a=Object.getOwnPropertyDescriptor(e,"ref"))==null?void 0:a.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}function qy(e){const t=e+"CollectionProvider",[n,r]=wn(t),[a,s]=n(t,{collectionRef:{current:null},itemMap:new Map}),i=w=>{const{scope:b,children:x}=w,_=Me.useRef(null),j=Me.useRef(new Map).current;return c.jsx(a,{scope:b,itemMap:j,collectionRef:_,children:x})};i.displayName=t;const l=e+"CollectionSlot",d=XO(l),f=Me.forwardRef((w,b)=>{const{scope:x,children:_}=w,j=s(l,x),C=ze(b,j.collectionRef);return c.jsx(d,{ref:C,children:_})});f.displayName=l;const h=e+"CollectionItemSlot",p="data-radix-collection-item",g=XO(h),y=Me.forwardRef((w,b)=>{const{scope:x,children:_,...j}=w,C=Me.useRef(null),T=ze(b,C),A=s(h,x);return Me.useEffect(()=>(A.itemMap.set(C,{ref:C,...j}),()=>void A.itemMap.delete(C))),c.jsx(g,{[p]:"",ref:T,children:_})});y.displayName=h;function S(w){const b=s(e+"CollectionConsumer",w);return Me.useCallback(()=>{const _=b.collectionRef.current;if(!_)return[];const j=Array.from(_.querySelectorAll(`[${p}]`));return Array.from(b.itemMap.values()).sort((A,k)=>j.indexOf(A.ref.current)-j.indexOf(k.ref.current))},[b.collectionRef,b.itemMap])}return[{Provider:i,Slot:f,ItemSlot:y},S,r]}var Uee=N.createContext(void 0);function Ko(e){const t=N.useContext(Uee);return e||t||"ltr"}function hn(e){const t=N.useRef(e);return N.useEffect(()=>{t.current=e}),N.useMemo(()=>(...n)=>{var r;return(r=t.current)==null?void 0:r.call(t,...n)},[])}function Hee(e,t=globalThis==null?void 0:globalThis.document){const n=hn(e);N.useEffect(()=>{const r=a=>{a.key==="Escape"&&n(a)};return t.addEventListener("keydown",r,{capture:!0}),()=>t.removeEventListener("keydown",r,{capture:!0})},[n,t])}var Bee="DismissableLayer",zj="dismissableLayer.update",Vee="dismissableLayer.pointerDownOutside",Wee="dismissableLayer.focusOutside",ZO,l6=N.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set}),hu=N.forwardRef((e,t)=>{const{disableOutsidePointerEvents:n=!1,onEscapeKeyDown:r,onPointerDownOutside:a,onFocusOutside:s,onInteractOutside:i,onDismiss:l,...d}=e,f=N.useContext(l6),[h,p]=N.useState(null),g=(h==null?void 0:h.ownerDocument)??(globalThis==null?void 0:globalThis.document),[,y]=N.useState({}),S=ze(t,k=>p(k)),w=Array.from(f.layers),[b]=[...f.layersWithOutsidePointerEventsDisabled].slice(-1),x=w.indexOf(b),_=h?w.indexOf(h):-1,j=f.layersWithOutsidePointerEventsDisabled.size>0,C=_>=x,T=Yee(k=>{const O=k.target,M=[...f.branches].some(z=>z.contains(O));!C||M||(a==null||a(k),i==null||i(k),k.defaultPrevented||l==null||l())},g),A=Xee(k=>{const O=k.target;[...f.branches].some(z=>z.contains(O))||(s==null||s(k),i==null||i(k),k.defaultPrevented||l==null||l())},g);return Hee(k=>{_===f.layers.size-1&&(r==null||r(k),!k.defaultPrevented&&l&&(k.preventDefault(),l()))},g),N.useEffect(()=>{if(h)return n&&(f.layersWithOutsidePointerEventsDisabled.size===0&&(ZO=g.body.style.pointerEvents,g.body.style.pointerEvents="none"),f.layersWithOutsidePointerEventsDisabled.add(h)),f.layers.add(h),QO(),()=>{n&&f.layersWithOutsidePointerEventsDisabled.size===1&&(g.body.style.pointerEvents=ZO)}},[h,g,n,f]),N.useEffect(()=>()=>{h&&(f.layers.delete(h),f.layersWithOutsidePointerEventsDisabled.delete(h),QO())},[h,f]),N.useEffect(()=>{const k=()=>y({});return document.addEventListener(zj,k),()=>document.removeEventListener(zj,k)},[]),c.jsx(Ae.div,{...d,ref:S,style:{pointerEvents:j?C?"auto":"none":void 0,...e.style},onFocusCapture:_e(e.onFocusCapture,A.onFocusCapture),onBlurCapture:_e(e.onBlurCapture,A.onBlurCapture),onPointerDownCapture:_e(e.onPointerDownCapture,T.onPointerDownCapture)})});hu.displayName=Bee;var Gee="DismissableLayerBranch",Kee=N.forwardRef((e,t)=>{const n=N.useContext(l6),r=N.useRef(null),a=ze(t,r);return N.useEffect(()=>{const s=r.current;if(s)return n.branches.add(s),()=>{n.branches.delete(s)}},[n.branches]),c.jsx(Ae.div,{...e,ref:a})});Kee.displayName=Gee;function Yee(e,t=globalThis==null?void 0:globalThis.document){const n=hn(e),r=N.useRef(!1),a=N.useRef(()=>{});return N.useEffect(()=>{const s=l=>{if(l.target&&!r.current){let d=function(){c6(Vee,n,f,{discrete:!0})};const f={originalEvent:l};l.pointerType==="touch"?(t.removeEventListener("click",a.current),a.current=d,t.addEventListener("click",a.current,{once:!0})):d()}else t.removeEventListener("click",a.current);r.current=!1},i=window.setTimeout(()=>{t.addEventListener("pointerdown",s)},0);return()=>{window.clearTimeout(i),t.removeEventListener("pointerdown",s),t.removeEventListener("click",a.current)}},[t,n]),{onPointerDownCapture:()=>r.current=!0}}function Xee(e,t=globalThis==null?void 0:globalThis.document){const n=hn(e),r=N.useRef(!1);return N.useEffect(()=>{const a=s=>{s.target&&!r.current&&c6(Wee,n,{originalEvent:s},{discrete:!1})};return t.addEventListener("focusin",a),()=>t.removeEventListener("focusin",a)},[t,n]),{onFocusCapture:()=>r.current=!0,onBlurCapture:()=>r.current=!1}}function QO(){const e=new CustomEvent(zj);document.dispatchEvent(e)}function c6(e,t,n,{discrete:r}){const a=n.originalEvent.target,s=new CustomEvent(e,{bubbles:!1,cancelable:!0,detail:n});t&&a.addEventListener(e,t,{once:!0}),r?i6(a,s):a.dispatchEvent(s)}var Xb=0;function Fy(){N.useEffect(()=>{const e=document.querySelectorAll("[data-radix-focus-guard]");return document.body.insertAdjacentElement("afterbegin",e[0]??JO()),document.body.insertAdjacentElement("beforeend",e[1]??JO()),Xb++,()=>{Xb===1&&document.querySelectorAll("[data-radix-focus-guard]").forEach(t=>t.remove()),Xb--}},[])}function JO(){const e=document.createElement("span");return e.setAttribute("data-radix-focus-guard",""),e.tabIndex=0,e.style.outline="none",e.style.opacity="0",e.style.position="fixed",e.style.pointerEvents="none",e}var Zb="focusScope.autoFocusOnMount",Qb="focusScope.autoFocusOnUnmount",eM={bubbles:!1,cancelable:!0},Zee="FocusScope",Yf=N.forwardRef((e,t)=>{const{loop:n=!1,trapped:r=!1,onMountAutoFocus:a,onUnmountAutoFocus:s,...i}=e,[l,d]=N.useState(null),f=hn(a),h=hn(s),p=N.useRef(null),g=ze(t,w=>d(w)),y=N.useRef({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}}).current;N.useEffect(()=>{if(r){let w=function(j){if(y.paused||!l)return;const C=j.target;l.contains(C)?p.current=C:No(p.current,{select:!0})},b=function(j){if(y.paused||!l)return;const C=j.relatedTarget;C!==null&&(l.contains(C)||No(p.current,{select:!0}))},x=function(j){if(document.activeElement===document.body)for(const T of j)T.removedNodes.length>0&&No(l)};document.addEventListener("focusin",w),document.addEventListener("focusout",b);const _=new MutationObserver(x);return l&&_.observe(l,{childList:!0,subtree:!0}),()=>{document.removeEventListener("focusin",w),document.removeEventListener("focusout",b),_.disconnect()}}},[r,l,y.paused]),N.useEffect(()=>{if(l){nM.add(y);const w=document.activeElement;if(!l.contains(w)){const x=new CustomEvent(Zb,eM);l.addEventListener(Zb,f),l.dispatchEvent(x),x.defaultPrevented||(Qee(rte(u6(l)),{select:!0}),document.activeElement===w&&No(l))}return()=>{l.removeEventListener(Zb,f),setTimeout(()=>{const x=new CustomEvent(Qb,eM);l.addEventListener(Qb,h),l.dispatchEvent(x),x.defaultPrevented||No(w??document.body,{select:!0}),l.removeEventListener(Qb,h),nM.remove(y)},0)}}},[l,f,h,y]);const S=N.useCallback(w=>{if(!n&&!r||y.paused)return;const b=w.key==="Tab"&&!w.altKey&&!w.ctrlKey&&!w.metaKey,x=document.activeElement;if(b&&x){const _=w.currentTarget,[j,C]=Jee(_);j&&C?!w.shiftKey&&x===C?(w.preventDefault(),n&&No(j,{select:!0})):w.shiftKey&&x===j&&(w.preventDefault(),n&&No(C,{select:!0})):x===_&&w.preventDefault()}},[n,r,y.paused]);return c.jsx(Ae.div,{tabIndex:-1,...i,ref:g,onKeyDown:S})});Yf.displayName=Zee;function Qee(e,{select:t=!1}={}){const n=document.activeElement;for(const r of e)if(No(r,{select:t}),document.activeElement!==n)return}function Jee(e){const t=u6(e),n=tM(t,e),r=tM(t.reverse(),e);return[n,r]}function u6(e){const t=[],n=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,{acceptNode:r=>{const a=r.tagName==="INPUT"&&r.type==="hidden";return r.disabled||r.hidden||a?NodeFilter.FILTER_SKIP:r.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});for(;n.nextNode();)t.push(n.currentNode);return t}function tM(e,t){for(const n of e)if(!ete(n,{upTo:t}))return n}function ete(e,{upTo:t}){if(getComputedStyle(e).visibility==="hidden")return!0;for(;e;){if(t!==void 0&&e===t)return!1;if(getComputedStyle(e).display==="none")return!0;e=e.parentElement}return!1}function tte(e){return e instanceof HTMLInputElement&&"select"in e}function No(e,{select:t=!1}={}){if(e&&e.focus){const n=document.activeElement;e.focus({preventScroll:!0}),e!==n&&tte(e)&&t&&e.select()}}var nM=nte();function nte(){let e=[];return{add(t){const n=e[0];t!==n&&(n==null||n.pause()),e=rM(e,t),e.unshift(t)},remove(t){var n;e=rM(e,t),(n=e[0])==null||n.resume()}}}function rM(e,t){const n=[...e],r=n.indexOf(t);return r!==-1&&n.splice(r,1),n}function rte(e){return e.filter(t=>t.tagName!=="A")}var ate=ky[" useId ".trim().toString()]||(()=>{}),ste=0;function zn(e){const[t,n]=N.useState(ate());return Jt(()=>{n(r=>r??String(ste++))},[e]),t?`radix-${t}`:""}const ote=["top","right","bottom","left"],qo=Math.min,mr=Math.max,Xg=Math.round,im=Math.floor,Ta=e=>({x:e,y:e}),ite={left:"right",right:"left",bottom:"top",top:"bottom"},lte={start:"end",end:"start"};function qj(e,t,n){return mr(e,qo(t,n))}function Rs(e,t){return typeof e=="function"?e(t):e}function ks(e){return e.split("-")[0]}function pu(e){return e.split("-")[1]}function t2(e){return e==="x"?"y":"x"}function n2(e){return e==="y"?"height":"width"}const cte=new Set(["top","bottom"]);function ja(e){return cte.has(ks(e))?"y":"x"}function r2(e){return t2(ja(e))}function ute(e,t,n){n===void 0&&(n=!1);const r=pu(e),a=r2(e),s=n2(a);let i=a==="x"?r===(n?"end":"start")?"right":"left":r==="start"?"bottom":"top";return t.reference[s]>t.floating[s]&&(i=Zg(i)),[i,Zg(i)]}function dte(e){const t=Zg(e);return[Fj(e),t,Fj(t)]}function Fj(e){return e.replace(/start|end/g,t=>lte[t])}const aM=["left","right"],sM=["right","left"],fte=["top","bottom"],hte=["bottom","top"];function pte(e,t,n){switch(e){case"top":case"bottom":return n?t?sM:aM:t?aM:sM;case"left":case"right":return t?fte:hte;default:return[]}}function mte(e,t,n,r){const a=pu(e);let s=pte(ks(e),n==="start",r);return a&&(s=s.map(i=>i+"-"+a),t&&(s=s.concat(s.map(Fj)))),s}function Zg(e){return e.replace(/left|right|bottom|top/g,t=>ite[t])}function gte(e){return{top:0,right:0,bottom:0,left:0,...e}}function d6(e){return typeof e!="number"?gte(e):{top:e,right:e,bottom:e,left:e}}function Qg(e){const{x:t,y:n,width:r,height:a}=e;return{width:r,height:a,top:n,left:t,right:t+r,bottom:n+a,x:t,y:n}}function oM(e,t,n){let{reference:r,floating:a}=e;const s=ja(t),i=r2(t),l=n2(i),d=ks(t),f=s==="y",h=r.x+r.width/2-a.width/2,p=r.y+r.height/2-a.height/2,g=r[l]/2-a[l]/2;let y;switch(d){case"top":y={x:h,y:r.y-a.height};break;case"bottom":y={x:h,y:r.y+r.height};break;case"right":y={x:r.x+r.width,y:p};break;case"left":y={x:r.x-a.width,y:p};break;default:y={x:r.x,y:r.y}}switch(pu(t)){case"start":y[i]-=g*(n&&f?-1:1);break;case"end":y[i]+=g*(n&&f?-1:1);break}return y}const yte=async(e,t,n)=>{const{placement:r="bottom",strategy:a="absolute",middleware:s=[],platform:i}=n,l=s.filter(Boolean),d=await(i.isRTL==null?void 0:i.isRTL(t));let f=await i.getElementRects({reference:e,floating:t,strategy:a}),{x:h,y:p}=oM(f,r,d),g=r,y={},S=0;for(let w=0;w<l.length;w++){const{name:b,fn:x}=l[w],{x:_,y:j,data:C,reset:T}=await x({x:h,y:p,initialPlacement:r,placement:g,strategy:a,middlewareData:y,rects:f,platform:i,elements:{reference:e,floating:t}});h=_??h,p=j??p,y={...y,[b]:{...y[b],...C}},T&&S<=50&&(S++,typeof T=="object"&&(T.placement&&(g=T.placement),T.rects&&(f=T.rects===!0?await i.getElementRects({reference:e,floating:t,strategy:a}):T.rects),{x:h,y:p}=oM(f,g,d)),w=-1)}return{x:h,y:p,placement:g,strategy:a,middlewareData:y}};async function pf(e,t){var n;t===void 0&&(t={});const{x:r,y:a,platform:s,rects:i,elements:l,strategy:d}=e,{boundary:f="clippingAncestors",rootBoundary:h="viewport",elementContext:p="floating",altBoundary:g=!1,padding:y=0}=Rs(t,e),S=d6(y),b=l[g?p==="floating"?"reference":"floating":p],x=Qg(await s.getClippingRect({element:(n=await(s.isElement==null?void 0:s.isElement(b)))==null||n?b:b.contextElement||await(s.getDocumentElement==null?void 0:s.getDocumentElement(l.floating)),boundary:f,rootBoundary:h,strategy:d})),_=p==="floating"?{x:r,y:a,width:i.floating.width,height:i.floating.height}:i.reference,j=await(s.getOffsetParent==null?void 0:s.getOffsetParent(l.floating)),C=await(s.isElement==null?void 0:s.isElement(j))?await(s.getScale==null?void 0:s.getScale(j))||{x:1,y:1}:{x:1,y:1},T=Qg(s.convertOffsetParentRelativeRectToViewportRelativeRect?await s.convertOffsetParentRelativeRectToViewportRelativeRect({elements:l,rect:_,offsetParent:j,strategy:d}):_);return{top:(x.top-T.top+S.top)/C.y,bottom:(T.bottom-x.bottom+S.bottom)/C.y,left:(x.left-T.left+S.left)/C.x,right:(T.right-x.right+S.right)/C.x}}const vte=e=>({name:"arrow",options:e,async fn(t){const{x:n,y:r,placement:a,rects:s,platform:i,elements:l,middlewareData:d}=t,{element:f,padding:h=0}=Rs(e,t)||{};if(f==null)return{};const p=d6(h),g={x:n,y:r},y=r2(a),S=n2(y),w=await i.getDimensions(f),b=y==="y",x=b?"top":"left",_=b?"bottom":"right",j=b?"clientHeight":"clientWidth",C=s.reference[S]+s.reference[y]-g[y]-s.floating[S],T=g[y]-s.reference[y],A=await(i.getOffsetParent==null?void 0:i.getOffsetParent(f));let k=A?A[j]:0;(!k||!await(i.isElement==null?void 0:i.isElement(A)))&&(k=l.floating[j]||s.floating[S]);const O=C/2-T/2,M=k/2-w[S]/2-1,z=qo(p[x],M),L=qo(p[_],M),U=z,F=k-w[S]-L,q=k/2-w[S]/2+O,V=qj(U,q,F),P=!d.arrow&&pu(a)!=null&&q!==V&&s.reference[S]/2-(q<U?z:L)-w[S]/2<0,K=P?q<U?q-U:q-F:0;return{[y]:g[y]+K,data:{[y]:V,centerOffset:q-V-K,...P&&{alignmentOffset:K}},reset:P}}}),xte=function(e){return e===void 0&&(e={}),{name:"flip",options:e,async fn(t){var n,r;const{placement:a,middlewareData:s,rects:i,initialPlacement:l,platform:d,elements:f}=t,{mainAxis:h=!0,crossAxis:p=!0,fallbackPlacements:g,fallbackStrategy:y="bestFit",fallbackAxisSideDirection:S="none",flipAlignment:w=!0,...b}=Rs(e,t);if((n=s.arrow)!=null&&n.alignmentOffset)return{};const x=ks(a),_=ja(l),j=ks(l)===l,C=await(d.isRTL==null?void 0:d.isRTL(f.floating)),T=g||(j||!w?[Zg(l)]:dte(l)),A=S!=="none";!g&&A&&T.push(...mte(l,w,S,C));const k=[l,...T],O=await pf(t,b),M=[];let z=((r=s.flip)==null?void 0:r.overflows)||[];if(h&&M.push(O[x]),p){const q=ute(a,i,C);M.push(O[q[0]],O[q[1]])}if(z=[...z,{placement:a,overflows:M}],!M.every(q=>q<=0)){var L,U;const q=(((L=s.flip)==null?void 0:L.index)||0)+1,V=k[q];if(V&&(!(p==="alignment"?_!==ja(V):!1)||z.every(H=>ja(H.placement)===_?H.overflows[0]>0:!0)))return{data:{index:q,overflows:z},reset:{placement:V}};let P=(U=z.filter(K=>K.overflows[0]<=0).sort((K,H)=>K.overflows[1]-H.overflows[1])[0])==null?void 0:U.placement;if(!P)switch(y){case"bestFit":{var F;const K=(F=z.filter(H=>{if(A){const Z=ja(H.placement);return Z===_||Z==="y"}return!0}).map(H=>[H.placement,H.overflows.filter(Z=>Z>0).reduce((Z,J)=>Z+J,0)]).sort((H,Z)=>H[1]-Z[1])[0])==null?void 0:F[0];K&&(P=K);break}case"initialPlacement":P=l;break}if(a!==P)return{reset:{placement:P}}}return{}}}};function iM(e,t){return{top:e.top-t.height,right:e.right-t.width,bottom:e.bottom-t.height,left:e.left-t.width}}function lM(e){return ote.some(t=>e[t]>=0)}const bte=function(e){return e===void 0&&(e={}),{name:"hide",options:e,async fn(t){const{rects:n}=t,{strategy:r="referenceHidden",...a}=Rs(e,t);switch(r){case"referenceHidden":{const s=await pf(t,{...a,elementContext:"reference"}),i=iM(s,n.reference);return{data:{referenceHiddenOffsets:i,referenceHidden:lM(i)}}}case"escaped":{const s=await pf(t,{...a,altBoundary:!0}),i=iM(s,n.floating);return{data:{escapedOffsets:i,escaped:lM(i)}}}default:return{}}}}},f6=new Set(["left","top"]);async function wte(e,t){const{placement:n,platform:r,elements:a}=e,s=await(r.isRTL==null?void 0:r.isRTL(a.floating)),i=ks(n),l=pu(n),d=ja(n)==="y",f=f6.has(i)?-1:1,h=s&&d?-1:1,p=Rs(t,e);let{mainAxis:g,crossAxis:y,alignmentAxis:S}=typeof p=="number"?{mainAxis:p,crossAxis:0,alignmentAxis:null}:{mainAxis:p.mainAxis||0,crossAxis:p.crossAxis||0,alignmentAxis:p.alignmentAxis};return l&&typeof S=="number"&&(y=l==="end"?S*-1:S),d?{x:y*h,y:g*f}:{x:g*f,y:y*h}}const Ste=function(e){return e===void 0&&(e=0),{name:"offset",options:e,async fn(t){var n,r;const{x:a,y:s,placement:i,middlewareData:l}=t,d=await wte(t,e);return i===((n=l.offset)==null?void 0:n.placement)&&(r=l.arrow)!=null&&r.alignmentOffset?{}:{x:a+d.x,y:s+d.y,data:{...d,placement:i}}}}},_te=function(e){return e===void 0&&(e={}),{name:"shift",options:e,async fn(t){const{x:n,y:r,placement:a}=t,{mainAxis:s=!0,crossAxis:i=!1,limiter:l={fn:b=>{let{x,y:_}=b;return{x,y:_}}},...d}=Rs(e,t),f={x:n,y:r},h=await pf(t,d),p=ja(ks(a)),g=t2(p);let y=f[g],S=f[p];if(s){const b=g==="y"?"top":"left",x=g==="y"?"bottom":"right",_=y+h[b],j=y-h[x];y=qj(_,y,j)}if(i){const b=p==="y"?"top":"left",x=p==="y"?"bottom":"right",_=S+h[b],j=S-h[x];S=qj(_,S,j)}const w=l.fn({...t,[g]:y,[p]:S});return{...w,data:{x:w.x-n,y:w.y-r,enabled:{[g]:s,[p]:i}}}}}},Nte=function(e){return e===void 0&&(e={}),{options:e,fn(t){const{x:n,y:r,placement:a,rects:s,middlewareData:i}=t,{offset:l=0,mainAxis:d=!0,crossAxis:f=!0}=Rs(e,t),h={x:n,y:r},p=ja(a),g=t2(p);let y=h[g],S=h[p];const w=Rs(l,t),b=typeof w=="number"?{mainAxis:w,crossAxis:0}:{mainAxis:0,crossAxis:0,...w};if(d){const j=g==="y"?"height":"width",C=s.reference[g]-s.floating[j]+b.mainAxis,T=s.reference[g]+s.reference[j]-b.mainAxis;y<C?y=C:y>T&&(y=T)}if(f){var x,_;const j=g==="y"?"width":"height",C=f6.has(ks(a)),T=s.reference[p]-s.floating[j]+(C&&((x=i.offset)==null?void 0:x[p])||0)+(C?0:b.crossAxis),A=s.reference[p]+s.reference[j]+(C?0:((_=i.offset)==null?void 0:_[p])||0)-(C?b.crossAxis:0);S<T?S=T:S>A&&(S=A)}return{[g]:y,[p]:S}}}},jte=function(e){return e===void 0&&(e={}),{name:"size",options:e,async fn(t){var n,r;const{placement:a,rects:s,platform:i,elements:l}=t,{apply:d=()=>{},...f}=Rs(e,t),h=await pf(t,f),p=ks(a),g=pu(a),y=ja(a)==="y",{width:S,height:w}=s.floating;let b,x;p==="top"||p==="bottom"?(b=p,x=g===(await(i.isRTL==null?void 0:i.isRTL(l.floating))?"start":"end")?"left":"right"):(x=p,b=g==="end"?"top":"bottom");const _=w-h.top-h.bottom,j=S-h.left-h.right,C=qo(w-h[b],_),T=qo(S-h[x],j),A=!t.middlewareData.shift;let k=C,O=T;if((n=t.middlewareData.shift)!=null&&n.enabled.x&&(O=j),(r=t.middlewareData.shift)!=null&&r.enabled.y&&(k=_),A&&!g){const z=mr(h.left,0),L=mr(h.right,0),U=mr(h.top,0),F=mr(h.bottom,0);y?O=S-2*(z!==0||L!==0?z+L:mr(h.left,h.right)):k=w-2*(U!==0||F!==0?U+F:mr(h.top,h.bottom))}await d({...t,availableWidth:O,availableHeight:k});const M=await i.getDimensions(l.floating);return S!==M.width||w!==M.height?{reset:{rects:!0}}:{}}}};function Uy(){return typeof window<"u"}function mu(e){return h6(e)?(e.nodeName||"").toLowerCase():"#document"}function Sr(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function za(e){var t;return(t=(h6(e)?e.ownerDocument:e.document)||window.document)==null?void 0:t.documentElement}function h6(e){return Uy()?e instanceof Node||e instanceof Sr(e).Node:!1}function ca(e){return Uy()?e instanceof Element||e instanceof Sr(e).Element:!1}function Ma(e){return Uy()?e instanceof HTMLElement||e instanceof Sr(e).HTMLElement:!1}function cM(e){return!Uy()||typeof ShadowRoot>"u"?!1:e instanceof ShadowRoot||e instanceof Sr(e).ShadowRoot}const Cte=new Set(["inline","contents"]);function Xf(e){const{overflow:t,overflowX:n,overflowY:r,display:a}=ua(e);return/auto|scroll|overlay|hidden|clip/.test(t+r+n)&&!Cte.has(a)}const Ete=new Set(["table","td","th"]);function Tte(e){return Ete.has(mu(e))}const Ate=[":popover-open",":modal"];function Hy(e){return Ate.some(t=>{try{return e.matches(t)}catch{return!1}})}const Rte=["transform","translate","scale","rotate","perspective"],kte=["transform","translate","scale","rotate","perspective","filter"],Ote=["paint","layout","strict","content"];function a2(e){const t=s2(),n=ca(e)?ua(e):e;return Rte.some(r=>n[r]?n[r]!=="none":!1)||(n.containerType?n.containerType!=="normal":!1)||!t&&(n.backdropFilter?n.backdropFilter!=="none":!1)||!t&&(n.filter?n.filter!=="none":!1)||kte.some(r=>(n.willChange||"").includes(r))||Ote.some(r=>(n.contain||"").includes(r))}function Mte(e){let t=Fo(e);for(;Ma(t)&&!qc(t);){if(a2(t))return t;if(Hy(t))return null;t=Fo(t)}return null}function s2(){return typeof CSS>"u"||!CSS.supports?!1:CSS.supports("-webkit-backdrop-filter","none")}const Dte=new Set(["html","body","#document"]);function qc(e){return Dte.has(mu(e))}function ua(e){return Sr(e).getComputedStyle(e)}function By(e){return ca(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function Fo(e){if(mu(e)==="html")return e;const t=e.assignedSlot||e.parentNode||cM(e)&&e.host||za(e);return cM(t)?t.host:t}function p6(e){const t=Fo(e);return qc(t)?e.ownerDocument?e.ownerDocument.body:e.body:Ma(t)&&Xf(t)?t:p6(t)}function mf(e,t,n){var r;t===void 0&&(t=[]),n===void 0&&(n=!0);const a=p6(e),s=a===((r=e.ownerDocument)==null?void 0:r.body),i=Sr(a);if(s){const l=Uj(i);return t.concat(i,i.visualViewport||[],Xf(a)?a:[],l&&n?mf(l):[])}return t.concat(a,mf(a,[],n))}function Uj(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}function m6(e){const t=ua(e);let n=parseFloat(t.width)||0,r=parseFloat(t.height)||0;const a=Ma(e),s=a?e.offsetWidth:n,i=a?e.offsetHeight:r,l=Xg(n)!==s||Xg(r)!==i;return l&&(n=s,r=i),{width:n,height:r,$:l}}function o2(e){return ca(e)?e:e.contextElement}function Rc(e){const t=o2(e);if(!Ma(t))return Ta(1);const n=t.getBoundingClientRect(),{width:r,height:a,$:s}=m6(t);let i=(s?Xg(n.width):n.width)/r,l=(s?Xg(n.height):n.height)/a;return(!i||!Number.isFinite(i))&&(i=1),(!l||!Number.isFinite(l))&&(l=1),{x:i,y:l}}const Pte=Ta(0);function g6(e){const t=Sr(e);return!s2()||!t.visualViewport?Pte:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function $te(e,t,n){return t===void 0&&(t=!1),!n||t&&n!==Sr(e)?!1:t}function Vi(e,t,n,r){t===void 0&&(t=!1),n===void 0&&(n=!1);const a=e.getBoundingClientRect(),s=o2(e);let i=Ta(1);t&&(r?ca(r)&&(i=Rc(r)):i=Rc(e));const l=$te(s,n,r)?g6(s):Ta(0);let d=(a.left+l.x)/i.x,f=(a.top+l.y)/i.y,h=a.width/i.x,p=a.height/i.y;if(s){const g=Sr(s),y=r&&ca(r)?Sr(r):r;let S=g,w=Uj(S);for(;w&&r&&y!==S;){const b=Rc(w),x=w.getBoundingClientRect(),_=ua(w),j=x.left+(w.clientLeft+parseFloat(_.paddingLeft))*b.x,C=x.top+(w.clientTop+parseFloat(_.paddingTop))*b.y;d*=b.x,f*=b.y,h*=b.x,p*=b.y,d+=j,f+=C,S=Sr(w),w=Uj(S)}}return Qg({width:h,height:p,x:d,y:f})}function Vy(e,t){const n=By(e).scrollLeft;return t?t.left+n:Vi(za(e)).left+n}function y6(e,t){const n=e.getBoundingClientRect(),r=n.left+t.scrollLeft-Vy(e,n),a=n.top+t.scrollTop;return{x:r,y:a}}function Ite(e){let{elements:t,rect:n,offsetParent:r,strategy:a}=e;const s=a==="fixed",i=za(r),l=t?Hy(t.floating):!1;if(r===i||l&&s)return n;let d={scrollLeft:0,scrollTop:0},f=Ta(1);const h=Ta(0),p=Ma(r);if((p||!p&&!s)&&((mu(r)!=="body"||Xf(i))&&(d=By(r)),Ma(r))){const y=Vi(r);f=Rc(r),h.x=y.x+r.clientLeft,h.y=y.y+r.clientTop}const g=i&&!p&&!s?y6(i,d):Ta(0);return{width:n.width*f.x,height:n.height*f.y,x:n.x*f.x-d.scrollLeft*f.x+h.x+g.x,y:n.y*f.y-d.scrollTop*f.y+h.y+g.y}}function Lte(e){return Array.from(e.getClientRects())}function zte(e){const t=za(e),n=By(e),r=e.ownerDocument.body,a=mr(t.scrollWidth,t.clientWidth,r.scrollWidth,r.clientWidth),s=mr(t.scrollHeight,t.clientHeight,r.scrollHeight,r.clientHeight);let i=-n.scrollLeft+Vy(e);const l=-n.scrollTop;return ua(r).direction==="rtl"&&(i+=mr(t.clientWidth,r.clientWidth)-a),{width:a,height:s,x:i,y:l}}const uM=25;function qte(e,t){const n=Sr(e),r=za(e),a=n.visualViewport;let s=r.clientWidth,i=r.clientHeight,l=0,d=0;if(a){s=a.width,i=a.height;const h=s2();(!h||h&&t==="fixed")&&(l=a.offsetLeft,d=a.offsetTop)}const f=Vy(r);if(f<=0){const h=r.ownerDocument,p=h.body,g=getComputedStyle(p),y=h.compatMode==="CSS1Compat"&&parseFloat(g.marginLeft)+parseFloat(g.marginRight)||0,S=Math.abs(r.clientWidth-p.clientWidth-y);S<=uM&&(s-=S)}else f<=uM&&(s+=f);return{width:s,height:i,x:l,y:d}}const Fte=new Set(["absolute","fixed"]);function Ute(e,t){const n=Vi(e,!0,t==="fixed"),r=n.top+e.clientTop,a=n.left+e.clientLeft,s=Ma(e)?Rc(e):Ta(1),i=e.clientWidth*s.x,l=e.clientHeight*s.y,d=a*s.x,f=r*s.y;return{width:i,height:l,x:d,y:f}}function dM(e,t,n){let r;if(t==="viewport")r=qte(e,n);else if(t==="document")r=zte(za(e));else if(ca(t))r=Ute(t,n);else{const a=g6(e);r={x:t.x-a.x,y:t.y-a.y,width:t.width,height:t.height}}return Qg(r)}function v6(e,t){const n=Fo(e);return n===t||!ca(n)||qc(n)?!1:ua(n).position==="fixed"||v6(n,t)}function Hte(e,t){const n=t.get(e);if(n)return n;let r=mf(e,[],!1).filter(l=>ca(l)&&mu(l)!=="body"),a=null;const s=ua(e).position==="fixed";let i=s?Fo(e):e;for(;ca(i)&&!qc(i);){const l=ua(i),d=a2(i);!d&&l.position==="fixed"&&(a=null),(s?!d&&!a:!d&&l.position==="static"&&!!a&&Fte.has(a.position)||Xf(i)&&!d&&v6(e,i))?r=r.filter(h=>h!==i):a=l,i=Fo(i)}return t.set(e,r),r}function Bte(e){let{element:t,boundary:n,rootBoundary:r,strategy:a}=e;const i=[...n==="clippingAncestors"?Hy(t)?[]:Hte(t,this._c):[].concat(n),r],l=i[0],d=i.reduce((f,h)=>{const p=dM(t,h,a);return f.top=mr(p.top,f.top),f.right=qo(p.right,f.right),f.bottom=qo(p.bottom,f.bottom),f.left=mr(p.left,f.left),f},dM(t,l,a));return{width:d.right-d.left,height:d.bottom-d.top,x:d.left,y:d.top}}function Vte(e){const{width:t,height:n}=m6(e);return{width:t,height:n}}function Wte(e,t,n){const r=Ma(t),a=za(t),s=n==="fixed",i=Vi(e,!0,s,t);let l={scrollLeft:0,scrollTop:0};const d=Ta(0);function f(){d.x=Vy(a)}if(r||!r&&!s)if((mu(t)!=="body"||Xf(a))&&(l=By(t)),r){const y=Vi(t,!0,s,t);d.x=y.x+t.clientLeft,d.y=y.y+t.clientTop}else a&&f();s&&!r&&a&&f();const h=a&&!r&&!s?y6(a,l):Ta(0),p=i.left+l.scrollLeft-d.x-h.x,g=i.top+l.scrollTop-d.y-h.y;return{x:p,y:g,width:i.width,height:i.height}}function Jb(e){return ua(e).position==="static"}function fM(e,t){if(!Ma(e)||ua(e).position==="fixed")return null;if(t)return t(e);let n=e.offsetParent;return za(e)===n&&(n=n.ownerDocument.body),n}function x6(e,t){const n=Sr(e);if(Hy(e))return n;if(!Ma(e)){let a=Fo(e);for(;a&&!qc(a);){if(ca(a)&&!Jb(a))return a;a=Fo(a)}return n}let r=fM(e,t);for(;r&&Tte(r)&&Jb(r);)r=fM(r,t);return r&&qc(r)&&Jb(r)&&!a2(r)?n:r||Mte(e)||n}const Gte=async function(e){const t=this.getOffsetParent||x6,n=this.getDimensions,r=await n(e.floating);return{reference:Wte(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:r.width,height:r.height}}};function Kte(e){return ua(e).direction==="rtl"}const Yte={convertOffsetParentRelativeRectToViewportRelativeRect:Ite,getDocumentElement:za,getClippingRect:Bte,getOffsetParent:x6,getElementRects:Gte,getClientRects:Lte,getDimensions:Vte,getScale:Rc,isElement:ca,isRTL:Kte};function b6(e,t){return e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height}function Xte(e,t){let n=null,r;const a=za(e);function s(){var l;clearTimeout(r),(l=n)==null||l.disconnect(),n=null}function i(l,d){l===void 0&&(l=!1),d===void 0&&(d=1),s();const f=e.getBoundingClientRect(),{left:h,top:p,width:g,height:y}=f;if(l||t(),!g||!y)return;const S=im(p),w=im(a.clientWidth-(h+g)),b=im(a.clientHeight-(p+y)),x=im(h),j={rootMargin:-S+"px "+-w+"px "+-b+"px "+-x+"px",threshold:mr(0,qo(1,d))||1};let C=!0;function T(A){const k=A[0].intersectionRatio;if(k!==d){if(!C)return i();k?i(!1,k):r=setTimeout(()=>{i(!1,1e-7)},1e3)}k===1&&!b6(f,e.getBoundingClientRect())&&i(),C=!1}try{n=new IntersectionObserver(T,{...j,root:a.ownerDocument})}catch{n=new IntersectionObserver(T,j)}n.observe(e)}return i(!0),s}function Zte(e,t,n,r){r===void 0&&(r={});const{ancestorScroll:a=!0,ancestorResize:s=!0,elementResize:i=typeof ResizeObserver=="function",layoutShift:l=typeof IntersectionObserver=="function",animationFrame:d=!1}=r,f=o2(e),h=a||s?[...f?mf(f):[],...mf(t)]:[];h.forEach(x=>{a&&x.addEventListener("scroll",n,{passive:!0}),s&&x.addEventListener("resize",n)});const p=f&&l?Xte(f,n):null;let g=-1,y=null;i&&(y=new ResizeObserver(x=>{let[_]=x;_&&_.target===f&&y&&(y.unobserve(t),cancelAnimationFrame(g),g=requestAnimationFrame(()=>{var j;(j=y)==null||j.observe(t)})),n()}),f&&!d&&y.observe(f),y.observe(t));let S,w=d?Vi(e):null;d&&b();function b(){const x=Vi(e);w&&!b6(w,x)&&n(),w=x,S=requestAnimationFrame(b)}return n(),()=>{var x;h.forEach(_=>{a&&_.removeEventListener("scroll",n),s&&_.removeEventListener("resize",n)}),p==null||p(),(x=y)==null||x.disconnect(),y=null,d&&cancelAnimationFrame(S)}}const Qte=Ste,Jte=_te,ene=xte,tne=jte,nne=bte,hM=vte,rne=Nte,ane=(e,t,n)=>{const r=new Map,a={platform:Yte,...n},s={...a.platform,_c:r};return yte(e,t,{...a,platform:s})};var sne=typeof document<"u",one=function(){},jg=sne?N.useLayoutEffect:one;function Jg(e,t){if(e===t)return!0;if(typeof e!=typeof t)return!1;if(typeof e=="function"&&e.toString()===t.toString())return!0;let n,r,a;if(e&&t&&typeof e=="object"){if(Array.isArray(e)){if(n=e.length,n!==t.length)return!1;for(r=n;r--!==0;)if(!Jg(e[r],t[r]))return!1;return!0}if(a=Object.keys(e),n=a.length,n!==Object.keys(t).length)return!1;for(r=n;r--!==0;)if(!{}.hasOwnProperty.call(t,a[r]))return!1;for(r=n;r--!==0;){const s=a[r];if(!(s==="_owner"&&e.$$typeof)&&!Jg(e[s],t[s]))return!1}return!0}return e!==e&&t!==t}function w6(e){return typeof window>"u"?1:(e.ownerDocument.defaultView||window).devicePixelRatio||1}function pM(e,t){const n=w6(e);return Math.round(t*n)/n}function ew(e){const t=N.useRef(e);return jg(()=>{t.current=e}),t}function ine(e){e===void 0&&(e={});const{placement:t="bottom",strategy:n="absolute",middleware:r=[],platform:a,elements:{reference:s,floating:i}={},transform:l=!0,whileElementsMounted:d,open:f}=e,[h,p]=N.useState({x:0,y:0,strategy:n,placement:t,middlewareData:{},isPositioned:!1}),[g,y]=N.useState(r);Jg(g,r)||y(r);const[S,w]=N.useState(null),[b,x]=N.useState(null),_=N.useCallback(H=>{H!==A.current&&(A.current=H,w(H))},[]),j=N.useCallback(H=>{H!==k.current&&(k.current=H,x(H))},[]),C=s||S,T=i||b,A=N.useRef(null),k=N.useRef(null),O=N.useRef(h),M=d!=null,z=ew(d),L=ew(a),U=ew(f),F=N.useCallback(()=>{if(!A.current||!k.current)return;const H={placement:t,strategy:n,middleware:g};L.current&&(H.platform=L.current),ane(A.current,k.current,H).then(Z=>{const J={...Z,isPositioned:U.current!==!1};q.current&&!Jg(O.current,J)&&(O.current=J,ol.flushSync(()=>{p(J)}))})},[g,t,n,L,U]);jg(()=>{f===!1&&O.current.isPositioned&&(O.current.isPositioned=!1,p(H=>({...H,isPositioned:!1})))},[f]);const q=N.useRef(!1);jg(()=>(q.current=!0,()=>{q.current=!1}),[]),jg(()=>{if(C&&(A.current=C),T&&(k.current=T),C&&T){if(z.current)return z.current(C,T,F);F()}},[C,T,F,z,M]);const V=N.useMemo(()=>({reference:A,floating:k,setReference:_,setFloating:j}),[_,j]),P=N.useMemo(()=>({reference:C,floating:T}),[C,T]),K=N.useMemo(()=>{const H={position:n,left:0,top:0};if(!P.floating)return H;const Z=pM(P.floating,h.x),J=pM(P.floating,h.y);return l?{...H,transform:"translate("+Z+"px, "+J+"px)",...w6(P.floating)>=1.5&&{willChange:"transform"}}:{position:n,left:Z,top:J}},[n,l,P.floating,h.x,h.y]);return N.useMemo(()=>({...h,update:F,refs:V,elements:P,floatingStyles:K}),[h,F,V,P,K])}const lne=e=>{function t(n){return{}.hasOwnProperty.call(n,"current")}return{name:"arrow",options:e,fn(n){const{element:r,padding:a}=typeof e=="function"?e(n):e;return r&&t(r)?r.current!=null?hM({element:r.current,padding:a}).fn(n):{}:r?hM({element:r,padding:a}).fn(n):{}}}},cne=(e,t)=>({...Qte(e),options:[e,t]}),une=(e,t)=>({...Jte(e),options:[e,t]}),dne=(e,t)=>({...rne(e),options:[e,t]}),fne=(e,t)=>({...ene(e),options:[e,t]}),hne=(e,t)=>({...tne(e),options:[e,t]}),pne=(e,t)=>({...nne(e),options:[e,t]}),mne=(e,t)=>({...lne(e),options:[e,t]});var gne="Arrow",S6=N.forwardRef((e,t)=>{const{children:n,width:r=10,height:a=5,...s}=e;return c.jsx(Ae.svg,{...s,ref:t,width:r,height:a,viewBox:"0 0 30 10",preserveAspectRatio:"none",children:e.asChild?n:c.jsx("polygon",{points:"0,0 30,0 15,10"})})});S6.displayName=gne;var yne=S6;function Wy(e){const[t,n]=N.useState(void 0);return Jt(()=>{if(e){n({width:e.offsetWidth,height:e.offsetHeight});const r=new ResizeObserver(a=>{if(!Array.isArray(a)||!a.length)return;const s=a[0];let i,l;if("borderBoxSize"in s){const d=s.borderBoxSize,f=Array.isArray(d)?d[0]:d;i=f.inlineSize,l=f.blockSize}else i=e.offsetWidth,l=e.offsetHeight;n({width:i,height:l})});return r.observe(e,{box:"border-box"}),()=>r.unobserve(e)}else n(void 0)},[e]),t}var i2="Popper",[_6,Yo]=wn(i2),[vne,N6]=_6(i2),j6=e=>{const{__scopePopper:t,children:n}=e,[r,a]=N.useState(null);return c.jsx(vne,{scope:t,anchor:r,onAnchorChange:a,children:n})};j6.displayName=i2;var C6="PopperAnchor",E6=N.forwardRef((e,t)=>{const{__scopePopper:n,virtualRef:r,...a}=e,s=N6(C6,n),i=N.useRef(null),l=ze(t,i),d=N.useRef(null);return N.useEffect(()=>{const f=d.current;d.current=(r==null?void 0:r.current)||i.current,f!==d.current&&s.onAnchorChange(d.current)}),r?null:c.jsx(Ae.div,{...a,ref:l})});E6.displayName=C6;var l2="PopperContent",[xne,bne]=_6(l2),T6=N.forwardRef((e,t)=>{var re,ne,Q,ae,Y,te;const{__scopePopper:n,side:r="bottom",sideOffset:a=0,align:s="center",alignOffset:i=0,arrowPadding:l=0,avoidCollisions:d=!0,collisionBoundary:f=[],collisionPadding:h=0,sticky:p="partial",hideWhenDetached:g=!1,updatePositionStrategy:y="optimized",onPlaced:S,...w}=e,b=N6(l2,n),[x,_]=N.useState(null),j=ze(t,se=>_(se)),[C,T]=N.useState(null),A=Wy(C),k=(A==null?void 0:A.width)??0,O=(A==null?void 0:A.height)??0,M=r+(s!=="center"?"-"+s:""),z=typeof h=="number"?h:{top:0,right:0,bottom:0,left:0,...h},L=Array.isArray(f)?f:[f],U=L.length>0,F={padding:z,boundary:L.filter(Sne),altBoundary:U},{refs:q,floatingStyles:V,placement:P,isPositioned:K,middlewareData:H}=ine({strategy:"fixed",placement:M,whileElementsMounted:(...se)=>Zte(...se,{animationFrame:y==="always"}),elements:{reference:b.anchor},middleware:[cne({mainAxis:a+O,alignmentAxis:i}),d&&une({mainAxis:!0,crossAxis:!1,limiter:p==="partial"?dne():void 0,...F}),d&&fne({...F}),hne({...F,apply:({elements:se,rects:le,availableWidth:fe,availableHeight:ve})=>{const{width:Se,height:Re}=le.reference,De=se.floating.style;De.setProperty("--radix-popper-available-width",`${fe}px`),De.setProperty("--radix-popper-available-height",`${ve}px`),De.setProperty("--radix-popper-anchor-width",`${Se}px`),De.setProperty("--radix-popper-anchor-height",`${Re}px`)}}),C&&mne({element:C,padding:l}),_ne({arrowWidth:k,arrowHeight:O}),g&&pne({strategy:"referenceHidden",...F})]}),[Z,J]=k6(P),D=hn(S);Jt(()=>{K&&(D==null||D())},[K,D]);const W=(re=H.arrow)==null?void 0:re.x,B=(ne=H.arrow)==null?void 0:ne.y,$=((Q=H.arrow)==null?void 0:Q.centerOffset)!==0,[G,ee]=N.useState();return Jt(()=>{x&&ee(window.getComputedStyle(x).zIndex)},[x]),c.jsx("div",{ref:q.setFloating,"data-radix-popper-content-wrapper":"",style:{...V,transform:K?V.transform:"translate(0, -200%)",minWidth:"max-content",zIndex:G,"--radix-popper-transform-origin":[(ae=H.transformOrigin)==null?void 0:ae.x,(Y=H.transformOrigin)==null?void 0:Y.y].join(" "),...((te=H.hide)==null?void 0:te.referenceHidden)&&{visibility:"hidden",pointerEvents:"none"}},dir:e.dir,children:c.jsx(xne,{scope:n,placedSide:Z,onArrowChange:T,arrowX:W,arrowY:B,shouldHideArrow:$,children:c.jsx(Ae.div,{"data-side":Z,"data-align":J,...w,ref:j,style:{...w.style,animation:K?void 0:"none"}})})})});T6.displayName=l2;var A6="PopperArrow",wne={top:"bottom",right:"left",bottom:"top",left:"right"},R6=N.forwardRef(function(t,n){const{__scopePopper:r,...a}=t,s=bne(A6,r),i=wne[s.placedSide];return c.jsx("span",{ref:s.onArrowChange,style:{position:"absolute",left:s.arrowX,top:s.arrowY,[i]:0,transformOrigin:{top:"",right:"0 0",bottom:"center 0",left:"100% 0"}[s.placedSide],transform:{top:"translateY(100%)",right:"translateY(50%) rotate(90deg) translateX(-50%)",bottom:"rotate(180deg)",left:"translateY(50%) rotate(-90deg) translateX(50%)"}[s.placedSide],visibility:s.shouldHideArrow?"hidden":void 0},children:c.jsx(yne,{...a,ref:n,style:{...a.style,display:"block"}})})});R6.displayName=A6;function Sne(e){return e!==null}var _ne=e=>({name:"transformOrigin",options:e,fn(t){var b,x,_;const{placement:n,rects:r,middlewareData:a}=t,i=((b=a.arrow)==null?void 0:b.centerOffset)!==0,l=i?0:e.arrowWidth,d=i?0:e.arrowHeight,[f,h]=k6(n),p={start:"0%",center:"50%",end:"100%"}[h],g=(((x=a.arrow)==null?void 0:x.x)??0)+l/2,y=(((_=a.arrow)==null?void 0:_.y)??0)+d/2;let S="",w="";return f==="bottom"?(S=i?p:`${g}px`,w=`${-d}px`):f==="top"?(S=i?p:`${g}px`,w=`${r.floating.height+d}px`):f==="right"?(S=`${-d}px`,w=i?p:`${y}px`):f==="left"&&(S=`${r.floating.width+d}px`,w=i?p:`${y}px`),{data:{x:S,y:w}}}});function k6(e){const[t,n="center"]=e.split("-");return[t,n]}var Zf=j6,Qf=E6,Gy=T6,Ky=R6,Nne="Portal",gu=N.forwardRef((e,t)=>{var l;const{container:n,...r}=e,[a,s]=N.useState(!1);Jt(()=>s(!0),[]);const i=n||a&&((l=globalThis==null?void 0:globalThis.document)==null?void 0:l.body);return i?uz.createPortal(c.jsx(Ae.div,{...r,ref:t}),i):null});gu.displayName=Nne;function jne(e,t){return N.useReducer((n,r)=>t[n][r]??n,e)}var sn=e=>{const{present:t,children:n}=e,r=Cne(t),a=typeof n=="function"?n({present:r.isPresent}):N.Children.only(n),s=ze(r.ref,Ene(a));return typeof n=="function"||r.isPresent?N.cloneElement(a,{ref:s}):null};sn.displayName="Presence";function Cne(e){const[t,n]=N.useState(),r=N.useRef(null),a=N.useRef(e),s=N.useRef("none"),i=e?"mounted":"unmounted",[l,d]=jne(i,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return N.useEffect(()=>{const f=lm(r.current);s.current=l==="mounted"?f:"none"},[l]),Jt(()=>{const f=r.current,h=a.current;if(h!==e){const g=s.current,y=lm(f);e?d("MOUNT"):y==="none"||(f==null?void 0:f.display)==="none"?d("UNMOUNT"):d(h&&g!==y?"ANIMATION_OUT":"UNMOUNT"),a.current=e}},[e,d]),Jt(()=>{if(t){let f;const h=t.ownerDocument.defaultView??window,p=y=>{const w=lm(r.current).includes(CSS.escape(y.animationName));if(y.target===t&&w&&(d("ANIMATION_END"),!a.current)){const b=t.style.animationFillMode;t.style.animationFillMode="forwards",f=h.setTimeout(()=>{t.style.animationFillMode==="forwards"&&(t.style.animationFillMode=b)})}},g=y=>{y.target===t&&(s.current=lm(r.current))};return t.addEventListener("animationstart",g),t.addEventListener("animationcancel",p),t.addEventListener("animationend",p),()=>{h.clearTimeout(f),t.removeEventListener("animationstart",g),t.removeEventListener("animationcancel",p),t.removeEventListener("animationend",p)}}else d("ANIMATION_END")},[t,d]),{isPresent:["mounted","unmountSuspended"].includes(l),ref:N.useCallback(f=>{r.current=f?getComputedStyle(f):null,n(f)},[])}}function lm(e){return(e==null?void 0:e.animationName)||"none"}function Ene(e){var r,a;let t=(r=Object.getOwnPropertyDescriptor(e.props,"ref"))==null?void 0:r.get,n=t&&"isReactWarning"in t&&t.isReactWarning;return n?e.ref:(t=(a=Object.getOwnPropertyDescriptor(e,"ref"))==null?void 0:a.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}var tw="rovingFocusGroup.onEntryFocus",Tne={bubbles:!1,cancelable:!0},Jf="RovingFocusGroup",[Hj,O6,Ane]=qy(Jf),[Rne,Xo]=wn(Jf,[Ane]),[kne,One]=Rne(Jf),M6=N.forwardRef((e,t)=>c.jsx(Hj.Provider,{scope:e.__scopeRovingFocusGroup,children:c.jsx(Hj.Slot,{scope:e.__scopeRovingFocusGroup,children:c.jsx(Mne,{...e,ref:t})})}));M6.displayName=Jf;var Mne=N.forwardRef((e,t)=>{const{__scopeRovingFocusGroup:n,orientation:r,loop:a=!1,dir:s,currentTabStopId:i,defaultCurrentTabStopId:l,onCurrentTabStopIdChange:d,onEntryFocus:f,preventScrollOnEntryFocus:h=!1,...p}=e,g=N.useRef(null),y=ze(t,g),S=Ko(s),[w,b]=bn({prop:i,defaultProp:l??null,onChange:d,caller:Jf}),[x,_]=N.useState(!1),j=hn(f),C=O6(n),T=N.useRef(!1),[A,k]=N.useState(0);return N.useEffect(()=>{const O=g.current;if(O)return O.addEventListener(tw,j),()=>O.removeEventListener(tw,j)},[j]),c.jsx(kne,{scope:n,orientation:r,dir:S,loop:a,currentTabStopId:w,onItemFocus:N.useCallback(O=>b(O),[b]),onItemShiftTab:N.useCallback(()=>_(!0),[]),onFocusableItemAdd:N.useCallback(()=>k(O=>O+1),[]),onFocusableItemRemove:N.useCallback(()=>k(O=>O-1),[]),children:c.jsx(Ae.div,{tabIndex:x||A===0?-1:0,"data-orientation":r,...p,ref:y,style:{outline:"none",...e.style},onMouseDown:_e(e.onMouseDown,()=>{T.current=!0}),onFocus:_e(e.onFocus,O=>{const M=!T.current;if(O.target===O.currentTarget&&M&&!x){const z=new CustomEvent(tw,Tne);if(O.currentTarget.dispatchEvent(z),!z.defaultPrevented){const L=C().filter(P=>P.focusable),U=L.find(P=>P.active),F=L.find(P=>P.id===w),V=[U,F,...L].filter(Boolean).map(P=>P.ref.current);$6(V,h)}}T.current=!1}),onBlur:_e(e.onBlur,()=>_(!1))})})}),D6="RovingFocusGroupItem",P6=N.forwardRef((e,t)=>{const{__scopeRovingFocusGroup:n,focusable:r=!0,active:a=!1,tabStopId:s,children:i,...l}=e,d=zn(),f=s||d,h=One(D6,n),p=h.currentTabStopId===f,g=O6(n),{onFocusableItemAdd:y,onFocusableItemRemove:S,currentTabStopId:w}=h;return N.useEffect(()=>{if(r)return y(),()=>S()},[r,y,S]),c.jsx(Hj.ItemSlot,{scope:n,id:f,focusable:r,active:a,children:c.jsx(Ae.span,{tabIndex:p?0:-1,"data-orientation":h.orientation,...l,ref:t,onMouseDown:_e(e.onMouseDown,b=>{r?h.onItemFocus(f):b.preventDefault()}),onFocus:_e(e.onFocus,()=>h.onItemFocus(f)),onKeyDown:_e(e.onKeyDown,b=>{if(b.key==="Tab"&&b.shiftKey){h.onItemShiftTab();return}if(b.target!==b.currentTarget)return;const x=$ne(b,h.orientation,h.dir);if(x!==void 0){if(b.metaKey||b.ctrlKey||b.altKey||b.shiftKey)return;b.preventDefault();let j=g().filter(C=>C.focusable).map(C=>C.ref.current);if(x==="last")j.reverse();else if(x==="prev"||x==="next"){x==="prev"&&j.reverse();const C=j.indexOf(b.currentTarget);j=h.loop?Ine(j,C+1):j.slice(C+1)}setTimeout(()=>$6(j))}}),children:typeof i=="function"?i({isCurrentTabStop:p,hasTabStop:w!=null}):i})})});P6.displayName=D6;var Dne={ArrowLeft:"prev",ArrowUp:"prev",ArrowRight:"next",ArrowDown:"next",PageUp:"first",Home:"first",PageDown:"last",End:"last"};function Pne(e,t){return t!=="rtl"?e:e==="ArrowLeft"?"ArrowRight":e==="ArrowRight"?"ArrowLeft":e}function $ne(e,t,n){const r=Pne(e.key,n);if(!(t==="vertical"&&["ArrowLeft","ArrowRight"].includes(r))&&!(t==="horizontal"&&["ArrowUp","ArrowDown"].includes(r)))return Dne[r]}function $6(e,t=!1){const n=document.activeElement;for(const r of e)if(r===n||(r.focus({preventScroll:t}),document.activeElement!==n))return}function Ine(e,t){return e.map((n,r)=>e[(t+r)%e.length])}var Yy=M6,Xy=P6;function Lne(e){const t=zne(e),n=N.forwardRef((r,a)=>{const{children:s,...i}=r,l=N.Children.toArray(s),d=l.find(Fne);if(d){const f=d.props.children,h=l.map(p=>p===d?N.Children.count(f)>1?N.Children.only(null):N.isValidElement(f)?f.props.children:null:p);return c.jsx(t,{...i,ref:a,children:N.isValidElement(f)?N.cloneElement(f,void 0,h):null})}return c.jsx(t,{...i,ref:a,children:s})});return n.displayName=`${e}.Slot`,n}function zne(e){const t=N.forwardRef((n,r)=>{const{children:a,...s}=n;if(N.isValidElement(a)){const i=Hne(a),l=Une(s,a.props);return a.type!==N.Fragment&&(l.ref=r?La(r,i):i),N.cloneElement(a,l)}return N.Children.count(a)>1?N.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var qne=Symbol("radix.slottable");function Fne(e){return N.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===qne}function Une(e,t){const n={...t};for(const r in t){const a=e[r],s=t[r];/^on[A-Z]/.test(r)?a&&s?n[r]=(...l)=>{const d=s(...l);return a(...l),d}:a&&(n[r]=a):r==="style"?n[r]={...a,...s}:r==="className"&&(n[r]=[a,s].filter(Boolean).join(" "))}return{...e,...n}}function Hne(e){var r,a;let t=(r=Object.getOwnPropertyDescriptor(e.props,"ref"))==null?void 0:r.get,n=t&&"isReactWarning"in t&&t.isReactWarning;return n?e.ref:(t=(a=Object.getOwnPropertyDescriptor(e,"ref"))==null?void 0:a.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}var Bne=function(e){if(typeof document>"u")return null;var t=Array.isArray(e)?e[0]:e;return t.ownerDocument.body},mc=new WeakMap,cm=new WeakMap,um={},nw=0,I6=function(e){return e&&(e.host||I6(e.parentNode))},Vne=function(e,t){return t.map(function(n){if(e.contains(n))return n;var r=I6(n);return r&&e.contains(r)?r:(console.error("aria-hidden",n,"in not contained inside",e,". Doing nothing"),null)}).filter(function(n){return!!n})},Wne=function(e,t,n,r){var a=Vne(t,Array.isArray(e)?e:[e]);um[n]||(um[n]=new WeakMap);var s=um[n],i=[],l=new Set,d=new Set(a),f=function(p){!p||l.has(p)||(l.add(p),f(p.parentNode))};a.forEach(f);var h=function(p){!p||d.has(p)||Array.prototype.forEach.call(p.children,function(g){if(l.has(g))h(g);else try{var y=g.getAttribute(r),S=y!==null&&y!=="false",w=(mc.get(g)||0)+1,b=(s.get(g)||0)+1;mc.set(g,w),s.set(g,b),i.push(g),w===1&&S&&cm.set(g,!0),b===1&&g.setAttribute(n,"true"),S||g.setAttribute(r,"true")}catch(x){console.error("aria-hidden: cannot operate on ",g,x)}})};return h(t),l.clear(),nw++,function(){i.forEach(function(p){var g=mc.get(p)-1,y=s.get(p)-1;mc.set(p,g),s.set(p,y),g||(cm.has(p)||p.removeAttribute(r),cm.delete(p)),y||p.removeAttribute(n)}),nw--,nw||(mc=new WeakMap,mc=new WeakMap,cm=new WeakMap,um={})}},Zy=function(e,t,n){n===void 0&&(n="data-aria-hidden");var r=Array.from(Array.isArray(e)?e:[e]),a=Bne(e);return a?(r.push.apply(r,Array.from(a.querySelectorAll("[aria-live], script"))),Wne(r,a,n,"aria-hidden")):function(){return null}},_a=function(){return _a=Object.assign||function(t){for(var n,r=1,a=arguments.length;r<a;r++){n=arguments[r];for(var s in n)Object.prototype.hasOwnProperty.call(n,s)&&(t[s]=n[s])}return t},_a.apply(this,arguments)};function L6(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var a=0,r=Object.getOwnPropertySymbols(e);a<r.length;a++)t.indexOf(r[a])<0&&Object.prototype.propertyIsEnumerable.call(e,r[a])&&(n[r[a]]=e[r[a]]);return n}function Gne(e,t,n){if(n||arguments.length===2)for(var r=0,a=t.length,s;r<a;r++)(s||!(r in t))&&(s||(s=Array.prototype.slice.call(t,0,r)),s[r]=t[r]);return e.concat(s||Array.prototype.slice.call(t))}var Cg="right-scroll-bar-position",Eg="width-before-scroll-bar",Kne="with-scroll-bars-hidden",Yne="--removed-body-scroll-bar-size";function rw(e,t){return typeof e=="function"?e(t):e&&(e.current=t),e}function Xne(e,t){var n=N.useState(function(){return{value:e,callback:t,facade:{get current(){return n.value},set current(r){var a=n.value;a!==r&&(n.value=r,n.callback(r,a))}}}})[0];return n.callback=t,n.facade}var Zne=typeof window<"u"?N.useLayoutEffect:N.useEffect,mM=new WeakMap;function Qne(e,t){var n=Xne(null,function(r){return e.forEach(function(a){return rw(a,r)})});return Zne(function(){var r=mM.get(n);if(r){var a=new Set(r),s=new Set(e),i=n.current;a.forEach(function(l){s.has(l)||rw(l,null)}),s.forEach(function(l){a.has(l)||rw(l,i)})}mM.set(n,e)},[e]),n}function Jne(e){return e}function ere(e,t){t===void 0&&(t=Jne);var n=[],r=!1,a={read:function(){if(r)throw new Error("Sidecar: could not `read` from an `assigned` medium. `read` could be used only with `useMedium`.");return n.length?n[n.length-1]:e},useMedium:function(s){var i=t(s,r);return n.push(i),function(){n=n.filter(function(l){return l!==i})}},assignSyncMedium:function(s){for(r=!0;n.length;){var i=n;n=[],i.forEach(s)}n={push:function(l){return s(l)},filter:function(){return n}}},assignMedium:function(s){r=!0;var i=[];if(n.length){var l=n;n=[],l.forEach(s),i=n}var d=function(){var h=i;i=[],h.forEach(s)},f=function(){return Promise.resolve().then(d)};f(),n={push:function(h){i.push(h),f()},filter:function(h){return i=i.filter(h),n}}}};return a}function tre(e){e===void 0&&(e={});var t=ere(null);return t.options=_a({async:!0,ssr:!1},e),t}var z6=function(e){var t=e.sideCar,n=L6(e,["sideCar"]);if(!t)throw new Error("Sidecar: please provide `sideCar` property to import the right car");var r=t.read();if(!r)throw new Error("Sidecar medium not found");return N.createElement(r,_a({},n))};z6.isSideCarExport=!0;function nre(e,t){return e.useMedium(t),z6}var q6=tre(),aw=function(){},Qy=N.forwardRef(function(e,t){var n=N.useRef(null),r=N.useState({onScrollCapture:aw,onWheelCapture:aw,onTouchMoveCapture:aw}),a=r[0],s=r[1],i=e.forwardProps,l=e.children,d=e.className,f=e.removeScrollBar,h=e.enabled,p=e.shards,g=e.sideCar,y=e.noRelative,S=e.noIsolation,w=e.inert,b=e.allowPinchZoom,x=e.as,_=x===void 0?"div":x,j=e.gapMode,C=L6(e,["forwardProps","children","className","removeScrollBar","enabled","shards","sideCar","noRelative","noIsolation","inert","allowPinchZoom","as","gapMode"]),T=g,A=Qne([n,t]),k=_a(_a({},C),a);return N.createElement(N.Fragment,null,h&&N.createElement(T,{sideCar:q6,removeScrollBar:f,shards:p,noRelative:y,noIsolation:S,inert:w,setCallbacks:s,allowPinchZoom:!!b,lockRef:n,gapMode:j}),i?N.cloneElement(N.Children.only(l),_a(_a({},k),{ref:A})):N.createElement(_,_a({},k,{className:d,ref:A}),l))});Qy.defaultProps={enabled:!0,removeScrollBar:!0,inert:!1};Qy.classNames={fullWidth:Eg,zeroRight:Cg};var rre=function(){if(typeof __webpack_nonce__<"u")return __webpack_nonce__};function are(){if(!document)return null;var e=document.createElement("style");e.type="text/css";var t=rre();return t&&e.setAttribute("nonce",t),e}function sre(e,t){e.styleSheet?e.styleSheet.cssText=t:e.appendChild(document.createTextNode(t))}function ore(e){var t=document.head||document.getElementsByTagName("head")[0];t.appendChild(e)}var ire=function(){var e=0,t=null;return{add:function(n){e==0&&(t=are())&&(sre(t,n),ore(t)),e++},remove:function(){e--,!e&&t&&(t.parentNode&&t.parentNode.removeChild(t),t=null)}}},lre=function(){var e=ire();return function(t,n){N.useEffect(function(){return e.add(t),function(){e.remove()}},[t&&n])}},F6=function(){var e=lre(),t=function(n){var r=n.styles,a=n.dynamic;return e(r,a),null};return t},cre={left:0,top:0,right:0,gap:0},sw=function(e){return parseInt(e||"",10)||0},ure=function(e){var t=window.getComputedStyle(document.body),n=t[e==="padding"?"paddingLeft":"marginLeft"],r=t[e==="padding"?"paddingTop":"marginTop"],a=t[e==="padding"?"paddingRight":"marginRight"];return[sw(n),sw(r),sw(a)]},dre=function(e){if(e===void 0&&(e="margin"),typeof window>"u")return cre;var t=ure(e),n=document.documentElement.clientWidth,r=window.innerWidth;return{left:t[0],top:t[1],right:t[2],gap:Math.max(0,r-n+t[2]-t[0])}},fre=F6(),kc="data-scroll-locked",hre=function(e,t,n,r){var a=e.left,s=e.top,i=e.right,l=e.gap;return n===void 0&&(n="margin"),`
|
|
626
|
+
.`.concat(Kne,` {
|
|
627
|
+
overflow: hidden `).concat(r,`;
|
|
628
|
+
padding-right: `).concat(l,"px ").concat(r,`;
|
|
629
|
+
}
|
|
630
|
+
body[`).concat(kc,`] {
|
|
631
|
+
overflow: hidden `).concat(r,`;
|
|
632
|
+
overscroll-behavior: contain;
|
|
633
|
+
`).concat([t&&"position: relative ".concat(r,";"),n==="margin"&&`
|
|
634
|
+
padding-left: `.concat(a,`px;
|
|
635
|
+
padding-top: `).concat(s,`px;
|
|
636
|
+
padding-right: `).concat(i,`px;
|
|
637
|
+
margin-left:0;
|
|
638
|
+
margin-top:0;
|
|
639
|
+
margin-right: `).concat(l,"px ").concat(r,`;
|
|
640
|
+
`),n==="padding"&&"padding-right: ".concat(l,"px ").concat(r,";")].filter(Boolean).join(""),`
|
|
641
|
+
}
|
|
642
|
+
|
|
643
|
+
.`).concat(Cg,` {
|
|
644
|
+
right: `).concat(l,"px ").concat(r,`;
|
|
645
|
+
}
|
|
646
|
+
|
|
647
|
+
.`).concat(Eg,` {
|
|
648
|
+
margin-right: `).concat(l,"px ").concat(r,`;
|
|
649
|
+
}
|
|
650
|
+
|
|
651
|
+
.`).concat(Cg," .").concat(Cg,` {
|
|
652
|
+
right: 0 `).concat(r,`;
|
|
653
|
+
}
|
|
654
|
+
|
|
655
|
+
.`).concat(Eg," .").concat(Eg,` {
|
|
656
|
+
margin-right: 0 `).concat(r,`;
|
|
657
|
+
}
|
|
658
|
+
|
|
659
|
+
body[`).concat(kc,`] {
|
|
660
|
+
`).concat(Yne,": ").concat(l,`px;
|
|
661
|
+
}
|
|
662
|
+
`)},gM=function(){var e=parseInt(document.body.getAttribute(kc)||"0",10);return isFinite(e)?e:0},pre=function(){N.useEffect(function(){return document.body.setAttribute(kc,(gM()+1).toString()),function(){var e=gM()-1;e<=0?document.body.removeAttribute(kc):document.body.setAttribute(kc,e.toString())}},[])},mre=function(e){var t=e.noRelative,n=e.noImportant,r=e.gapMode,a=r===void 0?"margin":r;pre();var s=N.useMemo(function(){return dre(a)},[a]);return N.createElement(fre,{styles:hre(s,!t,a,n?"":"!important")})},Bj=!1;if(typeof window<"u")try{var dm=Object.defineProperty({},"passive",{get:function(){return Bj=!0,!0}});window.addEventListener("test",dm,dm),window.removeEventListener("test",dm,dm)}catch{Bj=!1}var gc=Bj?{passive:!1}:!1,gre=function(e){return e.tagName==="TEXTAREA"},U6=function(e,t){if(!(e instanceof Element))return!1;var n=window.getComputedStyle(e);return n[t]!=="hidden"&&!(n.overflowY===n.overflowX&&!gre(e)&&n[t]==="visible")},yre=function(e){return U6(e,"overflowY")},vre=function(e){return U6(e,"overflowX")},yM=function(e,t){var n=t.ownerDocument,r=t;do{typeof ShadowRoot<"u"&&r instanceof ShadowRoot&&(r=r.host);var a=H6(e,r);if(a){var s=B6(e,r),i=s[1],l=s[2];if(i>l)return!0}r=r.parentNode}while(r&&r!==n.body);return!1},xre=function(e){var t=e.scrollTop,n=e.scrollHeight,r=e.clientHeight;return[t,n,r]},bre=function(e){var t=e.scrollLeft,n=e.scrollWidth,r=e.clientWidth;return[t,n,r]},H6=function(e,t){return e==="v"?yre(t):vre(t)},B6=function(e,t){return e==="v"?xre(t):bre(t)},wre=function(e,t){return e==="h"&&t==="rtl"?-1:1},Sre=function(e,t,n,r,a){var s=wre(e,window.getComputedStyle(t).direction),i=s*r,l=n.target,d=t.contains(l),f=!1,h=i>0,p=0,g=0;do{if(!l)break;var y=B6(e,l),S=y[0],w=y[1],b=y[2],x=w-b-s*S;(S||x)&&H6(e,l)&&(p+=x,g+=S);var _=l.parentNode;l=_&&_.nodeType===Node.DOCUMENT_FRAGMENT_NODE?_.host:_}while(!d&&l!==document.body||d&&(t.contains(l)||t===l));return(h&&Math.abs(p)<1||!h&&Math.abs(g)<1)&&(f=!0),f},fm=function(e){return"changedTouches"in e?[e.changedTouches[0].clientX,e.changedTouches[0].clientY]:[0,0]},vM=function(e){return[e.deltaX,e.deltaY]},xM=function(e){return e&&"current"in e?e.current:e},_re=function(e,t){return e[0]===t[0]&&e[1]===t[1]},Nre=function(e){return`
|
|
663
|
+
.block-interactivity-`.concat(e,` {pointer-events: none;}
|
|
664
|
+
.allow-interactivity-`).concat(e,` {pointer-events: all;}
|
|
665
|
+
`)},jre=0,yc=[];function Cre(e){var t=N.useRef([]),n=N.useRef([0,0]),r=N.useRef(),a=N.useState(jre++)[0],s=N.useState(F6)[0],i=N.useRef(e);N.useEffect(function(){i.current=e},[e]),N.useEffect(function(){if(e.inert){document.body.classList.add("block-interactivity-".concat(a));var w=Gne([e.lockRef.current],(e.shards||[]).map(xM),!0).filter(Boolean);return w.forEach(function(b){return b.classList.add("allow-interactivity-".concat(a))}),function(){document.body.classList.remove("block-interactivity-".concat(a)),w.forEach(function(b){return b.classList.remove("allow-interactivity-".concat(a))})}}},[e.inert,e.lockRef.current,e.shards]);var l=N.useCallback(function(w,b){if("touches"in w&&w.touches.length===2||w.type==="wheel"&&w.ctrlKey)return!i.current.allowPinchZoom;var x=fm(w),_=n.current,j="deltaX"in w?w.deltaX:_[0]-x[0],C="deltaY"in w?w.deltaY:_[1]-x[1],T,A=w.target,k=Math.abs(j)>Math.abs(C)?"h":"v";if("touches"in w&&k==="h"&&A.type==="range")return!1;var O=yM(k,A);if(!O)return!0;if(O?T=k:(T=k==="v"?"h":"v",O=yM(k,A)),!O)return!1;if(!r.current&&"changedTouches"in w&&(j||C)&&(r.current=T),!T)return!0;var M=r.current||T;return Sre(M,b,w,M==="h"?j:C)},[]),d=N.useCallback(function(w){var b=w;if(!(!yc.length||yc[yc.length-1]!==s)){var x="deltaY"in b?vM(b):fm(b),_=t.current.filter(function(T){return T.name===b.type&&(T.target===b.target||b.target===T.shadowParent)&&_re(T.delta,x)})[0];if(_&&_.should){b.cancelable&&b.preventDefault();return}if(!_){var j=(i.current.shards||[]).map(xM).filter(Boolean).filter(function(T){return T.contains(b.target)}),C=j.length>0?l(b,j[0]):!i.current.noIsolation;C&&b.cancelable&&b.preventDefault()}}},[]),f=N.useCallback(function(w,b,x,_){var j={name:w,delta:b,target:x,should:_,shadowParent:Ere(x)};t.current.push(j),setTimeout(function(){t.current=t.current.filter(function(C){return C!==j})},1)},[]),h=N.useCallback(function(w){n.current=fm(w),r.current=void 0},[]),p=N.useCallback(function(w){f(w.type,vM(w),w.target,l(w,e.lockRef.current))},[]),g=N.useCallback(function(w){f(w.type,fm(w),w.target,l(w,e.lockRef.current))},[]);N.useEffect(function(){return yc.push(s),e.setCallbacks({onScrollCapture:p,onWheelCapture:p,onTouchMoveCapture:g}),document.addEventListener("wheel",d,gc),document.addEventListener("touchmove",d,gc),document.addEventListener("touchstart",h,gc),function(){yc=yc.filter(function(w){return w!==s}),document.removeEventListener("wheel",d,gc),document.removeEventListener("touchmove",d,gc),document.removeEventListener("touchstart",h,gc)}},[]);var y=e.removeScrollBar,S=e.inert;return N.createElement(N.Fragment,null,S?N.createElement(s,{styles:Nre(a)}):null,y?N.createElement(mre,{noRelative:e.noRelative,gapMode:e.gapMode}):null)}function Ere(e){for(var t=null;e!==null;)e instanceof ShadowRoot&&(t=e.host,e=e.host),e=e.parentNode;return t}const Tre=nre(q6,Cre);var eh=N.forwardRef(function(e,t){return N.createElement(Qy,_a({},e,{ref:t,sideCar:Tre}))});eh.classNames=Qy.classNames;var Vj=["Enter"," "],Are=["ArrowDown","PageUp","Home"],V6=["ArrowUp","PageDown","End"],Rre=[...Are,...V6],kre={ltr:[...Vj,"ArrowRight"],rtl:[...Vj,"ArrowLeft"]},Ore={ltr:["ArrowLeft"],rtl:["ArrowRight"]},th="Menu",[gf,Mre,Dre]=qy(th),[cl,W6]=wn(th,[Dre,Yo,Xo]),nh=Yo(),G6=Xo(),[K6,Zo]=cl(th),[Pre,rh]=cl(th),Y6=e=>{const{__scopeMenu:t,open:n=!1,children:r,dir:a,onOpenChange:s,modal:i=!0}=e,l=nh(t),[d,f]=N.useState(null),h=N.useRef(!1),p=hn(s),g=Ko(a);return N.useEffect(()=>{const y=()=>{h.current=!0,document.addEventListener("pointerdown",S,{capture:!0,once:!0}),document.addEventListener("pointermove",S,{capture:!0,once:!0})},S=()=>h.current=!1;return document.addEventListener("keydown",y,{capture:!0}),()=>{document.removeEventListener("keydown",y,{capture:!0}),document.removeEventListener("pointerdown",S,{capture:!0}),document.removeEventListener("pointermove",S,{capture:!0})}},[]),c.jsx(Zf,{...l,children:c.jsx(K6,{scope:t,open:n,onOpenChange:p,content:d,onContentChange:f,children:c.jsx(Pre,{scope:t,onClose:N.useCallback(()=>p(!1),[p]),isUsingKeyboardRef:h,dir:g,modal:i,children:r})})})};Y6.displayName=th;var $re="MenuAnchor",c2=N.forwardRef((e,t)=>{const{__scopeMenu:n,...r}=e,a=nh(n);return c.jsx(Qf,{...a,...r,ref:t})});c2.displayName=$re;var u2="MenuPortal",[Ire,X6]=cl(u2,{forceMount:void 0}),Z6=e=>{const{__scopeMenu:t,forceMount:n,children:r,container:a}=e,s=Zo(u2,t);return c.jsx(Ire,{scope:t,forceMount:n,children:c.jsx(sn,{present:n||s.open,children:c.jsx(gu,{asChild:!0,container:a,children:r})})})};Z6.displayName=u2;var $r="MenuContent",[Lre,d2]=cl($r),Q6=N.forwardRef((e,t)=>{const n=X6($r,e.__scopeMenu),{forceMount:r=n.forceMount,...a}=e,s=Zo($r,e.__scopeMenu),i=rh($r,e.__scopeMenu);return c.jsx(gf.Provider,{scope:e.__scopeMenu,children:c.jsx(sn,{present:r||s.open,children:c.jsx(gf.Slot,{scope:e.__scopeMenu,children:i.modal?c.jsx(zre,{...a,ref:t}):c.jsx(qre,{...a,ref:t})})})})}),zre=N.forwardRef((e,t)=>{const n=Zo($r,e.__scopeMenu),r=N.useRef(null),a=ze(t,r);return N.useEffect(()=>{const s=r.current;if(s)return Zy(s)},[]),c.jsx(f2,{...e,ref:a,trapFocus:n.open,disableOutsidePointerEvents:n.open,disableOutsideScroll:!0,onFocusOutside:_e(e.onFocusOutside,s=>s.preventDefault(),{checkForDefaultPrevented:!1}),onDismiss:()=>n.onOpenChange(!1)})}),qre=N.forwardRef((e,t)=>{const n=Zo($r,e.__scopeMenu);return c.jsx(f2,{...e,ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,disableOutsideScroll:!1,onDismiss:()=>n.onOpenChange(!1)})}),Fre=Lne("MenuContent.ScrollLock"),f2=N.forwardRef((e,t)=>{const{__scopeMenu:n,loop:r=!1,trapFocus:a,onOpenAutoFocus:s,onCloseAutoFocus:i,disableOutsidePointerEvents:l,onEntryFocus:d,onEscapeKeyDown:f,onPointerDownOutside:h,onFocusOutside:p,onInteractOutside:g,onDismiss:y,disableOutsideScroll:S,...w}=e,b=Zo($r,n),x=rh($r,n),_=nh(n),j=G6(n),C=Mre(n),[T,A]=N.useState(null),k=N.useRef(null),O=ze(t,k,b.onContentChange),M=N.useRef(0),z=N.useRef(""),L=N.useRef(0),U=N.useRef(null),F=N.useRef("right"),q=N.useRef(0),V=S?eh:N.Fragment,P=S?{as:Fre,allowPinchZoom:!0}:void 0,K=Z=>{var re,ne;const J=z.current+Z,D=C().filter(Q=>!Q.disabled),W=document.activeElement,B=(re=D.find(Q=>Q.ref.current===W))==null?void 0:re.textValue,$=D.map(Q=>Q.textValue),G=Jre($,J,B),ee=(ne=D.find(Q=>Q.textValue===G))==null?void 0:ne.ref.current;(function Q(ae){z.current=ae,window.clearTimeout(M.current),ae!==""&&(M.current=window.setTimeout(()=>Q(""),1e3))})(J),ee&&setTimeout(()=>ee.focus())};N.useEffect(()=>()=>window.clearTimeout(M.current),[]),Fy();const H=N.useCallback(Z=>{var D,W;return F.current===((D=U.current)==null?void 0:D.side)&&tae(Z,(W=U.current)==null?void 0:W.area)},[]);return c.jsx(Lre,{scope:n,searchRef:z,onItemEnter:N.useCallback(Z=>{H(Z)&&Z.preventDefault()},[H]),onItemLeave:N.useCallback(Z=>{var J;H(Z)||((J=k.current)==null||J.focus(),A(null))},[H]),onTriggerLeave:N.useCallback(Z=>{H(Z)&&Z.preventDefault()},[H]),pointerGraceTimerRef:L,onPointerGraceIntentChange:N.useCallback(Z=>{U.current=Z},[]),children:c.jsx(V,{...P,children:c.jsx(Yf,{asChild:!0,trapped:a,onMountAutoFocus:_e(s,Z=>{var J;Z.preventDefault(),(J=k.current)==null||J.focus({preventScroll:!0})}),onUnmountAutoFocus:i,children:c.jsx(hu,{asChild:!0,disableOutsidePointerEvents:l,onEscapeKeyDown:f,onPointerDownOutside:h,onFocusOutside:p,onInteractOutside:g,onDismiss:y,children:c.jsx(Yy,{asChild:!0,...j,dir:x.dir,orientation:"vertical",loop:r,currentTabStopId:T,onCurrentTabStopIdChange:A,onEntryFocus:_e(d,Z=>{x.isUsingKeyboardRef.current||Z.preventDefault()}),preventScrollOnEntryFocus:!0,children:c.jsx(Gy,{role:"menu","aria-orientation":"vertical","data-state":m9(b.open),"data-radix-menu-content":"",dir:x.dir,..._,...w,ref:O,style:{outline:"none",...w.style},onKeyDown:_e(w.onKeyDown,Z=>{const D=Z.target.closest("[data-radix-menu-content]")===Z.currentTarget,W=Z.ctrlKey||Z.altKey||Z.metaKey,B=Z.key.length===1;D&&(Z.key==="Tab"&&Z.preventDefault(),!W&&B&&K(Z.key));const $=k.current;if(Z.target!==$||!Rre.includes(Z.key))return;Z.preventDefault();const ee=C().filter(re=>!re.disabled).map(re=>re.ref.current);V6.includes(Z.key)&&ee.reverse(),Zre(ee)}),onBlur:_e(e.onBlur,Z=>{Z.currentTarget.contains(Z.target)||(window.clearTimeout(M.current),z.current="")}),onPointerMove:_e(e.onPointerMove,yf(Z=>{const J=Z.target,D=q.current!==Z.clientX;if(Z.currentTarget.contains(J)&&D){const W=Z.clientX>q.current?"right":"left";F.current=W,q.current=Z.clientX}}))})})})})})})});Q6.displayName=$r;var Ure="MenuGroup",h2=N.forwardRef((e,t)=>{const{__scopeMenu:n,...r}=e;return c.jsx(Ae.div,{role:"group",...r,ref:t})});h2.displayName=Ure;var Hre="MenuLabel",J6=N.forwardRef((e,t)=>{const{__scopeMenu:n,...r}=e;return c.jsx(Ae.div,{...r,ref:t})});J6.displayName=Hre;var ey="MenuItem",bM="menu.itemSelect",Jy=N.forwardRef((e,t)=>{const{disabled:n=!1,onSelect:r,...a}=e,s=N.useRef(null),i=rh(ey,e.__scopeMenu),l=d2(ey,e.__scopeMenu),d=ze(t,s),f=N.useRef(!1),h=()=>{const p=s.current;if(!n&&p){const g=new CustomEvent(bM,{bubbles:!0,cancelable:!0});p.addEventListener(bM,y=>r==null?void 0:r(y),{once:!0}),i6(p,g),g.defaultPrevented?f.current=!1:i.onClose()}};return c.jsx(e9,{...a,ref:d,disabled:n,onClick:_e(e.onClick,h),onPointerDown:p=>{var g;(g=e.onPointerDown)==null||g.call(e,p),f.current=!0},onPointerUp:_e(e.onPointerUp,p=>{var g;f.current||(g=p.currentTarget)==null||g.click()}),onKeyDown:_e(e.onKeyDown,p=>{const g=l.searchRef.current!=="";n||g&&p.key===" "||Vj.includes(p.key)&&(p.currentTarget.click(),p.preventDefault())})})});Jy.displayName=ey;var e9=N.forwardRef((e,t)=>{const{__scopeMenu:n,disabled:r=!1,textValue:a,...s}=e,i=d2(ey,n),l=G6(n),d=N.useRef(null),f=ze(t,d),[h,p]=N.useState(!1),[g,y]=N.useState("");return N.useEffect(()=>{const S=d.current;S&&y((S.textContent??"").trim())},[s.children]),c.jsx(gf.ItemSlot,{scope:n,disabled:r,textValue:a??g,children:c.jsx(Xy,{asChild:!0,...l,focusable:!r,children:c.jsx(Ae.div,{role:"menuitem","data-highlighted":h?"":void 0,"aria-disabled":r||void 0,"data-disabled":r?"":void 0,...s,ref:f,onPointerMove:_e(e.onPointerMove,yf(S=>{r?i.onItemLeave(S):(i.onItemEnter(S),S.defaultPrevented||S.currentTarget.focus({preventScroll:!0}))})),onPointerLeave:_e(e.onPointerLeave,yf(S=>i.onItemLeave(S))),onFocus:_e(e.onFocus,()=>p(!0)),onBlur:_e(e.onBlur,()=>p(!1))})})})}),Bre="MenuCheckboxItem",t9=N.forwardRef((e,t)=>{const{checked:n=!1,onCheckedChange:r,...a}=e;return c.jsx(o9,{scope:e.__scopeMenu,checked:n,children:c.jsx(Jy,{role:"menuitemcheckbox","aria-checked":ty(n)?"mixed":n,...a,ref:t,"data-state":g2(n),onSelect:_e(a.onSelect,()=>r==null?void 0:r(ty(n)?!0:!n),{checkForDefaultPrevented:!1})})})});t9.displayName=Bre;var n9="MenuRadioGroup",[Vre,Wre]=cl(n9,{value:void 0,onValueChange:()=>{}}),r9=N.forwardRef((e,t)=>{const{value:n,onValueChange:r,...a}=e,s=hn(r);return c.jsx(Vre,{scope:e.__scopeMenu,value:n,onValueChange:s,children:c.jsx(h2,{...a,ref:t})})});r9.displayName=n9;var a9="MenuRadioItem",s9=N.forwardRef((e,t)=>{const{value:n,...r}=e,a=Wre(a9,e.__scopeMenu),s=n===a.value;return c.jsx(o9,{scope:e.__scopeMenu,checked:s,children:c.jsx(Jy,{role:"menuitemradio","aria-checked":s,...r,ref:t,"data-state":g2(s),onSelect:_e(r.onSelect,()=>{var i;return(i=a.onValueChange)==null?void 0:i.call(a,n)},{checkForDefaultPrevented:!1})})})});s9.displayName=a9;var p2="MenuItemIndicator",[o9,Gre]=cl(p2,{checked:!1}),i9=N.forwardRef((e,t)=>{const{__scopeMenu:n,forceMount:r,...a}=e,s=Gre(p2,n);return c.jsx(sn,{present:r||ty(s.checked)||s.checked===!0,children:c.jsx(Ae.span,{...a,ref:t,"data-state":g2(s.checked)})})});i9.displayName=p2;var Kre="MenuSeparator",l9=N.forwardRef((e,t)=>{const{__scopeMenu:n,...r}=e;return c.jsx(Ae.div,{role:"separator","aria-orientation":"horizontal",...r,ref:t})});l9.displayName=Kre;var Yre="MenuArrow",c9=N.forwardRef((e,t)=>{const{__scopeMenu:n,...r}=e,a=nh(n);return c.jsx(Ky,{...a,...r,ref:t})});c9.displayName=Yre;var m2="MenuSub",[Xre,u9]=cl(m2),d9=e=>{const{__scopeMenu:t,children:n,open:r=!1,onOpenChange:a}=e,s=Zo(m2,t),i=nh(t),[l,d]=N.useState(null),[f,h]=N.useState(null),p=hn(a);return N.useEffect(()=>(s.open===!1&&p(!1),()=>p(!1)),[s.open,p]),c.jsx(Zf,{...i,children:c.jsx(K6,{scope:t,open:r,onOpenChange:p,content:f,onContentChange:h,children:c.jsx(Xre,{scope:t,contentId:zn(),triggerId:zn(),trigger:l,onTriggerChange:d,children:n})})})};d9.displayName=m2;var Fd="MenuSubTrigger",f9=N.forwardRef((e,t)=>{const n=Zo(Fd,e.__scopeMenu),r=rh(Fd,e.__scopeMenu),a=u9(Fd,e.__scopeMenu),s=d2(Fd,e.__scopeMenu),i=N.useRef(null),{pointerGraceTimerRef:l,onPointerGraceIntentChange:d}=s,f={__scopeMenu:e.__scopeMenu},h=N.useCallback(()=>{i.current&&window.clearTimeout(i.current),i.current=null},[]);return N.useEffect(()=>h,[h]),N.useEffect(()=>{const p=l.current;return()=>{window.clearTimeout(p),d(null)}},[l,d]),c.jsx(c2,{asChild:!0,...f,children:c.jsx(e9,{id:a.triggerId,"aria-haspopup":"menu","aria-expanded":n.open,"aria-controls":a.contentId,"data-state":m9(n.open),...e,ref:La(t,a.onTriggerChange),onClick:p=>{var g;(g=e.onClick)==null||g.call(e,p),!(e.disabled||p.defaultPrevented)&&(p.currentTarget.focus(),n.open||n.onOpenChange(!0))},onPointerMove:_e(e.onPointerMove,yf(p=>{s.onItemEnter(p),!p.defaultPrevented&&!e.disabled&&!n.open&&!i.current&&(s.onPointerGraceIntentChange(null),i.current=window.setTimeout(()=>{n.onOpenChange(!0),h()},100))})),onPointerLeave:_e(e.onPointerLeave,yf(p=>{var y,S;h();const g=(y=n.content)==null?void 0:y.getBoundingClientRect();if(g){const w=(S=n.content)==null?void 0:S.dataset.side,b=w==="right",x=b?-5:5,_=g[b?"left":"right"],j=g[b?"right":"left"];s.onPointerGraceIntentChange({area:[{x:p.clientX+x,y:p.clientY},{x:_,y:g.top},{x:j,y:g.top},{x:j,y:g.bottom},{x:_,y:g.bottom}],side:w}),window.clearTimeout(l.current),l.current=window.setTimeout(()=>s.onPointerGraceIntentChange(null),300)}else{if(s.onTriggerLeave(p),p.defaultPrevented)return;s.onPointerGraceIntentChange(null)}})),onKeyDown:_e(e.onKeyDown,p=>{var y;const g=s.searchRef.current!=="";e.disabled||g&&p.key===" "||kre[r.dir].includes(p.key)&&(n.onOpenChange(!0),(y=n.content)==null||y.focus(),p.preventDefault())})})})});f9.displayName=Fd;var h9="MenuSubContent",p9=N.forwardRef((e,t)=>{const n=X6($r,e.__scopeMenu),{forceMount:r=n.forceMount,...a}=e,s=Zo($r,e.__scopeMenu),i=rh($r,e.__scopeMenu),l=u9(h9,e.__scopeMenu),d=N.useRef(null),f=ze(t,d);return c.jsx(gf.Provider,{scope:e.__scopeMenu,children:c.jsx(sn,{present:r||s.open,children:c.jsx(gf.Slot,{scope:e.__scopeMenu,children:c.jsx(f2,{id:l.contentId,"aria-labelledby":l.triggerId,...a,ref:f,align:"start",side:i.dir==="rtl"?"left":"right",disableOutsidePointerEvents:!1,disableOutsideScroll:!1,trapFocus:!1,onOpenAutoFocus:h=>{var p;i.isUsingKeyboardRef.current&&((p=d.current)==null||p.focus()),h.preventDefault()},onCloseAutoFocus:h=>h.preventDefault(),onFocusOutside:_e(e.onFocusOutside,h=>{h.target!==l.trigger&&s.onOpenChange(!1)}),onEscapeKeyDown:_e(e.onEscapeKeyDown,h=>{i.onClose(),h.preventDefault()}),onKeyDown:_e(e.onKeyDown,h=>{var y;const p=h.currentTarget.contains(h.target),g=Ore[i.dir].includes(h.key);p&&g&&(s.onOpenChange(!1),(y=l.trigger)==null||y.focus(),h.preventDefault())})})})})})});p9.displayName=h9;function m9(e){return e?"open":"closed"}function ty(e){return e==="indeterminate"}function g2(e){return ty(e)?"indeterminate":e?"checked":"unchecked"}function Zre(e){const t=document.activeElement;for(const n of e)if(n===t||(n.focus(),document.activeElement!==t))return}function Qre(e,t){return e.map((n,r)=>e[(t+r)%e.length])}function Jre(e,t,n){const a=t.length>1&&Array.from(t).every(f=>f===t[0])?t[0]:t,s=n?e.indexOf(n):-1;let i=Qre(e,Math.max(s,0));a.length===1&&(i=i.filter(f=>f!==n));const d=i.find(f=>f.toLowerCase().startsWith(a.toLowerCase()));return d!==n?d:void 0}function eae(e,t){const{x:n,y:r}=e;let a=!1;for(let s=0,i=t.length-1;s<t.length;i=s++){const l=t[s],d=t[i],f=l.x,h=l.y,p=d.x,g=d.y;h>r!=g>r&&n<(p-f)*(r-h)/(g-h)+f&&(a=!a)}return a}function tae(e,t){if(!t)return!1;const n={x:e.clientX,y:e.clientY};return eae(n,t)}function yf(e){return t=>t.pointerType==="mouse"?e(t):void 0}var nae=Y6,rae=c2,aae=Z6,sae=Q6,oae=h2,iae=J6,lae=Jy,cae=t9,uae=r9,dae=s9,fae=i9,hae=l9,pae=c9,mae=d9,gae=f9,yae=p9,ev="DropdownMenu",[vae]=wn(ev,[W6]),qn=W6(),[xae,g9]=vae(ev),y9=e=>{const{__scopeDropdownMenu:t,children:n,dir:r,open:a,defaultOpen:s,onOpenChange:i,modal:l=!0}=e,d=qn(t),f=N.useRef(null),[h,p]=bn({prop:a,defaultProp:s??!1,onChange:i,caller:ev});return c.jsx(xae,{scope:t,triggerId:zn(),triggerRef:f,contentId:zn(),open:h,onOpenChange:p,onOpenToggle:N.useCallback(()=>p(g=>!g),[p]),modal:l,children:c.jsx(nae,{...d,open:h,onOpenChange:p,dir:r,modal:l,children:n})})};y9.displayName=ev;var v9="DropdownMenuTrigger",x9=N.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,disabled:r=!1,...a}=e,s=g9(v9,n),i=qn(n);return c.jsx(rae,{asChild:!0,...i,children:c.jsx(Ae.button,{type:"button",id:s.triggerId,"aria-haspopup":"menu","aria-expanded":s.open,"aria-controls":s.open?s.contentId:void 0,"data-state":s.open?"open":"closed","data-disabled":r?"":void 0,disabled:r,...a,ref:La(t,s.triggerRef),onPointerDown:_e(e.onPointerDown,l=>{!r&&l.button===0&&l.ctrlKey===!1&&(s.onOpenToggle(),s.open||l.preventDefault())}),onKeyDown:_e(e.onKeyDown,l=>{r||(["Enter"," "].includes(l.key)&&s.onOpenToggle(),l.key==="ArrowDown"&&s.onOpenChange(!0),["Enter"," ","ArrowDown"].includes(l.key)&&l.preventDefault())})})})});x9.displayName=v9;var bae="DropdownMenuPortal",b9=e=>{const{__scopeDropdownMenu:t,...n}=e,r=qn(t);return c.jsx(aae,{...r,...n})};b9.displayName=bae;var w9="DropdownMenuContent",S9=N.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,a=g9(w9,n),s=qn(n),i=N.useRef(!1);return c.jsx(sae,{id:a.contentId,"aria-labelledby":a.triggerId,...s,...r,ref:t,onCloseAutoFocus:_e(e.onCloseAutoFocus,l=>{var d;i.current||(d=a.triggerRef.current)==null||d.focus(),i.current=!1,l.preventDefault()}),onInteractOutside:_e(e.onInteractOutside,l=>{const d=l.detail.originalEvent,f=d.button===0&&d.ctrlKey===!0,h=d.button===2||f;(!a.modal||h)&&(i.current=!0)}),style:{...e.style,"--radix-dropdown-menu-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-dropdown-menu-content-available-width":"var(--radix-popper-available-width)","--radix-dropdown-menu-content-available-height":"var(--radix-popper-available-height)","--radix-dropdown-menu-trigger-width":"var(--radix-popper-anchor-width)","--radix-dropdown-menu-trigger-height":"var(--radix-popper-anchor-height)"}})});S9.displayName=w9;var wae="DropdownMenuGroup",Sae=N.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,a=qn(n);return c.jsx(oae,{...a,...r,ref:t})});Sae.displayName=wae;var _ae="DropdownMenuLabel",_9=N.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,a=qn(n);return c.jsx(iae,{...a,...r,ref:t})});_9.displayName=_ae;var Nae="DropdownMenuItem",N9=N.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,a=qn(n);return c.jsx(lae,{...a,...r,ref:t})});N9.displayName=Nae;var jae="DropdownMenuCheckboxItem",j9=N.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,a=qn(n);return c.jsx(cae,{...a,...r,ref:t})});j9.displayName=jae;var Cae="DropdownMenuRadioGroup",Eae=N.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,a=qn(n);return c.jsx(uae,{...a,...r,ref:t})});Eae.displayName=Cae;var Tae="DropdownMenuRadioItem",C9=N.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,a=qn(n);return c.jsx(dae,{...a,...r,ref:t})});C9.displayName=Tae;var Aae="DropdownMenuItemIndicator",E9=N.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,a=qn(n);return c.jsx(fae,{...a,...r,ref:t})});E9.displayName=Aae;var Rae="DropdownMenuSeparator",T9=N.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,a=qn(n);return c.jsx(hae,{...a,...r,ref:t})});T9.displayName=Rae;var kae="DropdownMenuArrow",Oae=N.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,a=qn(n);return c.jsx(pae,{...a,...r,ref:t})});Oae.displayName=kae;var Mae=e=>{const{__scopeDropdownMenu:t,children:n,open:r,onOpenChange:a,defaultOpen:s}=e,i=qn(t),[l,d]=bn({prop:r,defaultProp:s??!1,onChange:a,caller:"DropdownMenuSub"});return c.jsx(mae,{...i,open:l,onOpenChange:d,children:n})},Dae="DropdownMenuSubTrigger",A9=N.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,a=qn(n);return c.jsx(gae,{...a,...r,ref:t})});A9.displayName=Dae;var Pae="DropdownMenuSubContent",R9=N.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,a=qn(n);return c.jsx(yae,{...a,...r,ref:t,style:{...e.style,"--radix-dropdown-menu-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-dropdown-menu-content-available-width":"var(--radix-popper-available-width)","--radix-dropdown-menu-content-available-height":"var(--radix-popper-available-height)","--radix-dropdown-menu-trigger-width":"var(--radix-popper-anchor-width)","--radix-dropdown-menu-trigger-height":"var(--radix-popper-anchor-height)"}})});R9.displayName=Pae;var $ae=y9,Iae=x9,Lae=b9,k9=S9,O9=_9,M9=N9,D9=j9,P9=C9,$9=E9,I9=T9,zae=Mae,L9=A9,z9=R9;const ul=$ae,dl=Iae,qae=zae,q9=N.forwardRef(({className:e,inset:t,children:n,...r},a)=>c.jsxs(L9,{ref:a,className:ye("flex cursor-default gap-2 select-none items-center rounded-sm px-2 py-1.5 text-sm outline-none focus:bg-accent data-[state=open]:bg-accent [&_svg]:pointer-events-none [&_svg]:size-4 [&_svg]:shrink-0",t&&"pl-8",e),...r,children:[n,c.jsx(Io,{className:"ml-auto"})]}));q9.displayName=L9.displayName;const F9=N.forwardRef(({className:e,...t},n)=>c.jsx(z9,{ref:n,className:ye("z-50 min-w-[8rem] overflow-hidden rounded-md border bg-popover p-1 text-popover-foreground shadow-lg data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-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",e),...t}));F9.displayName=z9.displayName;const Qo=N.forwardRef(({className:e,sideOffset:t=4,...n},r)=>c.jsx(Lae,{children:c.jsx(k9,{ref:r,sideOffset:t,className:ye("z-50 min-w-[8rem] overflow-hidden rounded-md border bg-popover p-1 text-popover-foreground shadow-md","data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-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",e),...n})}));Qo.displayName=k9.displayName;const Lt=N.forwardRef(({className:e,inset:t,...n},r)=>c.jsx(M9,{ref:r,className:ye("relative flex cursor-default select-none items-center gap-2 rounded-sm px-2 py-1.5 text-sm outline-none transition-colors focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50 [&>svg]:size-4 [&>svg]:shrink-0",t&&"pl-8",e),...n}));Lt.displayName=M9.displayName;const Fae=N.forwardRef(({className:e,children:t,checked:n,...r},a)=>c.jsxs(D9,{ref:a,className:ye("relative flex cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none transition-colors focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",e),checked:n,...r,children:[c.jsx("span",{className:"absolute left-2 flex h-3.5 w-3.5 items-center justify-center",children:c.jsx($9,{children:c.jsx(Is,{className:"h-4 w-4"})})}),t]}));Fae.displayName=D9.displayName;const Uae=N.forwardRef(({className:e,children:t,...n},r)=>c.jsxs(P9,{ref:r,className:ye("relative flex cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none transition-colors focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",e),...n,children:[c.jsx("span",{className:"absolute left-2 flex h-3.5 w-3.5 items-center justify-center",children:c.jsx($9,{children:c.jsx(YC,{className:"h-2 w-2 fill-current"})})}),t]}));Uae.displayName=P9.displayName;const tv=N.forwardRef(({className:e,inset:t,...n},r)=>c.jsx(O9,{ref:r,className:ye("px-2 py-1.5 text-sm font-semibold",t&&"pl-8",e),...n}));tv.displayName=O9.displayName;const Os=N.forwardRef(({className:e,...t},n)=>c.jsx(I9,{ref:n,className:ye("-mx-1 my-1 h-px bg-muted",e),...t}));Os.displayName=I9.displayName;function Hae(){return c.jsxs("div",{className:"flex items-center gap-4 lg:gap-6",children:[c.jsxs(pn,{to:"/",className:"flex items-center gap-2 whitespace-nowrap font-semibold",children:[c.jsx("img",{src:"/favicon.png",alt:"Orcheo Logo",className:"h-6 w-6"}),c.jsx("span",{children:"Orcheo Canvas"})]}),c.jsxs(ul,{children:[c.jsx(dl,{asChild:!0,children:c.jsxs(me,{variant:"outline",className:"flex items-center gap-1",children:[c.jsx(Mz,{className:"mr-1 h-4 w-4"}),c.jsx("span",{className:"hidden sm:inline",children:"My Projects"}),c.jsx("span",{className:"sm:hidden",children:"Projects"}),c.jsx(uu,{className:"ml-1 h-4 w-4"})]})}),c.jsxs(Qo,{align:"start",className:"w-56",children:[c.jsx(tv,{children:"Projects"}),c.jsx(Os,{}),[{label:"Marketing Automations",query:"marketing"},{label:"Customer Onboarding",query:"onboarding"},{label:"Data Processing",query:"data"}].map(e=>c.jsx(Lt,{children:c.jsx(pn,{to:`/workflow-canvas?project=${e.query}`,className:"flex w-full items-center",children:e.label})},e.query)),c.jsx(Os,{}),c.jsx(Lt,{children:c.jsxs(pn,{to:"/workflow-canvas?new=true",className:"flex w-full items-center",children:[c.jsx(ll,{className:"mr-2 h-4 w-4"}),"Create New Project"]})})]})]})]})}function Bae({currentWorkflow:e,windowWidth:t}){const n=N.useMemo(()=>Vae(e.path??[],t),[e.path,t]);return e.path?c.jsx("div",{className:"ml-4 flex items-center overflow-hidden text-sm text-muted-foreground",children:c.jsxs("div",{className:"flex items-center overflow-hidden",children:[n.map((r,a)=>c.jsx(Me.Fragment,{children:r.index===-1?c.jsxs(ul,{children:[c.jsx(dl,{asChild:!0,children:c.jsx(me,{variant:"ghost",size:"sm",className:"h-6 px-1",children:c.jsx(Vf,{className:"h-4 w-4"})})}),c.jsx(Qo,{align:"start",className:"w-48",children:e.path.slice(1,-1).map(s=>c.jsx(Lt,{children:c.jsx(pn,{to:"/",className:"flex w-full items-center",children:s})},s))})]}):c.jsxs(c.Fragment,{children:[c.jsx(pn,{to:"/",className:"max-w-[100px] truncate hover:text-foreground sm:max-w-[150px]",children:r.item}),a<n.length-1&&c.jsx(Io,{className:"mx-1 h-4 w-4 flex-shrink-0"})]})},`${r.item}-${a}`)),c.jsx(Io,{className:"mx-1 h-4 w-4 flex-shrink-0"}),c.jsx("span",{className:"max-w-[120px] truncate text-foreground sm:max-w-[200px]",children:e.name})]})}):c.jsx("span",{className:"truncate font-medium text-foreground",children:e.name})}function Vae(e,t){const n=e.length;return n===0?[]:t<640&&n>2?[{index:0,item:e[0]},{index:-1,item:"..."},{index:n-1,item:e[n-1]}]:t<768&&n>3?[{index:0,item:e[0]},{index:-1,item:"..."},{index:n-1,item:e[n-1]}]:e.map((r,a)=>({index:a,item:r}))}function Wae(e){const t=Gae(e),n=N.forwardRef((r,a)=>{const{children:s,...i}=r,l=N.Children.toArray(s),d=l.find(Yae);if(d){const f=d.props.children,h=l.map(p=>p===d?N.Children.count(f)>1?N.Children.only(null):N.isValidElement(f)?f.props.children:null:p);return c.jsx(t,{...i,ref:a,children:N.isValidElement(f)?N.cloneElement(f,void 0,h):null})}return c.jsx(t,{...i,ref:a,children:s})});return n.displayName=`${e}.Slot`,n}function Gae(e){const t=N.forwardRef((n,r)=>{const{children:a,...s}=n;if(N.isValidElement(a)){const i=Zae(a),l=Xae(s,a.props);return a.type!==N.Fragment&&(l.ref=r?La(r,i):i),N.cloneElement(a,l)}return N.Children.count(a)>1?N.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var Kae=Symbol("radix.slottable");function Yae(e){return N.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===Kae}function Xae(e,t){const n={...t};for(const r in t){const a=e[r],s=t[r];/^on[A-Z]/.test(r)?a&&s?n[r]=(...l)=>{const d=s(...l);return a(...l),d}:a&&(n[r]=a):r==="style"?n[r]={...a,...s}:r==="className"&&(n[r]=[a,s].filter(Boolean).join(" "))}return{...e,...n}}function Zae(e){var r,a;let t=(r=Object.getOwnPropertyDescriptor(e.props,"ref"))==null?void 0:r.get,n=t&&"isReactWarning"in t&&t.isReactWarning;return n?e.ref:(t=(a=Object.getOwnPropertyDescriptor(e,"ref"))==null?void 0:a.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}var nv="Dialog",[U9]=wn(nv),[Qae,da]=U9(nv),H9=e=>{const{__scopeDialog:t,children:n,open:r,defaultOpen:a,onOpenChange:s,modal:i=!0}=e,l=N.useRef(null),d=N.useRef(null),[f,h]=bn({prop:r,defaultProp:a??!1,onChange:s,caller:nv});return c.jsx(Qae,{scope:t,triggerRef:l,contentRef:d,contentId:zn(),titleId:zn(),descriptionId:zn(),open:f,onOpenChange:h,onOpenToggle:N.useCallback(()=>h(p=>!p),[h]),modal:i,children:n})};H9.displayName=nv;var B9="DialogTrigger",V9=N.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,a=da(B9,n),s=ze(t,a.triggerRef);return c.jsx(Ae.button,{type:"button","aria-haspopup":"dialog","aria-expanded":a.open,"aria-controls":a.contentId,"data-state":x2(a.open),...r,ref:s,onClick:_e(e.onClick,a.onOpenToggle)})});V9.displayName=B9;var y2="DialogPortal",[Jae,W9]=U9(y2,{forceMount:void 0}),G9=e=>{const{__scopeDialog:t,forceMount:n,children:r,container:a}=e,s=da(y2,t);return c.jsx(Jae,{scope:t,forceMount:n,children:N.Children.map(r,i=>c.jsx(sn,{present:n||s.open,children:c.jsx(gu,{asChild:!0,container:a,children:i})}))})};G9.displayName=y2;var ny="DialogOverlay",K9=N.forwardRef((e,t)=>{const n=W9(ny,e.__scopeDialog),{forceMount:r=n.forceMount,...a}=e,s=da(ny,e.__scopeDialog);return s.modal?c.jsx(sn,{present:r||s.open,children:c.jsx(tse,{...a,ref:t})}):null});K9.displayName=ny;var ese=Wae("DialogOverlay.RemoveScroll"),tse=N.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,a=da(ny,n);return c.jsx(eh,{as:ese,allowPinchZoom:!0,shards:[a.contentRef],children:c.jsx(Ae.div,{"data-state":x2(a.open),...r,ref:t,style:{pointerEvents:"auto",...r.style}})})}),Wi="DialogContent",Y9=N.forwardRef((e,t)=>{const n=W9(Wi,e.__scopeDialog),{forceMount:r=n.forceMount,...a}=e,s=da(Wi,e.__scopeDialog);return c.jsx(sn,{present:r||s.open,children:s.modal?c.jsx(nse,{...a,ref:t}):c.jsx(rse,{...a,ref:t})})});Y9.displayName=Wi;var nse=N.forwardRef((e,t)=>{const n=da(Wi,e.__scopeDialog),r=N.useRef(null),a=ze(t,n.contentRef,r);return N.useEffect(()=>{const s=r.current;if(s)return Zy(s)},[]),c.jsx(X9,{...e,ref:a,trapFocus:n.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:_e(e.onCloseAutoFocus,s=>{var i;s.preventDefault(),(i=n.triggerRef.current)==null||i.focus()}),onPointerDownOutside:_e(e.onPointerDownOutside,s=>{const i=s.detail.originalEvent,l=i.button===0&&i.ctrlKey===!0;(i.button===2||l)&&s.preventDefault()}),onFocusOutside:_e(e.onFocusOutside,s=>s.preventDefault())})}),rse=N.forwardRef((e,t)=>{const n=da(Wi,e.__scopeDialog),r=N.useRef(!1),a=N.useRef(!1);return c.jsx(X9,{...e,ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:s=>{var i,l;(i=e.onCloseAutoFocus)==null||i.call(e,s),s.defaultPrevented||(r.current||(l=n.triggerRef.current)==null||l.focus(),s.preventDefault()),r.current=!1,a.current=!1},onInteractOutside:s=>{var d,f;(d=e.onInteractOutside)==null||d.call(e,s),s.defaultPrevented||(r.current=!0,s.detail.originalEvent.type==="pointerdown"&&(a.current=!0));const i=s.target;((f=n.triggerRef.current)==null?void 0:f.contains(i))&&s.preventDefault(),s.detail.originalEvent.type==="focusin"&&a.current&&s.preventDefault()}})}),X9=N.forwardRef((e,t)=>{const{__scopeDialog:n,trapFocus:r,onOpenAutoFocus:a,onCloseAutoFocus:s,...i}=e,l=da(Wi,n),d=N.useRef(null),f=ze(t,d);return Fy(),c.jsxs(c.Fragment,{children:[c.jsx(Yf,{asChild:!0,loop:!0,trapped:r,onMountAutoFocus:a,onUnmountAutoFocus:s,children:c.jsx(hu,{role:"dialog",id:l.contentId,"aria-describedby":l.descriptionId,"aria-labelledby":l.titleId,"data-state":x2(l.open),...i,ref:f,onDismiss:()=>l.onOpenChange(!1)})}),c.jsxs(c.Fragment,{children:[c.jsx(ase,{titleId:l.titleId}),c.jsx(ose,{contentRef:d,descriptionId:l.descriptionId})]})]})}),v2="DialogTitle",Z9=N.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,a=da(v2,n);return c.jsx(Ae.h2,{id:a.titleId,...r,ref:t})});Z9.displayName=v2;var Q9="DialogDescription",J9=N.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,a=da(Q9,n);return c.jsx(Ae.p,{id:a.descriptionId,...r,ref:t})});J9.displayName=Q9;var e8="DialogClose",t8=N.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,a=da(e8,n);return c.jsx(Ae.button,{type:"button",...r,ref:t,onClick:_e(e.onClick,()=>a.onOpenChange(!1))})});t8.displayName=e8;function x2(e){return e?"open":"closed"}var n8="DialogTitleWarning",[PPe,r8]=jee(n8,{contentName:Wi,titleName:v2,docsSlug:"dialog"}),ase=({titleId:e})=>{const t=r8(n8),n=`\`${t.contentName}\` requires a \`${t.titleName}\` for the component to be accessible for screen reader users.
|
|
666
|
+
|
|
667
|
+
If you want to hide the \`${t.titleName}\`, you can wrap it with our VisuallyHidden component.
|
|
668
|
+
|
|
669
|
+
For more information, see https://radix-ui.com/primitives/docs/components/${t.docsSlug}`;return N.useEffect(()=>{e&&(document.getElementById(e)||console.error(n))},[n,e]),null},sse="DialogDescriptionWarning",ose=({contentRef:e,descriptionId:t})=>{const r=`Warning: Missing \`Description\` or \`aria-describedby={undefined}\` for {${r8(sse).contentName}}.`;return N.useEffect(()=>{var s;const a=(s=e.current)==null?void 0:s.getAttribute("aria-describedby");t&&a&&(document.getElementById(t)||console.warn(r))},[r,e,t]),null},ise=H9,lse=V9,cse=G9,a8=K9,s8=Y9,o8=Z9,i8=J9,use=t8;const fl=ise,ah=lse,dse=cse,l8=N.forwardRef(({className:e,...t},n)=>c.jsx(a8,{ref:n,className:ye("fixed inset-0 z-50 bg-black/80 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0",e),...t}));l8.displayName=a8.displayName;const Jo=N.forwardRef(({className:e,children:t,...n},r)=>c.jsxs(dse,{children:[c.jsx(l8,{}),c.jsxs(s8,{ref:r,className:ye("fixed left-[50%] top-[50%] z-50 grid w-full max-w-lg translate-x-[-50%] translate-y-[-50%] gap-4 border bg-background p-6 shadow-lg duration-200 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[state=closed]:slide-out-to-left-1/2 data-[state=closed]:slide-out-to-top-[48%] data-[state=open]:slide-in-from-left-1/2 data-[state=open]:slide-in-from-top-[48%] sm:rounded-lg",e),...n,children:[t,c.jsxs(use,{className:"absolute right-4 top-4 rounded-sm opacity-70 ring-offset-background transition-opacity hover:opacity-100 focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:pointer-events-none data-[state=open]:bg-accent data-[state=open]:text-muted-foreground",children:[c.jsx(la,{className:"h-4 w-4"}),c.jsx("span",{className:"sr-only",children:"Close"})]})]})]}));Jo.displayName=s8.displayName;const hl=({className:e,...t})=>c.jsx("div",{className:ye("flex flex-col space-y-1.5 text-center sm:text-left",e),...t});hl.displayName="DialogHeader";const rv=({className:e,...t})=>c.jsx("div",{className:ye("flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2",e),...t});rv.displayName="DialogFooter";const pl=N.forwardRef(({className:e,...t},n)=>c.jsx(o8,{ref:n,className:ye("text-lg font-semibold leading-none tracking-tight",e),...t}));pl.displayName=o8.displayName;const yu=N.forwardRef(({className:e,...t},n)=>c.jsx(i8,{ref:n,className:ye("text-sm text-muted-foreground",e),...t}));yu.displayName=i8.displayName;const Ct=N.forwardRef(({className:e,type:t,...n},r)=>c.jsx("input",{type:t,className:ye("flex h-9 w-full rounded-md border border-input bg-transparent px-3 py-1 text-base shadow-sm transition-colors file:border-0 file:bg-transparent file:text-sm file:font-medium file:text-foreground placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:cursor-not-allowed disabled:opacity-50 md:text-sm",e),ref:r,...n}));Ct.displayName="Input";const fse=Kf("inline-flex items-center rounded-md border px-2.5 py-0.5 text-xs font-semibold transition-colors focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2",{variants:{variant:{default:"border-transparent bg-primary text-primary-foreground shadow hover:bg-primary/80",secondary:"border-transparent bg-secondary text-secondary-foreground hover:bg-secondary/80",destructive:"border-transparent bg-destructive text-destructive-foreground shadow hover:bg-destructive/80",outline:"text-foreground"}},defaultVariants:{variant:"default"}});function Ue({className:e,variant:t,...n}){return c.jsx("div",{className:ye(fse({variant:t}),e),...n})}function hse(){const[e,t]=N.useState(!1);return c.jsxs(fl,{open:e,onOpenChange:t,children:[c.jsx(ah,{asChild:!0,children:c.jsxs(me,{variant:"outline",className:"hidden items-center gap-1 sm:flex",onClick:()=>t(!0),children:[c.jsx(ia,{className:"mr-1 h-4 w-4"}),c.jsx("span",{children:"Search"}),c.jsxs("kbd",{className:"pointer-events-none ml-auto inline-flex h-5 select-none items-center gap-1 rounded border bg-muted px-1.5 font-mono text-[10px] font-medium text-muted-foreground",children:[c.jsx("span",{className:"text-xs",children:"⌘"}),"K"]})]})}),c.jsxs(Jo,{className:"sm:max-w-[550px]",children:[c.jsxs(hl,{children:[c.jsx(pl,{children:"Search"}),c.jsx(yu,{children:"Search for workflows, nodes, or actions"})]}),c.jsxs("div",{className:"flex items-center border-b py-2",children:[c.jsx(ia,{className:"mr-2 h-4 w-4 shrink-0 opacity-50"}),c.jsx(Ct,{className:"flex h-10 w-full rounded-md border-0 bg-transparent py-3 text-sm outline-none placeholder:text-muted-foreground disabled:cursor-not-allowed disabled:opacity-50",placeholder:"Type to search...",autoFocus:!0})]}),c.jsxs("div",{className:"mt-2 space-y-1",children:[c.jsx("p",{className:"text-xs text-muted-foreground",children:"Recent searches"}),c.jsxs("div",{className:"grid gap-1",children:[c.jsxs(me,{variant:"ghost",className:"justify-start text-sm",onClick:()=>t(!1),children:[c.jsx(Mz,{className:"mr-2 h-4 w-4"}),c.jsx("span",{children:"Customer Onboarding"}),c.jsx(Ue,{variant:"outline",className:"ml-auto",children:"Workflow"})]}),c.jsxs(me,{variant:"ghost",className:"justify-start text-sm",onClick:()=>t(!1),children:[c.jsx($Z,{className:"mr-2 h-4 w-4"}),c.jsx("span",{children:"HTTP Request"}),c.jsx(Ue,{variant:"outline",className:"ml-auto",children:"Node"})]})]})]})]})]})}function Wj(e,[t,n]){return Math.min(n,Math.max(t,e))}function pse(e){const t=mse(e),n=N.forwardRef((r,a)=>{const{children:s,...i}=r,l=N.Children.toArray(s),d=l.find(yse);if(d){const f=d.props.children,h=l.map(p=>p===d?N.Children.count(f)>1?N.Children.only(null):N.isValidElement(f)?f.props.children:null:p);return c.jsx(t,{...i,ref:a,children:N.isValidElement(f)?N.cloneElement(f,void 0,h):null})}return c.jsx(t,{...i,ref:a,children:s})});return n.displayName=`${e}.Slot`,n}function mse(e){const t=N.forwardRef((n,r)=>{const{children:a,...s}=n;if(N.isValidElement(a)){const i=xse(a),l=vse(s,a.props);return a.type!==N.Fragment&&(l.ref=r?La(r,i):i),N.cloneElement(a,l)}return N.Children.count(a)>1?N.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var gse=Symbol("radix.slottable");function yse(e){return N.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===gse}function vse(e,t){const n={...t};for(const r in t){const a=e[r],s=t[r];/^on[A-Z]/.test(r)?a&&s?n[r]=(...l)=>{const d=s(...l);return a(...l),d}:a&&(n[r]=a):r==="style"?n[r]={...a,...s}:r==="className"&&(n[r]=[a,s].filter(Boolean).join(" "))}return{...e,...n}}function xse(e){var r,a;let t=(r=Object.getOwnPropertyDescriptor(e.props,"ref"))==null?void 0:r.get,n=t&&"isReactWarning"in t&&t.isReactWarning;return n?e.ref:(t=(a=Object.getOwnPropertyDescriptor(e,"ref"))==null?void 0:a.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}function av(e){const t=N.useRef({value:e,previous:e});return N.useMemo(()=>(t.current.value!==e&&(t.current.previous=t.current.value,t.current.value=e),t.current.previous),[e])}var c8=Object.freeze({position:"absolute",border:0,width:1,height:1,padding:0,margin:-1,overflow:"hidden",clip:"rect(0, 0, 0, 0)",whiteSpace:"nowrap",wordWrap:"normal"}),bse="VisuallyHidden",u8=N.forwardRef((e,t)=>c.jsx(Ae.span,{...e,ref:t,style:{...c8,...e.style}}));u8.displayName=bse;var wse=u8,Sse=[" ","Enter","ArrowUp","ArrowDown"],_se=[" ","Enter"],Gi="Select",[sv,ov,Nse]=qy(Gi),[vu]=wn(Gi,[Nse,Yo]),iv=Yo(),[jse,ei]=vu(Gi),[Cse,Ese]=vu(Gi),d8=e=>{const{__scopeSelect:t,children:n,open:r,defaultOpen:a,onOpenChange:s,value:i,defaultValue:l,onValueChange:d,dir:f,name:h,autoComplete:p,disabled:g,required:y,form:S}=e,w=iv(t),[b,x]=N.useState(null),[_,j]=N.useState(null),[C,T]=N.useState(!1),A=Ko(f),[k,O]=bn({prop:r,defaultProp:a??!1,onChange:s,caller:Gi}),[M,z]=bn({prop:i,defaultProp:l,onChange:d,caller:Gi}),L=N.useRef(null),U=b?S||!!b.closest("form"):!0,[F,q]=N.useState(new Set),V=Array.from(F).map(P=>P.props.value).join(";");return c.jsx(Zf,{...w,children:c.jsxs(jse,{required:y,scope:t,trigger:b,onTriggerChange:x,valueNode:_,onValueNodeChange:j,valueNodeHasChildren:C,onValueNodeHasChildrenChange:T,contentId:zn(),value:M,onValueChange:z,open:k,onOpenChange:O,dir:A,triggerPointerDownPosRef:L,disabled:g,children:[c.jsx(sv.Provider,{scope:t,children:c.jsx(Cse,{scope:e.__scopeSelect,onNativeOptionAdd:N.useCallback(P=>{q(K=>new Set(K).add(P))},[]),onNativeOptionRemove:N.useCallback(P=>{q(K=>{const H=new Set(K);return H.delete(P),H})},[]),children:n})}),U?c.jsxs(P8,{"aria-hidden":!0,required:y,tabIndex:-1,name:h,autoComplete:p,value:M,onChange:P=>z(P.target.value),disabled:g,form:S,children:[M===void 0?c.jsx("option",{value:""}):null,Array.from(F)]},V):null]})})};d8.displayName=Gi;var f8="SelectTrigger",h8=N.forwardRef((e,t)=>{const{__scopeSelect:n,disabled:r=!1,...a}=e,s=iv(n),i=ei(f8,n),l=i.disabled||r,d=ze(t,i.onTriggerChange),f=ov(n),h=N.useRef("touch"),[p,g,y]=I8(w=>{const b=f().filter(j=>!j.disabled),x=b.find(j=>j.value===i.value),_=L8(b,w,x);_!==void 0&&i.onValueChange(_.value)}),S=w=>{l||(i.onOpenChange(!0),y()),w&&(i.triggerPointerDownPosRef.current={x:Math.round(w.pageX),y:Math.round(w.pageY)})};return c.jsx(Qf,{asChild:!0,...s,children:c.jsx(Ae.button,{type:"button",role:"combobox","aria-controls":i.contentId,"aria-expanded":i.open,"aria-required":i.required,"aria-autocomplete":"none",dir:i.dir,"data-state":i.open?"open":"closed",disabled:l,"data-disabled":l?"":void 0,"data-placeholder":$8(i.value)?"":void 0,...a,ref:d,onClick:_e(a.onClick,w=>{w.currentTarget.focus(),h.current!=="mouse"&&S(w)}),onPointerDown:_e(a.onPointerDown,w=>{h.current=w.pointerType;const b=w.target;b.hasPointerCapture(w.pointerId)&&b.releasePointerCapture(w.pointerId),w.button===0&&w.ctrlKey===!1&&w.pointerType==="mouse"&&(S(w),w.preventDefault())}),onKeyDown:_e(a.onKeyDown,w=>{const b=p.current!=="";!(w.ctrlKey||w.altKey||w.metaKey)&&w.key.length===1&&g(w.key),!(b&&w.key===" ")&&Sse.includes(w.key)&&(S(),w.preventDefault())})})})});h8.displayName=f8;var p8="SelectValue",m8=N.forwardRef((e,t)=>{const{__scopeSelect:n,className:r,style:a,children:s,placeholder:i="",...l}=e,d=ei(p8,n),{onValueNodeHasChildrenChange:f}=d,h=s!==void 0,p=ze(t,d.onValueNodeChange);return Jt(()=>{f(h)},[f,h]),c.jsx(Ae.span,{...l,ref:p,style:{pointerEvents:"none"},children:$8(d.value)?c.jsx(c.Fragment,{children:i}):s})});m8.displayName=p8;var Tse="SelectIcon",g8=N.forwardRef((e,t)=>{const{__scopeSelect:n,children:r,...a}=e;return c.jsx(Ae.span,{"aria-hidden":!0,...a,ref:t,children:r||"▼"})});g8.displayName=Tse;var Ase="SelectPortal",y8=e=>c.jsx(gu,{asChild:!0,...e});y8.displayName=Ase;var Ki="SelectContent",v8=N.forwardRef((e,t)=>{const n=ei(Ki,e.__scopeSelect),[r,a]=N.useState();if(Jt(()=>{a(new DocumentFragment)},[]),!n.open){const s=r;return s?ol.createPortal(c.jsx(x8,{scope:e.__scopeSelect,children:c.jsx(sv.Slot,{scope:e.__scopeSelect,children:c.jsx("div",{children:e.children})})}),s):null}return c.jsx(b8,{...e,ref:t})});v8.displayName=Ki;var Jr=10,[x8,ti]=vu(Ki),Rse="SelectContentImpl",kse=pse("SelectContent.RemoveScroll"),b8=N.forwardRef((e,t)=>{const{__scopeSelect:n,position:r="item-aligned",onCloseAutoFocus:a,onEscapeKeyDown:s,onPointerDownOutside:i,side:l,sideOffset:d,align:f,alignOffset:h,arrowPadding:p,collisionBoundary:g,collisionPadding:y,sticky:S,hideWhenDetached:w,avoidCollisions:b,...x}=e,_=ei(Ki,n),[j,C]=N.useState(null),[T,A]=N.useState(null),k=ze(t,re=>C(re)),[O,M]=N.useState(null),[z,L]=N.useState(null),U=ov(n),[F,q]=N.useState(!1),V=N.useRef(!1);N.useEffect(()=>{if(j)return Zy(j)},[j]),Fy();const P=N.useCallback(re=>{const[ne,...Q]=U().map(te=>te.ref.current),[ae]=Q.slice(-1),Y=document.activeElement;for(const te of re)if(te===Y||(te==null||te.scrollIntoView({block:"nearest"}),te===ne&&T&&(T.scrollTop=0),te===ae&&T&&(T.scrollTop=T.scrollHeight),te==null||te.focus(),document.activeElement!==Y))return},[U,T]),K=N.useCallback(()=>P([O,j]),[P,O,j]);N.useEffect(()=>{F&&K()},[F,K]);const{onOpenChange:H,triggerPointerDownPosRef:Z}=_;N.useEffect(()=>{if(j){let re={x:0,y:0};const ne=ae=>{var Y,te;re={x:Math.abs(Math.round(ae.pageX)-(((Y=Z.current)==null?void 0:Y.x)??0)),y:Math.abs(Math.round(ae.pageY)-(((te=Z.current)==null?void 0:te.y)??0))}},Q=ae=>{re.x<=10&&re.y<=10?ae.preventDefault():j.contains(ae.target)||H(!1),document.removeEventListener("pointermove",ne),Z.current=null};return Z.current!==null&&(document.addEventListener("pointermove",ne),document.addEventListener("pointerup",Q,{capture:!0,once:!0})),()=>{document.removeEventListener("pointermove",ne),document.removeEventListener("pointerup",Q,{capture:!0})}}},[j,H,Z]),N.useEffect(()=>{const re=()=>H(!1);return window.addEventListener("blur",re),window.addEventListener("resize",re),()=>{window.removeEventListener("blur",re),window.removeEventListener("resize",re)}},[H]);const[J,D]=I8(re=>{const ne=U().filter(Y=>!Y.disabled),Q=ne.find(Y=>Y.ref.current===document.activeElement),ae=L8(ne,re,Q);ae&&setTimeout(()=>ae.ref.current.focus())}),W=N.useCallback((re,ne,Q)=>{const ae=!V.current&&!Q;(_.value!==void 0&&_.value===ne||ae)&&(M(re),ae&&(V.current=!0))},[_.value]),B=N.useCallback(()=>j==null?void 0:j.focus(),[j]),$=N.useCallback((re,ne,Q)=>{const ae=!V.current&&!Q;(_.value!==void 0&&_.value===ne||ae)&&L(re)},[_.value]),G=r==="popper"?Gj:w8,ee=G===Gj?{side:l,sideOffset:d,align:f,alignOffset:h,arrowPadding:p,collisionBoundary:g,collisionPadding:y,sticky:S,hideWhenDetached:w,avoidCollisions:b}:{};return c.jsx(x8,{scope:n,content:j,viewport:T,onViewportChange:A,itemRefCallback:W,selectedItem:O,onItemLeave:B,itemTextRefCallback:$,focusSelectedItem:K,selectedItemText:z,position:r,isPositioned:F,searchRef:J,children:c.jsx(eh,{as:kse,allowPinchZoom:!0,children:c.jsx(Yf,{asChild:!0,trapped:_.open,onMountAutoFocus:re=>{re.preventDefault()},onUnmountAutoFocus:_e(a,re=>{var ne;(ne=_.trigger)==null||ne.focus({preventScroll:!0}),re.preventDefault()}),children:c.jsx(hu,{asChild:!0,disableOutsidePointerEvents:!0,onEscapeKeyDown:s,onPointerDownOutside:i,onFocusOutside:re=>re.preventDefault(),onDismiss:()=>_.onOpenChange(!1),children:c.jsx(G,{role:"listbox",id:_.contentId,"data-state":_.open?"open":"closed",dir:_.dir,onContextMenu:re=>re.preventDefault(),...x,...ee,onPlaced:()=>q(!0),ref:k,style:{display:"flex",flexDirection:"column",outline:"none",...x.style},onKeyDown:_e(x.onKeyDown,re=>{const ne=re.ctrlKey||re.altKey||re.metaKey;if(re.key==="Tab"&&re.preventDefault(),!ne&&re.key.length===1&&D(re.key),["ArrowUp","ArrowDown","Home","End"].includes(re.key)){let ae=U().filter(Y=>!Y.disabled).map(Y=>Y.ref.current);if(["ArrowUp","End"].includes(re.key)&&(ae=ae.slice().reverse()),["ArrowUp","ArrowDown"].includes(re.key)){const Y=re.target,te=ae.indexOf(Y);ae=ae.slice(te+1)}setTimeout(()=>P(ae)),re.preventDefault()}})})})})})})});b8.displayName=Rse;var Ose="SelectItemAlignedPosition",w8=N.forwardRef((e,t)=>{const{__scopeSelect:n,onPlaced:r,...a}=e,s=ei(Ki,n),i=ti(Ki,n),[l,d]=N.useState(null),[f,h]=N.useState(null),p=ze(t,k=>h(k)),g=ov(n),y=N.useRef(!1),S=N.useRef(!0),{viewport:w,selectedItem:b,selectedItemText:x,focusSelectedItem:_}=i,j=N.useCallback(()=>{if(s.trigger&&s.valueNode&&l&&f&&w&&b&&x){const k=s.trigger.getBoundingClientRect(),O=f.getBoundingClientRect(),M=s.valueNode.getBoundingClientRect(),z=x.getBoundingClientRect();if(s.dir!=="rtl"){const Y=z.left-O.left,te=M.left-Y,se=k.left-te,le=k.width+se,fe=Math.max(le,O.width),ve=window.innerWidth-Jr,Se=Wj(te,[Jr,Math.max(Jr,ve-fe)]);l.style.minWidth=le+"px",l.style.left=Se+"px"}else{const Y=O.right-z.right,te=window.innerWidth-M.right-Y,se=window.innerWidth-k.right-te,le=k.width+se,fe=Math.max(le,O.width),ve=window.innerWidth-Jr,Se=Wj(te,[Jr,Math.max(Jr,ve-fe)]);l.style.minWidth=le+"px",l.style.right=Se+"px"}const L=g(),U=window.innerHeight-Jr*2,F=w.scrollHeight,q=window.getComputedStyle(f),V=parseInt(q.borderTopWidth,10),P=parseInt(q.paddingTop,10),K=parseInt(q.borderBottomWidth,10),H=parseInt(q.paddingBottom,10),Z=V+P+F+H+K,J=Math.min(b.offsetHeight*5,Z),D=window.getComputedStyle(w),W=parseInt(D.paddingTop,10),B=parseInt(D.paddingBottom,10),$=k.top+k.height/2-Jr,G=U-$,ee=b.offsetHeight/2,re=b.offsetTop+ee,ne=V+P+re,Q=Z-ne;if(ne<=$){const Y=L.length>0&&b===L[L.length-1].ref.current;l.style.bottom="0px";const te=f.clientHeight-w.offsetTop-w.offsetHeight,se=Math.max(G,ee+(Y?B:0)+te+K),le=ne+se;l.style.height=le+"px"}else{const Y=L.length>0&&b===L[0].ref.current;l.style.top="0px";const se=Math.max($,V+w.offsetTop+(Y?W:0)+ee)+Q;l.style.height=se+"px",w.scrollTop=ne-$+w.offsetTop}l.style.margin=`${Jr}px 0`,l.style.minHeight=J+"px",l.style.maxHeight=U+"px",r==null||r(),requestAnimationFrame(()=>y.current=!0)}},[g,s.trigger,s.valueNode,l,f,w,b,x,s.dir,r]);Jt(()=>j(),[j]);const[C,T]=N.useState();Jt(()=>{f&&T(window.getComputedStyle(f).zIndex)},[f]);const A=N.useCallback(k=>{k&&S.current===!0&&(j(),_==null||_(),S.current=!1)},[j,_]);return c.jsx(Dse,{scope:n,contentWrapper:l,shouldExpandOnScrollRef:y,onScrollButtonChange:A,children:c.jsx("div",{ref:d,style:{display:"flex",flexDirection:"column",position:"fixed",zIndex:C},children:c.jsx(Ae.div,{...a,ref:p,style:{boxSizing:"border-box",maxHeight:"100%",...a.style}})})})});w8.displayName=Ose;var Mse="SelectPopperPosition",Gj=N.forwardRef((e,t)=>{const{__scopeSelect:n,align:r="start",collisionPadding:a=Jr,...s}=e,i=iv(n);return c.jsx(Gy,{...i,...s,ref:t,align:r,collisionPadding:a,style:{boxSizing:"border-box",...s.style,"--radix-select-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-select-content-available-width":"var(--radix-popper-available-width)","--radix-select-content-available-height":"var(--radix-popper-available-height)","--radix-select-trigger-width":"var(--radix-popper-anchor-width)","--radix-select-trigger-height":"var(--radix-popper-anchor-height)"}})});Gj.displayName=Mse;var[Dse,b2]=vu(Ki,{}),Kj="SelectViewport",S8=N.forwardRef((e,t)=>{const{__scopeSelect:n,nonce:r,...a}=e,s=ti(Kj,n),i=b2(Kj,n),l=ze(t,s.onViewportChange),d=N.useRef(0);return c.jsxs(c.Fragment,{children:[c.jsx("style",{dangerouslySetInnerHTML:{__html:"[data-radix-select-viewport]{scrollbar-width:none;-ms-overflow-style:none;-webkit-overflow-scrolling:touch;}[data-radix-select-viewport]::-webkit-scrollbar{display:none}"},nonce:r}),c.jsx(sv.Slot,{scope:n,children:c.jsx(Ae.div,{"data-radix-select-viewport":"",role:"presentation",...a,ref:l,style:{position:"relative",flex:1,overflow:"hidden auto",...a.style},onScroll:_e(a.onScroll,f=>{const h=f.currentTarget,{contentWrapper:p,shouldExpandOnScrollRef:g}=i;if(g!=null&&g.current&&p){const y=Math.abs(d.current-h.scrollTop);if(y>0){const S=window.innerHeight-Jr*2,w=parseFloat(p.style.minHeight),b=parseFloat(p.style.height),x=Math.max(w,b);if(x<S){const _=x+y,j=Math.min(S,_),C=_-j;p.style.height=j+"px",p.style.bottom==="0px"&&(h.scrollTop=C>0?C:0,p.style.justifyContent="flex-end")}}}d.current=h.scrollTop})})})]})});S8.displayName=Kj;var _8="SelectGroup",[Pse,$se]=vu(_8),Ise=N.forwardRef((e,t)=>{const{__scopeSelect:n,...r}=e,a=zn();return c.jsx(Pse,{scope:n,id:a,children:c.jsx(Ae.div,{role:"group","aria-labelledby":a,...r,ref:t})})});Ise.displayName=_8;var N8="SelectLabel",j8=N.forwardRef((e,t)=>{const{__scopeSelect:n,...r}=e,a=$se(N8,n);return c.jsx(Ae.div,{id:a.id,...r,ref:t})});j8.displayName=N8;var ry="SelectItem",[Lse,C8]=vu(ry),E8=N.forwardRef((e,t)=>{const{__scopeSelect:n,value:r,disabled:a=!1,textValue:s,...i}=e,l=ei(ry,n),d=ti(ry,n),f=l.value===r,[h,p]=N.useState(s??""),[g,y]=N.useState(!1),S=ze(t,_=>{var j;return(j=d.itemRefCallback)==null?void 0:j.call(d,_,r,a)}),w=zn(),b=N.useRef("touch"),x=()=>{a||(l.onValueChange(r),l.onOpenChange(!1))};if(r==="")throw new Error("A <Select.Item /> must have a value prop that is not an empty string. This is because the Select value can be set to an empty string to clear the selection and show the placeholder.");return c.jsx(Lse,{scope:n,value:r,disabled:a,textId:w,isSelected:f,onItemTextChange:N.useCallback(_=>{p(j=>j||((_==null?void 0:_.textContent)??"").trim())},[]),children:c.jsx(sv.ItemSlot,{scope:n,value:r,disabled:a,textValue:h,children:c.jsx(Ae.div,{role:"option","aria-labelledby":w,"data-highlighted":g?"":void 0,"aria-selected":f&&g,"data-state":f?"checked":"unchecked","aria-disabled":a||void 0,"data-disabled":a?"":void 0,tabIndex:a?void 0:-1,...i,ref:S,onFocus:_e(i.onFocus,()=>y(!0)),onBlur:_e(i.onBlur,()=>y(!1)),onClick:_e(i.onClick,()=>{b.current!=="mouse"&&x()}),onPointerUp:_e(i.onPointerUp,()=>{b.current==="mouse"&&x()}),onPointerDown:_e(i.onPointerDown,_=>{b.current=_.pointerType}),onPointerMove:_e(i.onPointerMove,_=>{var j;b.current=_.pointerType,a?(j=d.onItemLeave)==null||j.call(d):b.current==="mouse"&&_.currentTarget.focus({preventScroll:!0})}),onPointerLeave:_e(i.onPointerLeave,_=>{var j;_.currentTarget===document.activeElement&&((j=d.onItemLeave)==null||j.call(d))}),onKeyDown:_e(i.onKeyDown,_=>{var C;((C=d.searchRef)==null?void 0:C.current)!==""&&_.key===" "||(_se.includes(_.key)&&x(),_.key===" "&&_.preventDefault())})})})})});E8.displayName=ry;var Ud="SelectItemText",T8=N.forwardRef((e,t)=>{const{__scopeSelect:n,className:r,style:a,...s}=e,i=ei(Ud,n),l=ti(Ud,n),d=C8(Ud,n),f=Ese(Ud,n),[h,p]=N.useState(null),g=ze(t,x=>p(x),d.onItemTextChange,x=>{var _;return(_=l.itemTextRefCallback)==null?void 0:_.call(l,x,d.value,d.disabled)}),y=h==null?void 0:h.textContent,S=N.useMemo(()=>c.jsx("option",{value:d.value,disabled:d.disabled,children:y},d.value),[d.disabled,d.value,y]),{onNativeOptionAdd:w,onNativeOptionRemove:b}=f;return Jt(()=>(w(S),()=>b(S)),[w,b,S]),c.jsxs(c.Fragment,{children:[c.jsx(Ae.span,{id:d.textId,...s,ref:g}),d.isSelected&&i.valueNode&&!i.valueNodeHasChildren?ol.createPortal(s.children,i.valueNode):null]})});T8.displayName=Ud;var A8="SelectItemIndicator",R8=N.forwardRef((e,t)=>{const{__scopeSelect:n,...r}=e;return C8(A8,n).isSelected?c.jsx(Ae.span,{"aria-hidden":!0,...r,ref:t}):null});R8.displayName=A8;var Yj="SelectScrollUpButton",k8=N.forwardRef((e,t)=>{const n=ti(Yj,e.__scopeSelect),r=b2(Yj,e.__scopeSelect),[a,s]=N.useState(!1),i=ze(t,r.onScrollButtonChange);return Jt(()=>{if(n.viewport&&n.isPositioned){let l=function(){const f=d.scrollTop>0;s(f)};const d=n.viewport;return l(),d.addEventListener("scroll",l),()=>d.removeEventListener("scroll",l)}},[n.viewport,n.isPositioned]),a?c.jsx(M8,{...e,ref:i,onAutoScroll:()=>{const{viewport:l,selectedItem:d}=n;l&&d&&(l.scrollTop=l.scrollTop-d.offsetHeight)}}):null});k8.displayName=Yj;var Xj="SelectScrollDownButton",O8=N.forwardRef((e,t)=>{const n=ti(Xj,e.__scopeSelect),r=b2(Xj,e.__scopeSelect),[a,s]=N.useState(!1),i=ze(t,r.onScrollButtonChange);return Jt(()=>{if(n.viewport&&n.isPositioned){let l=function(){const f=d.scrollHeight-d.clientHeight,h=Math.ceil(d.scrollTop)<f;s(h)};const d=n.viewport;return l(),d.addEventListener("scroll",l),()=>d.removeEventListener("scroll",l)}},[n.viewport,n.isPositioned]),a?c.jsx(M8,{...e,ref:i,onAutoScroll:()=>{const{viewport:l,selectedItem:d}=n;l&&d&&(l.scrollTop=l.scrollTop+d.offsetHeight)}}):null});O8.displayName=Xj;var M8=N.forwardRef((e,t)=>{const{__scopeSelect:n,onAutoScroll:r,...a}=e,s=ti("SelectScrollButton",n),i=N.useRef(null),l=ov(n),d=N.useCallback(()=>{i.current!==null&&(window.clearInterval(i.current),i.current=null)},[]);return N.useEffect(()=>()=>d(),[d]),Jt(()=>{var h;const f=l().find(p=>p.ref.current===document.activeElement);(h=f==null?void 0:f.ref.current)==null||h.scrollIntoView({block:"nearest"})},[l]),c.jsx(Ae.div,{"aria-hidden":!0,...a,ref:t,style:{flexShrink:0,...a.style},onPointerDown:_e(a.onPointerDown,()=>{i.current===null&&(i.current=window.setInterval(r,50))}),onPointerMove:_e(a.onPointerMove,()=>{var f;(f=s.onItemLeave)==null||f.call(s),i.current===null&&(i.current=window.setInterval(r,50))}),onPointerLeave:_e(a.onPointerLeave,()=>{d()})})}),zse="SelectSeparator",D8=N.forwardRef((e,t)=>{const{__scopeSelect:n,...r}=e;return c.jsx(Ae.div,{"aria-hidden":!0,...r,ref:t})});D8.displayName=zse;var Zj="SelectArrow",qse=N.forwardRef((e,t)=>{const{__scopeSelect:n,...r}=e,a=iv(n),s=ei(Zj,n),i=ti(Zj,n);return s.open&&i.position==="popper"?c.jsx(Ky,{...a,...r,ref:t}):null});qse.displayName=Zj;var Fse="SelectBubbleInput",P8=N.forwardRef(({__scopeSelect:e,value:t,...n},r)=>{const a=N.useRef(null),s=ze(r,a),i=av(t);return N.useEffect(()=>{const l=a.current;if(!l)return;const d=window.HTMLSelectElement.prototype,h=Object.getOwnPropertyDescriptor(d,"value").set;if(i!==t&&h){const p=new Event("change",{bubbles:!0});h.call(l,t),l.dispatchEvent(p)}},[i,t]),c.jsx(Ae.select,{...n,style:{...c8,...n.style},ref:s,defaultValue:t})});P8.displayName=Fse;function $8(e){return e===""||e===void 0}function I8(e){const t=hn(e),n=N.useRef(""),r=N.useRef(0),a=N.useCallback(i=>{const l=n.current+i;t(l),(function d(f){n.current=f,window.clearTimeout(r.current),f!==""&&(r.current=window.setTimeout(()=>d(""),1e3))})(l)},[t]),s=N.useCallback(()=>{n.current="",window.clearTimeout(r.current)},[]);return N.useEffect(()=>()=>window.clearTimeout(r.current),[]),[n,a,s]}function L8(e,t,n){const a=t.length>1&&Array.from(t).every(f=>f===t[0])?t[0]:t,s=n?e.indexOf(n):-1;let i=Use(e,Math.max(s,0));a.length===1&&(i=i.filter(f=>f!==n));const d=i.find(f=>f.textValue.toLowerCase().startsWith(a.toLowerCase()));return d!==n?d:void 0}function Use(e,t){return e.map((n,r)=>e[(t+r)%e.length])}var Hse=d8,z8=h8,Bse=m8,Vse=g8,Wse=y8,q8=v8,Gse=S8,F8=j8,U8=E8,Kse=T8,Yse=R8,H8=k8,B8=O8,V8=D8;const Fc=Hse,Uc=Bse,Yi=N.forwardRef(({className:e,children:t,...n},r)=>c.jsxs(z8,{ref:r,className:ye("flex h-9 w-full items-center justify-between whitespace-nowrap rounded-md border border-input bg-transparent px-3 py-2 text-sm shadow-sm ring-offset-background data-[placeholder]:text-muted-foreground focus:outline-none focus:ring-1 focus:ring-ring disabled:cursor-not-allowed disabled:opacity-50 [&>span]:line-clamp-1",e),...n,children:[t,c.jsx(Vse,{asChild:!0,children:c.jsx(uu,{className:"h-4 w-4 opacity-50"})})]}));Yi.displayName=z8.displayName;const W8=N.forwardRef(({className:e,...t},n)=>c.jsx(H8,{ref:n,className:ye("flex cursor-default items-center justify-center py-1",e),...t,children:c.jsx(gZ,{className:"h-4 w-4"})}));W8.displayName=H8.displayName;const G8=N.forwardRef(({className:e,...t},n)=>c.jsx(B8,{ref:n,className:ye("flex cursor-default items-center justify-center py-1",e),...t,children:c.jsx(uu,{className:"h-4 w-4"})}));G8.displayName=B8.displayName;const Xi=N.forwardRef(({className:e,children:t,position:n="popper",...r},a)=>c.jsx(Wse,{children:c.jsxs(q8,{ref:a,className:ye("relative z-50 max-h-96 min-w-[8rem] overflow-hidden rounded-md border bg-popover text-popover-foreground shadow-md data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-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",n==="popper"&&"data-[side=bottom]:translate-y-1 data-[side=left]:-translate-x-1 data-[side=right]:translate-x-1 data-[side=top]:-translate-y-1",e),position:n,...r,children:[c.jsx(W8,{}),c.jsx(Gse,{className:ye("p-1",n==="popper"&&"h-[var(--radix-select-trigger-height)] w-full min-w-[var(--radix-select-trigger-width)]"),children:t}),c.jsx(G8,{})]})}));Xi.displayName=q8.displayName;const Xse=N.forwardRef(({className:e,...t},n)=>c.jsx(F8,{ref:n,className:ye("px-2 py-1.5 text-sm font-semibold",e),...t}));Xse.displayName=F8.displayName;const Pn=N.forwardRef(({className:e,children:t,...n},r)=>c.jsxs(U8,{ref:r,className:ye("relative flex w-full cursor-default select-none items-center rounded-sm py-1.5 pl-2 pr-8 text-sm outline-none focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",e),...n,children:[c.jsx("span",{className:"absolute right-2 flex h-3.5 w-3.5 items-center justify-center",children:c.jsx(Yse,{children:c.jsx(Is,{className:"h-4 w-4"})})}),c.jsx(Kse,{children:t})]}));Pn.displayName=U8.displayName;const Zse=N.forwardRef(({className:e,...t},n)=>c.jsx(V8,{ref:n,className:ye("-mx-1 my-1 h-px bg-muted",e),...t}));Zse.displayName=V8.displayName;const wM={name:"",type:"api",access:"private",secrets:{apiKey:""}};function Qse({onAddCredential:e}){var b;const[t,n]=N.useState(!1),[r,a]=N.useState(wM),[s,i]=N.useState(!1),[l,d]=N.useState(null),f=r.name.trim().length>0,h=N.useCallback(()=>{a(wM),d(null),i(!1)},[]),p=N.useCallback(x=>{n(x),x||h()},[h]),g=N.useCallback(async()=>{if(!(!e||!f)){d(null),i(!0);try{await e(r),p(!1)}catch(x){console.error("Failed to save credential",x);const _=x instanceof Error?x.message:"Unable to save credential. Please try again.";d(_)}finally{i(!1)}}},[p,f,e,r]),y=N.useCallback(x=>{a(_=>({..._,...x,secrets:x.secrets??_.secrets}))},[]),S=N.useCallback((x,_)=>{y({secrets:{...r.secrets,[x]:_}})},[r.secrets,y]),w=N.useMemo(()=>!f||s,[f,s]);return c.jsxs(fl,{open:t,onOpenChange:p,children:[c.jsx(ah,{asChild:!0,children:c.jsxs(me,{children:[c.jsx(ll,{className:"h-4 w-4 mr-2"}),"Add Credential"]})}),c.jsxs(Jo,{className:"sm:max-w-[500px]",children:[c.jsxs(hl,{children:[c.jsx(pl,{children:"Add New Credential"}),c.jsx(yu,{children:"Create a new credential for connecting to external services. Credentials are encrypted at rest."})]}),c.jsxs("div",{className:"grid gap-4 py-4",children:[c.jsxs("div",{className:"grid grid-cols-4 items-center gap-4",children:[c.jsx("label",{htmlFor:"credential-name",className:"text-right text-sm font-medium",children:"Name"}),c.jsx(Ct,{id:"credential-name",value:r.name,onChange:x=>y({name:x.target.value}),className:"col-span-3",placeholder:"My API Credential"})]}),c.jsxs("div",{className:"grid grid-cols-4 items-center gap-4",children:[c.jsx("label",{htmlFor:"credential-type",className:"text-right text-sm font-medium",children:"Type"}),c.jsxs(Fc,{value:r.type,onValueChange:x=>y({type:x}),children:[c.jsx(Yi,{id:"credential-type",className:"col-span-3",children:c.jsx(Uc,{placeholder:"Select credential type"})}),c.jsxs(Xi,{children:[c.jsx(Pn,{value:"api",children:"API Key"}),c.jsx(Pn,{value:"oauth",children:"OAuth"}),c.jsx(Pn,{value:"database",children:"Database"}),c.jsx(Pn,{value:"aws",children:"AWS"}),c.jsx(Pn,{value:"gcp",children:"Google Cloud"}),c.jsx(Pn,{value:"azure",children:"Azure"})]})]})]}),c.jsxs("div",{className:"grid grid-cols-4 items-center gap-4",children:[c.jsx("label",{htmlFor:"credential-access",className:"text-right text-sm font-medium",children:"Access"}),c.jsxs(Fc,{value:r.access,onValueChange:x=>y({access:x}),children:[c.jsx(Yi,{id:"credential-access",className:"col-span-3",children:c.jsx(Uc,{placeholder:"Select access level"})}),c.jsxs(Xi,{children:[c.jsx(Pn,{value:"private",children:"Private"}),c.jsx(Pn,{value:"shared",children:"Shared"}),c.jsx(Pn,{value:"public",children:"Public"})]})]})]}),c.jsxs("div",{className:"grid grid-cols-4 items-center gap-4",children:[c.jsx("label",{htmlFor:"credential-api-key",className:"text-right text-sm font-medium",children:"API Key"}),c.jsx(Ct,{id:"credential-api-key",type:"password",value:((b=r.secrets)==null?void 0:b.apiKey)??"",onChange:x=>S("apiKey",x.target.value),className:"col-span-3",placeholder:"Enter API key"})]})]}),l?c.jsx("p",{className:"text-sm text-destructive px-1",children:l}):null,c.jsxs(rv,{children:[c.jsx(me,{variant:"outline",onClick:()=>p(!1),disabled:s,children:"Cancel"}),c.jsx(me,{onClick:g,disabled:w,children:s?c.jsxs(c.Fragment,{children:[c.jsx(zo,{className:"mr-2 h-4 w-4 animate-spin"}),"Saving..."]}):"Save Credential"})]})]})]})}const w2=N.forwardRef(({className:e,...t},n)=>c.jsx("div",{className:"relative w-full overflow-auto",children:c.jsx("table",{ref:n,className:ye("w-full caption-bottom text-sm",e),...t})}));w2.displayName="Table";const S2=N.forwardRef(({className:e,...t},n)=>c.jsx("thead",{ref:n,className:ye("[&_tr]:border-b",e),...t}));S2.displayName="TableHeader";const _2=N.forwardRef(({className:e,...t},n)=>c.jsx("tbody",{ref:n,className:ye("[&_tr:last-child]:border-0",e),...t}));_2.displayName="TableBody";const Jse=N.forwardRef(({className:e,...t},n)=>c.jsx("tfoot",{ref:n,className:ye("border-t bg-muted/50 font-medium [&>tr]:last:border-b-0",e),...t}));Jse.displayName="TableFooter";const To=N.forwardRef(({className:e,...t},n)=>c.jsx("tr",{ref:n,className:ye("border-b transition-colors hover:bg-muted/50 data-[state=selected]:bg-muted",e),...t}));To.displayName="TableRow";const hr=N.forwardRef(({className:e,...t},n)=>c.jsx("th",{ref:n,className:ye("h-10 px-2 text-left align-middle font-medium text-muted-foreground [&:has([role=checkbox])]:pr-0 [&>[role=checkbox]]:translate-y-[2px]",e),...t}));hr.displayName="TableHead";const $n=N.forwardRef(({className:e,...t},n)=>c.jsx("td",{ref:n,className:ye("p-2 align-middle [&:has([role=checkbox])]:pr-0 [&>[role=checkbox]]:translate-y-[2px]",e),...t}));$n.displayName="TableCell";const eoe=N.forwardRef(({className:e,...t},n)=>c.jsx("caption",{ref:n,className:ye("mt-4 text-sm text-muted-foreground",e),...t}));eoe.displayName="TableCaption";function toe({access:e}){switch(e){case"private":return c.jsxs(Ue,{variant:"outline",className:"bg-blue-100 text-blue-800 border-blue-200 dark:bg-blue-900/30 dark:text-blue-400 dark:border-blue-800",children:[c.jsx(vQ,{className:"h-3 w-3 mr-1"}),"Private"]});case"shared":return c.jsxs(Ue,{variant:"outline",className:"bg-purple-100 text-purple-800 border-purple-200 dark:bg-purple-900/30 dark:text-purple-400 dark:border-purple-800",children:[c.jsx(Wz,{className:"h-3 w-3 mr-1"}),"Shared"]});case"public":return c.jsxs(Ue,{variant:"outline",className:"bg-green-100 text-green-800 border-green-200 dark:bg-green-900/30 dark:text-green-400 dark:border-green-800",children:[c.jsx(tJ,{className:"h-3 w-3 mr-1"}),"Public"]});default:return null}}function noe({status:e}){switch(e??"unknown"){case"healthy":return c.jsxs(Ue,{variant:"outline",className:"flex items-center gap-1 bg-emerald-100 text-emerald-800 border-emerald-200 dark:bg-emerald-900/30 dark:text-emerald-300 dark:border-emerald-800",children:[c.jsx(Az,{className:"h-3 w-3"}),"Healthy"]});case"unhealthy":return c.jsxs(Ue,{variant:"outline",className:"flex items-center gap-1 bg-red-100 text-red-800 border-red-200 dark:bg-red-900/30 dark:text-red-400 dark:border-red-800",children:[c.jsx(JC,{className:"h-3 w-3"}),"Unhealthy"]});default:return c.jsxs(Ue,{variant:"outline",className:"flex items-center gap-1 bg-muted text-muted-foreground border-border",children:[c.jsx(YC,{className:"h-3 w-3"}),"Unknown"]})}}const roe="••••••••••••••••";function aoe({credentials:e,isLoading:t,searchQuery:n,onDeleteCredential:r}){const[a,s]=N.useState({}),i=N.useMemo(()=>{if(!n)return e;const f=n.toLowerCase();return e.filter(h=>{var g;const p=((g=h.type)==null?void 0:g.toLowerCase())??"";return h.name.toLowerCase().includes(f)||p.includes(f)})},[e,n]),l=f=>{s(h=>({...h,[f]:!h[f]}))},d=async f=>{const h=f.secrets?Object.values(f.secrets)[0]:void 0;!h||typeof navigator>"u"||await navigator.clipboard.writeText(h)};return c.jsx("div",{className:"border rounded-md",children:c.jsxs(w2,{children:[c.jsx(S2,{children:c.jsxs(To,{children:[c.jsx(hr,{children:"Name"}),c.jsx(hr,{children:"Type"}),c.jsx(hr,{children:"Access"}),c.jsx(hr,{children:"Status"}),c.jsx(hr,{children:"Secret"}),c.jsx(hr,{children:"Last Updated"}),c.jsx(hr,{className:"w-[80px]"})]})}),c.jsxs(_2,{children:[t?c.jsx(To,{children:c.jsx($n,{colSpan:7,className:"py-6 text-center",children:c.jsxs("div",{className:"flex items-center justify-center gap-2 text-muted-foreground",children:[c.jsx(zo,{className:"h-4 w-4 animate-spin"}),"Loading credentials..."]})})}):null,!t&&i.length===0?c.jsx(To,{children:c.jsx($n,{colSpan:7,className:"text-center py-8",children:c.jsxs("div",{className:"text-muted-foreground",children:["No credentials found",n?c.jsx("p",{className:"text-sm",children:"Try adjusting your search query"}):null]})})}):null,!t&&i.map(f=>{const h=f.secrets?Object.values(f.secrets)[0]:void 0,p=a[f.id];return c.jsxs(To,{children:[c.jsx($n,{className:"font-medium",children:c.jsxs("div",{className:"flex items-center gap-2",children:[c.jsx(Pz,{className:"h-4 w-4 text-muted-foreground"}),f.name]})}),c.jsx($n,{children:c.jsx(Ue,{variant:"outline",children:f.type??"unknown"})}),c.jsx($n,{children:c.jsx(toe,{access:f.access})}),c.jsx($n,{children:c.jsx(noe,{status:f.status})}),c.jsx($n,{children:c.jsxs("div",{className:"flex items-center gap-2",children:[c.jsx("div",{className:"font-mono text-xs bg-muted px-2 py-1 rounded",children:h?p?h:roe:"Not available"}),c.jsx(me,{variant:"ghost",size:"icon",className:"h-6 w-6",onClick:()=>l(f.id),disabled:!h,children:p?c.jsx(UZ,{className:"h-3 w-3"}):c.jsx(BZ,{className:"h-3 w-3"})}),c.jsx(me,{variant:"ghost",size:"icon",className:"h-6 w-6",onClick:()=>h&&d(f),disabled:!h,children:c.jsx(Lo,{className:"h-3 w-3"})})]})}),c.jsx($n,{children:new Date(f.updatedAt).toLocaleDateString()}),c.jsx($n,{children:c.jsx(soe,{credentialId:f.id,onDeleteCredential:r})})]},f.id)})]})]})})}function soe({credentialId:e,onDeleteCredential:t}){return c.jsxs(ul,{children:[c.jsx(dl,{asChild:!0,children:c.jsx(me,{variant:"ghost",size:"icon",className:"h-8 w-8",children:c.jsx(Vf,{className:"h-4 w-4"})})}),c.jsxs(Qo,{align:"end",children:[c.jsx(tv,{children:"Actions"}),c.jsxs(Lt,{children:[c.jsx(oJ,{className:"h-4 w-4 mr-2"}),"Edit"]}),c.jsxs(Lt,{children:[c.jsx(Lo,{className:"h-4 w-4 mr-2"}),"Duplicate"]}),c.jsx(Os,{}),c.jsxs(Lt,{className:"text-destructive focus:text-destructive",onClick:()=>t&&t(e),children:[c.jsx(Ly,{className:"h-4 w-4 mr-2"}),"Delete"]})]})]})}function ooe({credentials:e=[],isLoading:t=!1,onAddCredential:n,onDeleteCredential:r,className:a}){const[s,i]=N.useState(""),l=N.useMemo(()=>["space-y-4",a].filter(d=>!!(d&&d.trim())).join(" "),[a]);return c.jsxs("div",{className:l,children:[c.jsxs("div",{className:"flex justify-between items-center",children:[c.jsx("h2",{className:"text-xl font-bold",children:"Credential Vault"}),c.jsx(Qse,{onAddCredential:n})]}),c.jsx("div",{className:"flex items-center space-x-2",children:c.jsxs("div",{className:"relative flex-1",children:[c.jsx(ia,{className:"absolute left-2 top-2.5 h-4 w-4 text-muted-foreground"}),c.jsx(Ct,{placeholder:"Search credentials...",className:"pl-8",value:s,onChange:d=>i(d.target.value)})]})}),c.jsx(aoe,{credentials:e,isLoading:t,searchQuery:s,onDeleteCredential:r})]})}function ioe({credentials:e,isCredentialsLoading:t,onAddCredential:n,onDeleteCredential:r}){const[a,s]=N.useState(!1);return c.jsxs(c.Fragment,{children:[c.jsxs(ul,{children:[c.jsx(dl,{asChild:!0,children:c.jsx(me,{variant:"ghost",size:"icon",className:"rounded-full border-2 border-border",children:c.jsx(Pj,{className:"h-5 w-5"})})}),c.jsxs(Qo,{align:"end",children:[c.jsx(tv,{children:"My Account"}),c.jsx(Os,{}),c.jsx(Lt,{children:c.jsxs(pn,{to:"/profile",className:"flex w-full items-center",children:[c.jsx(Pj,{className:"mr-2 h-4 w-4"}),c.jsx("span",{children:"Profile"})]})}),c.jsx(Lt,{children:c.jsxs(pn,{to:"/settings",className:"flex w-full items-center",children:[c.jsx(Iy,{className:"mr-2 h-4 w-4"}),c.jsx("span",{children:"Settings"})]})}),c.jsx(Lt,{onSelect:i=>{i.preventDefault(),s(!0)},className:"cursor-pointer",children:c.jsxs("div",{className:"flex w-full items-center",children:[c.jsx(Pz,{className:"mr-2 h-4 w-4"}),c.jsx("span",{children:"Credential Vault"})]})}),c.jsx(Lt,{children:c.jsxs(pn,{to:"/help-support",className:"flex w-full items-center",children:[c.jsx(KC,{className:"mr-2 h-4 w-4"}),c.jsx("span",{children:"Help & Support"})]})}),c.jsx(Os,{}),c.jsx(Lt,{children:c.jsxs(pn,{to:"/login",className:"flex w-full items-center",children:[c.jsx(bQ,{className:"mr-2 h-4 w-4"}),c.jsx("span",{children:"Log out"})]})})]})]}),c.jsx(fl,{open:a,onOpenChange:s,children:c.jsx(Jo,{className:"max-w-4xl",children:c.jsx(ooe,{credentials:e,isLoading:t,onAddCredential:n,onDeleteCredential:r})})})]})}function loe(){const[e,t]=N.useState(typeof window<"u"?window.innerWidth:0);return N.useEffect(()=>{if(typeof window>"u")return;const n=()=>{t(window.innerWidth)};return window.addEventListener("resize",n),()=>{window.removeEventListener("resize",n)}},[]),e}function sh({currentWorkflow:e,className:t,credentials:n=[],isCredentialsLoading:r=!1,onAddCredential:a,onDeleteCredential:s}){const i=loe();return c.jsxs("header",{className:ye("flex h-14 items-center border-b border-border bg-background px-4 lg:px-6",t),children:[c.jsx(Hae,{}),e&&c.jsx(Bae,{currentWorkflow:e,windowWidth:i}),c.jsxs("div",{className:"ml-auto flex items-center gap-2",children:[c.jsx(hse,{}),c.jsx(me,{variant:"ghost",size:"icon",children:c.jsx(VX,{className:"h-5 w-5"})}),c.jsx(ioe,{credentials:n,isCredentialsLoading:r,onAddCredential:a,onDeleteCredential:s})]})]})}const coe=1,uoe=1e6;let ow=0;function doe(){return ow=(ow+1)%Number.MAX_SAFE_INTEGER,ow.toString()}const iw=new Map,SM=e=>{if(iw.has(e))return;const t=setTimeout(()=>{iw.delete(e),Tg({type:"REMOVE_TOAST",toastId:e})},uoe);iw.set(e,t)},foe=(e,t)=>{switch(t.type){case"ADD_TOAST":return{...e,toasts:[t.toast,...e.toasts].slice(0,coe)};case"UPDATE_TOAST":return{...e,toasts:e.toasts.map(n=>n.id===t.toast.id?{...n,...t.toast}:n)};case"DISMISS_TOAST":{const{toastId:n}=t;return n?SM(n):e.toasts.forEach(r=>{SM(r.id)}),{...e,toasts:e.toasts.map(r=>r.id===n||n===void 0?{...r,open:!1}:r)}}case"REMOVE_TOAST":return t.toastId===void 0?{...e,toasts:[]}:{...e,toasts:e.toasts.filter(n=>n.id!==t.toastId)}}},hoe=[];let lw={toasts:[]};function Tg(e){lw=foe(lw,e),hoe.forEach(t=>{t(lw)})}function Ne({...e}){const t=doe(),n=a=>Tg({type:"UPDATE_TOAST",toast:{...a,id:t}}),r=()=>Tg({type:"DISMISS_TOAST",toastId:t});return Tg({type:"ADD_TOAST",toast:{...e,id:t,open:!0,onOpenChange:a=>{a||r()}}}),{id:t,dismiss:r,update:n}}const cw={},Qj="http://localhost:8000",Oc=e=>e.replace(/\/+$/,""),poe=e=>["http:","https:","ws:","wss:"].includes(e),moe=e=>{if(!e.trim())return!1;try{const t=new URL(e);return poe(t.protocol)}catch{return!1}},Jj=e=>{if(!e)return Qj;const t=e.trim();return t.startsWith("http://")||t.startsWith("https://")||t.startsWith("ws://")||t.startsWith("wss://")?Oc(t):Oc(`http://${t}`)},ni=()=>{const e=(cw==null?void 0:cw.VITE_ORCHEO_BACKEND_URL)??"",n=Jj(e||Qj);return e&&!moe(n)?(console.warn("Invalid VITE_ORCHEO_BACKEND_URL provided, falling back to default backend URL."),Jj(Qj)):n},goe=e=>e.startsWith("http://")||e.startsWith("https://")?e:e.startsWith("ws://")?`http://${e.slice(5)}`:e.startsWith("wss://")?`https://${e.slice(6)}`:`http://${e}`,gn=(e,t)=>{const n=goe(t??ni()),r=Oc(n),a=e.startsWith("/")?e:`/${e}`;return`${r}${a}`},yoe=(e,t)=>{const n=e.trim();if(!n)throw new Error("workflowId is required to create a WebSocket URL");const r=Jj(t??ni());if(r.startsWith("ws://")||r.startsWith("wss://"))return`${Oc(r)}/ws/workflow/${n}`;const a=r.startsWith("https://")?"wss://":"ws://",s=r.replace(/^https?:\/\//,"").replace(/^ws?:\/\//,"");return`${a}${Oc(s)}/ws/workflow/${n}`},voe="system",xoe=e=>({id:e.id,name:e.name,type:e.provider??e.kind,createdAt:e.created_at,updatedAt:e.updated_at,owner:e.owner,access:e.access,secrets:e.secret_preview?{secret:e.secret_preview}:void 0,status:e.status});function lv(e={}){var h;const{workflowId:t=null}=e,n=N.useMemo(()=>ni(),[]),r=((h=e.actorName)==null?void 0:h.trim())||voe,[a,s]=N.useState([]),[i,l]=N.useState(!0);N.useEffect(()=>{const p=new AbortController;let g=!1;return(async()=>{l(!0);try{const S=new URL(gn("/api/credentials",n));t&&S.searchParams.set("workflow_id",t);const w=await fetch(S.toString(),{signal:p.signal});if(!w.ok)throw new Error(`Failed to load credentials (status ${w.status})`);const b=await w.json();if(g)return;s(b.map(xoe))}catch(S){if(p.signal.aborted||g)return;console.error("Failed to load credential vault",S),Ne({title:"Unable to load credentials",description:S instanceof Error?S.message:"An unexpected error occurred while loading credentials.",variant:"destructive"})}finally{g||l(!1)}})(),()=>{g=!0,p.abort()}},[n,t]);const d=N.useCallback(async p=>{var b,x;const g=(x=(b=p.secrets)==null?void 0:b.apiKey)==null?void 0:x.trim();if(!g){const _="API key is required to save a credential.";throw Ne({title:"Missing credential secret",description:_,variant:"destructive"}),new Error(_)}const y=await fetch(gn("/api/credentials",n),{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({name:p.name,provider:p.type??"custom",secret:g,actor:r,access:p.access,workflow_id:t,scopes:[]})});if(!y.ok){let _=`Failed to save credential (status ${y.status})`;try{const j=await y.json();typeof(j==null?void 0:j.detail)=="string"?_=j.detail:j!=null&&j.detail&&typeof j.detail.message=="string"&&(_=j.detail.message)}catch(j){console.warn("Failed to parse credential creation error",j)}throw Ne({title:"Unable to save credential",description:_,variant:"destructive"}),new Error(_)}const S=await y.json(),w={id:S.id,name:S.name,type:S.provider??S.kind,createdAt:S.created_at,updatedAt:S.updated_at,owner:S.owner,access:S.access,secrets:p.secrets,status:S.status};s(_=>[..._.filter(C=>C.id!==w.id),w]),Ne({title:"Credential added to vault",description:`${w.name} is now available for nodes that require secure access.`})},[r,n,t]),f=N.useCallback(async p=>{const g=new URL(gn(`/api/credentials/${p}`,n));t&&g.searchParams.set("workflow_id",t);try{const y=await fetch(g.toString(),{method:"DELETE"});if(!y.ok&&y.status!==404)throw new Error(`Failed to delete credential (status ${y.status})`);s(S=>S.filter(w=>w.id!==p)),Ne({title:"Credential removed",description:"Nodes referencing this credential will require reconfiguration before publish."})}catch(y){console.error("Failed to delete credential",y);const S=y instanceof Error?y.message:"Credential removal failed.";Ne({title:"Unable to delete credential",description:S,variant:"destructive"});return}},[n,t]);return{credentials:a,isLoading:i,onAddCredential:d,onDeleteCredential:f}}var boe=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],woe=boe.reduce((e,t)=>{const n=zy(`Primitive.${t}`),r=N.forwardRef((a,s)=>{const{asChild:i,...l}=a,d=i?n:t;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),c.jsx(d,{...l,ref:s})});return r.displayName=`Primitive.${t}`,{...e,[t]:r}},{}),Soe="Label",K8=N.forwardRef((e,t)=>c.jsx(woe.label,{...e,ref:t,onMouseDown:n=>{var a;n.target.closest("button, input, select, textarea")||((a=e.onMouseDown)==null||a.call(e,n),!n.defaultPrevented&&n.detail>1&&n.preventDefault())}}));K8.displayName=Soe;var Y8=K8;const _oe=Kf("text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70"),jt=N.forwardRef(({className:e,...t},n)=>c.jsx(Y8,{ref:n,className:ye(_oe(),e),...t}));jt.displayName=Y8.displayName;const Noe=({open:e,onOpenChange:t,folderName:n,onFolderNameChange:r,onCreateFolder:a})=>c.jsxs(fl,{open:e,onOpenChange:t,children:[c.jsx(ah,{asChild:!0,children:c.jsxs(me,{variant:"outline",children:[c.jsx(Oz,{className:"mr-2 h-4 w-4"}),"New Folder"]})}),c.jsxs(Jo,{children:[c.jsxs(hl,{children:[c.jsx(pl,{children:"Create New Folder"}),c.jsx(yu,{children:"Enter a name for your new folder."})]}),c.jsxs("div",{className:"py-4",children:[c.jsx(jt,{htmlFor:"folder-name",children:"Folder Name"}),c.jsx(Ct,{id:"folder-name",value:n,onChange:s=>r(s.target.value),placeholder:"My Workflows",className:"mt-2"})]}),c.jsxs(rv,{children:[c.jsx(me,{variant:"outline",onClick:()=>t(!1),children:"Cancel"}),c.jsx(me,{onClick:a,children:"Create Folder"})]})]})]}),joe=({open:e,onOpenChange:t,workflowName:n,onWorkflowNameChange:r,onCreateWorkflow:a})=>c.jsxs(fl,{open:e,onOpenChange:t,children:[c.jsx(ah,{asChild:!0,children:c.jsxs(me,{children:[c.jsx(ll,{className:"mr-2 h-4 w-4"}),"Create Workflow"]})}),c.jsxs(Jo,{children:[c.jsxs(hl,{children:[c.jsx(pl,{children:"Create New Workflow"}),c.jsx(yu,{children:"Enter a name for your new workflow."})]}),c.jsxs("div",{className:"py-4",children:[c.jsx(jt,{htmlFor:"workflow-name",children:"Workflow Name"}),c.jsx(Ct,{id:"workflow-name",value:n,onChange:s=>r(s.target.value),placeholder:"My New Workflow",className:"mt-2"})]}),c.jsxs(rv,{children:[c.jsx(me,{variant:"outline",onClick:()=>t(!1),children:"Cancel"}),c.jsx(me,{onClick:a,children:"Create & Open"})]})]})]});var cv="Checkbox",[Coe]=wn(cv),[Eoe,N2]=Coe(cv);function Toe(e){const{__scopeCheckbox:t,checked:n,children:r,defaultChecked:a,disabled:s,form:i,name:l,onCheckedChange:d,required:f,value:h="on",internal_do_not_use_render:p}=e,[g,y]=bn({prop:n,defaultProp:a??!1,onChange:d,caller:cv}),[S,w]=N.useState(null),[b,x]=N.useState(null),_=N.useRef(!1),j=S?!!i||!!S.closest("form"):!0,C={checked:g,disabled:s,setChecked:y,control:S,setControl:w,name:l,form:i,value:h,hasConsumerStoppedPropagationRef:_,required:f,defaultChecked:Oo(a)?!1:a,isFormControl:j,bubbleInput:b,setBubbleInput:x};return c.jsx(Eoe,{scope:t,...C,children:Aoe(p)?p(C):r})}var X8="CheckboxTrigger",Z8=N.forwardRef(({__scopeCheckbox:e,onKeyDown:t,onClick:n,...r},a)=>{const{control:s,value:i,disabled:l,checked:d,required:f,setControl:h,setChecked:p,hasConsumerStoppedPropagationRef:g,isFormControl:y,bubbleInput:S}=N2(X8,e),w=ze(a,h),b=N.useRef(d);return N.useEffect(()=>{const x=s==null?void 0:s.form;if(x){const _=()=>p(b.current);return x.addEventListener("reset",_),()=>x.removeEventListener("reset",_)}},[s,p]),c.jsx(Ae.button,{type:"button",role:"checkbox","aria-checked":Oo(d)?"mixed":d,"aria-required":f,"data-state":nq(d),"data-disabled":l?"":void 0,disabled:l,value:i,...r,ref:w,onKeyDown:_e(t,x=>{x.key==="Enter"&&x.preventDefault()}),onClick:_e(n,x=>{p(_=>Oo(_)?!0:!_),S&&y&&(g.current=x.isPropagationStopped(),g.current||x.stopPropagation())})})});Z8.displayName=X8;var j2=N.forwardRef((e,t)=>{const{__scopeCheckbox:n,name:r,checked:a,defaultChecked:s,required:i,disabled:l,value:d,onCheckedChange:f,form:h,...p}=e;return c.jsx(Toe,{__scopeCheckbox:n,checked:a,defaultChecked:s,disabled:l,required:i,onCheckedChange:f,name:r,form:h,value:d,internal_do_not_use_render:({isFormControl:g})=>c.jsxs(c.Fragment,{children:[c.jsx(Z8,{...p,ref:t,__scopeCheckbox:n}),g&&c.jsx(tq,{__scopeCheckbox:n})]})})});j2.displayName=cv;var Q8="CheckboxIndicator",J8=N.forwardRef((e,t)=>{const{__scopeCheckbox:n,forceMount:r,...a}=e,s=N2(Q8,n);return c.jsx(sn,{present:r||Oo(s.checked)||s.checked===!0,children:c.jsx(Ae.span,{"data-state":nq(s.checked),"data-disabled":s.disabled?"":void 0,...a,ref:t,style:{pointerEvents:"none",...e.style}})})});J8.displayName=Q8;var eq="CheckboxBubbleInput",tq=N.forwardRef(({__scopeCheckbox:e,...t},n)=>{const{control:r,hasConsumerStoppedPropagationRef:a,checked:s,defaultChecked:i,required:l,disabled:d,name:f,value:h,form:p,bubbleInput:g,setBubbleInput:y}=N2(eq,e),S=ze(n,y),w=av(s),b=Wy(r);N.useEffect(()=>{const _=g;if(!_)return;const j=window.HTMLInputElement.prototype,T=Object.getOwnPropertyDescriptor(j,"checked").set,A=!a.current;if(w!==s&&T){const k=new Event("click",{bubbles:A});_.indeterminate=Oo(s),T.call(_,Oo(s)?!1:s),_.dispatchEvent(k)}},[g,w,s,a]);const x=N.useRef(Oo(s)?!1:s);return c.jsx(Ae.input,{type:"checkbox","aria-hidden":!0,defaultChecked:i??x.current,required:l,disabled:d,name:f,value:h,form:p,...t,tabIndex:-1,ref:S,style:{...t.style,...b,position:"absolute",pointerEvents:"none",opacity:0,margin:0,transform:"translateX(-100%)"}})});tq.displayName=eq;function Aoe(e){return typeof e=="function"}function Oo(e){return e==="indeterminate"}function nq(e){return Oo(e)?"indeterminate":e?"checked":"unchecked"}const Ag=N.forwardRef(({className:e,...t},n)=>c.jsx(j2,{ref:n,className:ye("peer h-4 w-4 shrink-0 rounded-sm border border-primary shadow focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:cursor-not-allowed disabled:opacity-50 data-[state=checked]:bg-primary data-[state=checked]:text-primary-foreground",e),...t,children:c.jsx(J8,{className:ye("flex items-center justify-center text-current"),children:c.jsx(Is,{className:"h-4 w-4"})})}));Ag.displayName=j2.displayName;function Roe(e){const t=koe(e),n=N.forwardRef((r,a)=>{const{children:s,...i}=r,l=N.Children.toArray(s),d=l.find(Moe);if(d){const f=d.props.children,h=l.map(p=>p===d?N.Children.count(f)>1?N.Children.only(null):N.isValidElement(f)?f.props.children:null:p);return c.jsx(t,{...i,ref:a,children:N.isValidElement(f)?N.cloneElement(f,void 0,h):null})}return c.jsx(t,{...i,ref:a,children:s})});return n.displayName=`${e}.Slot`,n}function koe(e){const t=N.forwardRef((n,r)=>{const{children:a,...s}=n;if(N.isValidElement(a)){const i=Poe(a),l=Doe(s,a.props);return a.type!==N.Fragment&&(l.ref=r?La(r,i):i),N.cloneElement(a,l)}return N.Children.count(a)>1?N.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var Ooe=Symbol("radix.slottable");function Moe(e){return N.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===Ooe}function Doe(e,t){const n={...t};for(const r in t){const a=e[r],s=t[r];/^on[A-Z]/.test(r)?a&&s?n[r]=(...l)=>{const d=s(...l);return a(...l),d}:a&&(n[r]=a):r==="style"?n[r]={...a,...s}:r==="className"&&(n[r]=[a,s].filter(Boolean).join(" "))}return{...e,...n}}function Poe(e){var r,a;let t=(r=Object.getOwnPropertyDescriptor(e.props,"ref"))==null?void 0:r.get,n=t&&"isReactWarning"in t&&t.isReactWarning;return n?e.ref:(t=(a=Object.getOwnPropertyDescriptor(e,"ref"))==null?void 0:a.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}var uv="Popover",[rq]=wn(uv,[Yo]),oh=Yo(),[$oe,ri]=rq(uv),aq=e=>{const{__scopePopover:t,children:n,open:r,defaultOpen:a,onOpenChange:s,modal:i=!1}=e,l=oh(t),d=N.useRef(null),[f,h]=N.useState(!1),[p,g]=bn({prop:r,defaultProp:a??!1,onChange:s,caller:uv});return c.jsx(Zf,{...l,children:c.jsx($oe,{scope:t,contentId:zn(),triggerRef:d,open:p,onOpenChange:g,onOpenToggle:N.useCallback(()=>g(y=>!y),[g]),hasCustomAnchor:f,onCustomAnchorAdd:N.useCallback(()=>h(!0),[]),onCustomAnchorRemove:N.useCallback(()=>h(!1),[]),modal:i,children:n})})};aq.displayName=uv;var sq="PopoverAnchor",Ioe=N.forwardRef((e,t)=>{const{__scopePopover:n,...r}=e,a=ri(sq,n),s=oh(n),{onCustomAnchorAdd:i,onCustomAnchorRemove:l}=a;return N.useEffect(()=>(i(),()=>l()),[i,l]),c.jsx(Qf,{...s,...r,ref:t})});Ioe.displayName=sq;var oq="PopoverTrigger",iq=N.forwardRef((e,t)=>{const{__scopePopover:n,...r}=e,a=ri(oq,n),s=oh(n),i=ze(t,a.triggerRef),l=c.jsx(Ae.button,{type:"button","aria-haspopup":"dialog","aria-expanded":a.open,"aria-controls":a.contentId,"data-state":fq(a.open),...r,ref:i,onClick:_e(e.onClick,a.onOpenToggle)});return a.hasCustomAnchor?l:c.jsx(Qf,{asChild:!0,...s,children:l})});iq.displayName=oq;var C2="PopoverPortal",[Loe,zoe]=rq(C2,{forceMount:void 0}),lq=e=>{const{__scopePopover:t,forceMount:n,children:r,container:a}=e,s=ri(C2,t);return c.jsx(Loe,{scope:t,forceMount:n,children:c.jsx(sn,{present:n||s.open,children:c.jsx(gu,{asChild:!0,container:a,children:r})})})};lq.displayName=C2;var Hc="PopoverContent",cq=N.forwardRef((e,t)=>{const n=zoe(Hc,e.__scopePopover),{forceMount:r=n.forceMount,...a}=e,s=ri(Hc,e.__scopePopover);return c.jsx(sn,{present:r||s.open,children:s.modal?c.jsx(Foe,{...a,ref:t}):c.jsx(Uoe,{...a,ref:t})})});cq.displayName=Hc;var qoe=Roe("PopoverContent.RemoveScroll"),Foe=N.forwardRef((e,t)=>{const n=ri(Hc,e.__scopePopover),r=N.useRef(null),a=ze(t,r),s=N.useRef(!1);return N.useEffect(()=>{const i=r.current;if(i)return Zy(i)},[]),c.jsx(eh,{as:qoe,allowPinchZoom:!0,children:c.jsx(uq,{...e,ref:a,trapFocus:n.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:_e(e.onCloseAutoFocus,i=>{var l;i.preventDefault(),s.current||(l=n.triggerRef.current)==null||l.focus()}),onPointerDownOutside:_e(e.onPointerDownOutside,i=>{const l=i.detail.originalEvent,d=l.button===0&&l.ctrlKey===!0,f=l.button===2||d;s.current=f},{checkForDefaultPrevented:!1}),onFocusOutside:_e(e.onFocusOutside,i=>i.preventDefault(),{checkForDefaultPrevented:!1})})})}),Uoe=N.forwardRef((e,t)=>{const n=ri(Hc,e.__scopePopover),r=N.useRef(!1),a=N.useRef(!1);return c.jsx(uq,{...e,ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:s=>{var i,l;(i=e.onCloseAutoFocus)==null||i.call(e,s),s.defaultPrevented||(r.current||(l=n.triggerRef.current)==null||l.focus(),s.preventDefault()),r.current=!1,a.current=!1},onInteractOutside:s=>{var d,f;(d=e.onInteractOutside)==null||d.call(e,s),s.defaultPrevented||(r.current=!0,s.detail.originalEvent.type==="pointerdown"&&(a.current=!0));const i=s.target;((f=n.triggerRef.current)==null?void 0:f.contains(i))&&s.preventDefault(),s.detail.originalEvent.type==="focusin"&&a.current&&s.preventDefault()}})}),uq=N.forwardRef((e,t)=>{const{__scopePopover:n,trapFocus:r,onOpenAutoFocus:a,onCloseAutoFocus:s,disableOutsidePointerEvents:i,onEscapeKeyDown:l,onPointerDownOutside:d,onFocusOutside:f,onInteractOutside:h,...p}=e,g=ri(Hc,n),y=oh(n);return Fy(),c.jsx(Yf,{asChild:!0,loop:!0,trapped:r,onMountAutoFocus:a,onUnmountAutoFocus:s,children:c.jsx(hu,{asChild:!0,disableOutsidePointerEvents:i,onInteractOutside:h,onEscapeKeyDown:l,onPointerDownOutside:d,onFocusOutside:f,onDismiss:()=>g.onOpenChange(!1),children:c.jsx(Gy,{"data-state":fq(g.open),role:"dialog",id:g.contentId,...y,...p,ref:t,style:{...p.style,"--radix-popover-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-popover-content-available-width":"var(--radix-popper-available-width)","--radix-popover-content-available-height":"var(--radix-popper-available-height)","--radix-popover-trigger-width":"var(--radix-popper-anchor-width)","--radix-popover-trigger-height":"var(--radix-popper-anchor-height)"}})})})}),dq="PopoverClose",Hoe=N.forwardRef((e,t)=>{const{__scopePopover:n,...r}=e,a=ri(dq,n);return c.jsx(Ae.button,{type:"button",...r,ref:t,onClick:_e(e.onClick,()=>a.onOpenChange(!1))})});Hoe.displayName=dq;var Boe="PopoverArrow",Voe=N.forwardRef((e,t)=>{const{__scopePopover:n,...r}=e,a=oh(n);return c.jsx(Ky,{...a,...r,ref:t})});Voe.displayName=Boe;function fq(e){return e?"open":"closed"}var Woe=aq,Goe=iq,Koe=lq,hq=cq;const Yoe=Woe,Xoe=Goe,pq=N.forwardRef(({className:e,align:t="center",sideOffset:n=4,...r},a)=>c.jsx(Koe,{children:c.jsx(hq,{ref:a,align:t,sideOffset:n,className:ye("z-50 w-72 rounded-md border bg-popover p-4 text-popover-foreground shadow-md outline-none data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-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",e),...r})}));pq.displayName=hq.displayName;const Zoe=[{id:"owner-me",label:"Created by me",key:"me"},{id:"owner-shared",label:"Shared with me",key:"shared"}],Qoe=[{id:"status-active",label:"Active",key:"active"},{id:"status-draft",label:"Draft",key:"draft"},{id:"status-archived",label:"Archived",key:"archived"}],Joe=[{id:"tag-favorite",label:"Favorite",key:"favorite"},{id:"tag-template",label:"Template",key:"template"},{id:"tag-production",label:"Production",key:"production"},{id:"tag-development",label:"Development",key:"development"}],eie=({filters:e,onFiltersChange:t,open:n,onOpenChange:r,onApplyFilters:a})=>{const s=N.useCallback(d=>f=>{t({...e,owner:{...e.owner,[d]:!!f}})},[e,t]),i=N.useCallback(d=>f=>{t({...e,status:{...e.status,[d]:!!f}})},[e,t]),l=N.useCallback(d=>f=>{t({...e,tags:{...e.tags,[d]:!!f}})},[e,t]);return c.jsxs(Yoe,{open:n,onOpenChange:r,children:[c.jsx(Xoe,{asChild:!0,children:c.jsx(me,{variant:"outline",size:"icon",children:c.jsx(Kg,{className:"h-4 w-4"})})}),c.jsx(pq,{className:"w-80",children:c.jsxs("div",{className:"space-y-4",children:[c.jsx("h4",{className:"font-medium",children:"Filter Workflows"}),c.jsxs("div",{className:"space-y-2",children:[c.jsx("h5",{className:"text-sm font-medium",children:"Owner"}),c.jsx("div",{className:"flex flex-col gap-2",children:Zoe.map(d=>c.jsxs("div",{className:"flex items-center space-x-2",children:[c.jsx(Ag,{id:d.id,checked:e.owner[d.key],onCheckedChange:s(d.key)}),c.jsx(jt,{htmlFor:d.id,children:d.label})]},d.id))})]}),c.jsxs("div",{className:"space-y-2",children:[c.jsx("h5",{className:"text-sm font-medium",children:"Status"}),c.jsx("div",{className:"flex flex-col gap-2",children:Qoe.map(d=>c.jsxs("div",{className:"flex items-center space-x-2",children:[c.jsx(Ag,{id:d.id,checked:e.status[d.key],onCheckedChange:i(d.key)}),c.jsx(jt,{htmlFor:d.id,children:d.label})]},d.id))})]}),c.jsxs("div",{className:"space-y-2",children:[c.jsx("h5",{className:"text-sm font-medium",children:"Tags"}),c.jsx("div",{className:"flex flex-col gap-2",children:Joe.map(d=>c.jsxs("div",{className:"flex items-center space-x-2",children:[c.jsx(Ag,{id:d.id,checked:e.tags[d.key],onCheckedChange:l(d.key)}),c.jsx(jt,{htmlFor:d.id,children:d.label})]},d.id))})]}),c.jsxs("div",{className:"flex justify-end gap-2 pt-2",children:[c.jsx(me,{variant:"outline",size:"sm",onClick:()=>r(!1),children:"Cancel"}),c.jsx(me,{size:"sm",onClick:a,children:"Apply Filters"})]})]})})]})},tie=({searchQuery:e,onSearchQueryChange:t,sortBy:n,onSortChange:r,filters:a,onFiltersChange:s,showFilterPopover:i,onFilterPopoverChange:l,showNewFolderDialog:d,onNewFolderDialogChange:f,newFolderName:h,onFolderNameChange:p,onCreateFolder:g,showNewWorkflowDialog:y,onNewWorkflowDialogChange:S,newWorkflowName:w,onWorkflowNameChange:b,onCreateWorkflow:x,onApplyFilters:_})=>{const j=C=>{t(C.target.value)};return c.jsxs("div",{className:"flex flex-col gap-4 p-4 md:flex-row md:items-center",children:[c.jsxs("div",{className:"relative flex-1 md:order-1",children:[c.jsx(ia,{className:"absolute left-3 top-3 h-4 w-4 text-muted-foreground"}),c.jsx(Ct,{placeholder:"Search workflows...",className:"pl-10",value:e,onChange:j})]}),c.jsxs("div",{className:"flex items-center gap-2 md:order-2",children:[c.jsx(Noe,{open:d,onOpenChange:f,folderName:h,onFolderNameChange:p,onCreateFolder:g}),c.jsx(joe,{open:y,onOpenChange:S,workflowName:w,onWorkflowNameChange:b,onCreateWorkflow:x})]}),c.jsxs("div",{className:"flex items-center gap-2 md:order-3",children:[c.jsxs(Fc,{value:n,onValueChange:C=>r(C),children:[c.jsx(Yi,{className:"w-[180px]",children:c.jsx(Uc,{placeholder:"Sort by"})}),c.jsxs(Xi,{children:[c.jsx(Pn,{value:"updated",children:c.jsxs("div",{className:"flex items-center",children:[c.jsx(UO,{className:"mr-2 h-4 w-4"}),"Last Updated"]})}),c.jsx(Pn,{value:"created",children:c.jsxs("div",{className:"flex items-center",children:[c.jsx(Bi,{className:"mr-2 h-4 w-4"}),"Creation Date"]})}),c.jsx(Pn,{value:"name",children:c.jsxs("div",{className:"flex items-center",children:[c.jsx(UO,{className:"mr-2 h-4 w-4"}),"Name"]})})]})]}),c.jsx(eie,{filters:a,onFiltersChange:s,open:i,onOpenChange:l,onApplyFilters:_})]})]})};var dv="Tabs",[nie]=wn(dv,[Xo]),mq=Xo(),[rie,E2]=nie(dv),gq=N.forwardRef((e,t)=>{const{__scopeTabs:n,value:r,onValueChange:a,defaultValue:s,orientation:i="horizontal",dir:l,activationMode:d="automatic",...f}=e,h=Ko(l),[p,g]=bn({prop:r,onChange:a,defaultProp:s??"",caller:dv});return c.jsx(rie,{scope:n,baseId:zn(),value:p,onValueChange:g,orientation:i,dir:h,activationMode:d,children:c.jsx(Ae.div,{dir:h,"data-orientation":i,...f,ref:t})})});gq.displayName=dv;var yq="TabsList",vq=N.forwardRef((e,t)=>{const{__scopeTabs:n,loop:r=!0,...a}=e,s=E2(yq,n),i=mq(n);return c.jsx(Yy,{asChild:!0,...i,orientation:s.orientation,dir:s.dir,loop:r,children:c.jsx(Ae.div,{role:"tablist","aria-orientation":s.orientation,...a,ref:t})})});vq.displayName=yq;var xq="TabsTrigger",bq=N.forwardRef((e,t)=>{const{__scopeTabs:n,value:r,disabled:a=!1,...s}=e,i=E2(xq,n),l=mq(n),d=_q(i.baseId,r),f=Nq(i.baseId,r),h=r===i.value;return c.jsx(Xy,{asChild:!0,...l,focusable:!a,active:h,children:c.jsx(Ae.button,{type:"button",role:"tab","aria-selected":h,"aria-controls":f,"data-state":h?"active":"inactive","data-disabled":a?"":void 0,disabled:a,id:d,...s,ref:t,onMouseDown:_e(e.onMouseDown,p=>{!a&&p.button===0&&p.ctrlKey===!1?i.onValueChange(r):p.preventDefault()}),onKeyDown:_e(e.onKeyDown,p=>{[" ","Enter"].includes(p.key)&&i.onValueChange(r)}),onFocus:_e(e.onFocus,()=>{const p=i.activationMode!=="manual";!h&&!a&&p&&i.onValueChange(r)})})})});bq.displayName=xq;var wq="TabsContent",Sq=N.forwardRef((e,t)=>{const{__scopeTabs:n,value:r,forceMount:a,children:s,...i}=e,l=E2(wq,n),d=_q(l.baseId,r),f=Nq(l.baseId,r),h=r===l.value,p=N.useRef(h);return N.useEffect(()=>{const g=requestAnimationFrame(()=>p.current=!1);return()=>cancelAnimationFrame(g)},[]),c.jsx(sn,{present:a||h,children:({present:g})=>c.jsx(Ae.div,{"data-state":h?"active":"inactive","data-orientation":l.orientation,role:"tabpanel","aria-labelledby":d,hidden:!g,id:f,tabIndex:0,...i,ref:t,style:{...e.style,animationDuration:p.current?"0s":void 0},children:g&&s})})});Sq.displayName=wq;function _q(e,t){return`${e}-trigger-${t}`}function Nq(e,t){return`${e}-content-${t}`}var jq=gq,T2=vq,A2=bq,Cq=Sq;const Da=jq,Ls=N.forwardRef(({className:e,...t},n)=>c.jsx(T2,{ref:n,className:ye("inline-flex h-9 items-center justify-center rounded-lg bg-muted p-1 text-muted-foreground",e),...t}));Ls.displayName=T2.displayName;const St=N.forwardRef(({className:e,...t},n)=>c.jsx(A2,{ref:n,className:ye("inline-flex items-center justify-center whitespace-nowrap rounded-md px-3 py-1 text-sm font-medium ring-offset-background transition-all focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50 data-[state=active]:bg-background data-[state=active]:text-foreground data-[state=active]:shadow",e),...t}));St.displayName=A2.displayName;const $t=N.forwardRef(({className:e,...t},n)=>c.jsx(Cq,{ref:n,className:ye("mt-2 ring-offset-background focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2",e),...t}));$t.displayName=Cq.displayName;const At=N.forwardRef(({className:e,...t},n)=>c.jsx("div",{ref:n,className:ye("rounded-xl border bg-card text-card-foreground shadow",e),...t}));At.displayName="Card";const Ht=N.forwardRef(({className:e,...t},n)=>c.jsx("div",{ref:n,className:ye("flex flex-col space-y-1.5 p-6",e),...t}));Ht.displayName="CardHeader";const Rt=N.forwardRef(({className:e,...t},n)=>c.jsx("div",{ref:n,className:ye("font-semibold leading-none tracking-tight",e),...t}));Rt.displayName="CardTitle";const kt=N.forwardRef(({className:e,...t},n)=>c.jsx("div",{ref:n,className:ye("text-sm text-muted-foreground",e),...t}));kt.displayName="CardDescription";const Bt=N.forwardRef(({className:e,...t},n)=>c.jsx("div",{ref:n,className:ye("p-6 pt-0",e),...t}));Bt.displayName="CardContent";const rr=N.forwardRef(({className:e,...t},n)=>c.jsx("div",{ref:n,className:ye("flex items-center p-6 pt-0",e),...t}));rr.displayName="CardFooter";function aie(e,t=[]){let n=[];function r(s,i){const l=N.createContext(i);l.displayName=s+"Context";const d=n.length;n=[...n,i];const f=p=>{var x;const{scope:g,children:y,...S}=p,w=((x=g==null?void 0:g[e])==null?void 0:x[d])||l,b=N.useMemo(()=>S,Object.values(S));return c.jsx(w.Provider,{value:b,children:y})};f.displayName=s+"Provider";function h(p,g){var w;const y=((w=g==null?void 0:g[e])==null?void 0:w[d])||l,S=N.useContext(y);if(S)return S;if(i!==void 0)return i;throw new Error(`\`${p}\` must be used within \`${s}\``)}return[f,h]}const a=()=>{const s=n.map(i=>N.createContext(i));return function(l){const d=(l==null?void 0:l[e])||s;return N.useMemo(()=>({[`__scope${e}`]:{...l,[e]:d}}),[l,d])}};return a.scopeName=e,[r,sie(a,...t)]}function sie(...e){const t=e[0];if(e.length===1)return t;const n=()=>{const r=e.map(a=>({useScope:a(),scopeName:a.scopeName}));return function(s){const i=r.reduce((l,{useScope:d,scopeName:f})=>{const p=d(s)[`__scope${f}`];return{...l,...p}},{});return N.useMemo(()=>({[`__scope${t.scopeName}`]:i}),[i])}};return n.scopeName=t.scopeName,n}var oie=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],R2=oie.reduce((e,t)=>{const n=zy(`Primitive.${t}`),r=N.forwardRef((a,s)=>{const{asChild:i,...l}=a,d=i?n:t;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),c.jsx(d,{...l,ref:s})});return r.displayName=`Primitive.${t}`,{...e,[t]:r}},{}),uw={exports:{}},dw={};/**
|
|
670
|
+
* @license React
|
|
671
|
+
* use-sync-external-store-shim.production.js
|
|
672
|
+
*
|
|
673
|
+
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
674
|
+
*
|
|
675
|
+
* This source code is licensed under the MIT license found in the
|
|
676
|
+
* LICENSE file in the root directory of this source tree.
|
|
677
|
+
*/var _M;function iie(){if(_M)return dw;_M=1;var e=iu();function t(p,g){return p===g&&(p!==0||1/p===1/g)||p!==p&&g!==g}var n=typeof Object.is=="function"?Object.is:t,r=e.useState,a=e.useEffect,s=e.useLayoutEffect,i=e.useDebugValue;function l(p,g){var y=g(),S=r({inst:{value:y,getSnapshot:g}}),w=S[0].inst,b=S[1];return s(function(){w.value=y,w.getSnapshot=g,d(w)&&b({inst:w})},[p,y,g]),a(function(){return d(w)&&b({inst:w}),p(function(){d(w)&&b({inst:w})})},[p]),i(y),y}function d(p){var g=p.getSnapshot;p=p.value;try{var y=g();return!n(p,y)}catch{return!0}}function f(p,g){return g()}var h=typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"?f:l;return dw.useSyncExternalStore=e.useSyncExternalStore!==void 0?e.useSyncExternalStore:h,dw}var NM;function Eq(){return NM||(NM=1,uw.exports=iie()),uw.exports}var lie=Eq();function cie(){return lie.useSyncExternalStore(uie,()=>!0,()=>!1)}function uie(){return()=>{}}var k2="Avatar",[die]=aie(k2),[fie,Tq]=die(k2),Aq=N.forwardRef((e,t)=>{const{__scopeAvatar:n,...r}=e,[a,s]=N.useState("idle");return c.jsx(fie,{scope:n,imageLoadingStatus:a,onImageLoadingStatusChange:s,children:c.jsx(R2.span,{...r,ref:t})})});Aq.displayName=k2;var Rq="AvatarImage",kq=N.forwardRef((e,t)=>{const{__scopeAvatar:n,src:r,onLoadingStatusChange:a=()=>{},...s}=e,i=Tq(Rq,n),l=hie(r,s),d=hn(f=>{a(f),i.onImageLoadingStatusChange(f)});return Jt(()=>{l!=="idle"&&d(l)},[l,d]),l==="loaded"?c.jsx(R2.img,{...s,ref:t,src:r}):null});kq.displayName=Rq;var Oq="AvatarFallback",Mq=N.forwardRef((e,t)=>{const{__scopeAvatar:n,delayMs:r,...a}=e,s=Tq(Oq,n),[i,l]=N.useState(r===void 0);return N.useEffect(()=>{if(r!==void 0){const d=window.setTimeout(()=>l(!0),r);return()=>window.clearTimeout(d)}},[r]),i&&s.imageLoadingStatus!=="loaded"?c.jsx(R2.span,{...a,ref:t}):null});Mq.displayName=Oq;function jM(e,t){return e?t?(e.src!==t&&(e.src=t),e.complete&&e.naturalWidth>0?"loaded":"loading"):"error":"idle"}function hie(e,{referrerPolicy:t,crossOrigin:n}){const r=cie(),a=N.useRef(null),s=r?(a.current||(a.current=new window.Image),a.current):null,[i,l]=N.useState(()=>jM(s,e));return Jt(()=>{l(jM(s,e))},[s,e]),Jt(()=>{const d=p=>()=>{l(p)};if(!s)return;const f=d("loaded"),h=d("error");return s.addEventListener("load",f),s.addEventListener("error",h),t&&(s.referrerPolicy=t),typeof n=="string"&&(s.crossOrigin=n),()=>{s.removeEventListener("load",f),s.removeEventListener("error",h)}},[s,n,t]),i}var Dq=Aq,Pq=kq,$q=Mq;const O2=N.forwardRef(({className:e,...t},n)=>c.jsx(Dq,{ref:n,className:ye("relative flex h-10 w-10 shrink-0 overflow-hidden rounded-full",e),...t}));O2.displayName=Dq.displayName;const M2=N.forwardRef(({className:e,...t},n)=>c.jsx(Pq,{ref:n,className:ye("aspect-square h-full w-full",e),...t}));M2.displayName=Pq.displayName;const D2=N.forwardRef(({className:e,...t},n)=>c.jsx($q,{ref:n,className:ye("flex h-full w-full items-center justify-center rounded-full bg-muted",e),...t}));D2.displayName=$q.displayName;const pie={trigger:"#f59e0b",api:"#3b82f6",function:"#8b5cf6",data:"#10b981",ai:"#6366f1",python:"#f97316"},mie=({workflow:e})=>c.jsx("div",{className:"relative h-24 w-full overflow-hidden rounded-md bg-muted/30",children:c.jsxs("svg",{width:"100%",height:"100%",viewBox:"0 0 200 100",className:"absolute inset-0",children:[e.nodes.slice(0,5).map((t,n)=>{const r=30+n%3*70,a=30+Math.floor(n/3)*40,s=pie[t.type]??"#99a1b3";return c.jsx("g",{children:c.jsx("rect",{x:r-15,y:a-10,width:30,height:20,rx:4,fill:s,fillOpacity:.3,stroke:s,strokeWidth:1})},t.id)}),e.edges.slice(0,4).map(t=>{const n=e.nodes.findIndex(d=>d.id===t.source),r=e.nodes.findIndex(d=>d.id===t.target);if(n<0||r<0||n>=5||r>=5)return null;const a=30+n%3*70+15,s=30+Math.floor(n/3)*40,i=30+r%3*70-15,l=30+Math.floor(r/3)*40;return c.jsx("path",{d:`M${a},${s} C${a+20},${s} ${i-20},${l} ${i},${l}`,stroke:"#99a1b3",strokeWidth:1,fill:"none"},t.id)})]})}),gie=({workflow:e,isTemplate:t,onOpenWorkflow:n,onUseTemplate:r,onDuplicateWorkflow:a,onExportWorkflow:s,onDeleteWorkflow:i})=>{var d,f,h;const l=new Date(e.updatedAt||e.createdAt).toLocaleDateString();return c.jsxs(At,{className:"overflow-hidden",children:[c.jsxs(Ht,{className:"px-3 pb-2 pt-3",children:[c.jsxs("div",{className:"flex items-start justify-between",children:[c.jsx(Rt,{className:"text-base",children:e.name}),c.jsxs(ul,{children:[c.jsx(dl,{asChild:!0,children:c.jsx(me,{variant:"ghost",size:"icon",className:"h-7 w-7",children:c.jsx(Vf,{className:"h-4 w-4"})})}),c.jsx(Qo,{align:"end",children:t?c.jsxs(c.Fragment,{children:[c.jsxs(Lt,{onSelect:p=>{p.preventDefault(),r(e.id)},children:[c.jsx(Lo,{className:"mr-2 h-4 w-4"}),"Use template"]}),c.jsxs(Lt,{onSelect:p=>{p.preventDefault(),s(e)},children:[c.jsx(Mj,{className:"mr-2 h-4 w-4"}),"Export JSON"]})]}):c.jsxs(c.Fragment,{children:[c.jsxs(Lt,{onSelect:p=>{p.preventDefault(),n(e.id)},children:[c.jsx(Dj,{className:"mr-2 h-4 w-4"}),"Edit"]}),c.jsxs(Lt,{onSelect:p=>{p.preventDefault(),a(e.id)},children:[c.jsx(Lo,{className:"mr-2 h-4 w-4"}),"Duplicate"]}),c.jsxs(Lt,{onSelect:p=>{p.preventDefault(),s(e)},children:[c.jsx(Mj,{className:"mr-2 h-4 w-4"}),"Export JSON"]}),c.jsx(Os,{}),c.jsxs(Lt,{className:"text-red-600",onSelect:p=>{p.preventDefault(),i(e.id,e.name)},children:[c.jsx(Ly,{className:"mr-2 h-4 w-4"}),"Delete"]})]})})]})]}),c.jsx(kt,{className:"line-clamp-1",children:e.description||"No description provided"}),t&&e.sourceExample&&c.jsxs("p",{className:"mt-1 line-clamp-1 text-xs text-muted-foreground/80",children:["Based on ",e.sourceExample]})]}),c.jsxs(Bt,{className:"px-3 pb-2",children:[c.jsx(mie,{workflow:e}),c.jsxs("div",{className:"mt-2 flex flex-wrap gap-1",children:[e.tags.slice(0,2).map(p=>c.jsx(Ue,{variant:"secondary",className:"text-xs",children:p},p)),e.tags.length>2&&c.jsxs(Ue,{variant:"secondary",className:"text-xs",children:["+",e.tags.length-2," more"]})]})]}),c.jsxs(rr,{className:"flex justify-between px-3 pb-3 pt-2 text-xs text-muted-foreground",children:[c.jsxs("div",{className:"flex items-center",children:[c.jsxs(O2,{className:"mr-1 h-5 w-5",children:[c.jsx(M2,{src:e.owner.avatar}),c.jsx(D2,{children:e.owner.name.charAt(0)})]}),c.jsxs("div",{className:"flex items-center gap-1",children:[c.jsx("span",{children:l}),((d=e.lastRun)==null?void 0:d.status)==="success"&&c.jsx(Tz,{className:"h-3 w-3 text-green-500"}),((f=e.lastRun)==null?void 0:f.status)==="error"&&c.jsx($y,{className:"h-3 w-3 text-red-500"}),((h=e.lastRun)==null?void 0:h.status)==="running"&&c.jsx(Bi,{className:"h-3 w-3 animate-pulse text-blue-500"})]})]}),c.jsx("div",{className:"flex gap-1",children:t?c.jsxs(me,{size:"sm",className:"h-7 px-3 text-xs",onClick:()=>r(e.id),children:[c.jsx(Oz,{className:"mr-1 h-3 w-3"}),"Use template"]}):c.jsxs(c.Fragment,{children:[c.jsx(me,{variant:"ghost",size:"icon",className:"h-7 w-7",onClick:()=>Ne({title:"Favorites coming soon",description:`We'll remember ${e.name} as a favorite soon.`}),children:c.jsx(dJ,{className:"h-3 w-3"})}),c.jsx(pn,{to:`/workflow-canvas/${e.id}`,children:c.jsxs(me,{size:"sm",className:"h-7 px-2 text-xs",children:[c.jsx(Dj,{className:"mr-1 h-3 w-3"}),"Edit"]})})]})})]})]})},yie=({selectedTab:e,onSelectedTabChange:t,sortedWorkflows:n,isTemplateView:r,searchQuery:a,onCreateWorkflowRequest:s,onOpenWorkflow:i,onUseTemplate:l,onDuplicateWorkflow:d,onExportWorkflow:f,onDeleteWorkflow:h})=>c.jsxs(Da,{value:e,onValueChange:p=>t(p),className:"px-4",children:[c.jsx("div",{className:"mb-6 flex items-center justify-between",children:c.jsxs(Ls,{children:[c.jsx(St,{value:"all",children:"All"}),c.jsx(St,{value:"favorites",children:"Favorites"}),c.jsx(St,{value:"shared",children:"Shared with me"}),c.jsx(St,{value:"templates",children:"Templates"})]})}),c.jsx($t,{value:e,className:"mt-0",children:n.length===0?c.jsxs("div",{className:"flex flex-col items-center justify-center py-12 text-center",children:[c.jsx("div",{className:"mb-4 rounded-full bg-muted p-4",children:c.jsx(Gf,{className:"h-8 w-8 text-muted-foreground"})}),c.jsx("h3",{className:"mb-2 text-lg font-medium",children:"No workflows found"}),c.jsx("p",{className:"mb-6 max-w-md text-muted-foreground",children:a?`No workflows match your search for "${a}"`:"Get started by creating your first workflow"}),c.jsxs(me,{onClick:s,children:[c.jsx(ll,{className:"mr-2 h-4 w-4"}),"Create Workflow"]})]}):c.jsx("div",{className:"grid grid-cols-1 gap-3 pb-6 md:grid-cols-3 lg:grid-cols-4 xl:grid-cols-5 2xl:grid-cols-6",children:n.map(p=>c.jsx(gie,{workflow:p,isTemplate:r,onOpenWorkflow:i,onUseTemplate:l,onDuplicateWorkflow:d,onExportWorkflow:f,onDeleteWorkflow:h},p.id))})})]}),ml={id:"team-templates",name:"Orcheo Templates",avatar:"https://avatar.vercel.sh/templates"},vie={id:"workflow-quickstart",name:"Canvas Quickstart — Welcome Bot",description:"Greets a new teammate with a PythonCode node and saves the message to the canvas flow.",createdAt:"2024-01-15T10:00:00Z",updatedAt:"2024-03-04T15:30:00Z",sourceExample:"examples/quickstart/canvas_welcome.json",owner:ml,tags:["template","quickstart","canvas"],lastRun:{status:"success",timestamp:"2024-03-05T08:45:00Z",duration:3.1},nodes:[{id:"start",type:"start",position:{x:0,y:0},data:{label:"Start",type:"start",description:"Entry point for the welcome flow."}},{id:"compose-welcome-message",type:"function",position:{x:260,y:0},data:{label:"Compose welcome message",type:"function",description:"PythonCode node returns a templated greeting for the new teammate.",examplePath:"examples/quickstart/canvas_welcome.json"}},{id:"end",type:"end",position:{x:520,y:0},data:{label:"Finish",type:"end",description:"Flow completes after crafting the welcome message."}}],edges:[{id:"edge-start-compose",source:"start",target:"compose-welcome-message"},{id:"edge-compose-end",source:"compose-welcome-message",target:"end"}]},Uo=`def process_data(input_data):
|
|
678
|
+
"""Process incoming workflow data.
|
|
679
|
+
|
|
680
|
+
Args:
|
|
681
|
+
input_data: The dictionary payload provided to this node.
|
|
682
|
+
|
|
683
|
+
Returns:
|
|
684
|
+
A dictionary containing the transformed result that will
|
|
685
|
+
be passed to the next node in the workflow.
|
|
686
|
+
"""
|
|
687
|
+
result = input_data
|
|
688
|
+
|
|
689
|
+
# Example: filter items with value greater than 100
|
|
690
|
+
if isinstance(input_data, dict) and "items" in input_data:
|
|
691
|
+
result = {
|
|
692
|
+
"filtered_items": [
|
|
693
|
+
item for item in input_data["items"]
|
|
694
|
+
if isinstance(item, dict) and item.get("value", 0) > 100
|
|
695
|
+
]
|
|
696
|
+
}
|
|
697
|
+
|
|
698
|
+
return result
|
|
699
|
+
`,xie={id:"workflow-python-hello",name:"Simple Python Task",description:"Runs a standalone PythonCode node and returns a greeting.",createdAt:"2024-01-18T12:00:00Z",updatedAt:"2024-03-10T09:15:00Z",owner:ml,tags:["template","python","utility"],nodes:[{id:"python-start",type:"start",position:{x:0,y:0},data:{label:"Start",type:"start",description:"Kick off the simple Python workflow."}},{id:"python-greet",type:"python",position:{x:260,y:0},data:{label:"Run Python code",type:"python",description:"PythonCode node that returns a hello message.",code:Uo,codeExample:"return {'message': 'Hello from Python!'}"}},{id:"python-end",type:"end",position:{x:520,y:0},data:{label:"Finish",type:"end",description:"Ends after the Python node executes."}}],edges:[{id:"edge-python-start-greet",source:"python-start",target:"python-greet"},{id:"edge-python-greet-end",source:"python-greet",target:"python-end"}]},bie={id:"workflow-feedly-digest",name:"Feedly Digest to Telegram",description:"Captures a Feedly token, fetches unread items, and sends a Telegram digest.",createdAt:"2024-01-22T09:10:00Z",updatedAt:"2024-03-07T12:05:00Z",sourceExample:"examples/feedly_news.py",owner:ml,tags:["template","news","telegram","automation"],lastRun:{status:"success",timestamp:"2024-03-08T05:00:00Z",duration:57.8},nodes:[{id:"feedly-start",type:"start",position:{x:0,y:0},data:{label:"Start",type:"start",description:"Kick off the Feedly news digest workflow."}},{id:"collect-feedly-token",type:"function",position:{x:220,y:0},data:{label:"Collect Feedly token",type:"function",description:"Browser automation retrieves the Feedly developer token.",examplePath:"examples/feedly_news.py"}},{id:"fetch-unread-articles",type:"api",position:{x:440,y:0},data:{label:"Fetch unread articles",type:"api",description:"HTTP request pulls unread articles and formats them for Telegram.",examplePath:"examples/feedly_news.py"}},{id:"send-telegram-digest",type:"api",position:{x:660,y:0},data:{label:"Send Telegram digest",type:"api",description:"MessageTelegram sends the formatted digest to the configured chat.",examplePath:"examples/feedly_news.py"}},{id:"mark-as-read",type:"api",position:{x:660,y:160},data:{label:"Mark entries as read",type:"api",description:"Optional HTTP call updates Feedly with the read status.",isDisabled:!0,examplePath:"examples/feedly_news.py"}},{id:"feedly-end",type:"end",position:{x:880,y:0},data:{label:"Finish",type:"end",description:"Workflow completes after sending notifications."}}],edges:[{id:"edge-start-token",source:"feedly-start",target:"collect-feedly-token"},{id:"edge-token-fetch",source:"collect-feedly-token",target:"fetch-unread-articles"},{id:"edge-fetch-telegram",source:"fetch-unread-articles",target:"send-telegram-digest"},{id:"edge-telegram-end",source:"send-telegram-digest",target:"feedly-end"},{id:"edge-telegram-mark",source:"send-telegram-digest",target:"mark-as-read"},{id:"edge-mark-end",source:"mark-as-read",target:"feedly-end"}]},wie={id:"workflow-slack-broadcast",name:"Slack Channel Broadcast",description:"Posts an announcement to a Slack channel.",createdAt:"2024-02-01T13:20:00Z",updatedAt:"2024-03-02T18:40:00Z",sourceExample:"examples/slack.py",owner:ml,tags:["template","slack","messaging"],nodes:[{id:"slack-start",type:"start",position:{x:0,y:0},data:{label:"Start",type:"start",description:"Begin the Slack announcement workflow."}},{id:"send-slack-message",type:"api",position:{x:260,y:0},data:{label:"Send Slack message",type:"api",description:"Slack node posts the message to the configured channel.",examplePath:"examples/slack.py"}},{id:"slack-end",type:"end",position:{x:520,y:0},data:{label:"Finish",type:"end",description:"Slack announcement has been delivered."}}],edges:[{id:"edge-slack-start-send",source:"slack-start",target:"send-slack-message"},{id:"edge-slack-end",source:"send-slack-message",target:"slack-end"}]},Sie={id:"workflow-rss-monitor",name:"RSS Feed Monitor",description:"Pulls unread entries from multiple RSS feeds.",createdAt:"2024-02-12T07:05:00Z",updatedAt:"2024-03-06T11:20:00Z",sourceExample:"examples/pull_rss_updates.py",owner:ml,tags:["template","rss","monitoring"],nodes:[{id:"rss-start",type:"start",position:{x:0,y:0},data:{label:"Start",type:"start",description:"Begin monitoring configured RSS feeds."}},{id:"rss-fetch",type:"data",position:{x:260,y:0},data:{label:"Fetch RSS updates",type:"data",description:"RSS node retrieves the latest unread entries from the feed list.",examplePath:"examples/pull_rss_updates.py"}},{id:"rss-end",type:"end",position:{x:520,y:0},data:{label:"Finish",type:"end",description:"Results are ready for downstream storage or notifications."}}],edges:[{id:"edge-rss-start-fetch",source:"rss-start",target:"rss-fetch"},{id:"edge-rss-fetch-end",source:"rss-fetch",target:"rss-end"}]},_ie={id:"workflow-mongodb-session",name:"MongoDB Query Session",description:"Demonstrates MongoDB node reuse across runs.",createdAt:"2024-02-18T16:10:00Z",updatedAt:"2024-03-05T19:55:00Z",sourceExample:"examples/mongodb.py",owner:ml,tags:["template","database","storage"],nodes:[{id:"mongodb-start",type:"start",position:{x:0,y:0},data:{label:"Start",type:"start",description:"Start the MongoDB query workflow."}},{id:"mongodb-query",type:"data",position:{x:260,y:0},data:{label:"Query MongoDB collection",type:"data",description:"MongoDB node performs a find operation using the configured session.",examplePath:"examples/mongodb.py"}},{id:"mongodb-end",type:"end",position:{x:520,y:0},data:{label:"Finish",type:"end",description:"Workflow ends after retrieving the MongoDB results."}}],edges:[{id:"edge-mongodb-start-query",source:"mongodb-start",target:"mongodb-query"},{id:"edge-mongodb-query-end",source:"mongodb-query",target:"mongodb-end"}]},Nie={id:"workflow-telegram-broadcast",name:"Python to Telegram Broadcast",description:"Generates a message in Python and forwards it to Telegram.",createdAt:"2024-02-24T21:00:00Z",updatedAt:"2024-03-08T09:30:00Z",sourceExample:"examples/telegram_example.py",owner:ml,tags:["template","telegram","python"],nodes:[{id:"telegram-start",type:"start",position:{x:0,y:0},data:{label:"Start",type:"start",description:"Entry point for the Telegram broadcast."}},{id:"compose-telegram-message",type:"function",position:{x:220,y:0},data:{label:"Compose message with Python",type:"function",description:"PythonCode node prepares the message payload for Telegram.",examplePath:"examples/telegram_example.py"}},{id:"send-telegram-message",type:"api",position:{x:440,y:0},data:{label:"Send Telegram message",type:"api",description:"MessageTelegram node sends the composed message to the target chat.",examplePath:"examples/telegram_example.py"}},{id:"telegram-end",type:"end",position:{x:660,y:0},data:{label:"Finish",type:"end",description:"Broadcast completed successfully."}}],edges:[{id:"edge-telegram-start-compose",source:"telegram-start",target:"compose-telegram-message"},{id:"edge-telegram-compose-send",source:"compose-telegram-message",target:"send-telegram-message"},{id:"edge-telegram-send-end",source:"send-telegram-message",target:"telegram-end"}]},fv=[vie,xie,bie,wie,Sie,_ie,Nie],Nc=e=>({id:e.id,type:e.type,position:e.position,data:e.data}),jc=e=>({id:e.id,source:e.source,target:e.target,sourceHandle:e.sourceHandle,targetHandle:e.targetHandle,label:e.label,type:e.type}),jie=(e,t)=>JSON.stringify(Nc(e))===JSON.stringify(Nc(t)),Cie=(e,t)=>JSON.stringify(jc(e))===JSON.stringify(jc(t)),fw=e=>{const{label:t,status:n,description:r}=e.data??{};return[t,n,r].filter(Boolean).join(" · ")},Iq=(e,t)=>{const n=[];e.name!==t.name&&n.push({id:`workflow-name-${t.name}`,type:"modified",entity:"workflow",name:"Workflow name",before:e.name,after:t.name}),(e.description??"")!==(t.description??"")&&n.push({id:`workflow-description-${t.name}`,type:"modified",entity:"workflow",name:"Description",before:e.description??"",after:t.description??""});const r=new Map(e.nodes.map(d=>[d.id,d])),a=new Map(t.nodes.map(d=>[d.id,d]));t.nodes.forEach(d=>{var h,p;const f=r.get(d.id);if(!f){n.push({id:`node-added-${d.id}`,type:"added",entity:"node",name:((h=d.data)==null?void 0:h.label)??d.id,detail:fw(d),after:Nc(d)});return}jie(f,d)||n.push({id:`node-modified-${d.id}`,type:"modified",entity:"node",name:((p=d.data)==null?void 0:p.label)??d.id,detail:fw(d),before:Nc(f),after:Nc(d)})}),e.nodes.forEach(d=>{var f;a.has(d.id)||n.push({id:`node-removed-${d.id}`,type:"removed",entity:"node",name:((f=d.data)==null?void 0:f.label)??d.id,detail:fw(d),before:Nc(d)})});const s=new Map(e.edges.map(d=>[d.id,d])),i=new Map(t.edges.map(d=>[d.id,d]));return t.edges.forEach(d=>{const f=s.get(d.id);if(!f){n.push({id:`edge-added-${d.id}`,type:"added",entity:"edge",name:`${d.source} → ${d.target}`,after:jc(d)});return}Cie(f,d)||n.push({id:`edge-modified-${d.id}`,type:"modified",entity:"edge",name:`${d.source} → ${d.target}`,before:jc(f),after:jc(d)})}),e.edges.forEach(d=>{i.has(d.id)||n.push({id:`edge-removed-${d.id}`,type:"removed",entity:"edge",name:`${d.source} → ${d.target}`,before:jc(d)})}),{summary:n.reduce((d,f)=>(f.type==="added"?d.added+=1:f.type==="removed"?d.removed+=1:f.type==="modified"&&(d.modified+=1),d),{added:0,removed:0,modified:0}),entries:n}};var iz;const hm=((iz=fv[0])==null?void 0:iz.owner)??{id:"canvas-owner",name:"Canvas Author",avatar:"https://avatar.vercel.sh/orcheo"},Lq="canvas-app",Rg={added:0,removed:0,modified:0},vf="orcheo:workflows-updated",eC=e=>Array.isArray(e)?e:[],hv=e=>e.map(t=>({...t,position:{...t.position},data:{...t.data}})),pv=e=>e.map(t=>({...t})),Mc=(e,t)=>({name:e,description:t,nodes:[],edges:[]}),Eie=e=>`v${e.toString().padStart(2,"0")}`,zq=e=>e?{...hm,id:e||hm.id,name:e||hm.name}:{...hm},Tie=e=>e.map(t=>({id:t.id,type:t.type,position:t.position,data:t.data})),Aie=e=>e.map(t=>({id:t.id,source:t.source,target:t.target,sourceHandle:t.sourceHandle,targetHandle:t.targetHandle,label:t.label,type:t.type})),Rie=(e,t,n)=>{if(!e||typeof e!="object")return{snapshot:Mc(t,n),summary:{...Rg}};const r=e.canvas;if(!r||typeof r!="object")return{snapshot:Mc(t,n),summary:{...Rg}};const a=r,s=a.snapshot,i=a.summary,l=a.message,d=a.canvasToGraph,f=a.graphToCanvas,h=s?{name:typeof s.name=="string"?s.name:t,description:typeof s.description=="string"?s.description:n,nodes:eC(s.nodes),edges:eC(s.edges)}:Mc(t,n),p=i?{added:i.added??0,removed:i.removed??0,modified:i.modified??0}:{...Rg};return{snapshot:h,summary:p,message:l,canvasToGraph:d,graphToCanvas:f}},kie=(e,t,n)=>{const r=Rie(e.metadata,t,n??void 0),a=r.message??e.notes??`Updated from canvas on ${new Date(e.created_at).toLocaleString()}`;return{id:e.id,version:Eie(e.version),versionNumber:e.version,timestamp:e.created_at,message:a,author:zq(e.created_by),summary:r.summary??{...Rg},snapshot:r.snapshot??Mc(t,n),graphToCanvas:r.graphToCanvas}},qq=(e,t)=>{var a;const n=t.map(s=>kie(s,e.name,e.description??void 0)).slice(-20),r=((a=n.at(-1))==null?void 0:a.snapshot)??Mc(e.name,e.description??void 0);return{id:e.id,name:e.name,description:e.description??void 0,createdAt:e.created_at,updatedAt:e.updated_at,owner:zq(void 0),tags:eC(e.tags),nodes:hv(r.nodes),edges:pv(r.edges),versions:n,sourceExample:void 0,lastRun:void 0,isArchived:e.is_archived}},Zi="/api/workflows",Oie={Accept:"application/json","Content-Type":"application/json"};class mv extends Error{constructor(n,r){super(n);ft(this,"status");this.name="ApiRequestError",this.status=r}}const CM=async e=>{try{return await e.text()}catch{return""}},Qi=async(e,t={})=>{const n=t.expectJson??!0,r=gn(e),a=await fetch(r,{...t,headers:t.body?Oie:t.headers});if(!a.ok){const i=await CM(a)||a.statusText;throw new mv(i,a.status)}if(!n||a.status===204)return;const s=await CM(a);if(s)return JSON.parse(s)},Fq=async e=>{try{return await Qi(`${Zi}/${e}`)}catch(t){if(t instanceof mv&&(t.status===404||t.status===410))return;throw t}},Uq=async e=>{try{return await Qi(`${Zi}/${e}/versions`)}catch(t){if(t instanceof mv&&(t.status===404||t.status===410))return[];throw t}},Mie=async(e,t)=>e.id?(await Qi(`${Zi}/${e.id}`,{method:"PUT",body:JSON.stringify({name:e.name,description:e.description,tags:e.tags??[],actor:t})}),e.id):(await Qi(Zi,{method:"POST",body:JSON.stringify({name:e.name,description:e.description,tags:e.tags??[],actor:t})})).id,Aa=e=>{if(typeof e!="object"||e===null||Array.isArray(e))return!1;const t=Object.getPrototypeOf(e);return t===null||t===Object.prototype},EM=e=>Aa(e)?Object.entries(e).reduce((t,[n,r])=>typeof n!="string"?t:typeof r=="string"?(t[n]=r,t):((typeof r=="number"||typeof r=="boolean")&&(t[n]=String(r)),t),{}):{},Die=(e,t)=>e.trim().toLowerCase().replace(/[^a-z0-9]+/g,"-").replace(/^-+|-+$/g,"").replace(/-{2,}/g,"-")||t,Pie=(e,t)=>{if(!t.has(e))return t.add(e),e;let n=2;for(;t.has(`${e}-${n}`);)n+=1;const r=`${e}-${n}`;return t.add(r),r},$ie=e=>typeof e=="string"&&e.includes("{{"),Iie=async(e,t)=>{var s;const n={},r={},a=new Set;for(let i=0;i<e.length;i+=1){const l=e[i],d=String(((s=l.data)==null?void 0:s.label)??l.id??`node-${i+1}`),f=Die(d,`node-${i+1}`),h=Pie(f,a);n[l.id]=h,r[h]=l.id,await t()}return{canvasToGraph:n,graphToCanvas:r}},Lie="return state",zie=200,qie=50,Fie=new Set(["IfElseNode"]),Uie=async()=>new Promise(e=>{setTimeout(e,0)}),Hie=e=>{const t=e>zie;let n=0;return{maybeYield:async()=>{t&&(n+=1,n%qie===0&&await Uie())}}},Bie=e=>{var r;const t=typeof((r=e.data)==null?void 0:r.type)=="string"?e.data.type.toLowerCase():void 0,n=typeof e.type=="string"?e.type:void 0;return!(t==="annotation"||t==="start"||t==="end"||n==="stickyNote")},Vie=e=>e.filter(Bie),Wie=e=>e.reduce((t,n)=>{var a;const r=(a=n.data)==null?void 0:a.variables;return Array.isArray(r)?t+r.length:t},0),Gie=({node:e,backendType:t,baseConfig:n})=>{const r=e.data??{},a={...n};if(t==="IfElseNode"){const s=Array.isArray(r==null?void 0:r.conditions)?r.conditions:[],i=s.length>0?s:[{left:null,operator:"equals",right:null,caseSensitive:!0}];a.conditions=i.map((l,d)=>({left:(l==null?void 0:l.left)??null,operator:typeof(l==null?void 0:l.operator)=="string"?l.operator:"equals",right:(l==null?void 0:l.right)??null,case_sensitive:typeof(l==null?void 0:l.caseSensitive)=="boolean"?l.caseSensitive:!0,id:typeof(l==null?void 0:l.id)=="string"?l.id:`condition-${d+1}`})),a.condition_logic=typeof(r==null?void 0:r.conditionLogic)=="string"?r.conditionLogic:"and"}return a},Kie=({node:e,data:t,nodeConfig:n,canvasToGraph:r,branchPathByCanvasId:a,defaultBranchKeyByCanvasId:s})=>{const i=Array.isArray(t==null?void 0:t.cases)?t.cases:[],l=i.length>0?i:[{label:"Case 1",match:null,branchKey:"case_1"}];n.value=(t==null?void 0:t.value)??null,n.case_sensitive=(t==null?void 0:t.caseSensitive)??!0,n.cases=l.map((f,h)=>{const p=typeof(f==null?void 0:f.branchKey)=="string"&&f.branchKey.trim().length>0?f.branchKey.trim():`case_${h+1}`;return{label:typeof(f==null?void 0:f.label)=="string"?f.label:void 0,match:(f==null?void 0:f.match)??null,branch_key:p,case_sensitive:typeof(f==null?void 0:f.caseSensitive)=="boolean"?f.caseSensitive:void 0}});const d=typeof(t==null?void 0:t.defaultBranchKey)=="string"&&t.defaultBranchKey.trim().length>0?t.defaultBranchKey.trim():"default";n.default_branch_key=d,s[e.id]=d,a[e.id]=`results.${r[e.id]}.branch`},Yie=({node:e,data:t,nodeConfig:n,canvasToGraph:r,branchPathByCanvasId:a})=>{const s=Array.isArray(t==null?void 0:t.conditions)?t.conditions:[],i=s.length>0?s:[{left:null,operator:"less_than",right:null,caseSensitive:!0}];n.conditions=i.map((l,d)=>({left:(l==null?void 0:l.left)??null,operator:typeof(l==null?void 0:l.operator)=="string"?l.operator:"less_than",right:(l==null?void 0:l.right)??null,case_sensitive:typeof(l==null?void 0:l.caseSensitive)=="boolean"?l.caseSensitive:!0,id:typeof(l==null?void 0:l.id)=="string"?l.id:`condition-${d+1}`})),n.condition_logic=typeof(t==null?void 0:t.conditionLogic)=="string"?t.conditionLogic:"and",typeof(t==null?void 0:t.maxIterations)=="number"&&Number.isFinite(t.maxIterations)&&(n.max_iterations=t.maxIterations),a[e.id]=`results.${r[e.id]}.branch`},Xie=async(e,t,n,r)=>{const a=Array.isArray(e==null?void 0:e.variables)?e.variables:[],s={};for(const i of a){if(!(i!=null&&i.name)){await r();continue}const l=String(i.name),d=typeof i.valueType=="string"?i.valueType:"string";let f=i.value??null;const h=$ie(f);if(f!=null)switch(d){case"number":if(typeof f=="number"||h)break;{const p=Number(f);if(Number.isFinite(p))f=p;else{const g=`Variable "${l}" must be numeric. Keeping original value "${f}".`;n.push(g),console.warn(g)}}break;case"boolean":if(typeof f=="boolean"||h)break;typeof f=="string"?f=f.trim().toLowerCase()==="true":f=f===1;break;case"object":if(h)break;if(typeof f=="string")try{const p=JSON.parse(f);if(Aa(p))f=p;else{const g=`Variable "${l}" must be a JSON object. Using an empty object instead.`;n.push(g),console.warn(g),f={}}}catch(p){const g=`Variable "${l}" contains invalid JSON. Using an empty object instead.`;n.push(g),console.warn(g,p),f={}}else if(!Aa(f)){const p=`Variable "${l}" must be an object value. Using an empty object instead.`;n.push(p),console.warn(p),f={}}break;case"array":if(h)break;if(typeof f=="string")try{const p=JSON.parse(f);if(Array.isArray(p))f=p;else{const g=`Variable "${l}" must be a JSON array. Using an empty array instead.`;n.push(g),console.warn(g),f=[]}}catch(p){const g=`Variable "${l}" contains invalid JSON. Using an empty array instead.`;n.push(g),console.warn(g,p),f=[]}else if(!Array.isArray(f)){const p=`Variable "${l}" must be an array value. Using an empty array instead.`;n.push(p),console.warn(p),f=[]}break}s[l]=f,await r()}t.variables=s},Zie=(e,t)=>{const n=e==null?void 0:e.durationSeconds,r=typeof n=="number"?n:Number(n??0);t.duration_seconds=Number.isFinite(r)?r:0},Qie=(e,t)=>{typeof(e==null?void 0:e.database)=="string"&&e.database.length>0&&(t.database=e.database),typeof(e==null?void 0:e.collection)=="string"&&e.collection.length>0&&(t.collection=e.collection),t.operation=typeof(e==null?void 0:e.operation)=="string"&&e.operation.length>0?e.operation:"find",t.query=Aa(e==null?void 0:e.query)?e.query:{}},Jie=(e,t)=>{typeof(e==null?void 0:e.tool_name)=="string"&&e.tool_name.length>0&&(t.tool_name=e.tool_name),t.kwargs=Aa(e==null?void 0:e.kwargs)?e.kwargs:{}},ele=(e,t)=>{typeof(e==null?void 0:e.token)=="string"&&e.token.length>0&&(t.token=e.token),typeof(e==null?void 0:e.chat_id)=="string"&&e.chat_id.length>0&&(t.chat_id=e.chat_id),typeof(e==null?void 0:e.message)=="string"&&e.message.length>0&&(t.message=e.message),typeof(e==null?void 0:e.parse_mode)=="string"&&e.parse_mode.length>0&&(t.parse_mode=e.parse_mode)},tle=(e,t)=>{t.expression=typeof(e==null?void 0:e.expression)=="string"&&e.expression.length>0?e.expression:"0 * * * *",t.timezone=typeof(e==null?void 0:e.timezone)=="string"&&e.timezone.length>0?e.timezone:"UTC",t.allow_overlapping=!!(e!=null&&e.allow_overlapping),typeof(e==null?void 0:e.start_at)=="string"&&e.start_at.length>0&&(t.start_at=e.start_at),typeof(e==null?void 0:e.end_at)=="string"&&e.end_at.length>0&&(t.end_at=e.end_at)},nle=(e,t)=>{t.label=typeof(e==null?void 0:e.label)=="string"&&e.label.length>0?e.label:"manual",t.allowed_actors=Array.isArray(e==null?void 0:e.allowed_actors)?e.allowed_actors:[],t.require_comment=!!(e!=null&&e.require_comment),t.default_payload=Aa(e==null?void 0:e.default_payload)?e.default_payload:{};const n=e==null?void 0:e.cooldown_seconds,r=typeof n=="number"?n:Number(n??0);t.cooldown_seconds=Number.isFinite(r)?r:0},rle=(e,t)=>{t.url=typeof(e==null?void 0:e.url)=="string"&&e.url.length>0?e.url:"",t.method=typeof(e==null?void 0:e.method)=="string"&&e.method.length>0?e.method:"GET",t.headers=Aa(e==null?void 0:e.headers)?e.headers:{},t.query_params=Aa(e==null?void 0:e.query_params)?e.query_params:{},Aa(e==null?void 0:e.body)&&(t.body=e.body);const n=e==null?void 0:e.interval_seconds,r=typeof n=="number"?n:Number(n??0);t.interval_seconds=Number.isFinite(r)?r:300;const a=e==null?void 0:e.timeout_seconds,s=typeof a=="number"?a:Number(a??0);t.timeout_seconds=Number.isFinite(s)?s:30,t.verify_tls=(e==null?void 0:e.verify_tls)!==!1,t.follow_redirects=!!(e!=null&&e.follow_redirects),typeof(e==null?void 0:e.deduplicate_on)=="string"&&e.deduplicate_on.length>0&&(t.deduplicate_on=e.deduplicate_on)},ale=(e,t)=>{const r=(Array.isArray(e==null?void 0:e.allowed_methods)?e.allowed_methods:[]).filter(s=>typeof s=="string"&&s.trim().length>0).map(s=>s.trim().toUpperCase());t.allowed_methods=r.length>0?r:["POST"],t.required_headers=EM(e==null?void 0:e.required_headers),t.required_query_params=EM(e==null?void 0:e.required_query_params),typeof(e==null?void 0:e.shared_secret_header)=="string"&&e.shared_secret_header.length>0&&(t.shared_secret_header=e.shared_secret_header),typeof(e==null?void 0:e.shared_secret)=="string"&&e.shared_secret.length>0&&(t.shared_secret=e.shared_secret);const a=e==null?void 0:e.rate_limit;if(Aa(a)){const s=a.limit,i=a.interval_seconds,l=typeof s=="number"?s:Number(s??NaN),d=typeof i=="number"?i:Number(i??NaN);Number.isFinite(l)&&Number.isFinite(d)&&(t.rate_limit={limit:Math.max(1,Math.trunc(l)),interval_seconds:Math.max(1,Math.trunc(d))})}},sle=e=>{const t=e.data??{},n=t==null?void 0:t.backendType;if(typeof n=="string"&&n.trim().length>0)return n.trim()},ole=async(e,t)=>{var g;const{canvasToGraph:n,maybeYield:r,warnings:a}=t,s=[{name:"START",type:"START"}],i=[],l=[],d={},f={},h={},p={};for(let y=0;y<e.length;y+=1){const S=e[y],w=S.data??{},x=(typeof(w==null?void 0:w.type)=="string"?w.type.toLowerCase():void 0)==="python"?Uo:Lie,_=typeof(w==null?void 0:w.code)=="string"&&w.code.length>0?w.code:x,j=sle(S)??"PythonCode",C=n[S.id],T={name:C,type:j,display_name:((g=S.data)==null?void 0:g.label)??S.id??`Node ${y+1}`,canvas_id:S.id};if(Fie.has(j)){h[S.id]=C,p[S.id]=j;const k=Gie({node:S,backendType:j,baseConfig:T});i.push(k),await r();continue}const A={...T};j==="PythonCode"&&(A.code=_),j==="SwitchNode"&&Kie({node:S,data:w,nodeConfig:A,canvasToGraph:n,branchPathByCanvasId:d,defaultBranchKeyByCanvasId:f}),j==="WhileNode"&&Yie({node:S,data:w,nodeConfig:A,canvasToGraph:n,branchPathByCanvasId:d}),j==="SetVariableNode"&&await Xie(w,A,a,r),j==="DelayNode"&&Zie(w,A),j==="MongoDBNode"&&Qie(w,A),j==="SlackNode"&&Jie(w,A),j==="MessageTelegram"&&ele(w,A),j==="CronTriggerNode"&&tle(w,A),j==="ManualTriggerNode"&&nle(w,A),j==="HttpPollingTriggerNode"&&rle(w,A),j==="WebhookTriggerNode"&&ale(w,A),s.push(A),l.push(S),await r()}return{graphNodes:s,graphEdgeNodes:i,executableNodes:l,branchPathByCanvasId:d,defaultBranchKeyByCanvasId:f,decisionNodeNameByCanvasId:h,decisionNodeTypeByCanvasId:p}},ile=async({edges:e,canvasToGraph:t,branchPathByCanvasId:n,defaultBranchKeyByCanvasId:r,decisionNodeNameByCanvasId:a,decisionNodeTypeByCanvasId:s,maybeYield:i})=>{const l=[],d=[],f={},h={},p={};for(const g of e){const y=g.source,S=g.target,w=t[y],b=t[S];if(!w||!b){await i();continue}if(a[S]){const C=h[S]??new Set;C.add(w),h[S]=C,await i();continue}const x=typeof g.sourceHandle=="string"&&g.sourceHandle.length>0?g.sourceHandle.trim():void 0;if(a[y]){const C=p[y]??{mapping:{},defaultTarget:void 0},T=s[y],A=x&&T==="IfElseNode"?x.toLowerCase():x;A?C.mapping[A]=b:C.defaultTarget||(C.defaultTarget=b),p[y]=C,await i();continue}const _=n[y],j=r[y];if(_){const C=f[w]??{path:_,mapping:{},defaultTarget:void 0};x&&j&&x===j?C.defaultTarget=b:x?C.mapping[x]=b:!x&&j&&(C.defaultTarget=b),f[w]=C,await i();continue}l.push({source:w,target:b}),await i()}for(const[g,y]of Object.entries(f)){if(Object.keys(y.mapping).length===0&&!y.defaultTarget){await i();continue}const S={source:g,path:y.path,mapping:y.mapping};y.defaultTarget&&(S.default=y.defaultTarget),d.push(S),await i()}for(const[g,y]of Object.entries(h)){const S=a[g],w=p[g];if(!S||!w){await i();continue}if(Object.keys(w.mapping).length===0&&!w.defaultTarget){await i();continue}const b=y.size>0?Array.from(y):[S];for(const x of b){const _={source:x,path:S,mapping:{...w.mapping}};w.defaultTarget&&(_.default=w.defaultTarget),d.push(_),await i()}}return{graphEdges:l,conditionalEdges:d}},lle=async({executableNodes:e,canvasToGraph:t,graphEdges:n,conditionalEdges:r,maybeYield:a})=>{if(e.length===0){n.push({source:"START",target:"END"});return}const s=new Set(n.map(l=>l.target)),i=new Set(n.map(l=>l.source));for(const l of r)Object.values(l.mapping).forEach(d=>s.add(d)),l.default&&s.add(l.default),i.add(l.source),await a();for(const l of e){const d=t[l.id];s.has(d)||n.push({source:"START",target:d}),i.has(d)||n.push({source:d,target:"END"}),await a()}},Hq=async(e,t)=>{const n=Vie(e),r=Wie(n),a=n.length*3+t.length+r,{maybeYield:s}=Hie(a),i=[],{canvasToGraph:l,graphToCanvas:d}=await Iie(n,s),f=await ole(n,{canvasToGraph:l,maybeYield:s,warnings:i});f.graphNodes.push({name:"END",type:"END"});const{graphEdges:h,conditionalEdges:p}=await ile({edges:t,canvasToGraph:l,branchPathByCanvasId:f.branchPathByCanvasId,defaultBranchKeyByCanvasId:f.defaultBranchKeyByCanvasId,decisionNodeNameByCanvasId:f.decisionNodeNameByCanvasId,decisionNodeTypeByCanvasId:f.decisionNodeTypeByCanvasId,maybeYield:s});await lle({executableNodes:f.executableNodes,canvasToGraph:l,graphEdges:h,conditionalEdges:p,maybeYield:s});const g={nodes:f.graphNodes,edges:h};return f.graphEdgeNodes.length>0&&(g.edge_nodes=f.graphEdgeNodes),p.length>0&&(g.conditional_edges=p),{config:g,canvasToGraph:l,graphToCanvas:d,warnings:i}},cle=()=>`Updated from canvas on ${new Date().toLocaleString()}`,tC=async e=>{const[t,n]=await Promise.all([Fq(e),Uq(e)]);if(t)return qq(t,n)},ule=async(e,t,n,r,a,s)=>{const i=Tie(n.nodes),l=Aie(n.edges),{config:d,canvasToGraph:f,graphToCanvas:h,warnings:p}=await Hq(i,l);p.length>0&&p.forEach(g=>console.warn(g)),await Qi(`${Zi}/${e}/versions`,{method:"POST",body:JSON.stringify({graph:d,metadata:{canvas:{snapshot:n,summary:r.summary,entries:r.entries,message:s,canvasToGraph:f,graphToCanvas:h,tags:t.tags??[]}},notes:s,created_by:a})})},Bq=()=>{typeof window>"u"||window.dispatchEvent(new CustomEvent(vf))},dle=async()=>{const t=(await Qi(Zi)).filter(r=>r.is_archived!==!0);return(await Promise.all(t.map(async r=>{const a=await Uq(r.id);return qq(r,a)}))).filter(r=>r.isArchived!==!0)},gv=async e=>tC(e),yv=async(e,t)=>{var h;const n=(t==null?void 0:t.actor)??Lq,r=e.id?await tC(e.id):void 0,a=((h=r==null?void 0:r.versions.at(-1))==null?void 0:h.snapshot)??Mc((r==null?void 0:r.name)??e.name,r==null?void 0:r.description),s={name:e.name,description:e.description,nodes:hv(e.nodes),edges:pv(e.edges)},i=Iq(a,s),l=!r||r.versions.length===0||i.entries.length>0,d=await Mie(e,n);if(l){const p=(t==null?void 0:t.versionMessage)??cle();await ule(d,e,s,i,n,p)}const f=await tC(d);if(!f)throw new Error("Failed to load persisted workflow");return Bq(),f},fle=async e=>yv(e,{versionMessage:"Initial draft"}),hle=async(e,t)=>{const n=fv.find(r=>r.id===e);if(n)return yv({name:`${n.name} Copy`,description:n.description,tags:n.tags.filter(r=>r!=="template"),nodes:hv(n.nodes),edges:pv(n.edges)})},ple=async e=>{var r;const t=await gv(e);if(!t)return;const n=((r=t.versions.at(-1))==null?void 0:r.snapshot)??{name:t.name,description:t.description,nodes:t.nodes,edges:t.edges};return yv({name:`${t.name} Copy`,description:t.description,tags:t.tags,nodes:hv(n.nodes),edges:pv(n.edges)},{versionMessage:`Duplicated from ${t.name}`})},mle=async(e,t)=>{var r;const n=await gv(e);return(r=n==null?void 0:n.versions.find(a=>a.id===t))==null?void 0:r.snapshot},gle=async(e,t=Lq)=>{await Qi(`${Zi}/${e}?actor=${encodeURIComponent(t)}`,{method:"DELETE",expectJson:!1}),Bq()},yle=e=>{const t=My(),n=N.useCallback(h=>{t(`/workflow-canvas/${h}`)},[t]),r=N.useCallback(()=>{Ne({title:"Folder creation coming soon",description:e.newFolderName?`We'll create "${e.newFolderName}" once persistence is wired up.`:"Folder creation will be available in a future update."}),e.setNewFolderName(""),e.setShowNewFolderDialog(!1)},[e]),a=N.useCallback(async()=>{const h=e.newWorkflowName.trim()||"Untitled Workflow";try{const p=await fle({name:h,description:"",tags:["draft"],nodes:[],edges:[]});e.setNewWorkflowName(""),e.setShowNewWorkflowDialog(!1),e.setSelectedTab("all"),Ne({title:"Workflow created",description:`"${p.name}" is ready to edit.`}),n(p.id)}catch(p){Ne({title:"Failed to create workflow",description:p instanceof Error?p.message:"Unknown error occurred",variant:"destructive"})}},[n,e]),s=N.useCallback(async h=>{try{const p=await hle(h);if(!p){Ne({title:"Template unavailable",description:"We couldn't find that template. Please try another.",variant:"destructive"});return}e.setSelectedTab("all"),Ne({title:"Template copied",description:`"${p.name}" has been added to your workspace.`}),n(p.id)}catch(p){Ne({title:"Failed to create workflow from template",description:p instanceof Error?p.message:"Unknown error occurred",variant:"destructive"})}},[n,e]),i=N.useCallback(async h=>{try{const p=await ple(h);if(!p){Ne({title:"Duplicate failed",description:"We couldn't duplicate this workflow. Please try again.",variant:"destructive"});return}e.setSelectedTab("all"),Ne({title:"Workflow duplicated",description:`"${p.name}" is ready to edit.`}),n(p.id)}catch(p){Ne({title:"Failed to duplicate workflow",description:p instanceof Error?p.message:"Unknown error occurred",variant:"destructive"})}},[n,e]),l=N.useCallback(h=>{try{const p={name:h.name,description:h.description,nodes:h.nodes,edges:h.edges},g=JSON.stringify(p,null,2),y=new Blob([g],{type:"application/json"}),S=URL.createObjectURL(y),w=document.createElement("a");w.href=S,w.download=`${h.name.replace(/\s+/g,"-").toLowerCase()||"workflow"}.json`,w.click(),URL.revokeObjectURL(S),Ne({title:"Workflow exported",description:`Downloaded ${h.name}.json`})}catch(p){Ne({title:"Export failed",description:p instanceof Error?p.message:"Unable to export workflow.",variant:"destructive"})}},[]),d=N.useCallback(async(h,p)=>{try{await gle(h),Ne({title:"Workflow deleted",description:`"${p}" has been removed from your workspace.`})}catch(g){Ne({title:"Failed to delete workflow",description:g instanceof Error?g.message:"Unknown error occurred",variant:"destructive"})}},[]),f=N.useCallback(()=>{Ne({title:"Filters applied",description:"Filter changes will affect the gallery once data wiring is complete."}),e.setShowFilterPopover(!1)},[e]);return{handleOpenWorkflow:n,handleCreateFolder:r,handleCreateWorkflow:a,handleUseTemplate:s,handleDuplicateWorkflow:i,handleExportWorkflow:l,handleDeleteWorkflow:d,handleApplyFilters:f}},vle={owner:{me:!0,shared:!0},status:{active:!0,draft:!0,archived:!1},tags:{favorite:!1,template:!1,production:!1,development:!1}},xle=()=>{var M;const[e,t]=N.useState([]),[n,r]=N.useState(""),[a,s]=N.useState("all"),[i,l]=N.useState("updated"),[d,f]=N.useState(""),[h,p]=N.useState(""),[g,y]=N.useState(!1),[S,w]=N.useState(!1),[b,x]=N.useState(!1),[_,j]=N.useState(vle);N.useEffect(()=>{let z=!0;const L=async()=>{try{const F=await dle();z&&t(F)}catch(F){if(!z)return;console.error("Failed to load workflows",F),Ne({title:"Unable to load workflows",description:F instanceof Error?F.message:"Unknown error occurred",variant:"destructive"})}};L();const U=typeof window<"u"?window:void 0;if(U){const F=()=>{L()};return U.addEventListener(vf,F),()=>{z=!1,U.removeEventListener(vf,F)}}return()=>{z=!1}},[]);const C=N.useMemo(()=>fv,[]),T=((M=C[0])==null?void 0:M.owner.id)??"user-1",A=a==="templates",k=N.useMemo(()=>{const z=A?C:e,L=n.toLowerCase();return z.filter(U=>{var q;return U.name.toLowerCase().includes(L)||U.description&&U.description.toLowerCase().includes(L)?A?U.tags.includes("template"):a==="favorites"?U.tags.includes("favorite"):a==="shared"?((q=U.owner)==null?void 0:q.id)!==T:a==="templates"?U.tags.includes("template"):!0:!1})},[T,A,n,a,C,e]),O=N.useMemo(()=>[...k].sort((z,L)=>i==="name"?z.name.localeCompare(L.name):i==="updated"?new Date(L.updatedAt).getTime()-new Date(z.updatedAt).getTime():i==="created"?new Date(L.createdAt).getTime()-new Date(z.createdAt).getTime():0),[k,i]);return{searchQuery:n,setSearchQuery:r,selectedTab:a,setSelectedTab:s,sortBy:i,setSortBy:l,newFolderName:d,setNewFolderName:f,newWorkflowName:h,setNewWorkflowName:p,showNewFolderDialog:g,setShowNewFolderDialog:y,showNewWorkflowDialog:S,setShowNewWorkflowDialog:w,showFilterPopover:b,setShowFilterPopover:x,filters:_,setFilters:j,sortedWorkflows:O,isTemplateView:A,templates:C}},ble=()=>{const e=xle(),t=yle({newFolderName:e.newFolderName,setNewFolderName:e.setNewFolderName,newWorkflowName:e.newWorkflowName,setNewWorkflowName:e.setNewWorkflowName,setSelectedTab:e.setSelectedTab,setShowNewFolderDialog:e.setShowNewFolderDialog,setShowNewWorkflowDialog:e.setShowNewWorkflowDialog,setShowFilterPopover:e.setShowFilterPopover});return{...e,...t}};function wle(){const{credentials:e,isLoading:t,onAddCredential:n,onDeleteCredential:r}=lv(),{searchQuery:a,setSearchQuery:s,sortBy:i,setSortBy:l,filters:d,setFilters:f,showFilterPopover:h,setShowFilterPopover:p,showNewFolderDialog:g,setShowNewFolderDialog:y,newFolderName:S,setNewFolderName:w,showNewWorkflowDialog:b,setShowNewWorkflowDialog:x,newWorkflowName:_,setNewWorkflowName:j,selectedTab:C,setSelectedTab:T,sortedWorkflows:A,isTemplateView:k,handleCreateFolder:O,handleCreateWorkflow:M,handleUseTemplate:z,handleDuplicateWorkflow:L,handleExportWorkflow:U,handleDeleteWorkflow:F,handleApplyFilters:q,handleOpenWorkflow:V}=ble();return c.jsxs("div",{className:"flex h-screen flex-col",children:[c.jsx(sh,{credentials:e,isCredentialsLoading:t,onAddCredential:n,onDeleteCredential:r}),c.jsx("main",{className:"flex-1 overflow-auto",children:c.jsx("div",{className:"h-full",children:c.jsx("div",{className:"flex h-[calc(100%-80px)] flex-col",children:c.jsxs("div",{className:"flex-1 overflow-auto",children:[c.jsx(tie,{searchQuery:a,onSearchQueryChange:s,sortBy:i,onSortChange:l,filters:d,onFiltersChange:f,showFilterPopover:h,onFilterPopoverChange:p,showNewFolderDialog:g,onNewFolderDialogChange:y,newFolderName:S,onFolderNameChange:w,onCreateFolder:O,showNewWorkflowDialog:b,onNewWorkflowDialogChange:x,newWorkflowName:_,onWorkflowNameChange:j,onCreateWorkflow:M,onApplyFilters:q}),c.jsx(yie,{selectedTab:C,onSelectedTabChange:T,sortedWorkflows:A,isTemplateView:k,searchQuery:a,onCreateWorkflowRequest:()=>x(!0),onOpenWorkflow:V,onUseTemplate:z,onDuplicateWorkflow:L,onExportWorkflow:U,onDeleteWorkflow:F})]})})})})]})}function Sle(e,t,n){const r=new Set,a=new Set,s=[e];for(;s.length>0;){const l=s.shift();if(a.has(l))continue;a.add(l);const d=n.filter(f=>f.target===l);for(const f of d)f.source!==e&&r.add(f.source),s.push(f.source)}const i=t.filter(l=>r.has(l.id));return jle(i,n)}function _le(e,t){return t.some(n=>n.target===e)}function TM(e){if(!e)return null;const t=new Date(e).getTime();return Number.isNaN(t)?null:t}function Vq(e,t){if(!e&&!t)return;if(!e)return t;if(!t)return e;const n=TM(e.updatedAt),r=TM(t.updatedAt);return n!==null&&r!==null?n>=r?{...t,...e}:{...e,...t}:{...t,...e}}function Nle(e,t){var r;const n={};for(const a of e){const s=(r=a.data)==null?void 0:r.runtime,i=t==null?void 0:t[a.id],l=Vq(s,i);if(l){const d=l.outputs??l.messages??l.raw;d!==void 0&&(n[a.id]=d)}}return n}function jle(e,t){const n=new Map(e.map(l=>[l.id,l])),r=new Map,a=new Map;for(const l of e)r.set(l.id,0),a.set(l.id,[]);for(const l of t)n.has(l.source)&&n.has(l.target)&&(a.get(l.source).push(l.target),r.set(l.target,(r.get(l.target)||0)+1));const s=[],i=[];for(const[l,d]of r.entries())d===0&&s.push(l);for(;s.length>0;){const l=s.shift(),d=n.get(l);d&&i.push(d);for(const f of a.get(l)||[]){const h=(r.get(f)||0)-1;r.set(f,h),h===0&&s.push(f)}}return i}var hw={exports:{}},pw,AM;function Cle(){if(AM)return pw;AM=1;var e="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED";return pw=e,pw}var mw,RM;function Ele(){if(RM)return mw;RM=1;var e=Cle();function t(){}function n(){}return n.resetWarningCache=t,mw=function(){function r(i,l,d,f,h,p){if(p!==e){var g=new 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 g.name="Invariant Violation",g}}r.isRequired=r;function a(){return r}var s={array:r,bigint:r,bool:r,func:r,number:r,object:r,string:r,symbol:r,any:r,arrayOf:a,element:r,elementType:r,instanceOf:a,node:r,objectOf:a,oneOf:a,oneOfType:a,shape:a,exact:a,checkPropTypes:n,resetWarningCache:t};return s.PropTypes=s,s},mw}var kM;function Wq(){return kM||(kM=1,hw.exports=Ele()()),hw.exports}var Tle=Wq();const yt=zr(Tle);var Mr=typeof window<"u"?window:null,P2=Mr===null,xf=P2?void 0:Mr.document,Wr="addEventListener",Gr="removeEventListener",gw="getBoundingClientRect",Cd="_a",Kr="_b",ps="_c",pm="horizontal",Yr=function(){return!1},Ale=P2?"calc":["","-webkit-","-moz-","-o-"].filter(function(e){var t=xf.createElement("div");return t.style.cssText="width:"+e+"calc(9px)",!!t.style.length}).shift()+"calc",Gq=function(e){return typeof e=="string"||e instanceof String},OM=function(e){if(Gq(e)){var t=xf.querySelector(e);if(!t)throw new Error("Selector "+e+" did not match a DOM element");return t}return e},Dn=function(e,t,n){var r=e[t];return r!==void 0?r:n},mm=function(e,t,n,r){if(t){if(r==="end")return 0;if(r==="center")return e/2}else if(n){if(r==="start")return 0;if(r==="center")return e/2}return e},Rle=function(e,t){var n=xf.createElement("div");return n.className="gutter gutter-"+t,n},kle=function(e,t,n){var r={};return Gq(t)?r[e]=t:r[e]=Ale+"("+t+"% - "+n+"px)",r},Ole=function(e,t){var n;return n={},n[e]=t+"px",n},MM=function(e,t){if(t===void 0&&(t={}),P2)return{};var n=e,r,a,s,i,l,d;Array.from&&(n=Array.from(n));var f=OM(n[0]),h=f.parentNode,p=getComputedStyle?getComputedStyle(h):null,g=p?p.flexDirection:null,y=Dn(t,"sizes")||n.map(function(){return 100/n.length}),S=Dn(t,"minSize",100),w=Array.isArray(S)?S:n.map(function(){return S}),b=Dn(t,"maxSize",1/0),x=Array.isArray(b)?b:n.map(function(){return b}),_=Dn(t,"expandToMin",!1),j=Dn(t,"gutterSize",10),C=Dn(t,"gutterAlign","center"),T=Dn(t,"snapOffset",30),A=Array.isArray(T)?T:n.map(function(){return T}),k=Dn(t,"dragInterval",1),O=Dn(t,"direction",pm),M=Dn(t,"cursor",O===pm?"col-resize":"row-resize"),z=Dn(t,"gutter",Rle),L=Dn(t,"elementStyle",kle),U=Dn(t,"gutterStyle",Ole);O===pm?(r="width",a="clientX",s="left",i="right",l="clientWidth"):O==="vertical"&&(r="height",a="clientY",s="top",i="bottom",l="clientHeight");function F(ne,Q,ae,Y){var te=L(r,Q,ae,Y);Object.keys(te).forEach(function(se){ne.style[se]=te[se]})}function q(ne,Q,ae){var Y=U(r,Q,ae);Object.keys(Y).forEach(function(te){ne.style[te]=Y[te]})}function V(){return d.map(function(ne){return ne.size})}function P(ne){return"touches"in ne?ne.touches[0][a]:ne[a]}function K(ne){var Q=d[this.a],ae=d[this.b],Y=Q.size+ae.size;Q.size=ne/this.size*Y,ae.size=Y-ne/this.size*Y,F(Q.element,Q.size,this[Kr],Q.i),F(ae.element,ae.size,this[ps],ae.i)}function H(ne){var Q,ae=d[this.a],Y=d[this.b];this.dragging&&(Q=P(ne)-this.start+(this[Kr]-this.dragOffset),k>1&&(Q=Math.round(Q/k)*k),Q<=ae.minSize+ae.snapOffset+this[Kr]?Q=ae.minSize+this[Kr]:Q>=this.size-(Y.minSize+Y.snapOffset+this[ps])&&(Q=this.size-(Y.minSize+this[ps])),Q>=ae.maxSize-ae.snapOffset+this[Kr]?Q=ae.maxSize+this[Kr]:Q<=this.size-(Y.maxSize-Y.snapOffset+this[ps])&&(Q=this.size-(Y.maxSize+this[ps])),K.call(this,Q),Dn(t,"onDrag",Yr)(V()))}function Z(){var ne=d[this.a].element,Q=d[this.b].element,ae=ne[gw](),Y=Q[gw]();this.size=ae[r]+Y[r]+this[Kr]+this[ps],this.start=ae[s],this.end=ae[i]}function J(ne){if(!getComputedStyle)return null;var Q=getComputedStyle(ne);if(!Q)return null;var ae=ne[l];return ae===0?null:(O===pm?ae-=parseFloat(Q.paddingLeft)+parseFloat(Q.paddingRight):ae-=parseFloat(Q.paddingTop)+parseFloat(Q.paddingBottom),ae)}function D(ne){var Q=J(h);if(Q===null||w.reduce(function(se,le){return se+le},0)>Q)return ne;var ae=0,Y=[],te=ne.map(function(se,le){var fe=Q*se/100,ve=mm(j,le===0,le===ne.length-1,C),Se=w[le]+ve;return fe<Se?(ae+=Se-fe,Y.push(0),Se):(Y.push(fe-Se),fe)});return ae===0?ne:te.map(function(se,le){var fe=se;if(ae>0&&Y[le]-ae>0){var ve=Math.min(ae,Y[le]-ae);ae-=ve,fe=se-ve}return fe/Q*100})}function W(){var ne=this,Q=d[ne.a].element,ae=d[ne.b].element;ne.dragging&&Dn(t,"onDragEnd",Yr)(V()),ne.dragging=!1,Mr[Gr]("mouseup",ne.stop),Mr[Gr]("touchend",ne.stop),Mr[Gr]("touchcancel",ne.stop),Mr[Gr]("mousemove",ne.move),Mr[Gr]("touchmove",ne.move),ne.stop=null,ne.move=null,Q[Gr]("selectstart",Yr),Q[Gr]("dragstart",Yr),ae[Gr]("selectstart",Yr),ae[Gr]("dragstart",Yr),Q.style.userSelect="",Q.style.webkitUserSelect="",Q.style.MozUserSelect="",Q.style.pointerEvents="",ae.style.userSelect="",ae.style.webkitUserSelect="",ae.style.MozUserSelect="",ae.style.pointerEvents="",ne.gutter.style.cursor="",ne.parent.style.cursor="",xf.body.style.cursor=""}function B(ne){if(!("button"in ne&&ne.button!==0)){var Q=this,ae=d[Q.a].element,Y=d[Q.b].element;Q.dragging||Dn(t,"onDragStart",Yr)(V()),ne.preventDefault(),Q.dragging=!0,Q.move=H.bind(Q),Q.stop=W.bind(Q),Mr[Wr]("mouseup",Q.stop),Mr[Wr]("touchend",Q.stop),Mr[Wr]("touchcancel",Q.stop),Mr[Wr]("mousemove",Q.move),Mr[Wr]("touchmove",Q.move),ae[Wr]("selectstart",Yr),ae[Wr]("dragstart",Yr),Y[Wr]("selectstart",Yr),Y[Wr]("dragstart",Yr),ae.style.userSelect="none",ae.style.webkitUserSelect="none",ae.style.MozUserSelect="none",ae.style.pointerEvents="none",Y.style.userSelect="none",Y.style.webkitUserSelect="none",Y.style.MozUserSelect="none",Y.style.pointerEvents="none",Q.gutter.style.cursor=M,Q.parent.style.cursor=M,xf.body.style.cursor=M,Z.call(Q),Q.dragOffset=P(ne)-Q.end}}y=D(y);var $=[];d=n.map(function(ne,Q){var ae={element:OM(ne),size:y[Q],minSize:w[Q],maxSize:x[Q],snapOffset:A[Q],i:Q},Y;if(Q>0&&(Y={a:Q-1,b:Q,dragging:!1,direction:O,parent:h},Y[Kr]=mm(j,Q-1===0,!1,C),Y[ps]=mm(j,!1,Q===n.length-1,C),g==="row-reverse"||g==="column-reverse")){var te=Y.a;Y.a=Y.b,Y.b=te}if(Q>0){var se=z(Q,O,ae.element);q(se,j,Q),Y[Cd]=B.bind(Y),se[Wr]("mousedown",Y[Cd]),se[Wr]("touchstart",Y[Cd]),h.insertBefore(se,ae.element),Y.gutter=se}return F(ae.element,ae.size,mm(j,Q===0,Q===n.length-1,C),Q),Q>0&&$.push(Y),ae});function G(ne){var Q=ne.i===$.length,ae=Q?$[ne.i-1]:$[ne.i];Z.call(ae);var Y=Q?ae.size-ne.minSize-ae[ps]:ne.minSize+ae[Kr];K.call(ae,Y)}d.forEach(function(ne){var Q=ne.element[gw]()[r];Q<ne.minSize&&(_?G(ne):ne.minSize=Q)});function ee(ne){var Q=D(ne);Q.forEach(function(ae,Y){if(Y>0){var te=$[Y-1],se=d[te.a],le=d[te.b];se.size=Q[Y-1],le.size=ae,F(se.element,se.size,te[Kr],se.i),F(le.element,le.size,te[ps],le.i)}})}function re(ne,Q){$.forEach(function(ae){if(Q!==!0?ae.parent.removeChild(ae.gutter):(ae.gutter[Gr]("mousedown",ae[Cd]),ae.gutter[Gr]("touchstart",ae[Cd])),ne!==!0){var Y=L(r,ae.a.size,ae[Kr]);Object.keys(Y).forEach(function(te){d[ae.a].element.style[te]="",d[ae.b].element.style[te]=""})}})}return{setSizes:ee,getSizes:V,collapse:function(Q){G(d[Q])},destroy:re,parent:h,pairs:$}};function yw(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)===-1&&(n[r]=e[r]);return n}var ay=(function(e){function t(){e.apply(this,arguments)}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t.prototype.componentDidMount=function(){var r=this.props;r.children;var a=r.gutter,s=yw(r,["children","gutter"]),i=s;i.gutter=function(l,d){var f;return a?f=a(l,d):(f=document.createElement("div"),f.className="gutter gutter-"+d),f.__isSplitGutter=!0,f},this.split=MM(this.parent.children,i)},t.prototype.componentDidUpdate=function(r){var a=this,s=this.props;s.children;var i=s.minSize,l=s.sizes,d=s.collapsed,f=yw(s,["children","minSize","sizes","collapsed"]),h=f,p=r.minSize,g=r.sizes,y=r.collapsed,S=["maxSize","expandToMin","gutterSize","gutterAlign","snapOffset","dragInterval","direction","cursor"],w=S.map(function(_){return a.props[_]!==r[_]}).reduce(function(_,j){return _||j},!1);if(Array.isArray(i)&&Array.isArray(p)){var b=!1;i.forEach(function(_,j){b=b||_!==p[j]}),w=w||b}else Array.isArray(i)||Array.isArray(p)?w=!0:w=w||i!==p;if(w)h.minSize=i,h.sizes=l||this.split.getSizes(),this.split.destroy(!0,!0),h.gutter=function(_,j,C){return C.previousSibling},this.split=MM(Array.from(this.parent.children).filter(function(_){return!_.__isSplitGutter}),h);else if(l){var x=!1;l.forEach(function(_,j){x=x||_!==g[j]}),x&&this.split.setSizes(this.props.sizes)}Number.isInteger(d)&&(d!==y||w)&&this.split.collapse(d)},t.prototype.componentWillUnmount=function(){this.split.destroy(),delete this.split},t.prototype.render=function(){var r=this,a=this.props;a.sizes,a.minSize,a.maxSize,a.expandToMin,a.gutterSize,a.gutterAlign,a.snapOffset,a.dragInterval,a.direction,a.cursor,a.gutter,a.elementStyle,a.gutterStyle,a.onDrag,a.onDragStart,a.onDragEnd,a.collapsed;var s=a.children,i=yw(a,["sizes","minSize","maxSize","expandToMin","gutterSize","gutterAlign","snapOffset","dragInterval","direction","cursor","gutter","elementStyle","gutterStyle","onDrag","onDragStart","onDragEnd","collapsed","children"]),l=i;return Me.createElement("div",Object.assign({},{ref:function(d){r.parent=d}},l),s)},t})(Me.Component);ay.propTypes={sizes:yt.arrayOf(yt.number),minSize:yt.oneOfType([yt.number,yt.arrayOf(yt.number)]),maxSize:yt.oneOfType([yt.number,yt.arrayOf(yt.number)]),expandToMin:yt.bool,gutterSize:yt.number,gutterAlign:yt.string,snapOffset:yt.oneOfType([yt.number,yt.arrayOf(yt.number)]),dragInterval:yt.number,direction:yt.string,cursor:yt.string,gutter:yt.func,elementStyle:yt.func,gutterStyle:yt.func,onDrag:yt.func,onDragStart:yt.func,onDragEnd:yt.func,collapsed:yt.number,children:yt.arrayOf(yt.element)};ay.defaultProps={sizes:void 0,minSize:void 0,maxSize:void 0,expandToMin:void 0,gutterSize:void 0,gutterAlign:void 0,snapOffset:void 0,dragInterval:void 0,direction:void 0,cursor:void 0,gutter:void 0,elementStyle:void 0,gutterStyle:void 0,onDrag:void 0,onDragStart:void 0,onDragEnd:void 0,collapsed:void 0,children:void 0};function Kq({label:e,hasRuntime:t}){return c.jsx("div",{className:"flex items-center justify-center h-full",children:c.jsxs("div",{className:"text-center",children:[c.jsx(Ue,{variant:"outline",className:"mb-2",children:e}),c.jsx("p",{className:"text-sm text-muted-foreground",children:t?"No live data captured for this node yet.":"Run the workflow to capture live data."})]})})}const $2="application/x.orcheo.schema-field";function Mle(e,t){e.effectAllowed="copy",e.setData($2,JSON.stringify(t)),e.setData("text/plain",t.path)}function Yq(e){if(!e)return!1;const t=Array.from(e.types??[]);return t.includes($2)?!0:t.includes("text/plain")?e.getData("text/plain").trim().length>0:!1}function Xq(e){if(!e)return null;const t=e.getData($2);if(t)try{const r=JSON.parse(t);if(r&&typeof r.path=="string"&&r.path.length>0)return r}catch(r){console.warn("Failed to parse schema field payload",r)}const n=e.getData("text/plain");return n&&n.trim().length>0?{path:n.trim()}:null}function Zq(e,t){const n=`{{ ${t} }}`,r=e.value??"",a=e.selectionStart??r.length,s=e.selectionEnd??a,i=r.slice(0,a)+n+r.slice(s),l=a+n.length;return{value:i,selectionStart:l}}function Dle({inputViewMode:e,onInputViewModeChange:t,useLiveData:n,hasRuntime:r,hasLiveInputs:a,liveInputs:s,hasUpstreamConnections:i,upstreamInputs:l,schemaFields:d}){const f=N.useCallback((p,g)=>{Mle(p.dataTransfer,g)},[]),h=N.useCallback(()=>{},[]);return c.jsx("div",{className:"flex h-full flex-col",children:c.jsx("div",{className:"border-b border-border",children:c.jsxs(Da,{defaultValue:e,onValueChange:t,children:[c.jsxs(Ls,{className:"w-full justify-start h-10 rounded-none bg-transparent p-0",children:[c.jsxs(St,{value:"input-json",className:"rounded-none data-[state=active]:bg-muted",children:[c.jsx(kz,{className:"h-4 w-4 mr-2"}),"JSON"]}),c.jsxs(St,{value:"input-table",className:"rounded-none data-[state=active]:bg-muted",children:[c.jsx(Vz,{className:"h-4 w-4 mr-2"}),"Table"]}),c.jsxs(St,{value:"input-schema",className:"rounded-none data-[state=active]:bg-muted",children:[c.jsx(Jd,{className:"h-4 w-4 mr-2"}),"Schema"]})]}),c.jsx($t,{value:"input-json",className:"p-0 m-0",children:c.jsx("div",{className:"flex-1 p-4 bg-muted/30",children:n?a?c.jsx("pre",{className:"font-mono text-sm whitespace-pre overflow-auto rounded-md bg-muted p-4 h-full",children:JSON.stringify(s,null,2)}):c.jsx(Kq,{label:"Live Input",hasRuntime:r}):i?Object.keys(l).length>0?c.jsx("pre",{className:"font-mono text-sm whitespace-pre overflow-auto rounded-md bg-muted p-4 h-full",children:JSON.stringify(l,null,2)}):c.jsx("div",{className:"flex items-center justify-center h-full",children:c.jsxs("div",{className:"text-center",children:[c.jsx(Ue,{variant:"outline",className:"mb-2",children:"No Outputs"}),c.jsxs("p",{className:"text-sm text-muted-foreground",children:["Connected nodes have not produced outputs yet.",c.jsx("br",{}),"Run the workflow to see input data."]})]})}):c.jsx("div",{className:"flex items-center justify-center h-full",children:c.jsxs("div",{className:"text-center",children:[c.jsx(Ue,{variant:"outline",className:"mb-2",children:"No Connections"}),c.jsxs("p",{className:"text-sm text-muted-foreground",children:["This node has no incoming connections.",c.jsx("br",{}),"Connect nodes to see their outputs here."]})]})})})}),c.jsx($t,{value:"input-table",className:"p-0 m-0",children:c.jsx("div",{className:"flex-1 p-4 bg-muted/30",children:c.jsx("div",{className:"font-mono text-sm overflow-auto rounded-md bg-muted p-4 h-full",children:c.jsx("p",{children:"Table view not implemented"})})})}),c.jsx($t,{value:"input-schema",className:"p-0 m-0",children:c.jsx("div",{className:"flex-1 p-4 bg-muted/30",children:c.jsx("div",{className:"font-mono text-sm overflow-auto rounded-md bg-muted p-4 h-full",children:i?d.length>0?c.jsx("div",{className:"space-y-2",children:d.map(p=>c.jsxs("div",{className:"flex items-center justify-between p-2 bg-background rounded border border-border hover:border-primary/50 cursor-grab",draggable:!0,onDragStart:g=>f(g,p),onDragEnd:h,children:[c.jsxs("div",{className:"flex items-center gap-2",children:[c.jsx(rQ,{className:"h-4 w-4 text-muted-foreground"}),c.jsx("span",{className:"font-medium",children:p.name}),c.jsx(Ue,{variant:"outline",className:"text-xs",children:p.type})]}),c.jsx("div",{className:"text-xs text-muted-foreground",children:p.path})]},p.path))}):c.jsx("div",{className:"flex items-center justify-center h-full",children:c.jsxs("div",{className:"text-center",children:[c.jsx(Ue,{variant:"outline",className:"mb-2",children:"No Schema"}),c.jsxs("p",{className:"text-sm text-muted-foreground",children:["Connected nodes have not produced outputs yet.",c.jsx("br",{}),"Run the workflow to see the schema."]})]})}):c.jsx("div",{className:"flex items-center justify-center h-full",children:c.jsxs("div",{className:"text-center",children:[c.jsx(Ue,{variant:"outline",className:"mb-2",children:"No Connections"}),c.jsxs("p",{className:"text-sm text-muted-foreground",children:["This node has no incoming connections.",c.jsx("br",{}),"Connect nodes to see their output schema here."]})]})})})})})]})})})}function Ple(e,t){return N.useReducer((n,r)=>t[n][r]??n,e)}var I2="ScrollArea",[Qq]=wn(I2),[$le,qr]=Qq(I2),Jq=N.forwardRef((e,t)=>{const{__scopeScrollArea:n,type:r="hover",dir:a,scrollHideDelay:s=600,...i}=e,[l,d]=N.useState(null),[f,h]=N.useState(null),[p,g]=N.useState(null),[y,S]=N.useState(null),[w,b]=N.useState(null),[x,_]=N.useState(0),[j,C]=N.useState(0),[T,A]=N.useState(!1),[k,O]=N.useState(!1),M=ze(t,L=>d(L)),z=Ko(a);return c.jsx($le,{scope:n,type:r,dir:z,scrollHideDelay:s,scrollArea:l,viewport:f,onViewportChange:h,content:p,onContentChange:g,scrollbarX:y,onScrollbarXChange:S,scrollbarXEnabled:T,onScrollbarXEnabledChange:A,scrollbarY:w,onScrollbarYChange:b,scrollbarYEnabled:k,onScrollbarYEnabledChange:O,onCornerWidthChange:_,onCornerHeightChange:C,children:c.jsx(Ae.div,{dir:z,...i,ref:M,style:{position:"relative","--radix-scroll-area-corner-width":x+"px","--radix-scroll-area-corner-height":j+"px",...e.style}})})});Jq.displayName=I2;var eF="ScrollAreaViewport",tF=N.forwardRef((e,t)=>{const{__scopeScrollArea:n,children:r,nonce:a,...s}=e,i=qr(eF,n),l=N.useRef(null),d=ze(t,l,i.onViewportChange);return c.jsxs(c.Fragment,{children:[c.jsx("style",{dangerouslySetInnerHTML:{__html:"[data-radix-scroll-area-viewport]{scrollbar-width:none;-ms-overflow-style:none;-webkit-overflow-scrolling:touch;}[data-radix-scroll-area-viewport]::-webkit-scrollbar{display:none}"},nonce:a}),c.jsx(Ae.div,{"data-radix-scroll-area-viewport":"",...s,ref:d,style:{overflowX:i.scrollbarXEnabled?"scroll":"hidden",overflowY:i.scrollbarYEnabled?"scroll":"hidden",...e.style},children:c.jsx("div",{ref:i.onContentChange,style:{minWidth:"100%",display:"table"},children:r})})]})});tF.displayName=eF;var qa="ScrollAreaScrollbar",L2=N.forwardRef((e,t)=>{const{forceMount:n,...r}=e,a=qr(qa,e.__scopeScrollArea),{onScrollbarXEnabledChange:s,onScrollbarYEnabledChange:i}=a,l=e.orientation==="horizontal";return N.useEffect(()=>(l?s(!0):i(!0),()=>{l?s(!1):i(!1)}),[l,s,i]),a.type==="hover"?c.jsx(Ile,{...r,ref:t,forceMount:n}):a.type==="scroll"?c.jsx(Lle,{...r,ref:t,forceMount:n}):a.type==="auto"?c.jsx(nF,{...r,ref:t,forceMount:n}):a.type==="always"?c.jsx(z2,{...r,ref:t}):null});L2.displayName=qa;var Ile=N.forwardRef((e,t)=>{const{forceMount:n,...r}=e,a=qr(qa,e.__scopeScrollArea),[s,i]=N.useState(!1);return N.useEffect(()=>{const l=a.scrollArea;let d=0;if(l){const f=()=>{window.clearTimeout(d),i(!0)},h=()=>{d=window.setTimeout(()=>i(!1),a.scrollHideDelay)};return l.addEventListener("pointerenter",f),l.addEventListener("pointerleave",h),()=>{window.clearTimeout(d),l.removeEventListener("pointerenter",f),l.removeEventListener("pointerleave",h)}}},[a.scrollArea,a.scrollHideDelay]),c.jsx(sn,{present:n||s,children:c.jsx(nF,{"data-state":s?"visible":"hidden",...r,ref:t})})}),Lle=N.forwardRef((e,t)=>{const{forceMount:n,...r}=e,a=qr(qa,e.__scopeScrollArea),s=e.orientation==="horizontal",i=xv(()=>d("SCROLL_END"),100),[l,d]=Ple("hidden",{hidden:{SCROLL:"scrolling"},scrolling:{SCROLL_END:"idle",POINTER_ENTER:"interacting"},interacting:{SCROLL:"interacting",POINTER_LEAVE:"idle"},idle:{HIDE:"hidden",SCROLL:"scrolling",POINTER_ENTER:"interacting"}});return N.useEffect(()=>{if(l==="idle"){const f=window.setTimeout(()=>d("HIDE"),a.scrollHideDelay);return()=>window.clearTimeout(f)}},[l,a.scrollHideDelay,d]),N.useEffect(()=>{const f=a.viewport,h=s?"scrollLeft":"scrollTop";if(f){let p=f[h];const g=()=>{const y=f[h];p!==y&&(d("SCROLL"),i()),p=y};return f.addEventListener("scroll",g),()=>f.removeEventListener("scroll",g)}},[a.viewport,s,d,i]),c.jsx(sn,{present:n||l!=="hidden",children:c.jsx(z2,{"data-state":l==="hidden"?"hidden":"visible",...r,ref:t,onPointerEnter:_e(e.onPointerEnter,()=>d("POINTER_ENTER")),onPointerLeave:_e(e.onPointerLeave,()=>d("POINTER_LEAVE"))})})}),nF=N.forwardRef((e,t)=>{const n=qr(qa,e.__scopeScrollArea),{forceMount:r,...a}=e,[s,i]=N.useState(!1),l=e.orientation==="horizontal",d=xv(()=>{if(n.viewport){const f=n.viewport.offsetWidth<n.viewport.scrollWidth,h=n.viewport.offsetHeight<n.viewport.scrollHeight;i(l?f:h)}},10);return Bc(n.viewport,d),Bc(n.content,d),c.jsx(sn,{present:r||s,children:c.jsx(z2,{"data-state":s?"visible":"hidden",...a,ref:t})})}),z2=N.forwardRef((e,t)=>{const{orientation:n="vertical",...r}=e,a=qr(qa,e.__scopeScrollArea),s=N.useRef(null),i=N.useRef(0),[l,d]=N.useState({content:0,viewport:0,scrollbar:{size:0,paddingStart:0,paddingEnd:0}}),f=iF(l.viewport,l.content),h={...r,sizes:l,onSizesChange:d,hasThumb:f>0&&f<1,onThumbChange:g=>s.current=g,onThumbPointerUp:()=>i.current=0,onThumbPointerDown:g=>i.current=g};function p(g,y){return Ble(g,i.current,l,y)}return n==="horizontal"?c.jsx(zle,{...h,ref:t,onThumbPositionChange:()=>{if(a.viewport&&s.current){const g=a.viewport.scrollLeft,y=DM(g,l,a.dir);s.current.style.transform=`translate3d(${y}px, 0, 0)`}},onWheelScroll:g=>{a.viewport&&(a.viewport.scrollLeft=g)},onDragScroll:g=>{a.viewport&&(a.viewport.scrollLeft=p(g,a.dir))}}):n==="vertical"?c.jsx(qle,{...h,ref:t,onThumbPositionChange:()=>{if(a.viewport&&s.current){const g=a.viewport.scrollTop,y=DM(g,l);s.current.style.transform=`translate3d(0, ${y}px, 0)`}},onWheelScroll:g=>{a.viewport&&(a.viewport.scrollTop=g)},onDragScroll:g=>{a.viewport&&(a.viewport.scrollTop=p(g))}}):null}),zle=N.forwardRef((e,t)=>{const{sizes:n,onSizesChange:r,...a}=e,s=qr(qa,e.__scopeScrollArea),[i,l]=N.useState(),d=N.useRef(null),f=ze(t,d,s.onScrollbarXChange);return N.useEffect(()=>{d.current&&l(getComputedStyle(d.current))},[d]),c.jsx(aF,{"data-orientation":"horizontal",...a,ref:f,sizes:n,style:{bottom:0,left:s.dir==="rtl"?"var(--radix-scroll-area-corner-width)":0,right:s.dir==="ltr"?"var(--radix-scroll-area-corner-width)":0,"--radix-scroll-area-thumb-width":vv(n)+"px",...e.style},onThumbPointerDown:h=>e.onThumbPointerDown(h.x),onDragScroll:h=>e.onDragScroll(h.x),onWheelScroll:(h,p)=>{if(s.viewport){const g=s.viewport.scrollLeft+h.deltaX;e.onWheelScroll(g),cF(g,p)&&h.preventDefault()}},onResize:()=>{d.current&&s.viewport&&i&&r({content:s.viewport.scrollWidth,viewport:s.viewport.offsetWidth,scrollbar:{size:d.current.clientWidth,paddingStart:oy(i.paddingLeft),paddingEnd:oy(i.paddingRight)}})}})}),qle=N.forwardRef((e,t)=>{const{sizes:n,onSizesChange:r,...a}=e,s=qr(qa,e.__scopeScrollArea),[i,l]=N.useState(),d=N.useRef(null),f=ze(t,d,s.onScrollbarYChange);return N.useEffect(()=>{d.current&&l(getComputedStyle(d.current))},[d]),c.jsx(aF,{"data-orientation":"vertical",...a,ref:f,sizes:n,style:{top:0,right:s.dir==="ltr"?0:void 0,left:s.dir==="rtl"?0:void 0,bottom:"var(--radix-scroll-area-corner-height)","--radix-scroll-area-thumb-height":vv(n)+"px",...e.style},onThumbPointerDown:h=>e.onThumbPointerDown(h.y),onDragScroll:h=>e.onDragScroll(h.y),onWheelScroll:(h,p)=>{if(s.viewport){const g=s.viewport.scrollTop+h.deltaY;e.onWheelScroll(g),cF(g,p)&&h.preventDefault()}},onResize:()=>{d.current&&s.viewport&&i&&r({content:s.viewport.scrollHeight,viewport:s.viewport.offsetHeight,scrollbar:{size:d.current.clientHeight,paddingStart:oy(i.paddingTop),paddingEnd:oy(i.paddingBottom)}})}})}),[Fle,rF]=Qq(qa),aF=N.forwardRef((e,t)=>{const{__scopeScrollArea:n,sizes:r,hasThumb:a,onThumbChange:s,onThumbPointerUp:i,onThumbPointerDown:l,onThumbPositionChange:d,onDragScroll:f,onWheelScroll:h,onResize:p,...g}=e,y=qr(qa,n),[S,w]=N.useState(null),b=ze(t,M=>w(M)),x=N.useRef(null),_=N.useRef(""),j=y.viewport,C=r.content-r.viewport,T=hn(h),A=hn(d),k=xv(p,10);function O(M){if(x.current){const z=M.clientX-x.current.left,L=M.clientY-x.current.top;f({x:z,y:L})}}return N.useEffect(()=>{const M=z=>{const L=z.target;(S==null?void 0:S.contains(L))&&T(z,C)};return document.addEventListener("wheel",M,{passive:!1}),()=>document.removeEventListener("wheel",M,{passive:!1})},[j,S,C,T]),N.useEffect(A,[r,A]),Bc(S,k),Bc(y.content,k),c.jsx(Fle,{scope:n,scrollbar:S,hasThumb:a,onThumbChange:hn(s),onThumbPointerUp:hn(i),onThumbPositionChange:A,onThumbPointerDown:hn(l),children:c.jsx(Ae.div,{...g,ref:b,style:{position:"absolute",...g.style},onPointerDown:_e(e.onPointerDown,M=>{M.button===0&&(M.target.setPointerCapture(M.pointerId),x.current=S.getBoundingClientRect(),_.current=document.body.style.webkitUserSelect,document.body.style.webkitUserSelect="none",y.viewport&&(y.viewport.style.scrollBehavior="auto"),O(M))}),onPointerMove:_e(e.onPointerMove,O),onPointerUp:_e(e.onPointerUp,M=>{const z=M.target;z.hasPointerCapture(M.pointerId)&&z.releasePointerCapture(M.pointerId),document.body.style.webkitUserSelect=_.current,y.viewport&&(y.viewport.style.scrollBehavior=""),x.current=null})})})}),sy="ScrollAreaThumb",sF=N.forwardRef((e,t)=>{const{forceMount:n,...r}=e,a=rF(sy,e.__scopeScrollArea);return c.jsx(sn,{present:n||a.hasThumb,children:c.jsx(Ule,{ref:t,...r})})}),Ule=N.forwardRef((e,t)=>{const{__scopeScrollArea:n,style:r,...a}=e,s=qr(sy,n),i=rF(sy,n),{onThumbPositionChange:l}=i,d=ze(t,p=>i.onThumbChange(p)),f=N.useRef(void 0),h=xv(()=>{f.current&&(f.current(),f.current=void 0)},100);return N.useEffect(()=>{const p=s.viewport;if(p){const g=()=>{if(h(),!f.current){const y=Vle(p,l);f.current=y,l()}};return l(),p.addEventListener("scroll",g),()=>p.removeEventListener("scroll",g)}},[s.viewport,h,l]),c.jsx(Ae.div,{"data-state":i.hasThumb?"visible":"hidden",...a,ref:d,style:{width:"var(--radix-scroll-area-thumb-width)",height:"var(--radix-scroll-area-thumb-height)",...r},onPointerDownCapture:_e(e.onPointerDownCapture,p=>{const y=p.target.getBoundingClientRect(),S=p.clientX-y.left,w=p.clientY-y.top;i.onThumbPointerDown({x:S,y:w})}),onPointerUp:_e(e.onPointerUp,i.onThumbPointerUp)})});sF.displayName=sy;var q2="ScrollAreaCorner",oF=N.forwardRef((e,t)=>{const n=qr(q2,e.__scopeScrollArea),r=!!(n.scrollbarX&&n.scrollbarY);return n.type!=="scroll"&&r?c.jsx(Hle,{...e,ref:t}):null});oF.displayName=q2;var Hle=N.forwardRef((e,t)=>{const{__scopeScrollArea:n,...r}=e,a=qr(q2,n),[s,i]=N.useState(0),[l,d]=N.useState(0),f=!!(s&&l);return Bc(a.scrollbarX,()=>{var p;const h=((p=a.scrollbarX)==null?void 0:p.offsetHeight)||0;a.onCornerHeightChange(h),d(h)}),Bc(a.scrollbarY,()=>{var p;const h=((p=a.scrollbarY)==null?void 0:p.offsetWidth)||0;a.onCornerWidthChange(h),i(h)}),f?c.jsx(Ae.div,{...r,ref:t,style:{width:s,height:l,position:"absolute",right:a.dir==="ltr"?0:void 0,left:a.dir==="rtl"?0:void 0,bottom:0,...e.style}}):null});function oy(e){return e?parseInt(e,10):0}function iF(e,t){const n=e/t;return isNaN(n)?0:n}function vv(e){const t=iF(e.viewport,e.content),n=e.scrollbar.paddingStart+e.scrollbar.paddingEnd,r=(e.scrollbar.size-n)*t;return Math.max(r,18)}function Ble(e,t,n,r="ltr"){const a=vv(n),s=a/2,i=t||s,l=a-i,d=n.scrollbar.paddingStart+i,f=n.scrollbar.size-n.scrollbar.paddingEnd-l,h=n.content-n.viewport,p=r==="ltr"?[0,h]:[h*-1,0];return lF([d,f],p)(e)}function DM(e,t,n="ltr"){const r=vv(t),a=t.scrollbar.paddingStart+t.scrollbar.paddingEnd,s=t.scrollbar.size-a,i=t.content-t.viewport,l=s-r,d=n==="ltr"?[0,i]:[i*-1,0],f=Wj(e,d);return lF([0,i],[0,l])(f)}function lF(e,t){return n=>{if(e[0]===e[1]||t[0]===t[1])return t[0];const r=(t[1]-t[0])/(e[1]-e[0]);return t[0]+r*(n-e[0])}}function cF(e,t){return e>0&&e<t}var Vle=(e,t=()=>{})=>{let n={left:e.scrollLeft,top:e.scrollTop},r=0;return(function a(){const s={left:e.scrollLeft,top:e.scrollTop},i=n.left!==s.left,l=n.top!==s.top;(i||l)&&t(),n=s,r=window.requestAnimationFrame(a)})(),()=>window.cancelAnimationFrame(r)};function xv(e,t){const n=hn(e),r=N.useRef(0);return N.useEffect(()=>()=>window.clearTimeout(r.current),[]),N.useCallback(()=>{window.clearTimeout(r.current),r.current=window.setTimeout(n,t)},[n,t])}function Bc(e,t){const n=hn(t);Jt(()=>{let r=0;if(e){const a=new ResizeObserver(()=>{cancelAnimationFrame(r),r=window.requestAnimationFrame(n)});return a.observe(e),()=>{window.cancelAnimationFrame(r),a.unobserve(e)}}},[e,n])}var uF=Jq,Wle=tF,Gle=oF;const Mo=N.forwardRef(({className:e,children:t,...n},r)=>c.jsxs(uF,{ref:r,className:ye("relative overflow-hidden",e),...n,children:[c.jsx(Wle,{className:"h-full w-full rounded-[inherit]",children:t}),c.jsx(dF,{}),c.jsx(Gle,{})]}));Mo.displayName=uF.displayName;const dF=N.forwardRef(({className:e,orientation:t="vertical",...n},r)=>c.jsx(L2,{ref:r,orientation:t,className:ye("flex touch-none select-none transition-colors",t==="vertical"&&"h-full w-2.5 border-l border-l-transparent p-[1px]",t==="horizontal"&&"h-2.5 flex-col border-t border-t-transparent p-[1px]",e),...n,children:c.jsx(sF,{className:"relative flex-1 rounded-full bg-border"})}));dF.displayName=L2.displayName;const ih=N.forwardRef(({className:e,...t},n)=>c.jsx("textarea",{className:ye("flex min-h-[60px] w-full rounded-md border border-input bg-transparent px-3 py-2 text-base shadow-sm placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:cursor-not-allowed disabled:opacity-50 md:text-sm",e),ref:n,...t}));ih.displayName="Textarea";function PM(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function Kle(e){if(Array.isArray(e))return e}function Yle(e,t,n){return(t=nce(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Xle(e,t){var n=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(n!=null){var r,a,s,i,l=[],d=!0,f=!1;try{if(s=(n=n.call(e)).next,t!==0)for(;!(d=(r=s.call(n)).done)&&(l.push(r.value),l.length!==t);d=!0);}catch(h){f=!0,a=h}finally{try{if(!d&&n.return!=null&&(i=n.return(),Object(i)!==i))return}finally{if(f)throw a}}return l}}function Zle(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
|
|
700
|
+
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function $M(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(a){return Object.getOwnPropertyDescriptor(e,a).enumerable})),n.push.apply(n,r)}return n}function IM(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?$M(Object(n),!0).forEach(function(r){Yle(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):$M(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function Qle(e,t){if(e==null)return{};var n,r,a=Jle(e,t);if(Object.getOwnPropertySymbols){var s=Object.getOwnPropertySymbols(e);for(r=0;r<s.length;r++)n=s[r],t.indexOf(n)===-1&&{}.propertyIsEnumerable.call(e,n)&&(a[n]=e[n])}return a}function Jle(e,t){if(e==null)return{};var n={};for(var r in e)if({}.hasOwnProperty.call(e,r)){if(t.indexOf(r)!==-1)continue;n[r]=e[r]}return n}function ece(e,t){return Kle(e)||Xle(e,t)||rce(e,t)||Zle()}function tce(e,t){if(typeof e!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function nce(e){var t=tce(e,"string");return typeof t=="symbol"?t:t+""}function rce(e,t){if(e){if(typeof e=="string")return PM(e,t);var n={}.toString.call(e).slice(8,-1);return n==="Object"&&e.constructor&&(n=e.constructor.name),n==="Map"||n==="Set"?Array.from(e):n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?PM(e,t):void 0}}function ace(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function LM(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(a){return Object.getOwnPropertyDescriptor(e,a).enumerable})),n.push.apply(n,r)}return n}function zM(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?LM(Object(n),!0).forEach(function(r){ace(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):LM(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function sce(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return function(r){return t.reduceRight(function(a,s){return s(a)},r)}}function Hd(e){return function t(){for(var n=this,r=arguments.length,a=new Array(r),s=0;s<r;s++)a[s]=arguments[s];return a.length>=e.length?e.apply(this,a):function(){for(var i=arguments.length,l=new Array(i),d=0;d<i;d++)l[d]=arguments[d];return t.apply(n,[].concat(a,l))}}}function iy(e){return{}.toString.call(e).includes("Object")}function oce(e){return!Object.keys(e).length}function bf(e){return typeof e=="function"}function ice(e,t){return Object.prototype.hasOwnProperty.call(e,t)}function lce(e,t){return iy(t)||Do("changeType"),Object.keys(t).some(function(n){return!ice(e,n)})&&Do("changeField"),t}function cce(e){bf(e)||Do("selectorType")}function uce(e){bf(e)||iy(e)||Do("handlerType"),iy(e)&&Object.values(e).some(function(t){return!bf(t)})&&Do("handlersType")}function dce(e){e||Do("initialIsRequired"),iy(e)||Do("initialType"),oce(e)&&Do("initialContent")}function fce(e,t){throw new Error(e[t]||e.default)}var hce={initialIsRequired:"initial state is required",initialType:"initial state should be an object",initialContent:"initial state shouldn't be an empty object",handlerType:"handler should be an object or a function",handlersType:"all handlers should be a functions",selectorType:"selector should be a function",changeType:"provided value of changes should be an object",changeField:'it seams you want to change a field in the state which is not specified in the "initial" state',default:"an unknown error accured in `state-local` package"},Do=Hd(fce)(hce),gm={changes:lce,selector:cce,handler:uce,initial:dce};function pce(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};gm.initial(e),gm.handler(t);var n={current:e},r=Hd(yce)(n,t),a=Hd(gce)(n),s=Hd(gm.changes)(e),i=Hd(mce)(n);function l(){var f=arguments.length>0&&arguments[0]!==void 0?arguments[0]:function(h){return h};return gm.selector(f),f(n.current)}function d(f){sce(r,a,s,i)(f)}return[l,d]}function mce(e,t){return bf(t)?t(e.current):t}function gce(e,t){return e.current=zM(zM({},e.current),t),t}function yce(e,t,n){return bf(t)?t(e.current):Object.keys(n).forEach(function(r){var a;return(a=t[r])===null||a===void 0?void 0:a.call(t,e.current[r])}),n}var vce={create:pce},xce={paths:{vs:"https://cdn.jsdelivr.net/npm/monaco-editor@0.54.0/min/vs"}};function bce(e){return function t(){for(var n=this,r=arguments.length,a=new Array(r),s=0;s<r;s++)a[s]=arguments[s];return a.length>=e.length?e.apply(this,a):function(){for(var i=arguments.length,l=new Array(i),d=0;d<i;d++)l[d]=arguments[d];return t.apply(n,[].concat(a,l))}}}function wce(e){return{}.toString.call(e).includes("Object")}function Sce(e){return e||qM("configIsRequired"),wce(e)||qM("configType"),e.urls?(_ce(),{paths:{vs:e.urls.monacoBase}}):e}function _ce(){console.warn(fF.deprecation)}function Nce(e,t){throw new Error(e[t]||e.default)}var fF={configIsRequired:"the configuration object is required",configType:"the configuration object should be an object",default:"an unknown error accured in `@monaco-editor/loader` package",deprecation:`Deprecation warning!
|
|
701
|
+
You are using deprecated way of configuration.
|
|
702
|
+
|
|
703
|
+
Instead of using
|
|
704
|
+
monaco.config({ urls: { monacoBase: '...' } })
|
|
705
|
+
use
|
|
706
|
+
monaco.config({ paths: { vs: '...' } })
|
|
707
|
+
|
|
708
|
+
For more please check the link https://github.com/suren-atoyan/monaco-loader#config
|
|
709
|
+
`},qM=bce(Nce)(fF),jce={config:Sce},Cce=function(){for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];return function(a){return n.reduceRight(function(s,i){return i(s)},a)}};function hF(e,t){return Object.keys(t).forEach(function(n){t[n]instanceof Object&&e[n]&&Object.assign(t[n],hF(e[n],t[n]))}),IM(IM({},e),t)}var Ece={type:"cancelation",msg:"operation is manually canceled"};function vw(e){var t=!1,n=new Promise(function(r,a){e.then(function(s){return t?a(Ece):r(s)}),e.catch(a)});return n.cancel=function(){return t=!0},n}var Tce=["monaco"],Ace=vce.create({config:xce,isInitialized:!1,resolve:null,reject:null,monaco:null}),pF=ece(Ace,2),lh=pF[0],bv=pF[1];function Rce(e){var t=jce.config(e),n=t.monaco,r=Qle(t,Tce);bv(function(a){return{config:hF(a.config,r),monaco:n}})}function kce(){var e=lh(function(t){var n=t.monaco,r=t.isInitialized,a=t.resolve;return{monaco:n,isInitialized:r,resolve:a}});if(!e.isInitialized){if(bv({isInitialized:!0}),e.monaco)return e.resolve(e.monaco),vw(xw);if(window.monaco&&window.monaco.editor)return mF(window.monaco),e.resolve(window.monaco),vw(xw);Cce(Oce,Dce)(Pce)}return vw(xw)}function Oce(e){return document.body.appendChild(e)}function Mce(e){var t=document.createElement("script");return e&&(t.src=e),t}function Dce(e){var t=lh(function(r){var a=r.config,s=r.reject;return{config:a,reject:s}}),n=Mce("".concat(t.config.paths.vs,"/loader.js"));return n.onload=function(){return e()},n.onerror=t.reject,n}function Pce(){var e=lh(function(n){var r=n.config,a=n.resolve,s=n.reject;return{config:r,resolve:a,reject:s}}),t=window.require;t.config(e.config),t(["vs/editor/editor.main"],function(n){var r=n.m;mF(r),e.resolve(r)},function(n){e.reject(n)})}function mF(e){lh().monaco||bv({monaco:e})}function $ce(){return lh(function(e){var t=e.monaco;return t})}var xw=new Promise(function(e,t){return bv({resolve:e,reject:t})}),gF={config:Rce,init:kce,__getMonacoInstance:$ce},Ice={wrapper:{display:"flex",position:"relative",textAlign:"initial"},fullWidth:{width:"100%"},hide:{display:"none"}},bw=Ice,Lce={container:{display:"flex",height:"100%",width:"100%",justifyContent:"center",alignItems:"center"}},zce=Lce;function qce({children:e}){return Me.createElement("div",{style:zce.container},e)}var Fce=qce,Uce=Fce;function Hce({width:e,height:t,isEditorReady:n,loading:r,_ref:a,className:s,wrapperProps:i}){return Me.createElement("section",{style:{...bw.wrapper,width:e,height:t},...i},!n&&Me.createElement(Uce,null,r),Me.createElement("div",{ref:a,style:{...bw.fullWidth,...!n&&bw.hide},className:s}))}var Bce=Hce,yF=N.memo(Bce);function Vce(e){N.useEffect(e,[])}var vF=Vce;function Wce(e,t,n=!0){let r=N.useRef(!0);N.useEffect(r.current||!n?()=>{r.current=!1}:e,t)}var pr=Wce;function ef(){}function Cc(e,t,n,r){return Gce(e,r)||Kce(e,t,n,r)}function Gce(e,t){return e.editor.getModel(xF(e,t))}function Kce(e,t,n,r){return e.editor.createModel(t,n,r?xF(e,r):void 0)}function xF(e,t){return e.Uri.parse(t)}function Yce({original:e,modified:t,language:n,originalLanguage:r,modifiedLanguage:a,originalModelPath:s,modifiedModelPath:i,keepCurrentOriginalModel:l=!1,keepCurrentModifiedModel:d=!1,theme:f="light",loading:h="Loading...",options:p={},height:g="100%",width:y="100%",className:S,wrapperProps:w={},beforeMount:b=ef,onMount:x=ef}){let[_,j]=N.useState(!1),[C,T]=N.useState(!0),A=N.useRef(null),k=N.useRef(null),O=N.useRef(null),M=N.useRef(x),z=N.useRef(b),L=N.useRef(!1);vF(()=>{let V=gF.init();return V.then(P=>(k.current=P)&&T(!1)).catch(P=>(P==null?void 0:P.type)!=="cancelation"&&console.error("Monaco initialization: error:",P)),()=>A.current?q():V.cancel()}),pr(()=>{if(A.current&&k.current){let V=A.current.getOriginalEditor(),P=Cc(k.current,e||"",r||n||"text",s||"");P!==V.getModel()&&V.setModel(P)}},[s],_),pr(()=>{if(A.current&&k.current){let V=A.current.getModifiedEditor(),P=Cc(k.current,t||"",a||n||"text",i||"");P!==V.getModel()&&V.setModel(P)}},[i],_),pr(()=>{let V=A.current.getModifiedEditor();V.getOption(k.current.editor.EditorOption.readOnly)?V.setValue(t||""):t!==V.getValue()&&(V.executeEdits("",[{range:V.getModel().getFullModelRange(),text:t||"",forceMoveMarkers:!0}]),V.pushUndoStop())},[t],_),pr(()=>{var V,P;(P=(V=A.current)==null?void 0:V.getModel())==null||P.original.setValue(e||"")},[e],_),pr(()=>{let{original:V,modified:P}=A.current.getModel();k.current.editor.setModelLanguage(V,r||n||"text"),k.current.editor.setModelLanguage(P,a||n||"text")},[n,r,a],_),pr(()=>{var V;(V=k.current)==null||V.editor.setTheme(f)},[f],_),pr(()=>{var V;(V=A.current)==null||V.updateOptions(p)},[p],_);let U=N.useCallback(()=>{var K;if(!k.current)return;z.current(k.current);let V=Cc(k.current,e||"",r||n||"text",s||""),P=Cc(k.current,t||"",a||n||"text",i||"");(K=A.current)==null||K.setModel({original:V,modified:P})},[n,t,a,e,r,s,i]),F=N.useCallback(()=>{var V;!L.current&&O.current&&(A.current=k.current.editor.createDiffEditor(O.current,{automaticLayout:!0,...p}),U(),(V=k.current)==null||V.editor.setTheme(f),j(!0),L.current=!0)},[p,f,U]);N.useEffect(()=>{_&&M.current(A.current,k.current)},[_]),N.useEffect(()=>{!C&&!_&&F()},[C,_,F]);function q(){var P,K,H,Z;let V=(P=A.current)==null?void 0:P.getModel();l||((K=V==null?void 0:V.original)==null||K.dispose()),d||((H=V==null?void 0:V.modified)==null||H.dispose()),(Z=A.current)==null||Z.dispose()}return Me.createElement(yF,{width:y,height:g,isEditorReady:_,loading:h,_ref:O,className:S,wrapperProps:w})}var Xce=Yce;N.memo(Xce);function Zce(e){let t=N.useRef();return N.useEffect(()=>{t.current=e},[e]),t.current}var Qce=Zce,ym=new Map;function Jce({defaultValue:e,defaultLanguage:t,defaultPath:n,value:r,language:a,path:s,theme:i="light",line:l,loading:d="Loading...",options:f={},overrideServices:h={},saveViewState:p=!0,keepCurrentModel:g=!1,width:y="100%",height:S="100%",className:w,wrapperProps:b={},beforeMount:x=ef,onMount:_=ef,onChange:j,onValidate:C=ef}){let[T,A]=N.useState(!1),[k,O]=N.useState(!0),M=N.useRef(null),z=N.useRef(null),L=N.useRef(null),U=N.useRef(_),F=N.useRef(x),q=N.useRef(),V=N.useRef(r),P=Qce(s),K=N.useRef(!1),H=N.useRef(!1);vF(()=>{let D=gF.init();return D.then(W=>(M.current=W)&&O(!1)).catch(W=>(W==null?void 0:W.type)!=="cancelation"&&console.error("Monaco initialization: error:",W)),()=>z.current?J():D.cancel()}),pr(()=>{var W,B,$,G;let D=Cc(M.current,e||r||"",t||a||"",s||n||"");D!==((W=z.current)==null?void 0:W.getModel())&&(p&&ym.set(P,(B=z.current)==null?void 0:B.saveViewState()),($=z.current)==null||$.setModel(D),p&&((G=z.current)==null||G.restoreViewState(ym.get(s))))},[s],T),pr(()=>{var D;(D=z.current)==null||D.updateOptions(f)},[f],T),pr(()=>{!z.current||r===void 0||(z.current.getOption(M.current.editor.EditorOption.readOnly)?z.current.setValue(r):r!==z.current.getValue()&&(H.current=!0,z.current.executeEdits("",[{range:z.current.getModel().getFullModelRange(),text:r,forceMoveMarkers:!0}]),z.current.pushUndoStop(),H.current=!1))},[r],T),pr(()=>{var W,B;let D=(W=z.current)==null?void 0:W.getModel();D&&a&&((B=M.current)==null||B.editor.setModelLanguage(D,a))},[a],T),pr(()=>{var D;l!==void 0&&((D=z.current)==null||D.revealLine(l))},[l],T),pr(()=>{var D;(D=M.current)==null||D.editor.setTheme(i)},[i],T);let Z=N.useCallback(()=>{var D;if(!(!L.current||!M.current)&&!K.current){F.current(M.current);let W=s||n,B=Cc(M.current,r||e||"",t||a||"",W||"");z.current=(D=M.current)==null?void 0:D.editor.create(L.current,{model:B,automaticLayout:!0,...f},h),p&&z.current.restoreViewState(ym.get(W)),M.current.editor.setTheme(i),l!==void 0&&z.current.revealLine(l),A(!0),K.current=!0}},[e,t,n,r,a,s,f,h,p,i,l]);N.useEffect(()=>{T&&U.current(z.current,M.current)},[T]),N.useEffect(()=>{!k&&!T&&Z()},[k,T,Z]),V.current=r,N.useEffect(()=>{var D,W;T&&j&&((D=q.current)==null||D.dispose(),q.current=(W=z.current)==null?void 0:W.onDidChangeModelContent(B=>{H.current||j(z.current.getValue(),B)}))},[T,j]),N.useEffect(()=>{if(T){let D=M.current.editor.onDidChangeMarkers(W=>{var $;let B=($=z.current.getModel())==null?void 0:$.uri;if(B&&W.find(G=>G.path===B.path)){let G=M.current.editor.getModelMarkers({resource:B});C==null||C(G)}});return()=>{D==null||D.dispose()}}return()=>{}},[T,C]);function J(){var D,W;(D=q.current)==null||D.dispose(),g?p&&ym.set(s,z.current.saveViewState()):(W=z.current.getModel())==null||W.dispose(),z.current.dispose()}return Me.createElement(yF,{width:y,height:S,isEditorReady:T,loading:d,_ref:L,className:w,wrapperProps:b})}var eue=Jce,tue=N.memo(eue),nue=tue;function ot(e){return typeof e!="object"||e===null||typeof e.lastModified=="number"&&typeof File<"u"&&e instanceof File||typeof e.getMonth=="function"&&typeof Date<"u"&&e instanceof Date?!1:!Array.isArray(e)}function rue(e){return e.additionalItems===!0&&console.warn("additionalItems=true is currently not supported"),ot(e.additionalItems)}function FM(e){if(e==="")return;if(e===null)return null;if(/\.$/.test(e)||/\.0$/.test(e)||/\.\d*0$/.test(e))return e;const t=Number(e);return typeof t=="number"&&!Number.isNaN(t)?t:e}const ch="__additional_property",nC="additionalProperties",xu="allOf",na="anyOf",Ms="const",aue="default",wv="dependencies",sue="enum",gr="__errors",Ao="$id",oue="if",Po="items",iue="_$junk_option_schema_id$_",kg="$name",vr="oneOf",Xt="properties",lue="required",ly="submitButtonOptions",mn="$ref",F2="__rjsf_additionalProperties",bF="__rjsf_rootSchema",cue="ui:field",U2="ui:widget",tf="ui:options",uue="ui:globalOptions";function at(e={},t={}){return Object.keys(e).filter(n=>n.indexOf("ui:")===0).reduce((n,r)=>{const a=e[r];return r===U2&&ot(a)?(console.error("Setting options via ui:widget object is no longer supported, use ui:options instead"),n):r===tf&&ot(a)?{...n,...a}:{...n,[r.substring(3)]:a}},{...t})}function due(e,t={},n){if(!e.additionalProperties)return!1;const{expandable:r=!0}=at(t);return r===!1?r:e.maxProperties!==void 0&&n?Object.keys(n).length<e.maxProperties:!0}var wF=typeof global=="object"&&global&&global.Object===Object&&global,fue=typeof self=="object"&&self&&self.Object===Object&&self,Fa=wF||fue||Function("return this")(),Ir=Fa.Symbol,SF=Object.prototype,hue=SF.hasOwnProperty,pue=SF.toString,Ed=Ir?Ir.toStringTag:void 0;function mue(e){var t=hue.call(e,Ed),n=e[Ed];try{e[Ed]=void 0;var r=!0}catch{}var a=pue.call(e);return r&&(t?e[Ed]=n:delete e[Ed]),a}var gue=Object.prototype,yue=gue.toString;function vue(e){return yue.call(e)}var xue="[object Null]",bue="[object Undefined]",UM=Ir?Ir.toStringTag:void 0;function zs(e){return e==null?e===void 0?bue:xue:UM&&UM in Object(e)?mue(e):vue(e)}function _F(e,t){return function(n){return e(t(n))}}var Sv=_F(Object.getPrototypeOf,Object);function Lr(e){return e!=null&&typeof e=="object"}var wue="[object Object]",Sue=Function.prototype,_ue=Object.prototype,NF=Sue.toString,Nue=_ue.hasOwnProperty,jue=NF.call(Object);function Ji(e){if(!Lr(e)||zs(e)!=wue)return!1;var t=Sv(e);if(t===null)return!0;var n=Nue.call(t,"constructor")&&t.constructor;return typeof n=="function"&&n instanceof n&&NF.call(n)==jue}function cy(e){const t={[gr]:[],addError(n){this[gr].push(n)}};if(Array.isArray(e))return e.reduce((n,r,a)=>({...n,[a]:cy(r)}),t);if(Ji(e)){const n=e;return Object.keys(n).reduce((r,a)=>({...r,[a]:cy(n[a])}),t)}return t}function Cue(){this.__data__=[],this.size=0}function uh(e,t){return e===t||e!==e&&t!==t}function _v(e,t){for(var n=e.length;n--;)if(uh(e[n][0],t))return n;return-1}var Eue=Array.prototype,Tue=Eue.splice;function Aue(e){var t=this.__data__,n=_v(t,e);if(n<0)return!1;var r=t.length-1;return n==r?t.pop():Tue.call(t,n,1),--this.size,!0}function Rue(e){var t=this.__data__,n=_v(t,e);return n<0?void 0:t[n][1]}function kue(e){return _v(this.__data__,e)>-1}function Oue(e,t){var n=this.__data__,r=_v(n,e);return r<0?(++this.size,n.push([e,t])):n[r][1]=t,this}function qs(e){var t=-1,n=e==null?0:e.length;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}qs.prototype.clear=Cue;qs.prototype.delete=Aue;qs.prototype.get=Rue;qs.prototype.has=kue;qs.prototype.set=Oue;function Mue(){this.__data__=new qs,this.size=0}function Due(e){var t=this.__data__,n=t.delete(e);return this.size=t.size,n}function Pue(e){return this.__data__.get(e)}function $ue(e){return this.__data__.has(e)}function Tt(e){var t=typeof e;return e!=null&&(t=="object"||t=="function")}var Iue="[object AsyncFunction]",Lue="[object Function]",zue="[object GeneratorFunction]",que="[object Proxy]";function Nv(e){if(!Tt(e))return!1;var t=zs(e);return t==Lue||t==zue||t==Iue||t==que}var ww=Fa["__core-js_shared__"],HM=(function(){var e=/[^.]+$/.exec(ww&&ww.keys&&ww.keys.IE_PROTO||"");return e?"Symbol(src)_1."+e:""})();function Fue(e){return!!HM&&HM in e}var Uue=Function.prototype,Hue=Uue.toString;function gl(e){if(e!=null){try{return Hue.call(e)}catch{}try{return e+""}catch{}}return""}var Bue=/[\\^$.*+?()[\]{}|]/g,Vue=/^\[object .+?Constructor\]$/,Wue=Function.prototype,Gue=Object.prototype,Kue=Wue.toString,Yue=Gue.hasOwnProperty,Xue=RegExp("^"+Kue.call(Yue).replace(Bue,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");function Zue(e){if(!Tt(e)||Fue(e))return!1;var t=Nv(e)?Xue:Vue;return t.test(gl(e))}function Que(e,t){return e==null?void 0:e[t]}function yl(e,t){var n=Que(e,t);return Zue(n)?n:void 0}var wf=yl(Fa,"Map"),Sf=yl(Object,"create");function Jue(){this.__data__=Sf?Sf(null):{},this.size=0}function ede(e){var t=this.has(e)&&delete this.__data__[e];return this.size-=t?1:0,t}var tde="__lodash_hash_undefined__",nde=Object.prototype,rde=nde.hasOwnProperty;function ade(e){var t=this.__data__;if(Sf){var n=t[e];return n===tde?void 0:n}return rde.call(t,e)?t[e]:void 0}var sde=Object.prototype,ode=sde.hasOwnProperty;function ide(e){var t=this.__data__;return Sf?t[e]!==void 0:ode.call(t,e)}var lde="__lodash_hash_undefined__";function cde(e,t){var n=this.__data__;return this.size+=this.has(e)?0:1,n[e]=Sf&&t===void 0?lde:t,this}function el(e){var t=-1,n=e==null?0:e.length;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}el.prototype.clear=Jue;el.prototype.delete=ede;el.prototype.get=ade;el.prototype.has=ide;el.prototype.set=cde;function ude(){this.size=0,this.__data__={hash:new el,map:new(wf||qs),string:new el}}function dde(e){var t=typeof e;return t=="string"||t=="number"||t=="symbol"||t=="boolean"?e!=="__proto__":e===null}function jv(e,t){var n=e.__data__;return dde(t)?n[typeof t=="string"?"string":"hash"]:n.map}function fde(e){var t=jv(this,e).delete(e);return this.size-=t?1:0,t}function hde(e){return jv(this,e).get(e)}function pde(e){return jv(this,e).has(e)}function mde(e,t){var n=jv(this,e),r=n.size;return n.set(e,t),this.size+=n.size==r?0:1,this}function Fs(e){var t=-1,n=e==null?0:e.length;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}Fs.prototype.clear=ude;Fs.prototype.delete=fde;Fs.prototype.get=hde;Fs.prototype.has=pde;Fs.prototype.set=mde;var gde=200;function yde(e,t){var n=this.__data__;if(n instanceof qs){var r=n.__data__;if(!wf||r.length<gde-1)return r.push([e,t]),this.size=++n.size,this;n=this.__data__=new Fs(r)}return n.set(e,t),this.size=n.size,this}function sa(e){var t=this.__data__=new qs(e);this.size=t.size}sa.prototype.clear=Mue;sa.prototype.delete=Due;sa.prototype.get=Pue;sa.prototype.has=$ue;sa.prototype.set=yde;var vde="__lodash_hash_undefined__";function xde(e){return this.__data__.set(e,vde),this}function bde(e){return this.__data__.has(e)}function Vc(e){var t=-1,n=e==null?0:e.length;for(this.__data__=new Fs;++t<n;)this.add(e[t])}Vc.prototype.add=Vc.prototype.push=xde;Vc.prototype.has=bde;function wde(e,t){for(var n=-1,r=e==null?0:e.length;++n<r;)if(t(e[n],n,e))return!0;return!1}function H2(e,t){return e.has(t)}var Sde=1,_de=2;function jF(e,t,n,r,a,s){var i=n&Sde,l=e.length,d=t.length;if(l!=d&&!(i&&d>l))return!1;var f=s.get(e),h=s.get(t);if(f&&h)return f==t&&h==e;var p=-1,g=!0,y=n&_de?new Vc:void 0;for(s.set(e,t),s.set(t,e);++p<l;){var S=e[p],w=t[p];if(r)var b=i?r(w,S,p,t,e,s):r(S,w,p,e,t,s);if(b!==void 0){if(b)continue;g=!1;break}if(y){if(!wde(t,function(x,_){if(!H2(y,_)&&(S===x||a(S,x,n,r,s)))return y.push(_)})){g=!1;break}}else if(!(S===w||a(S,w,n,r,s))){g=!1;break}}return s.delete(e),s.delete(t),g}var uy=Fa.Uint8Array;function Nde(e){var t=-1,n=Array(e.size);return e.forEach(function(r,a){n[++t]=[a,r]}),n}function B2(e){var t=-1,n=Array(e.size);return e.forEach(function(r){n[++t]=r}),n}var jde=1,Cde=2,Ede="[object Boolean]",Tde="[object Date]",Ade="[object Error]",Rde="[object Map]",kde="[object Number]",Ode="[object RegExp]",Mde="[object Set]",Dde="[object String]",Pde="[object Symbol]",$de="[object ArrayBuffer]",Ide="[object DataView]",BM=Ir?Ir.prototype:void 0,Sw=BM?BM.valueOf:void 0;function Lde(e,t,n,r,a,s,i){switch(n){case Ide:if(e.byteLength!=t.byteLength||e.byteOffset!=t.byteOffset)return!1;e=e.buffer,t=t.buffer;case $de:return!(e.byteLength!=t.byteLength||!s(new uy(e),new uy(t)));case Ede:case Tde:case kde:return uh(+e,+t);case Ade:return e.name==t.name&&e.message==t.message;case Ode:case Dde:return e==t+"";case Rde:var l=Nde;case Mde:var d=r&jde;if(l||(l=B2),e.size!=t.size&&!d)return!1;var f=i.get(e);if(f)return f==t;r|=Cde,i.set(e,t);var h=jF(l(e),l(t),r,a,s,i);return i.delete(e),h;case Pde:if(Sw)return Sw.call(e)==Sw.call(t)}return!1}function V2(e,t){for(var n=-1,r=t.length,a=e.length;++n<r;)e[a+n]=t[n];return e}var yn=Array.isArray;function CF(e,t,n){var r=t(e);return yn(e)?r:V2(r,n(e))}function zde(e,t){for(var n=-1,r=e==null?0:e.length,a=0,s=[];++n<r;){var i=e[n];t(i,n,e)&&(s[a++]=i)}return s}function EF(){return[]}var qde=Object.prototype,Fde=qde.propertyIsEnumerable,VM=Object.getOwnPropertySymbols,W2=VM?function(e){return e==null?[]:(e=Object(e),zde(VM(e),function(t){return Fde.call(e,t)}))}:EF;function TF(e,t){for(var n=-1,r=Array(e);++n<e;)r[n]=t(n);return r}var Ude="[object Arguments]";function WM(e){return Lr(e)&&zs(e)==Ude}var AF=Object.prototype,Hde=AF.hasOwnProperty,Bde=AF.propertyIsEnumerable,Wc=WM((function(){return arguments})())?WM:function(e){return Lr(e)&&Hde.call(e,"callee")&&!Bde.call(e,"callee")};function Vde(){return!1}var RF=typeof br=="object"&&br&&!br.nodeType&&br,GM=RF&&typeof wr=="object"&&wr&&!wr.nodeType&&wr,Wde=GM&&GM.exports===RF,KM=Wde?Fa.Buffer:void 0,Gde=KM?KM.isBuffer:void 0,tl=Gde||Vde,Kde=9007199254740991,Yde=/^(?:0|[1-9]\d*)$/;function Cv(e,t){var n=typeof e;return t=t??Kde,!!t&&(n=="number"||n!="symbol"&&Yde.test(e))&&e>-1&&e%1==0&&e<t}var Xde=9007199254740991;function G2(e){return typeof e=="number"&&e>-1&&e%1==0&&e<=Xde}var Zde="[object Arguments]",Qde="[object Array]",Jde="[object Boolean]",efe="[object Date]",tfe="[object Error]",nfe="[object Function]",rfe="[object Map]",afe="[object Number]",sfe="[object Object]",ofe="[object RegExp]",ife="[object Set]",lfe="[object String]",cfe="[object WeakMap]",ufe="[object ArrayBuffer]",dfe="[object DataView]",ffe="[object Float32Array]",hfe="[object Float64Array]",pfe="[object Int8Array]",mfe="[object Int16Array]",gfe="[object Int32Array]",yfe="[object Uint8Array]",vfe="[object Uint8ClampedArray]",xfe="[object Uint16Array]",bfe="[object Uint32Array]",Dt={};Dt[ffe]=Dt[hfe]=Dt[pfe]=Dt[mfe]=Dt[gfe]=Dt[yfe]=Dt[vfe]=Dt[xfe]=Dt[bfe]=!0;Dt[Zde]=Dt[Qde]=Dt[ufe]=Dt[Jde]=Dt[dfe]=Dt[efe]=Dt[tfe]=Dt[nfe]=Dt[rfe]=Dt[afe]=Dt[sfe]=Dt[ofe]=Dt[ife]=Dt[lfe]=Dt[cfe]=!1;function wfe(e){return Lr(e)&&G2(e.length)&&!!Dt[zs(e)]}function K2(e){return function(t){return e(t)}}var kF=typeof br=="object"&&br&&!br.nodeType&&br,nf=kF&&typeof wr=="object"&&wr&&!wr.nodeType&&wr,Sfe=nf&&nf.exports===kF,_w=Sfe&&wF.process,Gc=(function(){try{var e=nf&&nf.require&&nf.require("util").types;return e||_w&&_w.binding&&_w.binding("util")}catch{}})(),YM=Gc&&Gc.isTypedArray,dh=YM?K2(YM):wfe,_fe=Object.prototype,Nfe=_fe.hasOwnProperty;function OF(e,t){var n=yn(e),r=!n&&Wc(e),a=!n&&!r&&tl(e),s=!n&&!r&&!a&&dh(e),i=n||r||a||s,l=i?TF(e.length,String):[],d=l.length;for(var f in e)(t||Nfe.call(e,f))&&!(i&&(f=="length"||a&&(f=="offset"||f=="parent")||s&&(f=="buffer"||f=="byteLength"||f=="byteOffset")||Cv(f,d)))&&l.push(f);return l}var jfe=Object.prototype;function Ev(e){var t=e&&e.constructor,n=typeof t=="function"&&t.prototype||jfe;return e===n}var Cfe=_F(Object.keys,Object),Efe=Object.prototype,Tfe=Efe.hasOwnProperty;function MF(e){if(!Ev(e))return Cfe(e);var t=[];for(var n in Object(e))Tfe.call(e,n)&&n!="constructor"&&t.push(n);return t}function bu(e){return e!=null&&G2(e.length)&&!Nv(e)}function Na(e){return bu(e)?OF(e):MF(e)}function rC(e){return CF(e,Na,W2)}var Afe=1,Rfe=Object.prototype,kfe=Rfe.hasOwnProperty;function Ofe(e,t,n,r,a,s){var i=n&Afe,l=rC(e),d=l.length,f=rC(t),h=f.length;if(d!=h&&!i)return!1;for(var p=d;p--;){var g=l[p];if(!(i?g in t:kfe.call(t,g)))return!1}var y=s.get(e),S=s.get(t);if(y&&S)return y==t&&S==e;var w=!0;s.set(e,t),s.set(t,e);for(var b=i;++p<d;){g=l[p];var x=e[g],_=t[g];if(r)var j=i?r(_,x,g,t,e,s):r(x,_,g,e,t,s);if(!(j===void 0?x===_||a(x,_,n,r,s):j)){w=!1;break}b||(b=g=="constructor")}if(w&&!b){var C=e.constructor,T=t.constructor;C!=T&&"constructor"in e&&"constructor"in t&&!(typeof C=="function"&&C instanceof C&&typeof T=="function"&&T instanceof T)&&(w=!1)}return s.delete(e),s.delete(t),w}var aC=yl(Fa,"DataView"),sC=yl(Fa,"Promise"),Dc=yl(Fa,"Set"),oC=yl(Fa,"WeakMap"),XM="[object Map]",Mfe="[object Object]",ZM="[object Promise]",QM="[object Set]",JM="[object WeakMap]",e4="[object DataView]",Dfe=gl(aC),Pfe=gl(wf),$fe=gl(sC),Ife=gl(Dc),Lfe=gl(oC),Pr=zs;(aC&&Pr(new aC(new ArrayBuffer(1)))!=e4||wf&&Pr(new wf)!=XM||sC&&Pr(sC.resolve())!=ZM||Dc&&Pr(new Dc)!=QM||oC&&Pr(new oC)!=JM)&&(Pr=function(e){var t=zs(e),n=t==Mfe?e.constructor:void 0,r=n?gl(n):"";if(r)switch(r){case Dfe:return e4;case Pfe:return XM;case $fe:return ZM;case Ife:return QM;case Lfe:return JM}return t});var zfe=1,t4="[object Arguments]",n4="[object Array]",vm="[object Object]",qfe=Object.prototype,r4=qfe.hasOwnProperty;function Ffe(e,t,n,r,a,s){var i=yn(e),l=yn(t),d=i?n4:Pr(e),f=l?n4:Pr(t);d=d==t4?vm:d,f=f==t4?vm:f;var h=d==vm,p=f==vm,g=d==f;if(g&&tl(e)){if(!tl(t))return!1;i=!0,h=!1}if(g&&!h)return s||(s=new sa),i||dh(e)?jF(e,t,n,r,a,s):Lde(e,t,d,n,r,a,s);if(!(n&zfe)){var y=h&&r4.call(e,"__wrapped__"),S=p&&r4.call(t,"__wrapped__");if(y||S){var w=y?e.value():e,b=S?t.value():t;return s||(s=new sa),a(w,b,n,r,s)}}return g?(s||(s=new sa),Ofe(e,t,n,r,a,s)):!1}function Tv(e,t,n,r,a){return e===t?!0:e==null||t==null||!Lr(e)&&!Lr(t)?e!==e&&t!==t:Ffe(e,t,n,r,Tv,a)}function Ufe(e,t,n){n=typeof n=="function"?n:void 0;var r=n?n(e,t):void 0;return r===void 0?Tv(e,t,void 0,n):!!r}function Pt(e,t){return Ufe(e,t,(n,r)=>{if(typeof n=="function"&&typeof r=="function")return!0})}var Hfe="[object Symbol]";function fh(e){return typeof e=="symbol"||Lr(e)&&zs(e)==Hfe}var Bfe=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,Vfe=/^\w*$/;function Y2(e,t){if(yn(e))return!1;var n=typeof e;return n=="number"||n=="symbol"||n=="boolean"||e==null||fh(e)?!0:Vfe.test(e)||!Bfe.test(e)||t!=null&&e in Object(t)}var Wfe="Expected a function";function X2(e,t){if(typeof e!="function"||t!=null&&typeof t!="function")throw new TypeError(Wfe);var n=function(){var r=arguments,a=t?t.apply(this,r):r[0],s=n.cache;if(s.has(a))return s.get(a);var i=e.apply(this,r);return n.cache=s.set(a,i)||s,i};return n.cache=new(X2.Cache||Fs),n}X2.Cache=Fs;var Gfe=500;function Kfe(e){var t=X2(e,function(r){return n.size===Gfe&&n.clear(),r}),n=t.cache;return t}var Yfe=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,Xfe=/\\(\\)?/g,DF=Kfe(function(e){var t=[];return e.charCodeAt(0)===46&&t.push(""),e.replace(Yfe,function(n,r,a,s){t.push(a?s.replace(Xfe,"$1"):r||n)}),t});function Av(e,t){for(var n=-1,r=e==null?0:e.length,a=Array(r);++n<r;)a[n]=t(e[n],n,e);return a}var a4=Ir?Ir.prototype:void 0,s4=a4?a4.toString:void 0;function PF(e){if(typeof e=="string")return e;if(yn(e))return Av(e,PF)+"";if(fh(e))return s4?s4.call(e):"";var t=e+"";return t=="0"&&1/e==-1/0?"-0":t}function Z2(e){return e==null?"":PF(e)}function wu(e,t){return yn(e)?e:Y2(e,t)?[e]:DF(Z2(e))}function vl(e){if(typeof e=="string"||fh(e))return e;var t=e+"";return t=="0"&&1/e==-1/0?"-0":t}function Rv(e,t){t=wu(t,e);for(var n=0,r=t.length;e!=null&&n<r;)e=e[vl(t[n++])];return n&&n==r?e:void 0}function Oe(e,t,n){var r=e==null?void 0:Rv(e,t);return r===void 0?n:r}var Zfe="[object Map]",Qfe="[object Set]",Jfe=Object.prototype,ehe=Jfe.hasOwnProperty;function Kc(e){if(e==null)return!0;if(bu(e)&&(yn(e)||typeof e=="string"||typeof e.splice=="function"||tl(e)||dh(e)||Wc(e)))return!e.length;var t=Pr(e);if(t==Zfe||t==Qfe)return!e.size;if(Ev(e))return!MF(e).length;for(var n in e)if(ehe.call(e,n))return!1;return!0}var Td={},o4;function the(){if(o4)return Td;o4=1;var e=/~/,t=/~[01]/g;function n(f){switch(f){case"~1":return"/";case"~0":return"~"}throw new Error("Invalid tilde escape: "+f)}function r(f){return e.test(f)?f.replace(t,n):f}function a(f,h,p){for(var g,y,S=1,w=h.length;S<w;){if(h[S]==="constructor"||h[S]==="prototype"||h[S]==="__proto__")return f;if(g=r(h[S++]),y=w>S,typeof f[g]>"u"&&(Array.isArray(f)&&g==="-"&&(g=f.length),y&&(h[S]!==""&&h[S]<1/0||h[S]==="-"?f[g]=[]:f[g]={})),!y)break;f=f[g]}var b=f[g];return p===void 0?delete f[g]:f[g]=p,b}function s(f){if(typeof f=="string"){if(f=f.split("/"),f[0]==="")return f;throw new Error("Invalid JSON pointer.")}else if(Array.isArray(f)){for(const h of f)if(typeof h!="string"&&typeof h!="number")throw new Error("Invalid JSON pointer. Must be of type string or number.");return f}throw new Error("Invalid JSON pointer.")}function i(f,h){if(typeof f!="object")throw new Error("Invalid input object.");h=s(h);var p=h.length;if(p===1)return f;for(var g=1;g<p;){if(f=f[r(h[g++])],p===g)return f;if(typeof f!="object"||f===null)return}}function l(f,h,p){if(typeof f!="object")throw new Error("Invalid input object.");if(h=s(h),h.length===0)throw new Error("Invalid JSON pointer for set.");return a(f,h,p)}function d(f){var h=s(f);return{get:function(p){return i(p,h)},set:function(p,g){return l(p,h,g)}}}return Td.get=i,Td.set=l,Td.compile=d,Td}var nhe=the();const rhe=zr(nhe);function Q2(e,t){for(var n=-1,r=e==null?0:e.length;++n<r&&t(e[n],n,e)!==!1;);return e}var dy=(function(){try{var e=yl(Object,"defineProperty");return e({},"",{}),e}catch{}})();function J2(e,t,n){t=="__proto__"&&dy?dy(e,t,{configurable:!0,enumerable:!0,value:n,writable:!0}):e[t]=n}var ahe=Object.prototype,she=ahe.hasOwnProperty;function eE(e,t,n){var r=e[t];(!(she.call(e,t)&&uh(r,n))||n===void 0&&!(t in e))&&J2(e,t,n)}function Su(e,t,n,r){var a=!n;n||(n={});for(var s=-1,i=t.length;++s<i;){var l=t[s],d=void 0;d===void 0&&(d=e[l]),a?J2(n,l,d):eE(n,l,d)}return n}function ohe(e,t){return e&&Su(t,Na(t),e)}function ihe(e){var t=[];if(e!=null)for(var n in Object(e))t.push(n);return t}var lhe=Object.prototype,che=lhe.hasOwnProperty;function uhe(e){if(!Tt(e))return ihe(e);var t=Ev(e),n=[];for(var r in e)r=="constructor"&&(t||!che.call(e,r))||n.push(r);return n}function hh(e){return bu(e)?OF(e,!0):uhe(e)}function dhe(e,t){return e&&Su(t,hh(t),e)}var $F=typeof br=="object"&&br&&!br.nodeType&&br,i4=$F&&typeof wr=="object"&&wr&&!wr.nodeType&&wr,fhe=i4&&i4.exports===$F,l4=fhe?Fa.Buffer:void 0,c4=l4?l4.allocUnsafe:void 0;function IF(e,t){if(t)return e.slice();var n=e.length,r=c4?c4(n):new e.constructor(n);return e.copy(r),r}function tE(e,t){var n=-1,r=e.length;for(t||(t=Array(r));++n<r;)t[n]=e[n];return t}function hhe(e,t){return Su(e,W2(e),t)}var phe=Object.getOwnPropertySymbols,LF=phe?function(e){for(var t=[];e;)V2(t,W2(e)),e=Sv(e);return t}:EF;function mhe(e,t){return Su(e,LF(e),t)}function nE(e){return CF(e,hh,LF)}var ghe=Object.prototype,yhe=ghe.hasOwnProperty;function vhe(e){var t=e.length,n=new e.constructor(t);return t&&typeof e[0]=="string"&&yhe.call(e,"index")&&(n.index=e.index,n.input=e.input),n}function rE(e){var t=new e.constructor(e.byteLength);return new uy(t).set(new uy(e)),t}function xhe(e,t){var n=t?rE(e.buffer):e.buffer;return new e.constructor(n,e.byteOffset,e.byteLength)}var bhe=/\w*$/;function whe(e){var t=new e.constructor(e.source,bhe.exec(e));return t.lastIndex=e.lastIndex,t}var u4=Ir?Ir.prototype:void 0,d4=u4?u4.valueOf:void 0;function She(e){return d4?Object(d4.call(e)):{}}function zF(e,t){var n=t?rE(e.buffer):e.buffer;return new e.constructor(n,e.byteOffset,e.length)}var _he="[object Boolean]",Nhe="[object Date]",jhe="[object Map]",Che="[object Number]",Ehe="[object RegExp]",The="[object Set]",Ahe="[object String]",Rhe="[object Symbol]",khe="[object ArrayBuffer]",Ohe="[object DataView]",Mhe="[object Float32Array]",Dhe="[object Float64Array]",Phe="[object Int8Array]",$he="[object Int16Array]",Ihe="[object Int32Array]",Lhe="[object Uint8Array]",zhe="[object Uint8ClampedArray]",qhe="[object Uint16Array]",Fhe="[object Uint32Array]";function Uhe(e,t,n){var r=e.constructor;switch(t){case khe:return rE(e);case _he:case Nhe:return new r(+e);case Ohe:return xhe(e,n);case Mhe:case Dhe:case Phe:case $he:case Ihe:case Lhe:case zhe:case qhe:case Fhe:return zF(e,n);case jhe:return new r;case Che:case Ahe:return new r(e);case Ehe:return whe(e);case The:return new r;case Rhe:return She(e)}}var f4=Object.create,qF=(function(){function e(){}return function(t){if(!Tt(t))return{};if(f4)return f4(t);e.prototype=t;var n=new e;return e.prototype=void 0,n}})();function FF(e){return typeof e.constructor=="function"&&!Ev(e)?qF(Sv(e)):{}}var Hhe="[object Map]";function Bhe(e){return Lr(e)&&Pr(e)==Hhe}var h4=Gc&&Gc.isMap,Vhe=h4?K2(h4):Bhe,Whe="[object Set]";function Ghe(e){return Lr(e)&&Pr(e)==Whe}var p4=Gc&&Gc.isSet,Khe=p4?K2(p4):Ghe,Yhe=1,Xhe=2,Zhe=4,UF="[object Arguments]",Qhe="[object Array]",Jhe="[object Boolean]",epe="[object Date]",tpe="[object Error]",HF="[object Function]",npe="[object GeneratorFunction]",rpe="[object Map]",ape="[object Number]",BF="[object Object]",spe="[object RegExp]",ope="[object Set]",ipe="[object String]",lpe="[object Symbol]",cpe="[object WeakMap]",upe="[object ArrayBuffer]",dpe="[object DataView]",fpe="[object Float32Array]",hpe="[object Float64Array]",ppe="[object Int8Array]",mpe="[object Int16Array]",gpe="[object Int32Array]",ype="[object Uint8Array]",vpe="[object Uint8ClampedArray]",xpe="[object Uint16Array]",bpe="[object Uint32Array]",Et={};Et[UF]=Et[Qhe]=Et[upe]=Et[dpe]=Et[Jhe]=Et[epe]=Et[fpe]=Et[hpe]=Et[ppe]=Et[mpe]=Et[gpe]=Et[rpe]=Et[ape]=Et[BF]=Et[spe]=Et[ope]=Et[ipe]=Et[lpe]=Et[ype]=Et[vpe]=Et[xpe]=Et[bpe]=!0;Et[tpe]=Et[HF]=Et[cpe]=!1;function rf(e,t,n,r,a,s){var i,l=t&Yhe,d=t&Xhe,f=t&Zhe;if(n&&(i=a?n(e,r,a,s):n(e)),i!==void 0)return i;if(!Tt(e))return e;var h=yn(e);if(h){if(i=vhe(e),!l)return tE(e,i)}else{var p=Pr(e),g=p==HF||p==npe;if(tl(e))return IF(e,l);if(p==BF||p==UF||g&&!a){if(i=d||g?{}:FF(e),!l)return d?mhe(e,dhe(i,e)):hhe(e,ohe(i,e))}else{if(!Et[p])return a?e:{};i=Uhe(e,p,l)}}s||(s=new sa);var y=s.get(e);if(y)return y;s.set(e,i),Khe(e)?e.forEach(function(b){i.add(rf(b,t,n,b,e,s))}):Vhe(e)&&e.forEach(function(b,x){i.set(x,rf(b,t,n,x,e,s))});var S=f?d?nE:rC:d?hh:Na,w=h?void 0:S(e);return Q2(w||e,function(b,x){w&&(x=b,b=e[x]),eE(i,x,rf(b,t,n,x,e,s))}),i}function wpe(e){var t=e==null?0:e.length;return t?e[t-1]:void 0}function Spe(e,t,n){var r=-1,a=e.length;t<0&&(t=-t>a?0:a+t),n=n>a?a:n,n<0&&(n+=a),a=t>n?0:n-t>>>0,t>>>=0;for(var s=Array(a);++r<a;)s[r]=e[r+t];return s}function _pe(e,t){return t.length<2?e:Rv(e,Spe(t,0,-1))}function VF(e,t){return t=wu(t,e),e=_pe(e,t),e==null||delete e[vl(wpe(t))]}function Npe(e){return Ji(e)?void 0:e}var m4=Ir?Ir.isConcatSpreadable:void 0;function jpe(e){return yn(e)||Wc(e)||!!(m4&&e&&e[m4])}function ph(e,t,n,r,a){var s=-1,i=e.length;for(n||(n=jpe),a||(a=[]);++s<i;){var l=e[s];t>0&&n(l)?t>1?ph(l,t-1,n,r,a):V2(a,l):r||(a[a.length]=l)}return a}function Cpe(e){var t=e==null?0:e.length;return t?ph(e,1):[]}function Epe(e,t,n){switch(n.length){case 0:return e.call(t);case 1:return e.call(t,n[0]);case 2:return e.call(t,n[0],n[1]);case 3:return e.call(t,n[0],n[1],n[2])}return e.apply(t,n)}var g4=Math.max;function WF(e,t,n){return t=g4(t===void 0?e.length-1:t,0),function(){for(var r=arguments,a=-1,s=g4(r.length-t,0),i=Array(s);++a<s;)i[a]=r[t+a];a=-1;for(var l=Array(t+1);++a<t;)l[a]=r[a];return l[t]=n(i),Epe(e,this,l)}}function Tpe(e){return function(){return e}}function kv(e){return e}var Ape=dy?function(e,t){return dy(e,"toString",{configurable:!0,enumerable:!1,value:Tpe(t),writable:!0})}:kv,Rpe=800,kpe=16,Ope=Date.now;function Mpe(e){var t=0,n=0;return function(){var r=Ope(),a=kpe-(r-n);if(n=r,a>0){if(++t>=Rpe)return arguments[0]}else t=0;return e.apply(void 0,arguments)}}var GF=Mpe(Ape);function KF(e){return GF(WF(e,void 0,Cpe),e+"")}var Dpe=1,Ppe=2,$pe=4,fy=KF(function(e,t){var n={};if(e==null)return n;var r=!1;t=Av(t,function(s){return s=wu(s,e),r||(r=s.length>1),s}),Su(e,nE(e),n),r&&(n=rf(n,Dpe|Ppe|$pe,Npe));for(var a=t.length;a--;)VF(n,t[a]);return n});function aE(e,t){const n=t[e];return[fy(t,[e]),n]}function YF(e,t={},n=[]){const r=e||"";let a;if(r.startsWith("#"))a=decodeURIComponent(r.substring(1));else throw new Error(`Could not find a definition for ${e}.`);const s=rhe.get(t,a);if(s===void 0)throw new Error(`Could not find a definition for ${e}.`);const i=s[mn];if(i){if(n.includes(i)){if(n.length===1)throw new Error(`Definition for ${e} is a circular reference`);const[h,...p]=n,g=[...p,r,h].join(" -> ");throw new Error(`Definition for ${h} contains a circular reference through ${g}`)}const[l,d]=aE(mn,s),f=YF(d,t,[...n,r]);return Object.keys(l).length>0?{...l,...f}:f}return s}function XF(e,t={}){return YF(e,t,[])}var Ipe=Object.prototype,Lpe=Ipe.hasOwnProperty;function zpe(e,t){return e!=null&&Lpe.call(e,t)}function ZF(e,t,n){t=wu(t,e);for(var r=-1,a=t.length,s=!1;++r<a;){var i=vl(t[r]);if(!(s=e!=null&&n(e,i)))break;e=e[i]}return s||++r!=a?s:(a=e==null?0:e.length,!!a&&G2(a)&&Cv(i,a)&&(yn(e)||Wc(e)))}function Bn(e,t){return e!=null&&ZF(e,t,zpe)}var qpe="[object Number]";function QF(e){return typeof e=="number"||Lr(e)&&zs(e)==qpe}var Fpe="[object String]";function Ov(e){return typeof e=="string"||!yn(e)&&Lr(e)&&zs(e)==Fpe}function Upe(e,t,n,r){var a=-1,s=e==null?0:e.length;for(r&&s&&(n=e[++a]);++a<s;)n=t(n,e[a],a,e);return n}function Hpe(e){return function(t,n,r){for(var a=-1,s=Object(t),i=r(t),l=i.length;l--;){var d=i[++a];if(n(s[d],d,s)===!1)break}return t}}var JF=Hpe();function e7(e,t){return e&&JF(e,t,Na)}function Bpe(e,t){return function(n,r){if(n==null)return n;if(!bu(n))return e(n,r);for(var a=n.length,s=-1,i=Object(n);++s<a&&r(i[s],s,i)!==!1;);return n}}var t7=Bpe(e7),Vpe=1,Wpe=2;function Gpe(e,t,n,r){var a=n.length,s=a;if(e==null)return!s;for(e=Object(e);a--;){var i=n[a];if(i[2]?i[1]!==e[i[0]]:!(i[0]in e))return!1}for(;++a<s;){i=n[a];var l=i[0],d=e[l],f=i[1];if(i[2]){if(d===void 0&&!(l in e))return!1}else{var h=new sa,p;if(!(p===void 0?Tv(f,d,Vpe|Wpe,r,h):p))return!1}}return!0}function n7(e){return e===e&&!Tt(e)}function Kpe(e){for(var t=Na(e),n=t.length;n--;){var r=t[n],a=e[r];t[n]=[r,a,n7(a)]}return t}function r7(e,t){return function(n){return n==null?!1:n[e]===t&&(t!==void 0||e in Object(n))}}function Ype(e){var t=Kpe(e);return t.length==1&&t[0][2]?r7(t[0][0],t[0][1]):function(n){return n===e||Gpe(n,e,t)}}function Xpe(e,t){return e!=null&&t in Object(e)}function a7(e,t){return e!=null&&ZF(e,t,Xpe)}var Zpe=1,Qpe=2;function Jpe(e,t){return Y2(e)&&n7(t)?r7(vl(e),t):function(n){var r=Oe(n,e);return r===void 0&&r===t?a7(n,e):Tv(t,r,Zpe|Qpe)}}function eme(e){return function(t){return t==null?void 0:t[e]}}function tme(e){return function(t){return Rv(t,e)}}function nme(e){return Y2(e)?eme(vl(e)):tme(e)}function sE(e){return typeof e=="function"?e:e==null?kv:typeof e=="object"?yn(e)?Jpe(e[0],e[1]):Ype(e):nme(e)}function rme(e,t,n,r,a){return a(e,function(s,i,l){n=r?(r=!1,s):t(n,s,i,l)}),n}function ame(e,t,n){var r=yn(e)?Upe:rme,a=arguments.length<3;return r(e,sE(t),n,a,t7)}function s7(e){return typeof e=="function"?e:kv}var sme=/\s/;function ome(e){for(var t=e.length;t--&&sme.test(e.charAt(t)););return t}var ime=/^\s+/;function lme(e){return e&&e.slice(0,ome(e)+1).replace(ime,"")}var y4=NaN,cme=/^[-+]0x[0-9a-f]+$/i,ume=/^0b[01]+$/i,dme=/^0o[0-7]+$/i,fme=parseInt;function hme(e){if(typeof e=="number")return e;if(fh(e))return y4;if(Tt(e)){var t=typeof e.valueOf=="function"?e.valueOf():e;e=Tt(t)?t+"":t}if(typeof e!="string")return e===0?e:+e;e=lme(e);var n=ume.test(e);return n||dme.test(e)?fme(e.slice(2),n?2:8):cme.test(e)?y4:+e}var v4=1/0,pme=17976931348623157e292;function mme(e){if(!e)return e===0?e:0;if(e=hme(e),e===v4||e===-v4){var t=e<0?-1:1;return t*pme}return e===e?e:0}function gme(e){var t=mme(e),n=t%1;return t===t?n?t-n:t:0}var yme=9007199254740991,Nw=4294967295,vme=Math.min;function o7(e,t){if(e=gme(e),e<1||e>yme)return[];var n=Nw,r=vme(e,Nw);t=s7(t),e-=Nw;for(var a=TF(r,t);++n<e;)t(n);return a}function i7(e,t,n){var r;if(e&&n){const a=Oe(e,n);if(a===void 0)return;for(let s=0;s<t.length;s++){const i=t[s],l=Oe(i,[Xt,n],{});if(!(l.type==="object"||l.type==="array")&&(l.const===a||!((r=l.enum)===null||r===void 0)&&r.includes(a)))return s}}}function l7(e,t,n,r,a){if(t===void 0)return 0;const s=i7(t,n,a);if(QF(s))return s;for(let i=0;i<n.length;i++){const l=n[i];if(a&&Bn(l,[Xt,a])){const d=Oe(t,a),f=Oe(l,[Xt,a],{});if(e.isValid(f,d,r))return i}else if(l[Xt]){const d={anyOf:Object.keys(l[Xt]).map(h=>({required:[h]}))};let f;if(l.anyOf){const{...h}=l;h.allOf?h.allOf=h.allOf.slice():h.allOf=[],h.allOf.push(d),f=h}else f=Object.assign({},l,d);if(delete f.required,e.isValid(f,t,r))return i}else if(e.isValid(l,t,r))return i}return 0}function oE(e,t,n,r,a){return l7(e,t,n,r,a)}function iE(e,t,n,r){if(!Tt(e))return e;t=wu(t,e);for(var a=-1,s=t.length,i=s-1,l=e;l!=null&&++a<s;){var d=vl(t[a]),f=n;if(d==="__proto__"||d==="constructor"||d==="prototype")return e;if(a!=i){var h=l[d];f=r?r(h,d,l):void 0,f===void 0&&(f=Tt(h)?h:Cv(t[a+1])?[]:{})}eE(l,d,f),l=l[d]}return e}function Tn(e,t,n){return e==null?e:iE(e,t,n)}function xme(e,t,n){var r=yn(e),a=r||tl(e)||dh(e);if(t=sE(t),n==null){var s=e&&e.constructor;a?n=r?new s:[]:Tt(e)?n=Nv(s)?qF(Sv(e)):{}:n={}}return(a?Q2:e7)(e,function(i,l,d){return t(n,i,l,d)}),n}function iC(e,t,n){(n!==void 0&&!uh(e[t],n)||n===void 0&&!(t in e))&&J2(e,t,n)}function hy(e){return Lr(e)&&bu(e)}function lC(e,t){if(!(t==="constructor"&&typeof e[t]=="function")&&t!="__proto__")return e[t]}function bme(e){return Su(e,hh(e))}function wme(e,t,n,r,a,s,i){var l=lC(e,n),d=lC(t,n),f=i.get(d);if(f){iC(e,n,f);return}var h=s?s(l,d,n+"",e,t,i):void 0,p=h===void 0;if(p){var g=yn(d),y=!g&&tl(d),S=!g&&!y&&dh(d);h=d,g||y||S?yn(l)?h=l:hy(l)?h=tE(l):y?(p=!1,h=IF(d,!0)):S?(p=!1,h=zF(d,!0)):h=[]:Ji(d)||Wc(d)?(h=l,Wc(l)?h=bme(l):(!Tt(l)||Nv(l))&&(h=FF(d))):p=!1}p&&(i.set(d,h),a(h,d,r,s,i),i.delete(d)),iC(e,n,h)}function c7(e,t,n,r,a){e!==t&&JF(t,function(s,i){if(a||(a=new sa),Tt(s))wme(e,t,i,n,c7,r,a);else{var l=r?r(lC(e,i),s,i+"",e,t,a):void 0;l===void 0&&(l=s),iC(e,i,l)}},hh)}function lE(e,t){return GF(WF(e,t,kv),e+"")}function Sme(e,t,n){if(!Tt(n))return!1;var r=typeof t;return(r=="number"?bu(n)&&Cv(t,n.length):r=="string"&&t in n)?uh(n[t],e):!1}function _me(e){return lE(function(t,n){var r=-1,a=n.length,s=a>1?n[a-1]:void 0,i=a>2?n[2]:void 0;for(s=e.length>3&&typeof s=="function"?(a--,s):void 0,i&&Sme(n[0],n[1],i)&&(s=a<3?void 0:s,a=1),t=Object(t);++r<a;){var l=n[r];l&&e(t,l,r,s)}return t})}var Nme=_me(function(e,t,n){c7(e,t,n)}),jme=1/0;function Cme(e){var t=e==null?0:e.length;return t?ph(e,jme):[]}function Eme(e,t,n,r){for(var a=e.length,s=n+-1;++s<a;)if(t(e[s],s,e))return s;return-1}function Tme(e){return e!==e}function Ame(e,t,n){for(var r=n-1,a=e.length;++r<a;)if(e[r]===t)return r;return-1}function Rme(e,t,n){return t===t?Ame(e,t,n):Eme(e,Tme,n)}function u7(e,t){var n=e==null?0:e.length;return!!n&&Rme(e,t,0)>-1}function kme(){}var Ome=1/0,Mme=Dc&&1/B2(new Dc([,-0]))[1]==Ome?function(e){return new Dc(e)}:kme,Dme=200;function d7(e,t,n){var r=-1,a=u7,s=e.length,i=!0,l=[],d=l;if(s>=Dme){var f=Mme(e);if(f)return B2(f);i=!1,a=H2,d=new Vc}else d=l;e:for(;++r<s;){var h=e[r],p=h;if(h=h!==0?h:0,i&&p===p){for(var g=d.length;g--;)if(d[g]===p)continue e;l.push(h)}else a(d,p,n)||(d!==l&&d.push(p),l.push(h))}return l}function Pme(e){return e&&e.length?d7(e):[]}var jw,x4;function $me(){if(x4)return jw;x4=1;function e(){this.__data__=[],this.size=0}return jw=e,jw}var Cw,b4;function _u(){if(b4)return Cw;b4=1;function e(t,n){return t===n||t!==t&&n!==n}return Cw=e,Cw}var Ew,w4;function Mv(){if(w4)return Ew;w4=1;var e=_u();function t(n,r){for(var a=n.length;a--;)if(e(n[a][0],r))return a;return-1}return Ew=t,Ew}var Tw,S4;function Ime(){if(S4)return Tw;S4=1;var e=Mv(),t=Array.prototype,n=t.splice;function r(a){var s=this.__data__,i=e(s,a);if(i<0)return!1;var l=s.length-1;return i==l?s.pop():n.call(s,i,1),--this.size,!0}return Tw=r,Tw}var Aw,_4;function Lme(){if(_4)return Aw;_4=1;var e=Mv();function t(n){var r=this.__data__,a=e(r,n);return a<0?void 0:r[a][1]}return Aw=t,Aw}var Rw,N4;function zme(){if(N4)return Rw;N4=1;var e=Mv();function t(n){return e(this.__data__,n)>-1}return Rw=t,Rw}var kw,j4;function qme(){if(j4)return kw;j4=1;var e=Mv();function t(n,r){var a=this.__data__,s=e(a,n);return s<0?(++this.size,a.push([n,r])):a[s][1]=r,this}return kw=t,kw}var Ow,C4;function Dv(){if(C4)return Ow;C4=1;var e=$me(),t=Ime(),n=Lme(),r=zme(),a=qme();function s(i){var l=-1,d=i==null?0:i.length;for(this.clear();++l<d;){var f=i[l];this.set(f[0],f[1])}}return s.prototype.clear=e,s.prototype.delete=t,s.prototype.get=n,s.prototype.has=r,s.prototype.set=a,Ow=s,Ow}var Mw,E4;function Fme(){if(E4)return Mw;E4=1;var e=Dv();function t(){this.__data__=new e,this.size=0}return Mw=t,Mw}var Dw,T4;function Ume(){if(T4)return Dw;T4=1;function e(t){var n=this.__data__,r=n.delete(t);return this.size=n.size,r}return Dw=e,Dw}var Pw,A4;function Hme(){if(A4)return Pw;A4=1;function e(t){return this.__data__.get(t)}return Pw=e,Pw}var $w,R4;function Bme(){if(R4)return $w;R4=1;function e(t){return this.__data__.has(t)}return $w=e,$w}var Iw,k4;function f7(){if(k4)return Iw;k4=1;var e=typeof rm=="object"&&rm&&rm.Object===Object&&rm;return Iw=e,Iw}var Lw,O4;function Ua(){if(O4)return Lw;O4=1;var e=f7(),t=typeof self=="object"&&self&&self.Object===Object&&self,n=e||t||Function("return this")();return Lw=n,Lw}var zw,M4;function Nu(){if(M4)return zw;M4=1;var e=Ua(),t=e.Symbol;return zw=t,zw}var qw,D4;function Vme(){if(D4)return qw;D4=1;var e=Nu(),t=Object.prototype,n=t.hasOwnProperty,r=t.toString,a=e?e.toStringTag:void 0;function s(i){var l=n.call(i,a),d=i[a];try{i[a]=void 0;var f=!0}catch{}var h=r.call(i);return f&&(l?i[a]=d:delete i[a]),h}return qw=s,qw}var Fw,P4;function Wme(){if(P4)return Fw;P4=1;var e=Object.prototype,t=e.toString;function n(r){return t.call(r)}return Fw=n,Fw}var Uw,$4;function xl(){if($4)return Uw;$4=1;var e=Nu(),t=Vme(),n=Wme(),r="[object Null]",a="[object Undefined]",s=e?e.toStringTag:void 0;function i(l){return l==null?l===void 0?a:r:s&&s in Object(l)?t(l):n(l)}return Uw=i,Uw}var Hw,I4;function Ha(){if(I4)return Hw;I4=1;function e(t){var n=typeof t;return t!=null&&(n=="object"||n=="function")}return Hw=e,Hw}var Bw,L4;function cE(){if(L4)return Bw;L4=1;var e=xl(),t=Ha(),n="[object AsyncFunction]",r="[object Function]",a="[object GeneratorFunction]",s="[object Proxy]";function i(l){if(!t(l))return!1;var d=e(l);return d==r||d==a||d==n||d==s}return Bw=i,Bw}var Vw,z4;function Gme(){if(z4)return Vw;z4=1;var e=Ua(),t=e["__core-js_shared__"];return Vw=t,Vw}var Ww,q4;function Kme(){if(q4)return Ww;q4=1;var e=Gme(),t=(function(){var r=/[^.]+$/.exec(e&&e.keys&&e.keys.IE_PROTO||"");return r?"Symbol(src)_1."+r:""})();function n(r){return!!t&&t in r}return Ww=n,Ww}var Gw,F4;function h7(){if(F4)return Gw;F4=1;var e=Function.prototype,t=e.toString;function n(r){if(r!=null){try{return t.call(r)}catch{}try{return r+""}catch{}}return""}return Gw=n,Gw}var Kw,U4;function Yme(){if(U4)return Kw;U4=1;var e=cE(),t=Kme(),n=Ha(),r=h7(),a=/[\\^$.*+?()[\]{}|]/g,s=/^\[object .+?Constructor\]$/,i=Function.prototype,l=Object.prototype,d=i.toString,f=l.hasOwnProperty,h=RegExp("^"+d.call(f).replace(a,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");function p(g){if(!n(g)||t(g))return!1;var y=e(g)?h:s;return y.test(r(g))}return Kw=p,Kw}var Yw,H4;function Xme(){if(H4)return Yw;H4=1;function e(t,n){return t==null?void 0:t[n]}return Yw=e,Yw}var Xw,B4;function bl(){if(B4)return Xw;B4=1;var e=Yme(),t=Xme();function n(r,a){var s=t(r,a);return e(s)?s:void 0}return Xw=n,Xw}var Zw,V4;function uE(){if(V4)return Zw;V4=1;var e=bl(),t=Ua(),n=e(t,"Map");return Zw=n,Zw}var Qw,W4;function Pv(){if(W4)return Qw;W4=1;var e=bl(),t=e(Object,"create");return Qw=t,Qw}var Jw,G4;function Zme(){if(G4)return Jw;G4=1;var e=Pv();function t(){this.__data__=e?e(null):{},this.size=0}return Jw=t,Jw}var e1,K4;function Qme(){if(K4)return e1;K4=1;function e(t){var n=this.has(t)&&delete this.__data__[t];return this.size-=n?1:0,n}return e1=e,e1}var t1,Y4;function Jme(){if(Y4)return t1;Y4=1;var e=Pv(),t="__lodash_hash_undefined__",n=Object.prototype,r=n.hasOwnProperty;function a(s){var i=this.__data__;if(e){var l=i[s];return l===t?void 0:l}return r.call(i,s)?i[s]:void 0}return t1=a,t1}var n1,X4;function ege(){if(X4)return n1;X4=1;var e=Pv(),t=Object.prototype,n=t.hasOwnProperty;function r(a){var s=this.__data__;return e?s[a]!==void 0:n.call(s,a)}return n1=r,n1}var r1,Z4;function tge(){if(Z4)return r1;Z4=1;var e=Pv(),t="__lodash_hash_undefined__";function n(r,a){var s=this.__data__;return this.size+=this.has(r)?0:1,s[r]=e&&a===void 0?t:a,this}return r1=n,r1}var a1,Q4;function nge(){if(Q4)return a1;Q4=1;var e=Zme(),t=Qme(),n=Jme(),r=ege(),a=tge();function s(i){var l=-1,d=i==null?0:i.length;for(this.clear();++l<d;){var f=i[l];this.set(f[0],f[1])}}return s.prototype.clear=e,s.prototype.delete=t,s.prototype.get=n,s.prototype.has=r,s.prototype.set=a,a1=s,a1}var s1,J4;function rge(){if(J4)return s1;J4=1;var e=nge(),t=Dv(),n=uE();function r(){this.size=0,this.__data__={hash:new e,map:new(n||t),string:new e}}return s1=r,s1}var o1,eD;function age(){if(eD)return o1;eD=1;function e(t){var n=typeof t;return n=="string"||n=="number"||n=="symbol"||n=="boolean"?t!=="__proto__":t===null}return o1=e,o1}var i1,tD;function $v(){if(tD)return i1;tD=1;var e=age();function t(n,r){var a=n.__data__;return e(r)?a[typeof r=="string"?"string":"hash"]:a.map}return i1=t,i1}var l1,nD;function sge(){if(nD)return l1;nD=1;var e=$v();function t(n){var r=e(this,n).delete(n);return this.size-=r?1:0,r}return l1=t,l1}var c1,rD;function oge(){if(rD)return c1;rD=1;var e=$v();function t(n){return e(this,n).get(n)}return c1=t,c1}var u1,aD;function ige(){if(aD)return u1;aD=1;var e=$v();function t(n){return e(this,n).has(n)}return u1=t,u1}var d1,sD;function lge(){if(sD)return d1;sD=1;var e=$v();function t(n,r){var a=e(this,n),s=a.size;return a.set(n,r),this.size+=a.size==s?0:1,this}return d1=t,d1}var f1,oD;function dE(){if(oD)return f1;oD=1;var e=rge(),t=sge(),n=oge(),r=ige(),a=lge();function s(i){var l=-1,d=i==null?0:i.length;for(this.clear();++l<d;){var f=i[l];this.set(f[0],f[1])}}return s.prototype.clear=e,s.prototype.delete=t,s.prototype.get=n,s.prototype.has=r,s.prototype.set=a,f1=s,f1}var h1,iD;function cge(){if(iD)return h1;iD=1;var e=Dv(),t=uE(),n=dE(),r=200;function a(s,i){var l=this.__data__;if(l instanceof e){var d=l.__data__;if(!t||d.length<r-1)return d.push([s,i]),this.size=++l.size,this;l=this.__data__=new n(d)}return l.set(s,i),this.size=l.size,this}return h1=a,h1}var p1,lD;function Iv(){if(lD)return p1;lD=1;var e=Dv(),t=Fme(),n=Ume(),r=Hme(),a=Bme(),s=cge();function i(l){var d=this.__data__=new e(l);this.size=d.size}return i.prototype.clear=t,i.prototype.delete=n,i.prototype.get=r,i.prototype.has=a,i.prototype.set=s,p1=i,p1}var m1,cD;function p7(){if(cD)return m1;cD=1;function e(t,n){for(var r=-1,a=t==null?0:t.length;++r<a&&n(t[r],r,t)!==!1;);return t}return m1=e,m1}var g1,uD;function m7(){if(uD)return g1;uD=1;var e=bl(),t=(function(){try{var n=e(Object,"defineProperty");return n({},"",{}),n}catch{}})();return g1=t,g1}var y1,dD;function fE(){if(dD)return y1;dD=1;var e=m7();function t(n,r,a){r=="__proto__"&&e?e(n,r,{configurable:!0,enumerable:!0,value:a,writable:!0}):n[r]=a}return y1=t,y1}var v1,fD;function g7(){if(fD)return v1;fD=1;var e=fE(),t=_u(),n=Object.prototype,r=n.hasOwnProperty;function a(s,i,l){var d=s[i];(!(r.call(s,i)&&t(d,l))||l===void 0&&!(i in s))&&e(s,i,l)}return v1=a,v1}var x1,hD;function mh(){if(hD)return x1;hD=1;var e=g7(),t=fE();function n(r,a,s,i){var l=!s;s||(s={});for(var d=-1,f=a.length;++d<f;){var h=a[d],p=i?i(s[h],r[h],h,s,r):void 0;p===void 0&&(p=r[h]),l?t(s,h,p):e(s,h,p)}return s}return x1=n,x1}var b1,pD;function uge(){if(pD)return b1;pD=1;function e(t,n){for(var r=-1,a=Array(t);++r<t;)a[r]=n(r);return a}return b1=e,b1}var w1,mD;function Ba(){if(mD)return w1;mD=1;function e(t){return t!=null&&typeof t=="object"}return w1=e,w1}var S1,gD;function dge(){if(gD)return S1;gD=1;var e=xl(),t=Ba(),n="[object Arguments]";function r(a){return t(a)&&e(a)==n}return S1=r,S1}var _1,yD;function Lv(){if(yD)return _1;yD=1;var e=dge(),t=Ba(),n=Object.prototype,r=n.hasOwnProperty,a=n.propertyIsEnumerable,s=e((function(){return arguments})())?e:function(i){return t(i)&&r.call(i,"callee")&&!a.call(i,"callee")};return _1=s,_1}var N1,vD;function Nr(){if(vD)return N1;vD=1;var e=Array.isArray;return N1=e,N1}var Bd={exports:{}},j1,xD;function fge(){if(xD)return j1;xD=1;function e(){return!1}return j1=e,j1}Bd.exports;var bD;function zv(){return bD||(bD=1,(function(e,t){var n=Ua(),r=fge(),a=t&&!t.nodeType&&t,s=a&&!0&&e&&!e.nodeType&&e,i=s&&s.exports===a,l=i?n.Buffer:void 0,d=l?l.isBuffer:void 0,f=d||r;e.exports=f})(Bd,Bd.exports)),Bd.exports}var C1,wD;function hE(){if(wD)return C1;wD=1;var e=9007199254740991,t=/^(?:0|[1-9]\d*)$/;function n(r,a){var s=typeof r;return a=a??e,!!a&&(s=="number"||s!="symbol"&&t.test(r))&&r>-1&&r%1==0&&r<a}return C1=n,C1}var E1,SD;function pE(){if(SD)return E1;SD=1;var e=9007199254740991;function t(n){return typeof n=="number"&&n>-1&&n%1==0&&n<=e}return E1=t,E1}var T1,_D;function hge(){if(_D)return T1;_D=1;var e=xl(),t=pE(),n=Ba(),r="[object Arguments]",a="[object Array]",s="[object Boolean]",i="[object Date]",l="[object Error]",d="[object Function]",f="[object Map]",h="[object Number]",p="[object Object]",g="[object RegExp]",y="[object Set]",S="[object String]",w="[object WeakMap]",b="[object ArrayBuffer]",x="[object DataView]",_="[object Float32Array]",j="[object Float64Array]",C="[object Int8Array]",T="[object Int16Array]",A="[object Int32Array]",k="[object Uint8Array]",O="[object Uint8ClampedArray]",M="[object Uint16Array]",z="[object Uint32Array]",L={};L[_]=L[j]=L[C]=L[T]=L[A]=L[k]=L[O]=L[M]=L[z]=!0,L[r]=L[a]=L[b]=L[s]=L[x]=L[i]=L[l]=L[d]=L[f]=L[h]=L[p]=L[g]=L[y]=L[S]=L[w]=!1;function U(F){return n(F)&&t(F.length)&&!!L[e(F)]}return T1=U,T1}var A1,ND;function wl(){if(ND)return A1;ND=1;function e(t){return function(n){return t(n)}}return A1=e,A1}var Vd={exports:{}};Vd.exports;var jD;function mE(){return jD||(jD=1,(function(e,t){var n=f7(),r=t&&!t.nodeType&&t,a=r&&!0&&e&&!e.nodeType&&e,s=a&&a.exports===r,i=s&&n.process,l=(function(){try{var d=a&&a.require&&a.require("util").types;return d||i&&i.binding&&i.binding("util")}catch{}})();e.exports=l})(Vd,Vd.exports)),Vd.exports}var R1,CD;function gE(){if(CD)return R1;CD=1;var e=hge(),t=wl(),n=mE(),r=n&&n.isTypedArray,a=r?t(r):e;return R1=a,R1}var k1,ED;function y7(){if(ED)return k1;ED=1;var e=uge(),t=Lv(),n=Nr(),r=zv(),a=hE(),s=gE(),i=Object.prototype,l=i.hasOwnProperty;function d(f,h){var p=n(f),g=!p&&t(f),y=!p&&!g&&r(f),S=!p&&!g&&!y&&s(f),w=p||g||y||S,b=w?e(f.length,String):[],x=b.length;for(var _ in f)(h||l.call(f,_))&&!(w&&(_=="length"||y&&(_=="offset"||_=="parent")||S&&(_=="buffer"||_=="byteLength"||_=="byteOffset")||a(_,x)))&&b.push(_);return b}return k1=d,k1}var O1,TD;function yE(){if(TD)return O1;TD=1;var e=Object.prototype;function t(n){var r=n&&n.constructor,a=typeof r=="function"&&r.prototype||e;return n===a}return O1=t,O1}var M1,AD;function v7(){if(AD)return M1;AD=1;function e(t,n){return function(r){return t(n(r))}}return M1=e,M1}var D1,RD;function pge(){if(RD)return D1;RD=1;var e=v7(),t=e(Object.keys,Object);return D1=t,D1}var P1,kD;function mge(){if(kD)return P1;kD=1;var e=yE(),t=pge(),n=Object.prototype,r=n.hasOwnProperty;function a(s){if(!e(s))return t(s);var i=[];for(var l in Object(s))r.call(s,l)&&l!="constructor"&&i.push(l);return i}return P1=a,P1}var $1,OD;function ju(){if(OD)return $1;OD=1;var e=cE(),t=pE();function n(r){return r!=null&&t(r.length)&&!e(r)}return $1=n,$1}var I1,MD;function gh(){if(MD)return I1;MD=1;var e=y7(),t=mge(),n=ju();function r(a){return n(a)?e(a):t(a)}return I1=r,I1}var L1,DD;function gge(){if(DD)return L1;DD=1;var e=mh(),t=gh();function n(r,a){return r&&e(a,t(a),r)}return L1=n,L1}var z1,PD;function yge(){if(PD)return z1;PD=1;function e(t){var n=[];if(t!=null)for(var r in Object(t))n.push(r);return n}return z1=e,z1}var q1,$D;function vge(){if($D)return q1;$D=1;var e=Ha(),t=yE(),n=yge(),r=Object.prototype,a=r.hasOwnProperty;function s(i){if(!e(i))return n(i);var l=t(i),d=[];for(var f in i)f=="constructor"&&(l||!a.call(i,f))||d.push(f);return d}return q1=s,q1}var F1,ID;function Cu(){if(ID)return F1;ID=1;var e=y7(),t=vge(),n=ju();function r(a){return n(a)?e(a,!0):t(a)}return F1=r,F1}var U1,LD;function xge(){if(LD)return U1;LD=1;var e=mh(),t=Cu();function n(r,a){return r&&e(a,t(a),r)}return U1=n,U1}var Wd={exports:{}};Wd.exports;var zD;function x7(){return zD||(zD=1,(function(e,t){var n=Ua(),r=t&&!t.nodeType&&t,a=r&&!0&&e&&!e.nodeType&&e,s=a&&a.exports===r,i=s?n.Buffer:void 0,l=i?i.allocUnsafe:void 0;function d(f,h){if(h)return f.slice();var p=f.length,g=l?l(p):new f.constructor(p);return f.copy(g),g}e.exports=d})(Wd,Wd.exports)),Wd.exports}var H1,qD;function vE(){if(qD)return H1;qD=1;function e(t,n){var r=-1,a=t.length;for(n||(n=Array(a));++r<a;)n[r]=t[r];return n}return H1=e,H1}var B1,FD;function bge(){if(FD)return B1;FD=1;function e(t,n){for(var r=-1,a=t==null?0:t.length,s=0,i=[];++r<a;){var l=t[r];n(l,r,t)&&(i[s++]=l)}return i}return B1=e,B1}var V1,UD;function b7(){if(UD)return V1;UD=1;function e(){return[]}return V1=e,V1}var W1,HD;function xE(){if(HD)return W1;HD=1;var e=bge(),t=b7(),n=Object.prototype,r=n.propertyIsEnumerable,a=Object.getOwnPropertySymbols,s=a?function(i){return i==null?[]:(i=Object(i),e(a(i),function(l){return r.call(i,l)}))}:t;return W1=s,W1}var G1,BD;function wge(){if(BD)return G1;BD=1;var e=mh(),t=xE();function n(r,a){return e(r,t(r),a)}return G1=n,G1}var K1,VD;function bE(){if(VD)return K1;VD=1;function e(t,n){for(var r=-1,a=n.length,s=t.length;++r<a;)t[s+r]=n[r];return t}return K1=e,K1}var Y1,WD;function wE(){if(WD)return Y1;WD=1;var e=v7(),t=e(Object.getPrototypeOf,Object);return Y1=t,Y1}var X1,GD;function w7(){if(GD)return X1;GD=1;var e=bE(),t=wE(),n=xE(),r=b7(),a=Object.getOwnPropertySymbols,s=a?function(i){for(var l=[];i;)e(l,n(i)),i=t(i);return l}:r;return X1=s,X1}var Z1,KD;function Sge(){if(KD)return Z1;KD=1;var e=mh(),t=w7();function n(r,a){return e(r,t(r),a)}return Z1=n,Z1}var Q1,YD;function S7(){if(YD)return Q1;YD=1;var e=bE(),t=Nr();function n(r,a,s){var i=a(r);return t(r)?i:e(i,s(r))}return Q1=n,Q1}var J1,XD;function _7(){if(XD)return J1;XD=1;var e=S7(),t=xE(),n=gh();function r(a){return e(a,n,t)}return J1=r,J1}var eS,ZD;function _ge(){if(ZD)return eS;ZD=1;var e=S7(),t=w7(),n=Cu();function r(a){return e(a,n,t)}return eS=r,eS}var tS,QD;function Nge(){if(QD)return tS;QD=1;var e=bl(),t=Ua(),n=e(t,"DataView");return tS=n,tS}var nS,JD;function jge(){if(JD)return nS;JD=1;var e=bl(),t=Ua(),n=e(t,"Promise");return nS=n,nS}var rS,eP;function N7(){if(eP)return rS;eP=1;var e=bl(),t=Ua(),n=e(t,"Set");return rS=n,rS}var aS,tP;function Cge(){if(tP)return aS;tP=1;var e=bl(),t=Ua(),n=e(t,"WeakMap");return aS=n,aS}var sS,nP;function qv(){if(nP)return sS;nP=1;var e=Nge(),t=uE(),n=jge(),r=N7(),a=Cge(),s=xl(),i=h7(),l="[object Map]",d="[object Object]",f="[object Promise]",h="[object Set]",p="[object WeakMap]",g="[object DataView]",y=i(e),S=i(t),w=i(n),b=i(r),x=i(a),_=s;return(e&&_(new e(new ArrayBuffer(1)))!=g||t&&_(new t)!=l||n&&_(n.resolve())!=f||r&&_(new r)!=h||a&&_(new a)!=p)&&(_=function(j){var C=s(j),T=C==d?j.constructor:void 0,A=T?i(T):"";if(A)switch(A){case y:return g;case S:return l;case w:return f;case b:return h;case x:return p}return C}),sS=_,sS}var oS,rP;function Ege(){if(rP)return oS;rP=1;var e=Object.prototype,t=e.hasOwnProperty;function n(r){var a=r.length,s=new r.constructor(a);return a&&typeof r[0]=="string"&&t.call(r,"index")&&(s.index=r.index,s.input=r.input),s}return oS=n,oS}var iS,aP;function j7(){if(aP)return iS;aP=1;var e=Ua(),t=e.Uint8Array;return iS=t,iS}var lS,sP;function SE(){if(sP)return lS;sP=1;var e=j7();function t(n){var r=new n.constructor(n.byteLength);return new e(r).set(new e(n)),r}return lS=t,lS}var cS,oP;function Tge(){if(oP)return cS;oP=1;var e=SE();function t(n,r){var a=r?e(n.buffer):n.buffer;return new n.constructor(a,n.byteOffset,n.byteLength)}return cS=t,cS}var uS,iP;function Age(){if(iP)return uS;iP=1;var e=/\w*$/;function t(n){var r=new n.constructor(n.source,e.exec(n));return r.lastIndex=n.lastIndex,r}return uS=t,uS}var dS,lP;function Rge(){if(lP)return dS;lP=1;var e=Nu(),t=e?e.prototype:void 0,n=t?t.valueOf:void 0;function r(a){return n?Object(n.call(a)):{}}return dS=r,dS}var fS,cP;function C7(){if(cP)return fS;cP=1;var e=SE();function t(n,r){var a=r?e(n.buffer):n.buffer;return new n.constructor(a,n.byteOffset,n.length)}return fS=t,fS}var hS,uP;function kge(){if(uP)return hS;uP=1;var e=SE(),t=Tge(),n=Age(),r=Rge(),a=C7(),s="[object Boolean]",i="[object Date]",l="[object Map]",d="[object Number]",f="[object RegExp]",h="[object Set]",p="[object String]",g="[object Symbol]",y="[object ArrayBuffer]",S="[object DataView]",w="[object Float32Array]",b="[object Float64Array]",x="[object Int8Array]",_="[object Int16Array]",j="[object Int32Array]",C="[object Uint8Array]",T="[object Uint8ClampedArray]",A="[object Uint16Array]",k="[object Uint32Array]";function O(M,z,L){var U=M.constructor;switch(z){case y:return e(M);case s:case i:return new U(+M);case S:return t(M,L);case w:case b:case x:case _:case j:case C:case T:case A:case k:return a(M,L);case l:return new U;case d:case p:return new U(M);case f:return n(M);case h:return new U;case g:return r(M)}}return hS=O,hS}var pS,dP;function Oge(){if(dP)return pS;dP=1;var e=Ha(),t=Object.create,n=(function(){function r(){}return function(a){if(!e(a))return{};if(t)return t(a);r.prototype=a;var s=new r;return r.prototype=void 0,s}})();return pS=n,pS}var mS,fP;function E7(){if(fP)return mS;fP=1;var e=Oge(),t=wE(),n=yE();function r(a){return typeof a.constructor=="function"&&!n(a)?e(t(a)):{}}return mS=r,mS}var gS,hP;function Mge(){if(hP)return gS;hP=1;var e=qv(),t=Ba(),n="[object Map]";function r(a){return t(a)&&e(a)==n}return gS=r,gS}var yS,pP;function Dge(){if(pP)return yS;pP=1;var e=Mge(),t=wl(),n=mE(),r=n&&n.isMap,a=r?t(r):e;return yS=a,yS}var vS,mP;function Pge(){if(mP)return vS;mP=1;var e=qv(),t=Ba(),n="[object Set]";function r(a){return t(a)&&e(a)==n}return vS=r,vS}var xS,gP;function $ge(){if(gP)return xS;gP=1;var e=Pge(),t=wl(),n=mE(),r=n&&n.isSet,a=r?t(r):e;return xS=a,xS}var bS,yP;function Ige(){if(yP)return bS;yP=1;var e=Iv(),t=p7(),n=g7(),r=gge(),a=xge(),s=x7(),i=vE(),l=wge(),d=Sge(),f=_7(),h=_ge(),p=qv(),g=Ege(),y=kge(),S=E7(),w=Nr(),b=zv(),x=Dge(),_=Ha(),j=$ge(),C=gh(),T=Cu(),A=1,k=2,O=4,M="[object Arguments]",z="[object Array]",L="[object Boolean]",U="[object Date]",F="[object Error]",q="[object Function]",V="[object GeneratorFunction]",P="[object Map]",K="[object Number]",H="[object Object]",Z="[object RegExp]",J="[object Set]",D="[object String]",W="[object Symbol]",B="[object WeakMap]",$="[object ArrayBuffer]",G="[object DataView]",ee="[object Float32Array]",re="[object Float64Array]",ne="[object Int8Array]",Q="[object Int16Array]",ae="[object Int32Array]",Y="[object Uint8Array]",te="[object Uint8ClampedArray]",se="[object Uint16Array]",le="[object Uint32Array]",fe={};fe[M]=fe[z]=fe[$]=fe[G]=fe[L]=fe[U]=fe[ee]=fe[re]=fe[ne]=fe[Q]=fe[ae]=fe[P]=fe[K]=fe[H]=fe[Z]=fe[J]=fe[D]=fe[W]=fe[Y]=fe[te]=fe[se]=fe[le]=!0,fe[F]=fe[q]=fe[B]=!1;function ve(Se,Re,De,Ve,Le,$e){var qe,Je=Re&A,qt=Re&k,ln=Re&O;if(De&&(qe=Le?De(Se,Ve,Le,$e):De(Se)),qe!==void 0)return qe;if(!_(Se))return Se;var Sn=w(Se);if(Sn){if(qe=g(Se),!Je)return i(Se,qe)}else{var cn=p(Se),Wa=cn==q||cn==V;if(b(Se))return s(Se,Je);if(cn==H||cn==M||Wa&&!Le){if(qe=qt||Wa?{}:S(Se),!Je)return qt?d(Se,a(qe,Se)):l(Se,r(qe,Se))}else{if(!fe[cn])return Le?Se:{};qe=y(Se,cn,Je)}}$e||($e=new e);var Fr=$e.get(Se);if(Fr)return Fr;$e.set(Se,qe),j(Se)?Se.forEach(function(Rn){qe.add(ve(Rn,Re,De,Rn,Se,$e))}):x(Se)&&Se.forEach(function(Rn,Ft){qe.set(Ft,ve(Rn,Re,De,Ft,Se,$e))});var Tu=ln?qt?h:f:qt?T:C,jl=Sn?void 0:Tu(Se);return t(jl||Se,function(Rn,Ft){jl&&(Ft=Rn,Rn=Se[Ft]),n(qe,Ft,ve(Rn,Re,De,Ft,Se,$e))}),qe}return bS=ve,bS}var wS,vP;function Lge(){if(vP)return wS;vP=1;var e=Ige(),t=1,n=4;function r(a){return e(a,t|n)}return wS=r,wS}var SS,xP;function zge(){if(xP)return SS;xP=1;var e="__lodash_hash_undefined__";function t(n){return this.__data__.set(n,e),this}return SS=t,SS}var _S,bP;function qge(){if(bP)return _S;bP=1;function e(t){return this.__data__.has(t)}return _S=e,_S}var NS,wP;function Fv(){if(wP)return NS;wP=1;var e=dE(),t=zge(),n=qge();function r(a){var s=-1,i=a==null?0:a.length;for(this.__data__=new e;++s<i;)this.add(a[s])}return r.prototype.add=r.prototype.push=t,r.prototype.has=n,NS=r,NS}var jS,SP;function Fge(){if(SP)return jS;SP=1;function e(t,n){for(var r=-1,a=t==null?0:t.length;++r<a;)if(n(t[r],r,t))return!0;return!1}return jS=e,jS}var CS,_P;function Uv(){if(_P)return CS;_P=1;function e(t,n){return t.has(n)}return CS=e,CS}var ES,NP;function T7(){if(NP)return ES;NP=1;var e=Fv(),t=Fge(),n=Uv(),r=1,a=2;function s(i,l,d,f,h,p){var g=d&r,y=i.length,S=l.length;if(y!=S&&!(g&&S>y))return!1;var w=p.get(i),b=p.get(l);if(w&&b)return w==l&&b==i;var x=-1,_=!0,j=d&a?new e:void 0;for(p.set(i,l),p.set(l,i);++x<y;){var C=i[x],T=l[x];if(f)var A=g?f(T,C,x,l,i,p):f(C,T,x,i,l,p);if(A!==void 0){if(A)continue;_=!1;break}if(j){if(!t(l,function(k,O){if(!n(j,O)&&(C===k||h(C,k,d,f,p)))return j.push(O)})){_=!1;break}}else if(!(C===T||h(C,T,d,f,p))){_=!1;break}}return p.delete(i),p.delete(l),_}return ES=s,ES}var TS,jP;function Uge(){if(jP)return TS;jP=1;function e(t){var n=-1,r=Array(t.size);return t.forEach(function(a,s){r[++n]=[s,a]}),r}return TS=e,TS}var AS,CP;function _E(){if(CP)return AS;CP=1;function e(t){var n=-1,r=Array(t.size);return t.forEach(function(a){r[++n]=a}),r}return AS=e,AS}var RS,EP;function Hge(){if(EP)return RS;EP=1;var e=Nu(),t=j7(),n=_u(),r=T7(),a=Uge(),s=_E(),i=1,l=2,d="[object Boolean]",f="[object Date]",h="[object Error]",p="[object Map]",g="[object Number]",y="[object RegExp]",S="[object Set]",w="[object String]",b="[object Symbol]",x="[object ArrayBuffer]",_="[object DataView]",j=e?e.prototype:void 0,C=j?j.valueOf:void 0;function T(A,k,O,M,z,L,U){switch(O){case _:if(A.byteLength!=k.byteLength||A.byteOffset!=k.byteOffset)return!1;A=A.buffer,k=k.buffer;case x:return!(A.byteLength!=k.byteLength||!L(new t(A),new t(k)));case d:case f:case g:return n(+A,+k);case h:return A.name==k.name&&A.message==k.message;case y:case w:return A==k+"";case p:var F=a;case S:var q=M&i;if(F||(F=s),A.size!=k.size&&!q)return!1;var V=U.get(A);if(V)return V==k;M|=l,U.set(A,k);var P=r(F(A),F(k),M,z,L,U);return U.delete(A),P;case b:if(C)return C.call(A)==C.call(k)}return!1}return RS=T,RS}var kS,TP;function Bge(){if(TP)return kS;TP=1;var e=_7(),t=1,n=Object.prototype,r=n.hasOwnProperty;function a(s,i,l,d,f,h){var p=l&t,g=e(s),y=g.length,S=e(i),w=S.length;if(y!=w&&!p)return!1;for(var b=y;b--;){var x=g[b];if(!(p?x in i:r.call(i,x)))return!1}var _=h.get(s),j=h.get(i);if(_&&j)return _==i&&j==s;var C=!0;h.set(s,i),h.set(i,s);for(var T=p;++b<y;){x=g[b];var A=s[x],k=i[x];if(d)var O=p?d(k,A,x,i,s,h):d(A,k,x,s,i,h);if(!(O===void 0?A===k||f(A,k,l,d,h):O)){C=!1;break}T||(T=x=="constructor")}if(C&&!T){var M=s.constructor,z=i.constructor;M!=z&&"constructor"in s&&"constructor"in i&&!(typeof M=="function"&&M instanceof M&&typeof z=="function"&&z instanceof z)&&(C=!1)}return h.delete(s),h.delete(i),C}return kS=a,kS}var OS,AP;function Vge(){if(AP)return OS;AP=1;var e=Iv(),t=T7(),n=Hge(),r=Bge(),a=qv(),s=Nr(),i=zv(),l=gE(),d=1,f="[object Arguments]",h="[object Array]",p="[object Object]",g=Object.prototype,y=g.hasOwnProperty;function S(w,b,x,_,j,C){var T=s(w),A=s(b),k=T?h:a(w),O=A?h:a(b);k=k==f?p:k,O=O==f?p:O;var M=k==p,z=O==p,L=k==O;if(L&&i(w)){if(!i(b))return!1;T=!0,M=!1}if(L&&!M)return C||(C=new e),T||l(w)?t(w,b,x,_,j,C):n(w,b,k,x,_,j,C);if(!(x&d)){var U=M&&y.call(w,"__wrapped__"),F=z&&y.call(b,"__wrapped__");if(U||F){var q=U?w.value():w,V=F?b.value():b;return C||(C=new e),j(q,V,x,_,C)}}return L?(C||(C=new e),r(w,b,x,_,j,C)):!1}return OS=S,OS}var MS,RP;function NE(){if(RP)return MS;RP=1;var e=Vge(),t=Ba();function n(r,a,s,i,l){return r===a?!0:r==null||a==null||!t(r)&&!t(a)?r!==r&&a!==a:e(r,a,s,i,n,l)}return MS=n,MS}var DS,kP;function A7(){if(kP)return DS;kP=1;var e=NE();function t(n,r){return e(n,r)}return DS=t,DS}var PS,OP;function Wge(){if(OP)return PS;OP=1;var e=Nu(),t=Lv(),n=Nr(),r=e?e.isConcatSpreadable:void 0;function a(s){return n(s)||t(s)||!!(r&&s&&s[r])}return PS=a,PS}var $S,MP;function jE(){if(MP)return $S;MP=1;var e=bE(),t=Wge();function n(r,a,s,i,l){var d=-1,f=r.length;for(s||(s=t),l||(l=[]);++d<f;){var h=r[d];a>0&&s(h)?a>1?n(h,a-1,s,i,l):e(l,h):i||(l[l.length]=h)}return l}return $S=n,$S}var IS,DP;function Sl(){if(DP)return IS;DP=1;function e(t,n){for(var r=-1,a=t==null?0:t.length,s=Array(a);++r<a;)s[r]=n(t[r],r,t);return s}return IS=e,IS}var LS,PP;function Hv(){if(PP)return LS;PP=1;var e=xl(),t=Ba(),n="[object Symbol]";function r(a){return typeof a=="symbol"||t(a)&&e(a)==n}return LS=r,LS}var zS,$P;function CE(){if($P)return zS;$P=1;var e=Nr(),t=Hv(),n=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,r=/^\w*$/;function a(s,i){if(e(s))return!1;var l=typeof s;return l=="number"||l=="symbol"||l=="boolean"||s==null||t(s)?!0:r.test(s)||!n.test(s)||i!=null&&s in Object(i)}return zS=a,zS}var qS,IP;function Gge(){if(IP)return qS;IP=1;var e=dE(),t="Expected a function";function n(r,a){if(typeof r!="function"||a!=null&&typeof a!="function")throw new TypeError(t);var s=function(){var i=arguments,l=a?a.apply(this,i):i[0],d=s.cache;if(d.has(l))return d.get(l);var f=r.apply(this,i);return s.cache=d.set(l,f)||d,f};return s.cache=new(n.Cache||e),s}return n.Cache=e,qS=n,qS}var FS,LP;function Kge(){if(LP)return FS;LP=1;var e=Gge(),t=500;function n(r){var a=e(r,function(i){return s.size===t&&s.clear(),i}),s=a.cache;return a}return FS=n,FS}var US,zP;function Yge(){if(zP)return US;zP=1;var e=Kge(),t=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,n=/\\(\\)?/g,r=e(function(a){var s=[];return a.charCodeAt(0)===46&&s.push(""),a.replace(t,function(i,l,d,f){s.push(d?f.replace(n,"$1"):l||i)}),s});return US=r,US}var HS,qP;function Xge(){if(qP)return HS;qP=1;var e=Nu(),t=Sl(),n=Nr(),r=Hv(),a=e?e.prototype:void 0,s=a?a.toString:void 0;function i(l){if(typeof l=="string")return l;if(n(l))return t(l,i)+"";if(r(l))return s?s.call(l):"";var d=l+"";return d=="0"&&1/l==-1/0?"-0":d}return HS=i,HS}var BS,FP;function Zge(){if(FP)return BS;FP=1;var e=Xge();function t(n){return n==null?"":e(n)}return BS=t,BS}var VS,UP;function R7(){if(UP)return VS;UP=1;var e=Nr(),t=CE(),n=Yge(),r=Zge();function a(s,i){return e(s)?s:t(s,i)?[s]:n(r(s))}return VS=a,VS}var WS,HP;function Bv(){if(HP)return WS;HP=1;var e=Hv();function t(n){if(typeof n=="string"||e(n))return n;var r=n+"";return r=="0"&&1/n==-1/0?"-0":r}return WS=t,WS}var GS,BP;function EE(){if(BP)return GS;BP=1;var e=R7(),t=Bv();function n(r,a){a=e(a,r);for(var s=0,i=a.length;r!=null&&s<i;)r=r[t(a[s++])];return s&&s==i?r:void 0}return GS=n,GS}var KS,VP;function Qge(){if(VP)return KS;VP=1;var e=Iv(),t=NE(),n=1,r=2;function a(s,i,l,d){var f=l.length,h=f,p=!d;if(s==null)return!h;for(s=Object(s);f--;){var g=l[f];if(p&&g[2]?g[1]!==s[g[0]]:!(g[0]in s))return!1}for(;++f<h;){g=l[f];var y=g[0],S=s[y],w=g[1];if(p&&g[2]){if(S===void 0&&!(y in s))return!1}else{var b=new e;if(d)var x=d(S,w,y,s,i,b);if(!(x===void 0?t(w,S,n|r,d,b):x))return!1}}return!0}return KS=a,KS}var YS,WP;function k7(){if(WP)return YS;WP=1;var e=Ha();function t(n){return n===n&&!e(n)}return YS=t,YS}var XS,GP;function Jge(){if(GP)return XS;GP=1;var e=k7(),t=gh();function n(r){for(var a=t(r),s=a.length;s--;){var i=a[s],l=r[i];a[s]=[i,l,e(l)]}return a}return XS=n,XS}var ZS,KP;function O7(){if(KP)return ZS;KP=1;function e(t,n){return function(r){return r==null?!1:r[t]===n&&(n!==void 0||t in Object(r))}}return ZS=e,ZS}var QS,YP;function eye(){if(YP)return QS;YP=1;var e=Qge(),t=Jge(),n=O7();function r(a){var s=t(a);return s.length==1&&s[0][2]?n(s[0][0],s[0][1]):function(i){return i===a||e(i,a,s)}}return QS=r,QS}var JS,XP;function tye(){if(XP)return JS;XP=1;var e=EE();function t(n,r,a){var s=n==null?void 0:e(n,r);return s===void 0?a:s}return JS=t,JS}var e_,ZP;function nye(){if(ZP)return e_;ZP=1;function e(t,n){return t!=null&&n in Object(t)}return e_=e,e_}var t_,QP;function rye(){if(QP)return t_;QP=1;var e=R7(),t=Lv(),n=Nr(),r=hE(),a=pE(),s=Bv();function i(l,d,f){d=e(d,l);for(var h=-1,p=d.length,g=!1;++h<p;){var y=s(d[h]);if(!(g=l!=null&&f(l,y)))break;l=l[y]}return g||++h!=p?g:(p=l==null?0:l.length,!!p&&a(p)&&r(y,p)&&(n(l)||t(l)))}return t_=i,t_}var n_,JP;function aye(){if(JP)return n_;JP=1;var e=nye(),t=rye();function n(r,a){return r!=null&&t(r,a,e)}return n_=n,n_}var r_,e$;function sye(){if(e$)return r_;e$=1;var e=NE(),t=tye(),n=aye(),r=CE(),a=k7(),s=O7(),i=Bv(),l=1,d=2;function f(h,p){return r(h)&&a(p)?s(i(h),p):function(g){var y=t(g,h);return y===void 0&&y===p?n(g,h):e(p,y,l|d)}}return r_=f,r_}var a_,t$;function yh(){if(t$)return a_;t$=1;function e(t){return t}return a_=e,a_}var s_,n$;function oye(){if(n$)return s_;n$=1;function e(t){return function(n){return n==null?void 0:n[t]}}return s_=e,s_}var o_,r$;function iye(){if(r$)return o_;r$=1;var e=EE();function t(n){return function(r){return e(r,n)}}return o_=t,o_}var i_,a$;function lye(){if(a$)return i_;a$=1;var e=oye(),t=iye(),n=CE(),r=Bv();function a(s){return n(s)?e(r(s)):t(s)}return i_=a,i_}var l_,s$;function cye(){if(s$)return l_;s$=1;var e=eye(),t=sye(),n=yh(),r=Nr(),a=lye();function s(i){return typeof i=="function"?i:i==null?n:typeof i=="object"?r(i)?t(i[0],i[1]):e(i):a(i)}return l_=s,l_}var c_,o$;function uye(){if(o$)return c_;o$=1;function e(t){return function(n,r,a){for(var s=-1,i=Object(n),l=a(n),d=l.length;d--;){var f=l[t?d:++s];if(r(i[f],f,i)===!1)break}return n}}return c_=e,c_}var u_,i$;function M7(){if(i$)return u_;i$=1;var e=uye(),t=e();return u_=t,u_}var d_,l$;function dye(){if(l$)return d_;l$=1;var e=M7(),t=gh();function n(r,a){return r&&e(r,a,t)}return d_=n,d_}var f_,c$;function fye(){if(c$)return f_;c$=1;var e=ju();function t(n,r){return function(a,s){if(a==null)return a;if(!e(a))return n(a,s);for(var i=a.length,l=r?i:-1,d=Object(a);(r?l--:++l<i)&&s(d[l],l,d)!==!1;);return a}}return f_=t,f_}var h_,u$;function D7(){if(u$)return h_;u$=1;var e=dye(),t=fye(),n=t(e);return h_=n,h_}var p_,d$;function hye(){if(d$)return p_;d$=1;var e=D7(),t=ju();function n(r,a){var s=-1,i=t(r)?Array(r.length):[];return e(r,function(l,d,f){i[++s]=a(l,d,f)}),i}return p_=n,p_}var m_,f$;function pye(){if(f$)return m_;f$=1;function e(t,n){var r=t.length;for(t.sort(n);r--;)t[r]=t[r].value;return t}return m_=e,m_}var g_,h$;function mye(){if(h$)return g_;h$=1;var e=Hv();function t(n,r){if(n!==r){var a=n!==void 0,s=n===null,i=n===n,l=e(n),d=r!==void 0,f=r===null,h=r===r,p=e(r);if(!f&&!p&&!l&&n>r||l&&d&&h&&!f&&!p||s&&d&&h||!a&&h||!i)return 1;if(!s&&!l&&!p&&n<r||p&&a&&i&&!s&&!l||f&&a&&i||!d&&i||!h)return-1}return 0}return g_=t,g_}var y_,p$;function gye(){if(p$)return y_;p$=1;var e=mye();function t(n,r,a){for(var s=-1,i=n.criteria,l=r.criteria,d=i.length,f=a.length;++s<d;){var h=e(i[s],l[s]);if(h){if(s>=f)return h;var p=a[s];return h*(p=="desc"?-1:1)}}return n.index-r.index}return y_=t,y_}var v_,m$;function yye(){if(m$)return v_;m$=1;var e=Sl(),t=EE(),n=cye(),r=hye(),a=pye(),s=wl(),i=gye(),l=yh(),d=Nr();function f(h,p,g){p.length?p=e(p,function(w){return d(w)?function(b){return t(b,w.length===1?w[0]:w)}:w}):p=[l];var y=-1;p=e(p,s(n));var S=r(h,function(w,b,x){var _=e(p,function(j){return j(w)});return{criteria:_,index:++y,value:w}});return a(S,function(w,b){return i(w,b,g)})}return v_=f,v_}var x_,g$;function P7(){if(g$)return x_;g$=1;function e(t,n,r){switch(r.length){case 0:return t.call(n);case 1:return t.call(n,r[0]);case 2:return t.call(n,r[0],r[1]);case 3:return t.call(n,r[0],r[1],r[2])}return t.apply(n,r)}return x_=e,x_}var b_,y$;function vye(){if(y$)return b_;y$=1;var e=P7(),t=Math.max;function n(r,a,s){return a=t(a===void 0?r.length-1:a,0),function(){for(var i=arguments,l=-1,d=t(i.length-a,0),f=Array(d);++l<d;)f[l]=i[a+l];l=-1;for(var h=Array(a+1);++l<a;)h[l]=i[l];return h[a]=s(f),e(r,this,h)}}return b_=n,b_}var w_,v$;function xye(){if(v$)return w_;v$=1;function e(t){return function(){return t}}return w_=e,w_}var S_,x$;function bye(){if(x$)return S_;x$=1;var e=xye(),t=m7(),n=yh(),r=t?function(a,s){return t(a,"toString",{configurable:!0,enumerable:!1,value:e(s),writable:!0})}:n;return S_=r,S_}var __,b$;function wye(){if(b$)return __;b$=1;var e=800,t=16,n=Date.now;function r(a){var s=0,i=0;return function(){var l=n(),d=t-(l-i);if(i=l,d>0){if(++s>=e)return arguments[0]}else s=0;return a.apply(void 0,arguments)}}return __=r,__}var N_,w$;function Sye(){if(w$)return N_;w$=1;var e=bye(),t=wye(),n=t(e);return N_=n,N_}var j_,S$;function _l(){if(S$)return j_;S$=1;var e=yh(),t=vye(),n=Sye();function r(a,s){return n(t(a,s,e),a+"")}return j_=r,j_}var C_,_$;function TE(){if(_$)return C_;_$=1;var e=_u(),t=ju(),n=hE(),r=Ha();function a(s,i,l){if(!r(l))return!1;var d=typeof i;return(d=="number"?t(l)&&n(i,l.length):d=="string"&&i in l)?e(l[i],s):!1}return C_=a,C_}var E_,N$;function $7(){if(N$)return E_;N$=1;var e=jE(),t=yye(),n=_l(),r=TE(),a=n(function(s,i){if(s==null)return[];var l=i.length;return l>1&&r(s,i[0],i[1])?i=[]:l>2&&r(i[0],i[1],i[2])&&(i=[i[0]]),t(s,e(i,1),[])});return E_=a,E_}var T_,j$;function _ye(){if(j$)return T_;j$=1;function e(t,n,r,a){for(var s=t.length,i=r+(a?1:-1);a?i--:++i<s;)if(n(t[i],i,t))return i;return-1}return T_=e,T_}var A_,C$;function Nye(){if(C$)return A_;C$=1;function e(t){return t!==t}return A_=e,A_}var R_,E$;function jye(){if(E$)return R_;E$=1;function e(t,n,r){for(var a=r-1,s=t.length;++a<s;)if(t[a]===n)return a;return-1}return R_=e,R_}var k_,T$;function I7(){if(T$)return k_;T$=1;var e=_ye(),t=Nye(),n=jye();function r(a,s,i){return s===s?n(a,s,i):e(a,t,i)}return k_=r,k_}var O_,A$;function AE(){if(A$)return O_;A$=1;var e=I7();function t(n,r){var a=n==null?0:n.length;return!!a&&e(n,r,0)>-1}return O_=t,O_}var M_,R$;function RE(){if(R$)return M_;R$=1;function e(t,n,r){for(var a=-1,s=t==null?0:t.length;++a<s;)if(r(n,t[a]))return!0;return!1}return M_=e,M_}var D_,k$;function Cye(){if(k$)return D_;k$=1;function e(){}return D_=e,D_}var P_,O$;function Eye(){if(O$)return P_;O$=1;var e=N7(),t=Cye(),n=_E(),r=1/0,a=e&&1/n(new e([,-0]))[1]==r?function(s){return new e(s)}:t;return P_=a,P_}var $_,M$;function L7(){if(M$)return $_;M$=1;var e=Fv(),t=AE(),n=RE(),r=Uv(),a=Eye(),s=_E(),i=200;function l(d,f,h){var p=-1,g=t,y=d.length,S=!0,w=[],b=w;if(h)S=!1,g=n;else if(y>=i){var x=f?null:a(d);if(x)return s(x);S=!1,g=r,b=new e}else b=f?[]:w;e:for(;++p<y;){var _=d[p],j=f?f(_):_;if(_=h||_!==0?_:0,S&&j===j){for(var C=b.length;C--;)if(b[C]===j)continue e;f&&b.push(j),w.push(_)}else g(b,j,h)||(b!==w&&b.push(j),w.push(_))}return w}return $_=l,$_}var I_,D$;function kE(){if(D$)return I_;D$=1;var e=L7();function t(n){return n&&n.length?e(n):[]}return I_=t,I_}var L_,P$;function OE(){if(P$)return L_;P$=1;var e=L7();function t(n,r){return r=typeof r=="function"?r:void 0,n&&n.length?e(n,void 0,r):[]}return L_=t,L_}var z_,$$;function Tye(){if($$)return z_;$$=1;var e=_l(),t=_u(),n=TE(),r=Cu(),a=Object.prototype,s=a.hasOwnProperty,i=e(function(l,d){l=Object(l);var f=-1,h=d.length,p=h>2?d[2]:void 0;for(p&&n(d[0],d[1],p)&&(h=1);++f<h;)for(var g=d[f],y=r(g),S=-1,w=y.length;++S<w;){var b=y[S],x=l[b];(x===void 0||t(x,a[b])&&!s.call(l,b))&&(l[b]=g[b])}return l});return z_=i,z_}var q_,I$;function z7(){if(I$)return q_;I$=1;var e=Fv(),t=AE(),n=RE(),r=Sl(),a=wl(),s=Uv(),i=Math.min;function l(d,f,h){for(var p=h?n:t,g=d[0].length,y=d.length,S=y,w=Array(y),b=1/0,x=[];S--;){var _=d[S];S&&f&&(_=r(_,a(f))),b=i(_.length,b),w[S]=!h&&(f||g>=120&&_.length>=120)?new e(S&&_):void 0}_=d[0];var j=-1,C=w[0];e:for(;++j<g&&x.length<b;){var T=_[j],A=f?f(T):T;if(T=h||T!==0?T:0,!(C?s(C,A):p(x,A,h))){for(S=y;--S;){var k=w[S];if(!(k?s(k,A):p(d[S],A,h)))continue e}C&&C.push(A),x.push(T)}}return x}return q_=l,q_}var F_,L$;function ME(){if(L$)return F_;L$=1;var e=ju(),t=Ba();function n(r){return t(r)&&e(r)}return F_=n,F_}var U_,z$;function q7(){if(z$)return U_;z$=1;var e=ME();function t(n){return e(n)?n:[]}return U_=t,U_}var H_,q$;function Aye(){if(q$)return H_;q$=1;function e(t){var n=t==null?0:t.length;return n?t[n-1]:void 0}return H_=e,H_}var B_,F$;function F7(){if(F$)return B_;F$=1;var e=Sl(),t=z7(),n=_l(),r=q7(),a=Aye(),s=n(function(i){var l=a(i),d=e(i,r);return l=typeof l=="function"?l:void 0,l&&d.pop(),d.length&&d[0]===i[0]?t(d,void 0,l):[]});return B_=s,B_}var V_,U$;function Vv(){if(U$)return V_;U$=1;var e=xl(),t=wE(),n=Ba(),r="[object Object]",a=Function.prototype,s=Object.prototype,i=a.toString,l=s.hasOwnProperty,d=i.call(Object);function f(h){if(!n(h)||e(h)!=r)return!1;var p=t(h);if(p===null)return!0;var g=l.call(p,"constructor")&&p.constructor;return typeof g=="function"&&g instanceof g&&i.call(g)==d}return V_=f,V_}var W_,H$;function Rye(){if(H$)return W_;H$=1;var e=xl(),t=Ba(),n="[object Boolean]";function r(a){return a===!0||a===!1||t(a)&&e(a)==n}return W_=r,W_}var G_,B$;function DE(){if(B$)return G_;B$=1;var e=A7(),t=$7(),n=kE(),r=OE(),a=Tye(),s=F7(),i=Vv(),l=Rye(),d=F=>Array.isArray(F)?F:[F],f=F=>F===void 0,h=F=>i(F)||Array.isArray(F)?Object.keys(F):[],p=(F,q)=>F.hasOwnProperty(q),g=F=>t(n(F)),y=F=>f(F)||Array.isArray(F)&&F.length===0,S=(F,q,V,P)=>q&&p(q,V)&&F&&p(F,V)&&P(F[V],q[V]),w=(F,q)=>f(F)&&q===0||f(q)&&F===0||e(F,q),b=(F,q)=>f(F)&&q===!1||f(q)&&F===!1||e(F,q),x=F=>f(F)||e(F,{})||F===!0,_=F=>f(F)||e(F,{}),j=F=>f(F)||i(F)||F===!0||F===!1;function C(F,q){return y(F)&&y(q)?!0:e(g(F),g(q))}function T(F,q){return F=d(F),q=d(q),e(g(F),g(q))}function A(F,q,V,P){var K=n(h(F).concat(h(q)));return _(F)&&_(q)?!0:_(F)&&h(q).length||_(q)&&h(F).length?!1:K.every(function(H){var Z=F[H],J=q[H];return Array.isArray(Z)&&Array.isArray(J)?e(g(F),g(q)):Array.isArray(Z)&&!Array.isArray(J)||Array.isArray(J)&&!Array.isArray(Z)?!1:S(F,q,H,P)})}function k(F,q,V,P){return i(F)&&i(q)?P(F,q):Array.isArray(F)&&Array.isArray(q)?A(F,q,V,P):e(F,q)}function O(F,q,V,P){var K=r(F,P),H=r(q,P),Z=s(K,H,P);return Z.length===Math.max(K.length,H.length)}var M={title:e,uniqueItems:b,minLength:w,minItems:w,minProperties:w,required:C,enum:C,type:T,items:k,anyOf:O,allOf:O,oneOf:O,properties:A,patternProperties:A,dependencies:A},z=["properties","patternProperties","dependencies","uniqueItems","minLength","minItems","minProperties","required"],L=["additionalProperties","additionalItems","contains","propertyNames","not"];function U(F,q,V){if(V=a(V,{ignore:[]}),x(F)&&x(q))return!0;if(!j(F)||!j(q))throw new Error("Either of the values are not a JSON schema.");if(F===q)return!0;if(l(F)&&l(q))return F===q;if(F===void 0&&q===!1||q===void 0&&F===!1||f(F)&&!f(q)||!f(F)&&f(q))return!1;var P=n(Object.keys(F).concat(Object.keys(q)));if(V.ignore.length&&(P=P.filter(H=>V.ignore.indexOf(H)===-1)),!P.length)return!0;function K(H,Z){return U(H,Z,V)}return P.every(function(H){var Z=F[H],J=q[H];if(L.indexOf(H)!==-1)return U(Z,J,V);var D=M[H];if(D||(D=e),e(Z,J))return!0;if(z.indexOf(H)===-1&&(!p(F,H)&&p(q,H)||p(F,H)&&!p(q,H)))return Z===J;var W=D(Z,J,H,K);if(!l(W))throw new Error("Comparer must return true or false");return W})}return G_=U,G_}var K_,V$;function PE(){if(V$)return K_;V$=1;function e(t){return Object.prototype.toString.call(t)==="[object Array]"}return K_=Array.isArray||e,K_}var Y_,W$;function kye(){if(W$)return Y_;W$=1;function e(t){return(typeof t=="number"||Object.prototype.toString.call(t)==="[object Number]")&&t.valueOf()===t.valueOf()}return Y_=e,Y_}var X_,G$;function Oye(){if(G$)return X_;G$=1;var e=kye();function t(n){return e(n)&&n%1===0}return X_=t,X_}var Z_,K$;function U7(){if(K$)return Z_;K$=1;var e=PE(),t=Oye();function n(r){var a;if(!e(r)||(a=r.length,!a))return!1;for(var s=0;s<a;s++)if(!t(r[s]))return!1;return!0}return Z_=n,Z_}var Q_,Y$;function H7(){if(Y$)return Q_;Y$=1;function e(t){return typeof t=="function"}return Q_=e,Q_}var J_,X$;function Mye(){if(X$)return J_;X$=1;var e=PE(),t=U7(),n=H7(),r=Math.pow(2,31)-1;function a(l,d){var f=1,h;if(l===0)return d;if(d===0)return l;for(;l%2===0&&d%2===0;)l=l/2,d=d/2,f=f*2;for(;l%2===0;)l=l/2;for(;d;){for(;d%2===0;)d=d/2;l>d&&(h=d,d=l,l=h),d=d-l}return f*l}function s(l,d){var f=0,h;if(l===0)return d;if(d===0)return l;for(;(l&1)===0&&(d&1)===0;)l>>>=1,d>>>=1,f++;for(;(l&1)===0;)l>>>=1;for(;d;){for(;(d&1)===0;)d>>>=1;l>d&&(h=d,d=l,l=h),d=d-l}return l<<f}function i(){var l=arguments.length,d,f,h,p,g,y,S;for(d=new Array(l),S=0;S<l;S++)d[S]=arguments[S];if(t(d)){if(l===2)return g=d[0],y=d[1],g<0&&(g=-g),y<0&&(y=-y),g<=r&&y<=r?s(g,y):a(g,y);h=d}else if(e(d[0]))if(l>1){if(h=d[0],f=d[1],!n(f))throw new TypeError("gcd()::invalid input argument. Accessor must be a function. Value: `"+f+"`.")}else h=d[0];else throw new TypeError("gcd()::invalid input argument. Must provide an array of integers. Value: `"+d[0]+"`.");if(p=h.length,p<2)return null;if(f){for(g=new Array(p),S=0;S<p;S++)g[S]=f(h[S],S);h=g}if(l<3&&!t(h))throw new TypeError("gcd()::invalid input argument. Accessed array values must be integers. Value: `"+h+"`.");for(S=0;S<p;S++)g=h[S],g<0&&(h[S]=-g);for(g=h[0],S=1;S<p;S++)y=h[S],y<=r&&g<=r?g=s(g,y):g=a(g,y);return g}return J_=i,J_}var eN,Z$;function Dye(){if(Z$)return eN;Z$=1;var e=Mye(),t=PE(),n=U7(),r=H7();function a(){var s=arguments.length,i,l,d,f,h,p,g;for(i=new Array(s),g=0;g<s;g++)i[g]=arguments[g];if(n(i)){if(s===2)return h=i[0],p=i[1],h<0&&(h=-h),p<0&&(p=-p),h===0||p===0?0:h/e(h,p)*p;d=i}else if(t(i[0]))if(s>1){if(d=i[0],l=i[1],!r(l))throw new TypeError("lcm()::invalid input argument. Accessor must be a function. Value: `"+l+"`.")}else d=i[0];else throw new TypeError("lcm()::invalid input argument. Must provide an array of integers. Value: `"+i[0]+"`.");if(f=d.length,f<2)return null;if(l){for(h=new Array(f),g=0;g<f;g++)h[g]=l(d[g],g);d=h}if(s<3&&!n(d))throw new TypeError("lcm()::invalid input argument. Accessed array values must be integers. Value: `"+d+"`.");for(g=0;g<f;g++)h=d[g],h<0&&(d[g]=-h);for(h=d[0],g=1;g<f;g++){if(p=d[g],h===0||p===0)return 0;h=h/e(h,p)*p}return h}return eN=a,eN}var tN,Q$;function B7(){if(Q$)return tN;Q$=1;var e=fE(),t=_u();function n(r,a,s){(s!==void 0&&!t(r[a],s)||s===void 0&&!(a in r))&&e(r,a,s)}return tN=n,tN}var nN,J$;function V7(){if(J$)return nN;J$=1;function e(t,n){if(!(n==="constructor"&&typeof t[n]=="function")&&n!="__proto__")return t[n]}return nN=e,nN}var rN,e3;function Pye(){if(e3)return rN;e3=1;var e=mh(),t=Cu();function n(r){return e(r,t(r))}return rN=n,rN}var aN,t3;function $ye(){if(t3)return aN;t3=1;var e=B7(),t=x7(),n=C7(),r=vE(),a=E7(),s=Lv(),i=Nr(),l=ME(),d=zv(),f=cE(),h=Ha(),p=Vv(),g=gE(),y=V7(),S=Pye();function w(b,x,_,j,C,T,A){var k=y(b,_),O=y(x,_),M=A.get(O);if(M){e(b,_,M);return}var z=T?T(k,O,_+"",b,x,A):void 0,L=z===void 0;if(L){var U=i(O),F=!U&&d(O),q=!U&&!F&&g(O);z=O,U||F||q?i(k)?z=k:l(k)?z=r(k):F?(L=!1,z=t(O,!0)):q?(L=!1,z=n(O,!0)):z=[]:p(O)||s(O)?(z=k,s(k)?z=S(k):(!h(k)||f(k))&&(z=a(O))):L=!1}L&&(A.set(O,z),C(z,O,j,T,A),A.delete(O)),e(b,_,z)}return aN=w,aN}var sN,n3;function W7(){if(n3)return sN;n3=1;var e=Iv(),t=B7(),n=M7(),r=$ye(),a=Ha(),s=Cu(),i=V7();function l(d,f,h,p,g){d!==f&&n(f,function(y,S){if(g||(g=new e),a(y))r(d,f,S,h,l,p,g);else{var w=p?p(i(d,S),y,S+"",d,f,g):void 0;w===void 0&&(w=y),t(d,S,w)}},s)}return sN=l,sN}var oN,r3;function Iye(){if(r3)return oN;r3=1;var e=W7(),t=Ha();function n(r,a,s,i,l,d){return t(r)&&t(a)&&(d.set(a,r),e(r,a,void 0,n,d),d.delete(a)),r}return oN=n,oN}var iN,a3;function Lye(){if(a3)return iN;a3=1;var e=_l(),t=TE();function n(r){return e(function(a,s){var i=-1,l=s.length,d=l>1?s[l-1]:void 0,f=l>2?s[2]:void 0;for(d=r.length>3&&typeof d=="function"?(l--,d):void 0,f&&t(s[0],s[1],f)&&(d=l<3?void 0:d,l=1),a=Object(a);++i<l;){var h=s[i];h&&r(a,h,i,d)}return a})}return iN=n,iN}var lN,s3;function zye(){if(s3)return lN;s3=1;var e=W7(),t=Lye(),n=t(function(r,a,s,i){e(r,a,s,i)});return lN=n,lN}var cN,o3;function qye(){if(o3)return cN;o3=1;var e=P7(),t=_l(),n=Iye(),r=zye(),a=t(function(s){return s.push(void 0,n),e(r,void 0,s)});return cN=a,cN}var uN,i3;function G7(){if(i3)return uN;i3=1;var e=jE();function t(n){var r=n==null?0:n.length;return r?e(n,1):[]}return uN=t,uN}var dN,l3;function K7(){if(l3)return dN;l3=1;var e=jE(),t=1/0;function n(r){var a=r==null?0:r.length;return a?e(r,t):[]}return dN=n,dN}var fN,c3;function Fye(){if(c3)return fN;c3=1;var e=Sl(),t=z7(),n=_l(),r=q7(),a=n(function(s){var i=e(s,r);return i.length&&i[0]===s[0]?t(i):[]});return fN=a,fN}var hN,u3;function Uye(){if(u3)return hN;u3=1;function e(t,n,r,a){for(var s=r-1,i=t.length;++s<i;)if(a(t[s],n))return s;return-1}return hN=e,hN}var pN,d3;function Hye(){if(d3)return pN;d3=1;var e=Sl(),t=I7(),n=Uye(),r=wl(),a=vE(),s=Array.prototype,i=s.splice;function l(d,f,h,p){var g=p?n:t,y=-1,S=f.length,w=d;for(d===f&&(f=a(f)),h&&(w=e(d,r(h)));++y<S;)for(var b=0,x=f[y],_=h?h(x):x;(b=g(w,_,b,p))>-1;)w!==d&&i.call(w,b,1),i.call(d,b,1);return d}return pN=l,pN}var mN,f3;function Bye(){if(f3)return mN;f3=1;var e=Hye();function t(n,r){return n&&n.length&&r&&r.length?e(n,r):n}return mN=t,mN}var gN,h3;function Vye(){if(h3)return gN;h3=1;var e=yh();function t(n){return typeof n=="function"?n:e}return gN=t,gN}var yN,p3;function Y7(){if(p3)return yN;p3=1;var e=p7(),t=D7(),n=Vye(),r=Nr();function a(s,i){var l=r(s)?e:t;return l(s,n(i))}return yN=a,yN}var vN,m3;function Wye(){if(m3)return vN;m3=1;var e=Fv(),t=AE(),n=RE(),r=Sl(),a=wl(),s=Uv(),i=200;function l(d,f,h,p){var g=-1,y=t,S=!0,w=d.length,b=[],x=f.length;if(!w)return b;h&&(f=r(f,a(h))),p?(y=n,S=!1):f.length>=i&&(y=s,S=!1,f=new e(f));e:for(;++g<w;){var _=d[g],j=h==null?_:h(_);if(_=p||_!==0?_:0,S&&j===j){for(var C=x;C--;)if(f[C]===j)continue e;b.push(_)}else y(f,j,p)||b.push(_)}return b}return vN=l,vN}var xN,g3;function Gye(){if(g3)return xN;g3=1;var e=Wye(),t=_l(),n=ME(),r=t(function(a,s){return n(a)?e(a,s):[]});return xN=r,xN}var bN,y3;function X7(){if(y3)return bN;y3=1;const e=G7(),t=K7(),n=Vv(),r=kE(),a=OE(),s=Gye();function i(w){for(const b in w)f(w,b)&&y(w[b])&&delete w[b];return w}const l=w=>r(t(w.map(h))),d=(w,b)=>w.map(x=>x&&x[b]),f=(w,b)=>Object.prototype.hasOwnProperty.call(w,b),h=w=>n(w)||Array.isArray(w)?Object.keys(w):[],p=w=>w!==void 0,g=w=>n(w)||w===!0||w===!1,y=w=>!h(w).length&&w!==!1&&w!==!0;return bN={allUniqueKeys:l,deleteUndefinedProps:i,getValues:d,has:f,isEmptySchema:y,isSchema:g,keys:h,notUndefined:p,uniqWith:a,withoutArr:(w,...b)=>s.apply(null,[w].concat(e(b)))},bN}var wN,v3;function Kye(){if(v3)return wN;v3=1;const e=DE(),t=Y7(),{allUniqueKeys:n,deleteUndefinedProps:r,getValues:a,keys:s,notUndefined:i,uniqWith:l,withoutArr:d}=X7();function f(p){t(p,function(g,y){g===!1&&delete p[y]})}function h(p,g){return n(p).reduce(function(S,w){const b=a(p,w),x=l(b.filter(i),e);return S[w]=g(x,w),S},{})}return wN={keywords:["properties","patternProperties","additionalProperties"],resolver(p,g,y,S){S.ignoreAdditionalProperties||(p.forEach(function(b){const x=p.filter(T=>T!==b),_=s(b.properties),C=s(b.patternProperties).map(T=>new RegExp(T));x.forEach(function(T){const A=s(T.properties),k=A.filter(M=>C.some(z=>z.test(M)));d(A,_,k).forEach(function(M){T.properties[M]=y.properties([T.properties[M],b.additionalProperties],M)})})}),p.forEach(function(b){const x=p.filter(j=>j!==b),_=s(b.patternProperties);b.additionalProperties===!1&&x.forEach(function(j){const C=s(j.patternProperties);d(C,_).forEach(A=>delete j.patternProperties[A])})}));const w={additionalProperties:y.additionalProperties(p.map(b=>b.additionalProperties)),patternProperties:h(p.map(b=>b.patternProperties),y.patternProperties),properties:h(p.map(b=>b.properties),y.properties)};return w.additionalProperties===!1&&f(w.properties),r(w)}},wN}var SN,x3;function Yye(){if(x3)return SN;x3=1;const e=DE(),t=Y7(),{allUniqueKeys:n,deleteUndefinedProps:r,has:a,isSchema:s,notUndefined:i,uniqWith:l}=X7();function d(g){t(g,function(y,S){y===!1&&g.splice(S,1)})}function f(g,y){return g.map(function(S){if(S)if(Array.isArray(S.items)){const w=S.items[y];if(s(w))return w;if(a(S,"additionalItems"))return S.additionalItems}else return S.items})}function h(g){return g.map(function(y){if(y)return Array.isArray(y.items)?y.additionalItems:y.items})}function p(g,y,S){return n(S).reduce(function(b,x){const _=f(g,x),j=l(_.filter(i),e);return b[x]=y(j,x),b},[])}return SN={keywords:["items","additionalItems"],resolver(g,y,S){const w=g.map(j=>j.items),b=w.filter(i),x={};b.every(s)?x.items=S.items(w):x.items=p(g,S.items,w);let _;return b.every(Array.isArray)?_=g.map(j=>j.additionalItems):b.some(Array.isArray)&&(_=h(g)),_&&(x.additionalItems=S.additionalItems(_)),x.additionalItems===!1&&Array.isArray(x.items)&&d(x.items),r(x)}},SN}var _N,b3;function Xye(){if(b3)return _N;b3=1;const e=Lge(),t=DE(),n=Dye(),r=qye(),a=G7(),s=K7(),i=Fye(),l=F7(),d=A7(),f=Vv(),h=Bye(),p=$7(),g=kE(),y=OE(),S=Kye(),w=Yye(),b=(Q,ae)=>Q.indexOf(ae)!==-1,x=Q=>f(Q)||Q===!0||Q===!1,_=Q=>Q===!1,j=Q=>Q===!0,C=(Q,ae,Y)=>Y(Q),T=Q=>p(g(s(Q))),A=Q=>Q!==void 0,k=Q=>g(s(Q.map(H))),O=Q=>Q[0],M=Q=>T(Q),z=Q=>Math.max.apply(Math,Q),L=Q=>Math.min.apply(Math,Q),U=Q=>Q.some(j),F=Q=>y(a(Q),d);function q(Q){return function(ae,Y){return t({[Q]:ae},{[Q]:Y})}}function V(Q){let{allOf:ae=[],...Y}=Q;return Y=f(Q)?Y:Q,[Y,...ae.map(V)]}function P(Q,ae){return Q.map(Y=>Y&&Y[ae])}function K(Q,ae){return Q.map(function(Y,te){try{return ae(Y,te)}catch{return}}).filter(A)}function H(Q){return f(Q)||Array.isArray(Q)?Object.keys(Q):[]}function Z(Q,ae){if(ae=ae||[],!Q.length)return ae;const Y=Q.slice(0).shift(),te=Q.slice(1);return ae.length?Z(te,a(ae.map(se=>Y.map(le=>[le].concat(se))))):Z(te,Y.map(se=>se))}function J(Q,ae){let Y;try{Y=Q.map(function(te){return JSON.stringify(te,null,2)}).join(`
|
|
710
|
+
`)}catch{Y=Q.join(", ")}throw new Error('Could not resolve values for path:"'+ae.join(".")+`". They are probably incompatible. Values:
|
|
711
|
+
`+Y)}function D(Q,ae,Y,te,se,le){if(Q.length){const fe=se.complexResolvers[ae];if(!fe||!fe.resolver)throw new Error("No resolver found for "+ae);const ve=Y.map(Ve=>Q.reduce((Le,$e)=>(Ve[$e]!==void 0&&(Le[$e]=Ve[$e]),Le),{})),Se=y(ve,t),Re=fe.keywords.reduce((Ve,Le)=>({...Ve,[Le]:($e,qe=[])=>te($e,null,le.concat(Le,qe))}),{}),De=fe.resolver(Se,le.concat(ae),Re,se);return f(De)||J(Se,le.concat(ae)),De}}function W(Q){return{required:Q}}const B=["properties","patternProperties","definitions","dependencies"],$=["anyOf","oneOf"],G=["additionalProperties","additionalItems","contains","propertyNames","not","items"],ee={type(Q){if(Q.some(Array.isArray)){const ae=Q.map(function(te){return Array.isArray(te)?te:[te]}),Y=i.apply(null,ae);if(Y.length===1)return Y[0];if(Y.length>1)return g(Y)}},dependencies(Q,ae,Y){return k(Q).reduce(function(se,le){const fe=P(Q,le);let ve=y(fe.filter(A),d);const Se=ve.filter(Array.isArray);if(Se.length){if(Se.length===ve.length)se[le]=T(ve);else{const Re=ve.filter(x),De=Se.map(W);se[le]=Y(Re.concat(De),le)}return se}return ve=y(ve,t),se[le]=Y(ve,le),se},{})},oneOf(Q,ae,Y){const te=Z(e(Q)),se=K(te,Y),le=y(se,t);if(le.length)return le},not(Q){return{anyOf:Q}},pattern(Q){return Q.map(ae=>"(?="+ae+")").join("")},multipleOf(Q){let ae=Q.slice(0),Y=1;for(;ae.some(te=>!Number.isInteger(te));)ae=ae.map(te=>te*10),Y=Y*10;return n(ae)/Y},enum(Q){const ae=l.apply(null,Q.concat(d));if(ae.length)return p(ae)}};ee.$id=O,ee.$ref=O,ee.$schema=O,ee.additionalItems=C,ee.additionalProperties=C,ee.anyOf=ee.oneOf,ee.contains=C,ee.default=O,ee.definitions=ee.dependencies,ee.description=O,ee.examples=F,ee.exclusiveMaximum=L,ee.exclusiveMinimum=z,ee.items=w,ee.maximum=L,ee.maxItems=L,ee.maxLength=L,ee.maxProperties=L,ee.minimum=z,ee.minItems=z,ee.minLength=z,ee.minProperties=z,ee.properties=S,ee.propertyNames=C,ee.required=M,ee.title=O,ee.uniqueItems=U;const re={properties:S,items:w};function ne(Q,ae,Y){ae=r(ae,{ignoreAdditionalProperties:!1,resolvers:ee,complexResolvers:re,deep:!0});const te=Object.entries(ae.complexResolvers);function se(ve,Se,Re){ve=e(ve.filter(A)),Re=Re||[];const De=f(Se)?Se:{};if(!ve.length)return;if(ve.some(_))return!1;if(ve.every(j))return!0;ve=ve.filter(f);const Ve=k(ve);if(ae.deep&&b(Ve,"allOf"))return ne({allOf:ve},ae);const Le=te.map(([$e,qe])=>Ve.filter(Je=>qe.keywords.includes(Je)));return Le.forEach($e=>h(Ve,$e)),Ve.forEach(function($e){const qe=P(ve,$e),Je=y(qe.filter(A),q($e));if(Je.length===1&&b($,$e))De[$e]=Je[0].map(qt=>se([qt],qt));else if(Je.length===1&&!b(B,$e)&&!b(G,$e))De[$e]=Je[0];else{const qt=ae.resolvers[$e]||ae.resolvers.defaultResolver;if(!qt)throw new Error("No resolver found for key "+$e+". You can provide a resolver for this keyword in the options, or provide a default resolver.");const ln=(Sn,cn=[])=>se(Sn,null,Re.concat($e,cn));De[$e]=qt(Je,Re.concat($e),ln,ae),De[$e]===void 0?J(Je,Re.concat($e)):De[$e]===void 0&&delete De[$e]}}),te.reduce(($e,[qe,Je],qt)=>({...$e,...D(Le[qt],qe,ve,se,ae,Re)}),De)}const le=s(V(Q));return se(le)}return ne.options={resolvers:ee},_N=ne,_N}var Zye=Xye();const Qye=zr(Zye);function Yc(e){let t;const n=Oe(e,"discriminator.propertyName",void 0);return Ov(n)?t=n:n!==void 0&&console.warn(`Expecting discriminator to be a string, got "${typeof n}" instead`),t}function _f(e){return Array.isArray(e)?"array":typeof e=="string"?"string":e==null?"null":typeof e=="boolean"?"boolean":isNaN(e)?typeof e=="object"?"object":"string":"number"}var Jye=lE(function(e){return d7(ph(e,1,hy,!0))});function Ds(e){let{type:t}=e;return!t&&e.const?_f(e.const):!t&&e.enum?"string":!t&&(e.properties||e.additionalProperties)?"object":(Array.isArray(t)&&(t.length===2&&t.includes("null")?t=t.find(n=>n!=="null"):t=t[0]),t)}function Ps(e,t){const n=Object.assign({},e);return Object.keys(t).reduce((r,a)=>{const s=e?e[a]:{},i=t[a];return e&&a in e&&ot(i)?r[a]=Ps(s,i):e&&t&&(Ds(e)==="object"||Ds(t)==="object")&&a===lue&&Array.isArray(s)&&Array.isArray(i)?r[a]=Jye(s,i):r[a]=i,r},n)}function xr(e,t,n={},r,a){return Ca(e,t,n,r,void 0,void 0,a)[0]}function eve(e,t,n,r,a,s,i){const{if:l,then:d,else:f,...h}=t,p=e.isValid(l,s||{},n);let g=[h],y=[];if(r)d&&typeof d!="boolean"&&(y=y.concat(Ca(e,d,n,s,r,a,i))),f&&typeof f!="boolean"&&(y=y.concat(Ca(e,f,n,s,r,a,i)));else{const S=p?d:f;S&&typeof S!="boolean"&&(y=y.concat(Ca(e,S,n,s,r,a,i)))}return y.length&&(g=y.map(S=>Ps(h,S))),g.flatMap(S=>Ca(e,S,n,s,r,a,i))}function Z7(e){return e.reduce((n,r)=>r.length>1?r.flatMap(a=>o7(n.length,s=>[...n[s]].concat(a))):(n.forEach(a=>a.push(r[0])),n),[[]])}function tve(e,t,n,r,a,s,i){const l=Q7(e,t,n,r,a,s);if(l.length>1||l[0]!==t)return l;if(wv in t)return J7(e,t,n,r,a,s).flatMap(f=>Ca(e,f,n,s,r,a,i));if(xu in t&&Array.isArray(t.allOf)){const d=t.allOf.map(h=>Ca(e,h,n,s,r,a,i));return Z7(d).map(h=>({...t,allOf:h}))}return[t]}function Q7(e,t,n,r,a,s,i){const l=Nf(t,n,a);return l!==t?Ca(e,l,n,s,r,a,i):[t]}function Nf(e,t,n){if(!ot(e))return e;let r=e;if(mn in r){const{$ref:a,...s}=r;if(n.includes(a))return r;n.push(a),r={...XF(a,t),...s}}if(Xt in r){const a=[],s=xme(r[Xt],(i,l,d)=>{const f=[...n];i[d]=Nf(l,t,f),a.push(f)},{});Nme(n,Pme(Cme(a))),r={...r,[Xt]:s}}return Po in r&&!Array.isArray(r.items)&&typeof r.items!="boolean"&&(r={...r,items:Nf(r.items,t,n)}),Pt(e,r)?e:r}function nve(e,t,n,r,a){const s={...t,properties:{...t.properties}},i=r&&ot(r)?r:{};return Object.keys(i).forEach(l=>{if(l in s.properties)return;let d={};typeof s.additionalProperties!="boolean"?mn in s.additionalProperties?d=xr(e,{$ref:Oe(s.additionalProperties,[mn])},n,i,a):"type"in s.additionalProperties?d={...s.additionalProperties}:na in s.additionalProperties||vr in s.additionalProperties?d={type:"object",...s.additionalProperties}:d={type:_f(Oe(i,[l]))}:d={type:_f(Oe(i,[l]))},s.properties[l]=d,Tn(s.properties,[l,ch],!0)}),s}function Ca(e,t,n,r,a=!1,s=[],i){return ot(t)?tve(e,t,n,a,s,r,i).flatMap(d=>{var f;let h=d;if(oue in h)return eve(e,h,n,a,s,r,i);if(xu in h){if(a){const{allOf:g,...y}=h;return[...g,y]}try{const g=[],y=[];(f=h.allOf)===null||f===void 0||f.forEach(S=>{typeof S=="object"&&S.contains?g.push(S):y.push(S)}),g.length&&(h={...h,allOf:y}),h=i?i(h):Qye(h,{deep:!1}),g.length&&(h.allOf=g)}catch(g){console.warn(`could not merge subschemas in allOf:
|
|
712
|
+
`,g);const{allOf:y,...S}=h;return S}}return nC in h&&h.additionalProperties!==!1?nve(e,h,n,r,i):h}):[{}]}function rve(e,t,n,r,a){let s;const{oneOf:i,anyOf:l,...d}=t;if(Array.isArray(i)?s=i:Array.isArray(l)&&(s=l),s){const f=a===void 0&&r?{}:a,h=Yc(t);s=s.map(g=>Nf(g,n,[]));const p=oE(e,f,s,n,h);if(r)return s.map(g=>Ps(d,g));t=Ps(d,s[p])}return[t]}function J7(e,t,n,r,a,s,i){const{dependencies:l,...d}=t;return rve(e,d,n,r,s).flatMap(h=>eU(e,l,h,n,r,a,s,i))}function eU(e,t,n,r,a,s,i,l){let d=[n];for(const f in t){if(!a&&Oe(i,[f])===void 0||n.properties&&!(f in n.properties))continue;const[h,p]=aE(f,t);return Array.isArray(p)?d[0]=ave(n,p):ot(p)&&(d=sve(e,n,r,f,p,a,s,i,l)),d.flatMap(g=>eU(e,h,g,r,a,s,i,l))}return d}function ave(e,t){if(!t)return e;const n=Array.isArray(e.required)?Array.from(new Set([...e.required,...t])):t;return{...e,required:n}}function sve(e,t,n,r,a,s,i,l,d){return Ca(e,a,n,l,s,i,d).flatMap(h=>{const{oneOf:p,...g}=h;if(t=Ps(t,g),p===void 0)return t;const y=p.map(w=>typeof w=="boolean"||!(mn in w)?[w]:Q7(e,w,n,s,i,l));return Z7(y).flatMap(w=>ove(e,t,n,r,w,s,i,l,d))})}function ove(e,t,n,r,a,s,i,l,d){const f=a.filter(h=>{if(typeof h=="boolean"||!h||!h.properties)return!1;const{[r]:p}=h.properties;if(p){const g={type:"object",properties:{[r]:p}};return e.isValid(g,l,n)||s}return!1});return!s&&f.length!==1?(console.warn("ignoring oneOf in dependencies because there isn't exactly one subschema that is valid"),[t]):f.flatMap(h=>{const p=h,[g]=aE(r,p.properties),y={...p,properties:g};return Ca(e,y,n,l,s,i,d).map(w=>Ps(t,w))})}const ive={type:"object",$id:iue,properties:{__not_really_there__:{type:"number"}}};function cC(e,t,n,r,a){let s=0;return n&&(Tt(n.properties)?s+=ame(n.properties,(i,l,d)=>{const f=Oe(r,d);if(typeof l=="boolean")return i;if(Bn(l,mn)){const h=xr(e,l,t,f,a);return i+cC(e,t,h,f||{},a)}if((Bn(l,vr)||Bn(l,na))&&f){const h=Bn(l,vr)?vr:na,p=Yc(l);return i+jf(e,t,f,Oe(l,h),-1,p,a)}if(l.type==="object")return Tt(f)&&(i+=1),i+cC(e,t,l,f,a);if(l.type===_f(f)){let h=i+1;return l.default?h+=f===l.default?1:-1:l.const&&(h+=f===l.const?1:-1),h}return i},0):Ov(n.type)&&n.type===_f(r)&&(s+=1)),s}function jf(e,t,n,r,a=-1,s,i){const l=r.map(g=>Nf(g,t,[])),d=i7(n,r,s);if(QF(d))return d;const f=l.reduce((g,y,S)=>(oE(e,n,[ive,y],t,s)===1&&g.push(S),g),[]);if(f.length===1)return f[0];f.length||o7(l.length,g=>f.push(g));const h=new Set,{bestIndex:p}=f.reduce((g,y)=>{const{bestScore:S}=g,w=l[y],b=cC(e,t,w,n,i);return h.add(b),b>S?{bestIndex:y,bestScore:b}:g},{bestIndex:a,bestScore:0});return h.size===1&&a>=0?a:p}function uC(e){return Array.isArray(e.items)&&e.items.length>0&&e.items.every(t=>ot(t))}function af(e){return e==null}function Cf(e,t,n=!1,r=!1,a=!1){if(Array.isArray(t)){const s=Array.isArray(e)?e:[],i=a?s:t,l=a?t:s,d=i.map((f,h)=>l[h]!==void 0?Cf(s[h],t[h],n,r,a):f);return(n||a)&&d.length<l.length&&d.push(...l.slice(d.length)),d}if(ot(t)){const s=Object.assign({},e);return Object.keys(t).reduce((i,l)=>{const d=Oe(t,l),f=ot(e)&&l in e,h=l in t;return i[l]=Cf(e?Oe(e,l):{},d,n,r,a&&(f||!h)),i},s)}return r&&(!af(e)&&af(t)||typeof t=="number"&&isNaN(t))||a&&!af(t)?e:t}function _s(e,t,n=!1){return Object.keys(t).reduce((r,a)=>{const s=e?e[a]:{},i=t[a];if(e&&a in e&&ot(i))r[a]=_s(s,i,n);else if(n&&Array.isArray(s)&&Array.isArray(i)){let l=i;n==="preventDuplicates"&&(l=i.reduce((d,f)=>(s.includes(f)||d.push(f),d),[])),r[a]=s.concat(l)}else r[a]=i;return r},Object.assign({},e))}function tU(e){return Array.isArray(e.enum)&&e.enum.length===1||Ms in e}function $E(e,t,n={},r){const a=xr(e,t,n,void 0,r),s=a.oneOf||a.anyOf;return Array.isArray(a.enum)?!0:Array.isArray(s)?s.every(i=>typeof i!="boolean"&&tU(i)):!1}function IE(e,t,n,r){return!t.uniqueItems||!t.items||typeof t.items=="boolean"?!1:$E(e,t.items,n,r)}function nU(e){const t=e[Ms],n=Ds(e);return ot(t)&&Ov(t==null?void 0:t.$data)&&n!=="object"&&n!=="array"}function lve(e){if(sue in e&&Array.isArray(e.enum)&&e.enum.length===1)return e.enum[0];if(Ms in e)return e.const;throw new Error("schema cannot be inferred as a constant")}function Ef(e,t){const n=e;if(e.enum){let s;if(t){const{enumNames:i}=at(t);s=i}return!s&&n.enumNames&&(s=n.enumNames),e.enum.map((i,l)=>({label:(s==null?void 0:s[l])||String(i),value:i}))}let r,a;return e.anyOf?(r=e.anyOf,a=t==null?void 0:t.anyOf):e.oneOf&&(r=e.oneOf,a=t==null?void 0:t.oneOf),r&&r.map((s,i)=>{const{title:l}=at(a==null?void 0:a[i]),d=s,f=lve(d),h=l||d.title||String(f);return{schema:d,label:h,value:f}})}const cve=["string","number","integer","boolean","null"];var Xc;(function(e){e[e.Ignore=0]="Ignore",e[e.Invert=1]="Invert",e[e.Fallback=2]="Fallback"})(Xc||(Xc={}));function NN(e,t=Xc.Ignore,n=-1){if(n>=0){if(Array.isArray(e.items)&&n<e.items.length){const r=e.items[n];if(typeof r!="boolean")return r}}else if(e.items&&!Array.isArray(e.items)&&typeof e.items!="boolean")return e.items;return t!==Xc.Ignore&&ot(e.additionalItems)?e.additionalItems:{}}function w3(e,t,n,r,a,s=[],i={},l=!1){const{emptyObjectFields:d="populateAllDefaults"}=i;if(r||l)e[t]=n;else if(d!=="skipDefaults"){const f=a===void 0?s.includes(t):a;ot(n)?d==="skipEmptyDefaults"?Kc(n)||(e[t]=n):(!Kc(n)||s.includes(t))&&(f||d!=="populateRequiredDefaults")&&(e[t]=n):n!==void 0&&(d==="populateAllDefaults"||d==="skipEmptyDefaults"||f&&s.includes(t))&&(e[t]=n)}}function $o(e,t,n={}){const{parentDefaults:r,rawFormData:a,rootSchema:s={},includeUndefinedValues:i=!1,_recurseList:l=[],experimental_defaultFormStateBehavior:d=void 0,experimental_customMergeAllOf:f=void 0,required:h,shouldMergeDefaultsIntoFormData:p=!1}=n;let g=ot(a)?a:{};const y=ot(t)?t:{};let S=r,w=null,b=d,x=l;if(y[Ms]!==void 0&&(d==null?void 0:d.constAsDefaults)!=="never"&&!nU(y))S=y[Ms];else if(ot(S)&&ot(y.default))S=_s(S,y.default);else if(aue in y&&!y[na]&&!y[vr])S=y.default;else if(mn in y){const C=y[mn];l.includes(C)||(x=l.concat(C),w=XF(C,s)),w&&!S&&(S=y.default),p&&w&&!ot(a)&&(g=a)}else if(wv in y){const C={...S3(e,y,n,S),...g};w=J7(e,y,s,!1,[],C,f)[0]}else if(uC(y))S=y.items.map((C,T)=>$o(e,C,{rootSchema:s,includeUndefinedValues:i,_recurseList:l,experimental_defaultFormStateBehavior:d,experimental_customMergeAllOf:f,parentDefaults:Array.isArray(r)?r[T]:void 0,rawFormData:g,required:h,shouldMergeDefaultsIntoFormData:p}));else if(vr in y){const{oneOf:C,...T}=y;if(C.length===0)return;const A=Yc(y),{type:k="null"}=T;!Array.isArray(k)&&cve.includes(k)&&(b==null?void 0:b.constAsDefaults)==="skipOneOf"&&(b={...b,constAsDefaults:"never"}),w=C[jf(e,s,a??y.default,C,0,A,f)],w=Ps(T,w)}else if(na in y){const{anyOf:C,...T}=y;if(C.length===0)return;const A=Yc(y);w=C[jf(e,s,a??y.default,C,0,A,f)],w=Ps(T,w)}if(w)return $o(e,w,{rootSchema:s,includeUndefinedValues:i,_recurseList:x,experimental_defaultFormStateBehavior:b,experimental_customMergeAllOf:f,parentDefaults:S,rawFormData:a??g,required:h,shouldMergeDefaultsIntoFormData:p});S===void 0&&(S=y.default);const _=S3(e,y,n,S);let j=_??S;if(p){const{arrayMinItems:C={}}=d||{},{mergeExtraDefaults:T}=C,A=uve(e,y,s,a,d,f);(!ot(a)||xu in y)&&(j=Cf(j,A,T,!0))}return j}function uve(e,t,n,r,a,s){const i=!tU(t)&&$E(e,t,n,s);let l=r;if(i){const f=Ef(t);l=(f==null?void 0:f.some(p=>Pt(p.value,r)))?r:void 0}return t[Ms]&&(a==null?void 0:a.constAsDefaults)==="always"&&(l=t.const),l}function dve(e,t,{rawFormData:n,rootSchema:r={},includeUndefinedValues:a=!1,_recurseList:s=[],experimental_defaultFormStateBehavior:i=void 0,experimental_customMergeAllOf:l=void 0,required:d,shouldMergeDefaultsIntoFormData:f}={},h){{const p=ot(n)?n:{},g=t,y=(i==null?void 0:i.allOf)==="populateDefaults"&&xu in g?xr(e,g,r,p,l):g,S=y[Ms],w=Object.keys(y.properties||{}).reduce((b,x)=>{var _;const j=Oe(y,[Xt,x]),C=ot(S)&&S[x]!==void 0,T=(ot(j)&&Ms in j||C)&&(i==null?void 0:i.constAsDefaults)!=="never"&&!nU(j),A=$o(e,j,{rootSchema:r,_recurseList:s,experimental_defaultFormStateBehavior:i,experimental_customMergeAllOf:l,includeUndefinedValues:a===!0,parentDefaults:Oe(h,[x]),rawFormData:Oe(p,[x]),required:(_=y.required)===null||_===void 0?void 0:_.includes(x),shouldMergeDefaultsIntoFormData:f});return w3(b,x,A,a,d,y.required,i,T),b},{});if(y.additionalProperties){const b=ot(y.additionalProperties)?y.additionalProperties:{},x=new Set;ot(h)&&Object.keys(h).filter(j=>!y.properties||!y.properties[j]).forEach(j=>x.add(j));const _=[];Object.keys(p).filter(j=>!y.properties||!y.properties[j]).forEach(j=>{x.add(j),_.push(j)}),x.forEach(j=>{var C;const T=$o(e,b,{rootSchema:r,_recurseList:s,experimental_defaultFormStateBehavior:i,experimental_customMergeAllOf:l,includeUndefinedValues:a===!0,parentDefaults:Oe(h,[j]),rawFormData:Oe(p,[j]),required:(C=y.required)===null||C===void 0?void 0:C.includes(j),shouldMergeDefaultsIntoFormData:f});w3(w,j,T,a,d,_)})}return w}}function fve(e,t,{rawFormData:n,rootSchema:r={},_recurseList:a=[],experimental_defaultFormStateBehavior:s=void 0,experimental_customMergeAllOf:i=void 0,required:l,shouldMergeDefaultsIntoFormData:d}={},f){var h,p;const g=t,y=(h=s==null?void 0:s.arrayMinItems)!==null&&h!==void 0?h:{},{populate:S,mergeExtraDefaults:w}=y,b=S==="never",x=S==="requiredOnly",_=S==="all"||!b&&!x,j=(p=y==null?void 0:y.computeSkipPopulate)!==null&&p!==void 0?p:(()=>!1),T=(s==null?void 0:s.emptyObjectFields)==="skipEmptyDefaults"?void 0:[];if(Array.isArray(f)&&(f=f.map((U,F)=>{const q=NN(g,Xc.Fallback,F);return $o(e,q,{rootSchema:r,_recurseList:a,experimental_defaultFormStateBehavior:s,experimental_customMergeAllOf:i,parentDefaults:U,required:l,shouldMergeDefaultsIntoFormData:d})})),Array.isArray(n)){const U=NN(g);if(b)f=n;else{const F=n.map((V,P)=>$o(e,U,{rootSchema:r,_recurseList:a,experimental_defaultFormStateBehavior:s,experimental_customMergeAllOf:i,rawFormData:V,parentDefaults:Oe(f,[P]),required:l,shouldMergeDefaultsIntoFormData:d}));f=Cf(f,F,(x&&l||_)&&w)}}if((ot(g)&&Ms in g&&(s==null?void 0:s.constAsDefaults)!=="never")===!1){if(b)return f??T;if(x&&!l)return f||void 0}const k=Array.isArray(f)?f.length:0;if(!g.minItems||IE(e,g,r,i)||j(e,g,r)||g.minItems<=k)return f||T;const O=f||[],M=NN(g,Xc.Invert),z=M.default,L=new Array(g.minItems-k).fill($o(e,M,{parentDefaults:z,rootSchema:r,_recurseList:a,experimental_defaultFormStateBehavior:s,experimental_customMergeAllOf:i,required:l,shouldMergeDefaultsIntoFormData:d}));return O.concat(L)}function S3(e,t,n={},r){switch(Ds(t)){case"object":return dve(e,t,n,r);case"array":return fve(e,t,n,r)}}function rU(e,t,n,r,a=!1,s,i){if(!ot(t))throw new Error("Invalid schema: "+t);const l=xr(e,t,r,n,i),d=$o(e,l,{rootSchema:r,includeUndefinedValues:a,experimental_defaultFormStateBehavior:s,experimental_customMergeAllOf:i,rawFormData:n,shouldMergeDefaultsIntoFormData:!0});if(ot(n)||Array.isArray(n)){const{mergeDefaultsIntoFormData:f}=s||{};return Cf(d,n,!0,f==="useDefaultIfFormDataUndefined",!0)}return d}function aU(e={}){return"widget"in at(e)&&at(e).widget!=="hidden"}function sU(e,t,n={},r,a){if(n[U2]==="files")return!0;if(t.items){const s=xr(e,t.items,r,void 0,a);return s.type==="string"&&s.format==="data-url"}return!1}function hve(e,t,n={},r,a,s){const i=at(n,a),{label:l=!0}=i;let d=!!l;const f=Ds(t);return f==="array"&&(d=IE(e,t,r,s)||sU(e,t,n,r,s)||aU(n)),f==="object"&&(d=!1),f==="boolean"&&!n[U2]&&(d=!1),n[cue]&&(d=!1),d}function pve(e,t,n){if(!n)return t;const{errors:r,errorSchema:a}=t;let s=e.toErrorList(n),i=n;return Kc(a)||(i=_s(a,n,!0),s=[...r].concat(s)),{errorSchema:i,errors:s}}const vc=Symbol("no Value");function dC(e,t,n,r,a={},s){let i;if(Bn(n,Xt)){const l={};if(Bn(r,Xt)){const h=Oe(r,Xt,{});Object.keys(h).forEach(p=>{Bn(a,p)&&(l[p]=void 0)})}const d=Object.keys(Oe(n,Xt,{})),f={};d.forEach(h=>{const p=Oe(a,h);let g=Oe(r,[Xt,h],{}),y=Oe(n,[Xt,h],{});Bn(g,mn)&&(g=xr(e,g,t,p,s)),Bn(y,mn)&&(y=xr(e,y,t,p,s));const S=Oe(g,"type"),w=Oe(y,"type");if(!S||S===w)if(Bn(l,h)&&delete l[h],w==="object"||w==="array"&&Array.isArray(p)){const b=dC(e,t,y,g,p,s);(b!==void 0||w==="array")&&(f[h]=b)}else{const b=Oe(y,"default",vc),x=Oe(g,"default",vc);b!==vc&&b!==p&&(x===p?l[h]=b:Oe(y,"readOnly")===!0&&(l[h]=void 0));const _=Oe(y,"const",vc),j=Oe(g,"const",vc);_!==vc&&_!==p&&(l[h]=j===p?_:void 0)}}),i={...typeof a=="string"||Array.isArray(a)?void 0:a,...l,...f}}else if(Oe(r,"type")==="array"&&Oe(n,"type")==="array"&&Array.isArray(a)){let l=Oe(r,"items"),d=Oe(n,"items");if(typeof l=="object"&&typeof d=="object"&&!Array.isArray(l)&&!Array.isArray(d)){Bn(l,mn)&&(l=xr(e,l,t,a,s)),Bn(d,mn)&&(d=xr(e,d,t,a,s));const f=Oe(l,"type"),h=Oe(d,"type");if(!f||f===h){const p=Oe(n,"maxItems",-1);h==="object"?i=a.reduce((g,y)=>{const S=dC(e,t,d,l,y,s);return S!==void 0&&(p<0||g.length<p)&&g.push(S),g},[]):i=p>0&&a.length>p?a.slice(0,p):a}}else typeof l=="boolean"&&typeof d=="boolean"&&l===d&&(i=a)}return i}function Og(e,t,n,r,a,s,i,l=[],d){if(mn in t||wv in t||xu in t){const p=xr(e,t,s,i,d);if(l.findIndex(y=>Pt(y,p))===-1)return Og(e,p,n,r,a,s,i,l.concat(p),d)}if(Po in t&&!Oe(t,[Po,mn]))return Og(e,Oe(t,Po),n,r,a,s,i,l,d);const h={$id:a||n};if(Ds(t)==="object"&&Xt in t)for(const p in t.properties){const g=Oe(t,[Xt,p]),y=h[Ao]+r+p;h[p]=Og(e,ot(g)?g:{},n,r,y,s,Oe(i,[p]),l,d)}return h}function mve(e,t,n,r,a,s="root",i="_",l){return Og(e,t,s,i,n,r,a,void 0,l)}function Mi(e,t,n,r,a,s=[],i){if(mn in t||wv in t||xu in t){const d=xr(e,t,r,a,i);if(s.findIndex(h=>Pt(h,d))===-1)return Mi(e,d,n,r,a,s.concat(d),i)}let l={[kg]:n.replace(/^\./,"")};if(vr in t||na in t){const d=vr in t?t.oneOf:t.anyOf,f=Yc(t),h=jf(e,r,a,d,0,f,i),p=d[h];l={...l,...Mi(e,p,n,r,a,s,i)}}if(nC in t&&t[nC]!==!1&&Tn(l,F2,!0),Po in t&&Array.isArray(a)){const{items:d,additionalItems:f}=t;Array.isArray(d)?a.forEach((h,p)=>{d[p]?l[p]=Mi(e,d[p],`${n}.${p}`,r,h,s,i):f?l[p]=Mi(e,f,`${n}.${p}`,r,h,s,i):console.warn(`Unable to generate path schema for "${n}.${p}". No schema defined for it`)}):a.forEach((h,p)=>{l[p]=Mi(e,d,`${n}.${p}`,r,h,s,i)})}else if(Xt in t)for(const d in t.properties){const f=Oe(t,[Xt,d]);l[d]=Mi(e,f,`${n}.${d}`,r,Oe(a,[d]),s,i)}return l}function gve(e,t,n="",r,a,s){return Mi(e,t,n,r,a,void 0,s)}class yve{constructor(t,n,r,a){this.rootSchema=n,this.validator=t,this.experimental_defaultFormStateBehavior=r,this.experimental_customMergeAllOf=a}getValidator(){return this.validator}doesSchemaUtilsDiffer(t,n,r={},a){return!t||!n?!1:this.validator!==t||!Pt(this.rootSchema,n)||!Pt(this.experimental_defaultFormStateBehavior,r)||this.experimental_customMergeAllOf!==a}getDefaultFormState(t,n,r=!1){return rU(this.validator,t,n,this.rootSchema,r,this.experimental_defaultFormStateBehavior,this.experimental_customMergeAllOf)}getDisplayLabel(t,n,r){return hve(this.validator,t,n,this.rootSchema,r,this.experimental_customMergeAllOf)}getClosestMatchingOption(t,n,r,a){return jf(this.validator,this.rootSchema,t,n,r,a,this.experimental_customMergeAllOf)}getFirstMatchingOption(t,n,r){return oE(this.validator,t,n,this.rootSchema,r)}getMatchingOption(t,n,r){return l7(this.validator,t,n,this.rootSchema,r)}isFilesArray(t,n){return sU(this.validator,t,n,this.rootSchema,this.experimental_customMergeAllOf)}isMultiSelect(t){return IE(this.validator,t,this.rootSchema,this.experimental_customMergeAllOf)}isSelect(t){return $E(this.validator,t,this.rootSchema,this.experimental_customMergeAllOf)}mergeValidationData(t,n){return pve(this.validator,t,n)}retrieveSchema(t,n){return xr(this.validator,t,this.rootSchema,n,this.experimental_customMergeAllOf)}sanitizeDataForNewSchema(t,n,r){return dC(this.validator,this.rootSchema,t,n,r,this.experimental_customMergeAllOf)}toIdSchema(t,n,r,a="root",s="_"){return mve(this.validator,t,n,this.rootSchema,r,a,s,this.experimental_customMergeAllOf)}toPathSchema(t,n,r){return gve(this.validator,t,n,this.rootSchema,r,this.experimental_customMergeAllOf)}}function vve(e,t,n={},r){return new yve(e,t,n,r)}function xve(e){var t;if(e.indexOf("data:")===-1)throw new Error("File is invalid: URI must be a dataURI");const r=e.slice(5).split(";base64,");if(r.length!==2)throw new Error("File is invalid: dataURI must be base64");const[a,s]=r,[i,...l]=a.split(";"),d=i||"",f=decodeURI(((t=l.map(h=>h.split("=")).find(([h])=>h==="name"))===null||t===void 0?void 0:t[1])||"unknown");try{const h=atob(s),p=new Array(h.length);for(let y=0;y<h.length;y++)p[y]=h.charCodeAt(y);return{blob:new window.Blob([new Uint8Array(p)],{type:d}),name:f}}catch(h){throw new Error("File is invalid: "+h.message)}}function jo(e,t){let n=String(e);for(;n.length<t;)n="0"+n;return n}function oU(e,t){if(e<=0&&t<=0)e=new Date().getFullYear()+e,t=new Date().getFullYear()+t;else if(e<0||t<0)throw new Error(`Both start (${e}) and stop (${t}) must both be <= 0 or > 0, got one of each`);if(e>t)return oU(t,e).reverse();const n=[];for(let r=e;r<=t;r++)n.push({value:r,label:jo(r,2)});return n}function bve(e,t){let n=e;if(Array.isArray(t)){const r=n.split(/(%\d)/);t.forEach((a,s)=>{const i=r.findIndex(l=>l===`%${s+1}`);i>=0&&(r[i]=a)}),n=r.join("")}return n}function wve(e,t){return bve(e,t)}function Ra(e,t=[],n){if(Array.isArray(e))return e.map(s=>Ra(s,t)).filter(s=>s!==n);const r=e===""||e===null?-1:Number(e),a=t[r];return a?a.value:n}function Sve(e,t,n=[]){const r=Ra(e,n);return Array.isArray(t)?t.filter(a=>!Pt(a,r)):Pt(r,t)?void 0:t}function LE(e,t){return Array.isArray(t)?t.some(n=>Pt(n,e)):Pt(t,e)}function _ve(e,t=[],n=!1){const r=t.map((a,s)=>LE(a.value,e)?String(s):void 0).filter(a=>typeof a<"u");return n?r:r[0]}function Nve(e,t,n=[]){const r=Ra(e,n);if(!af(r)){const a=n.findIndex(l=>r===l.value),s=n.map(({value:l})=>l);return t.slice(0,a).concat(r,t.slice(a)).sort((l,d)=>+(s.indexOf(l)>s.indexOf(d)))}return t}var jve=1,Cve=4;function iU(e){return rf(e,jve|Cve)}function Eve(e,t,n,r){return r=typeof r=="function"?r:void 0,e==null?e:iE(e,t,n,r)}class Tve{constructor(t){this.errorSchema={},this.resetAllErrors(t)}get ErrorSchema(){return this.errorSchema}getOrCreateErrorBlock(t){let r=Array.isArray(t)&&t.length>0||typeof t=="string"?Oe(this.errorSchema,t):this.errorSchema;return!r&&t&&(r={},Eve(this.errorSchema,t,r,Object)),r}resetAllErrors(t){return this.errorSchema=t?iU(t):{},this}addErrors(t,n){const r=this.getOrCreateErrorBlock(n);let a=Oe(r,gr);return Array.isArray(a)||(a=[],r[gr]=a),Array.isArray(t)?Tn(r,gr,[...new Set([...a,...t])]):Tn(r,gr,[...new Set([...a,t])]),this}setErrors(t,n){const r=this.getOrCreateErrorBlock(n),a=Array.isArray(t)?[...new Set([...t])]:[t];return Tn(r,gr,a),this}clearErrors(t){const n=this.getOrCreateErrorBlock(t);return Tn(n,gr,[]),this}}function Ave(e,t,n=[1900,new Date().getFullYear()+2],r="YMD"){const{day:a,month:s,year:i,hour:l,minute:d,second:f}=e,h={type:"day",range:[1,31],value:a},p={type:"month",range:[1,12],value:s},g={type:"year",range:n,value:i},y=[];switch(r){case"MDY":y.push(p,h,g);break;case"DMY":y.push(h,p,g);break;case"YMD":default:y.push(g,p,h)}return t&&y.push({type:"hour",range:[0,23],value:l},{type:"minute",range:[0,59],value:d},{type:"second",range:[0,59],value:f}),y}function Rve(e){const t={};return e.multipleOf&&(t.step=e.multipleOf),(e.minimum||e.minimum===0)&&(t.min=e.minimum),(e.maximum||e.maximum===0)&&(t.max=e.maximum),t}function kve(e,t,n={},r=!0){const a={type:t||"text",...Rve(e)};return n.inputType?a.type=n.inputType:t||(e.type==="number"?(a.type="number",r&&a.step===void 0&&(a.step="any")):e.type==="integer"&&(a.type="number",a.step===void 0&&(a.step=1))),n.autocomplete&&(a.autoComplete=n.autocomplete),n.accept&&(a.accept=n.accept),a}const _3={props:{disabled:!1},submitText:"Submit",norender:!1};function Ove(e={}){const t=at(e);if(t&&t[ly]){const n=t[ly];return{..._3,...n}}return _3}function pt(e,t,n={}){const{templates:r}=t;return e==="ButtonTemplates"?r[e]:n[e]||r[e]}var jN={exports:{}},ht={};/**
|
|
713
|
+
* @license React
|
|
714
|
+
* react-is.production.min.js
|
|
715
|
+
*
|
|
716
|
+
* Copyright (c) Facebook, Inc. and its affiliates.
|
|
717
|
+
*
|
|
718
|
+
* This source code is licensed under the MIT license found in the
|
|
719
|
+
* LICENSE file in the root directory of this source tree.
|
|
720
|
+
*/var N3;function Mve(){if(N3)return ht;N3=1;var e=Symbol.for("react.element"),t=Symbol.for("react.portal"),n=Symbol.for("react.fragment"),r=Symbol.for("react.strict_mode"),a=Symbol.for("react.profiler"),s=Symbol.for("react.provider"),i=Symbol.for("react.context"),l=Symbol.for("react.server_context"),d=Symbol.for("react.forward_ref"),f=Symbol.for("react.suspense"),h=Symbol.for("react.suspense_list"),p=Symbol.for("react.memo"),g=Symbol.for("react.lazy"),y=Symbol.for("react.offscreen"),S;S=Symbol.for("react.module.reference");function w(b){if(typeof b=="object"&&b!==null){var x=b.$$typeof;switch(x){case e:switch(b=b.type,b){case n:case a:case r:case f:case h:return b;default:switch(b=b&&b.$$typeof,b){case l:case i:case d:case g:case p:case s:return b;default:return x}}case t:return x}}}return ht.ContextConsumer=i,ht.ContextProvider=s,ht.Element=e,ht.ForwardRef=d,ht.Fragment=n,ht.Lazy=g,ht.Memo=p,ht.Portal=t,ht.Profiler=a,ht.StrictMode=r,ht.Suspense=f,ht.SuspenseList=h,ht.isAsyncMode=function(){return!1},ht.isConcurrentMode=function(){return!1},ht.isContextConsumer=function(b){return w(b)===i},ht.isContextProvider=function(b){return w(b)===s},ht.isElement=function(b){return typeof b=="object"&&b!==null&&b.$$typeof===e},ht.isForwardRef=function(b){return w(b)===d},ht.isFragment=function(b){return w(b)===n},ht.isLazy=function(b){return w(b)===g},ht.isMemo=function(b){return w(b)===p},ht.isPortal=function(b){return w(b)===t},ht.isProfiler=function(b){return w(b)===a},ht.isStrictMode=function(b){return w(b)===r},ht.isSuspense=function(b){return w(b)===f},ht.isSuspenseList=function(b){return w(b)===h},ht.isValidElementType=function(b){return typeof b=="string"||typeof b=="function"||b===n||b===a||b===r||b===f||b===h||b===y||typeof b=="object"&&b!==null&&(b.$$typeof===g||b.$$typeof===p||b.$$typeof===s||b.$$typeof===i||b.$$typeof===d||b.$$typeof===S||b.getModuleId!==void 0)},ht.typeOf=w,ht}var j3;function Dve(){return j3||(j3=1,jN.exports=Mve()),jN.exports}var Pve=Dve();const C3=zr(Pve),CN={boolean:{checkbox:"CheckboxWidget",radio:"RadioWidget",select:"SelectWidget",hidden:"HiddenWidget"},string:{text:"TextWidget",password:"PasswordWidget",email:"EmailWidget",hostname:"TextWidget",ipv4:"TextWidget",ipv6:"TextWidget",uri:"URLWidget","data-url":"FileWidget",radio:"RadioWidget",select:"SelectWidget",textarea:"TextareaWidget",hidden:"HiddenWidget",date:"DateWidget",datetime:"DateTimeWidget","date-time":"DateTimeWidget","alt-date":"AltDateWidget","alt-datetime":"AltDateTimeWidget",time:"TimeWidget",color:"ColorWidget",file:"FileWidget"},number:{text:"TextWidget",select:"SelectWidget",updown:"UpDownWidget",range:"RangeWidget",radio:"RadioWidget",hidden:"HiddenWidget"},integer:{text:"TextWidget",select:"SelectWidget",updown:"UpDownWidget",range:"RangeWidget",radio:"RadioWidget",hidden:"HiddenWidget"},array:{select:"SelectWidget",checkboxes:"CheckboxesWidget",files:"FileWidget",hidden:"HiddenWidget"}};function $ve(e){let t=Oe(e,"MergedWidget");if(!t){const n=e.defaultProps&&e.defaultProps.options||{};t=({options:r,...a})=>c.jsx(e,{options:{...n,...r},...a}),Tn(e,"MergedWidget",t)}return t}function Es(e,t,n={}){const r=Ds(e);if(typeof t=="function"||t&&C3.isForwardRef(N.createElement(t))||C3.isMemo(t))return $ve(t);if(typeof t!="string")throw new Error(`Unsupported widget definition: ${typeof t}`);if(t in n){const a=n[t];return Es(e,a,n)}if(typeof r=="string"){if(!(r in CN))throw new Error(`No widget for type '${r}'`);if(t in CN[r]){const a=n[CN[r][t]];return Es(e,a,n)}}throw new Error(`No widget '${t}' for type '${r}'`)}function Ive(e){let t=0;for(let n=0;n<e.length;n+=1){const r=e.charCodeAt(n);t=(t<<5)-t+r,t=t&t}return t.toString(16)}function Lve(e){const t=new Set;return JSON.stringify(e,(n,r)=>(t.add(n),r)),Ive(JSON.stringify(e,Array.from(t).sort()))}function zve(e,t,n={}){try{return Es(e,t,n),!0}catch(r){const a=r;if(a.message&&(a.message.startsWith("No widget")||a.message.startsWith("Unsupported widget")))return!1;throw r}}function vh(e,t){return`${Ov(e)?e:e[Ao]}__${t}`}function xh(e){return vh(e,"description")}function lU(e){return vh(e,"error")}function fC(e){return vh(e,"examples")}function cU(e){return vh(e,"help")}function uU(e){return vh(e,"title")}function Nl(e,t=!1){const n=t?` ${fC(e)}`:"";return`${lU(e)} ${xh(e)} ${cU(e)}${n}`}function dU(e,t){return`${e}-${t}`}function qve(e,t,n){return t?n:e}function Fve(e){return e?new Date(e).toJSON():void 0}function Uve(e,t){if(!Array.isArray(t))return e;const n=h=>h.reduce((p,g)=>(p[g]=!0,p),{}),r=h=>h.length>1?`properties '${h.join("', '")}'`:`property '${h[0]}'`,a=n(e),s=t.filter(h=>h==="*"||a[h]),i=n(s),l=e.filter(h=>!i[h]),d=s.indexOf("*");if(d===-1){if(l.length)throw new Error(`uiSchema order list does not contain ${r(l)}`);return s}if(d!==s.lastIndexOf("*"))throw new Error("uiSchema order list contains more than one wildcard item");const f=[...s];return f.splice(d,1,...l),f}function EN(e,t=!0){if(!e)return{year:-1,month:-1,day:-1,hour:t?-1:0,minute:t?-1:0,second:t?-1:0};const n=new Date(e);if(Number.isNaN(n.getTime()))throw new Error("Unable to parse date "+e);return{year:n.getUTCFullYear(),month:n.getUTCMonth()+1,day:n.getUTCDate(),hour:t?n.getUTCHours():0,minute:t?n.getUTCMinutes():0,second:t?n.getUTCSeconds():0}}function Mg(e){if(e.const||e.enum&&e.enum.length===1&&e.enum[0]===!0)return!0;if(e.anyOf&&e.anyOf.length===1)return Mg(e.anyOf[0]);if(e.oneOf&&e.oneOf.length===1)return Mg(e.oneOf[0]);if(e.allOf){const t=n=>Mg(n);return e.allOf.some(t)}return!1}function Hve(e,t,n){const{props:r,state:a}=e;return!Pt(r,t)||!Pt(a,n)}function E3(e,t=!0){const{year:n,month:r,day:a,hour:s=0,minute:i=0,second:l=0}=e,d=Date.UTC(n,r-1,a,s,i,l),f=new Date(d).toJSON();return t?f:f.slice(0,10)}function Tf(e,t=[]){if(!e)return[];let n=[];return gr in e&&(n=n.concat(e[gr].map(r=>{const a=`.${t.join(".")}`;return{property:a,message:r,stack:`${a} ${r}`}}))),Object.keys(e).reduce((r,a)=>{if(a!==gr){const s=e[a];Ji(s)&&(r=r.concat(Tf(s,[...t,a])))}return r},n)}function fU(e){return yn(e)?Av(e,vl):fh(e)?[e]:tE(DF(Z2(e)))}function Bve(e){const t=new Tve;return e.length&&e.forEach(n=>{const{property:r,message:a}=n,s=r==="."?[]:fU(r);s.length>0&&s[0]===""&&s.splice(0,1),a&&t.addErrors(a,s)}),t.ErrorSchema}function zE(e){return Object.keys(e).reduce((t,n)=>{if(n==="addError")return t;{const r=e[n];return Ji(r)?{...t,[n]:zE(r)}:{...t,[n]:r}}},{})}function Vve(e){if(!e)return"";const t=new Date(e),n=jo(t.getFullYear(),4),r=jo(t.getMonth()+1,2),a=jo(t.getDate(),2),s=jo(t.getHours(),2),i=jo(t.getMinutes(),2),l=jo(t.getSeconds(),2),d=jo(t.getMilliseconds(),3);return`${n}-${r}-${a}T${s}:${i}:${l}.${d}`}function Dg(e,t){if(!t)return e;const{errors:n,errorSchema:r}=e;let a=Tf(t),s=t;return Kc(r)||(s=_s(r,t,!0),a=[...n].concat(a)),{errorSchema:s,errors:a}}function Wve(e){for(const t in e){const n=e,r=n[t];t===mn&&typeof r=="string"&&r.startsWith("#")?n[t]=bF+r:n[t]=qE(r)}return e}function Gve(e){for(let t=0;t<e.length;t++)e[t]=qE(e[t]);return e}function qE(e){return Array.isArray(e)?Gve([...e]):Tt(e)?Wve({...e}):e}function hU(e,t,n){for(var r=-1,a=t.length,s={};++r<a;){var i=t[r],l=Rv(e,i);n(l,i)&&iE(s,wu(i,e),l)}return s}function Kve(e,t){if(e==null)return{};var n=Av(nE(e),function(r){return[r]});return t=sE(t),hU(e,n,function(r,a){return t(r,a[0])})}var Yve=200;function Xve(e,t,n,r){var a=-1,s=u7,i=!0,l=e.length,d=[],f=t.length;if(!l)return d;t.length>=Yve&&(s=H2,i=!1,t=new Vc(t));e:for(;++a<l;){var h=e[a],p=h;if(h=h!==0?h:0,i&&p===p){for(var g=f;g--;)if(t[g]===p)continue e;d.push(h)}else s(t,p,r)||d.push(h)}return d}var Zve=lE(function(e,t){return hy(e)?Xve(e,ph(t,1,hy,!0)):[]});function Qve(e,t){const n=Ji(e),r=Ji(t);if(e===t||!n&&!r)return[];if(n&&!r)return Na(e);if(!n&&r)return Na(t);{const a=Na(Kve(e,(i,l)=>!Pt(i,Oe(t,l)))),s=Zve(Na(t),Na(e));return[...a,...s]}}var Nt;(function(e){e.ArrayItemTitle="Item",e.MissingItems="Missing items definition",e.YesLabel="Yes",e.NoLabel="No",e.CloseLabel="Close",e.ErrorsLabel="Errors",e.NewStringDefault="New Value",e.AddButton="Add",e.AddItemButton="Add Item",e.CopyButton="Copy",e.MoveDownButton="Move down",e.MoveUpButton="Move up",e.RemoveButton="Remove",e.NowLabel="Now",e.ClearLabel="Clear",e.AriaDateLabel="Select a date",e.PreviewLabel="Preview",e.DecrementAriaLabel="Decrease value by 1",e.IncrementAriaLabel="Increase value by 1",e.UnknownFieldType="Unknown field type %1",e.OptionPrefix="Option %1",e.TitleOptionPrefix="%1 option %2",e.KeyLabel="%1 Key",e.InvalidObjectField='Invalid "%1" object field configuration: _%2_.',e.UnsupportedField="Unsupported field schema.",e.UnsupportedFieldWithId="Unsupported field schema for field `%1`.",e.UnsupportedFieldWithReason="Unsupported field schema: _%1_.",e.UnsupportedFieldWithIdAndReason="Unsupported field schema for field `%1`: _%2_.",e.FilesInfo="**%1** (%2, %3 bytes)"})(Nt||(Nt={}));function Jve(e,t){var n=yn(e)?Q2:t7;return n(e,s7(t))}function e0e(e,t){return hU(e,t,function(n,r){return a7(e,r)})}var T3=KF(function(e,t){return e==null?{}:e0e(e,t)}),t0e=0;function n0e(e){var t=++t0e;return Z2(e)+t}function hC(){return n0e("rjsf-array-item-")}function A3(e){return Array.isArray(e)?e.map(t=>({key:hC(),item:t})):[]}function Ad(e){return Array.isArray(e)?e.map(t=>t.item):[]}class r0e extends N.Component{constructor(n){super(n);ft(this,"_getNewFormDataRow",()=>{const{schema:n,registry:r}=this.props,{schemaUtils:a}=r;let s=n.items;return uC(n)&&rue(n)&&(s=n.additionalItems),a.getDefaultFormState(s)});ft(this,"onAddClick",n=>{this._handleAddClick(n)});ft(this,"onAddIndexClick",n=>r=>{this._handleAddClick(r,n)});ft(this,"onCopyIndexClick",n=>r=>{r&&r.preventDefault();const{onChange:a,errorSchema:s}=this.props,{keyedFormData:i}=this.state;let l;if(s){l={};for(const h in s){const p=parseInt(h);p<=n?Tn(l,[p],s[h]):p>n&&Tn(l,[p+1],s[h])}}const d={key:hC(),item:iU(i[n].item)},f=[...i];n!==void 0?f.splice(n+1,0,d):f.push(d),this.setState({keyedFormData:f,updatedKeyedFormData:!0},()=>a(Ad(f),l))});ft(this,"onDropIndexClick",n=>r=>{r&&r.preventDefault();const{onChange:a,errorSchema:s}=this.props,{keyedFormData:i}=this.state;let l;if(s){l={};for(const f in s){const h=parseInt(f);h<n?Tn(l,[h],s[f]):h>n&&Tn(l,[h-1],s[f])}}const d=i.filter((f,h)=>h!==n);this.setState({keyedFormData:d,updatedKeyedFormData:!0},()=>a(Ad(d),l))});ft(this,"onReorderClick",(n,r)=>a=>{a&&(a.preventDefault(),a.currentTarget.blur());const{onChange:s,errorSchema:i}=this.props;let l;if(i){l={};for(const p in i){const g=parseInt(p);g==n?Tn(l,[r],i[n]):g==r?Tn(l,[n],i[r]):Tn(l,[p],i[g])}}const{keyedFormData:d}=this.state;function f(){const p=d.slice();return p.splice(n,1),p.splice(r,0,d[n]),p}const h=f();this.setState({keyedFormData:h},()=>s(Ad(h),l))});ft(this,"onChangeForIndex",n=>(r,a,s)=>{const{formData:i,onChange:l,errorSchema:d}=this.props,h=(Array.isArray(i)?i:[]).map((p,g)=>n===g?typeof r>"u"?null:r:p);l(h,d&&d&&{...d,[n]:a},s)});ft(this,"onSelectChange",n=>{const{onChange:r,idSchema:a}=this.props;r(n,void 0,a&&a.$id)});const{formData:r=[]}=n,a=A3(r);this.state={keyedFormData:a,updatedKeyedFormData:!1}}static getDerivedStateFromProps(n,r){if(r.updatedKeyedFormData)return{updatedKeyedFormData:!1};const a=Array.isArray(n.formData)?n.formData:[],s=r.keyedFormData||[];return{keyedFormData:a.length===s.length?s.map((l,d)=>({key:l.key,item:a[d]})):A3(a)}}get itemTitle(){const{schema:n,registry:r}=this.props,{translateString:a}=r;return Oe(n,[Po,"title"],Oe(n,[Po,"description"],a(Nt.ArrayItemTitle)))}isItemRequired(n){return Array.isArray(n.type)?!n.type.includes("null"):n.type!=="null"}canAddItem(n){const{schema:r,uiSchema:a,registry:s}=this.props;let{addable:i}=at(a,s.globalUiOptions);return i!==!1&&(r.maxItems!==void 0?i=n.length<r.maxItems:i=!0),i}_handleAddClick(n,r){n&&n.preventDefault();const{onChange:a,errorSchema:s}=this.props,{keyedFormData:i}=this.state;let l;if(s){l={};for(const h in s){const p=parseInt(h);r===void 0||p<r?Tn(l,[p],s[h]):p>=r&&Tn(l,[p+1],s[h])}}const d={key:hC(),item:this._getNewFormDataRow()},f=[...i];r!==void 0?f.splice(r,0,d):f.push(d),this.setState({keyedFormData:f,updatedKeyedFormData:!0},()=>a(Ad(f),l))}render(){const{schema:n,uiSchema:r,idSchema:a,registry:s}=this.props,{schemaUtils:i,translateString:l}=s;if(!(Po in n)){const d=at(r),f=pt("UnsupportedFieldTemplate",s,d);return c.jsx(f,{schema:n,idSchema:a,reason:l(Nt.MissingItems),registry:s})}return i.isMultiSelect(n)?this.renderMultiSelect():aU(r)?this.renderCustomWidget():uC(n)?this.renderFixedArray():i.isFilesArray(n,r)?this.renderFiles():this.renderNormalArray()}renderNormalArray(){const{schema:n,uiSchema:r={},errorSchema:a,idSchema:s,name:i,title:l,disabled:d=!1,readonly:f=!1,autofocus:h=!1,required:p=!1,registry:g,onBlur:y,onFocus:S,idPrefix:w,idSeparator:b="_",rawErrors:x}=this.props,{keyedFormData:_}=this.state,j=n.title||l||i,{schemaUtils:C,formContext:T}=g,A=at(r),k=Tt(n.items)?n.items:{},O=C.retrieveSchema(k),M=Ad(this.state.keyedFormData),z=this.canAddItem(M),L={canAdd:z,items:_.map((F,q)=>{const{key:V,item:P}=F,K=P,H=C.retrieveSchema(k,K),Z=a?a[q]:void 0,J=s.$id+b+q,D=C.toIdSchema(H,J,K,w,b);return this.renderArrayFieldItem({key:V,index:q,name:i&&`${i}-${q}`,title:j?`${j}-${q+1}`:void 0,canAdd:z,canMoveUp:q>0,canMoveDown:q<M.length-1,itemSchema:H,itemIdSchema:D,itemErrorSchema:Z,itemData:K,itemUiSchema:r.items,autofocus:h&&q===0,onBlur:y,onFocus:S,rawErrors:x,totalItems:_.length})}),className:`field field-array field-array-of-${O.type}`,disabled:d,idSchema:s,uiSchema:r,onAddClick:this.onAddClick,readonly:f,required:p,schema:n,title:j,formContext:T,formData:M,rawErrors:x,registry:g},U=pt("ArrayFieldTemplate",g,A);return c.jsx(U,{...L})}renderCustomWidget(){const{schema:n,idSchema:r,uiSchema:a,disabled:s=!1,readonly:i=!1,autofocus:l=!1,required:d=!1,hideError:f,placeholder:h,onBlur:p,onFocus:g,formData:y=[],registry:S,rawErrors:w,name:b}=this.props,{widgets:x,formContext:_,globalUiOptions:j,schemaUtils:C}=S,{widget:T,title:A,...k}=at(a,j),O=Es(n,T,x),M=A??n.title??b,z=C.getDisplayLabel(n,a,j);return c.jsx(O,{id:r.$id,name:b,multiple:!0,onChange:this.onSelectChange,onBlur:p,onFocus:g,options:k,schema:n,uiSchema:a,registry:S,value:y,disabled:s,readonly:i,hideError:f,required:d,label:M,hideLabel:!z,placeholder:h,formContext:_,autofocus:l,rawErrors:w})}renderMultiSelect(){const{schema:n,idSchema:r,uiSchema:a,formData:s=[],disabled:i=!1,readonly:l=!1,autofocus:d=!1,required:f=!1,placeholder:h,onBlur:p,onFocus:g,registry:y,rawErrors:S,name:w}=this.props,{widgets:b,schemaUtils:x,formContext:_,globalUiOptions:j}=y,C=x.retrieveSchema(n.items,s),T=Ef(C,a),{widget:A="select",title:k,...O}=at(a,j),M=Es(n,A,b),z=k??n.title??w,L=x.getDisplayLabel(n,a,j);return c.jsx(M,{id:r.$id,name:w,multiple:!0,onChange:this.onSelectChange,onBlur:p,onFocus:g,options:{...O,enumOptions:T},schema:n,uiSchema:a,registry:y,value:s,disabled:i,readonly:l,required:f,label:z,hideLabel:!L,placeholder:h,formContext:_,autofocus:d,rawErrors:S})}renderFiles(){const{schema:n,uiSchema:r,idSchema:a,name:s,disabled:i=!1,readonly:l=!1,autofocus:d=!1,required:f=!1,onBlur:h,onFocus:p,registry:g,formData:y=[],rawErrors:S}=this.props,{widgets:w,formContext:b,globalUiOptions:x,schemaUtils:_}=g,{widget:j="files",title:C,...T}=at(r,x),A=Es(n,j,w),k=C??n.title??s,O=_.getDisplayLabel(n,r,x);return c.jsx(A,{options:T,id:a.$id,name:s,multiple:!0,onChange:this.onSelectChange,onBlur:h,onFocus:p,schema:n,uiSchema:r,value:y,disabled:i,readonly:l,required:f,registry:g,formContext:b,autofocus:d,rawErrors:S,label:k,hideLabel:!O})}renderFixedArray(){const{schema:n,uiSchema:r={},formData:a=[],errorSchema:s,idPrefix:i,idSeparator:l="_",idSchema:d,name:f,title:h,disabled:p=!1,readonly:g=!1,autofocus:y=!1,required:S=!1,registry:w,onBlur:b,onFocus:x,rawErrors:_}=this.props,{keyedFormData:j}=this.state;let{formData:C=[]}=this.props;const T=n.title||h||f,A=at(r),{schemaUtils:k,formContext:O}=w,z=(Tt(n.items)?n.items:[]).map((V,P)=>k.retrieveSchema(V,a[P])),L=Tt(n.additionalItems)?k.retrieveSchema(n.additionalItems,a):null;(!C||C.length<z.length)&&(C=C||[],C=C.concat(new Array(z.length-C.length)));const U=this.canAddItem(C)&&!!L,F={canAdd:U,className:"field field-array field-array-fixed-items",disabled:p,idSchema:d,formData:a,items:j.map((V,P)=>{const{key:K,item:H}=V,Z=H,J=P>=z.length,D=(J&&Tt(n.additionalItems)?k.retrieveSchema(n.additionalItems,Z):z[P])||{},W=d.$id+l+P,B=k.toIdSchema(D,W,Z,i,l),$=J?r.additionalItems||{}:Array.isArray(r.items)?r.items[P]:r.items||{},G=s?s[P]:void 0;return this.renderArrayFieldItem({key:K,index:P,name:f&&`${f}-${P}`,title:T?`${T}-${P+1}`:void 0,canAdd:U,canRemove:J,canMoveUp:P>=z.length+1,canMoveDown:J&&P<C.length-1,itemSchema:D,itemData:Z,itemUiSchema:$,itemIdSchema:B,itemErrorSchema:G,autofocus:y&&P===0,onBlur:b,onFocus:x,rawErrors:_,totalItems:j.length})}),onAddClick:this.onAddClick,readonly:g,required:S,registry:w,schema:n,uiSchema:r,title:T,formContext:O,errorSchema:s,rawErrors:_},q=pt("ArrayFieldTemplate",w,A);return c.jsx(q,{...F})}renderArrayFieldItem(n){const{key:r,index:a,name:s,canAdd:i,canRemove:l=!0,canMoveUp:d,canMoveDown:f,itemSchema:h,itemData:p,itemUiSchema:g,itemIdSchema:y,itemErrorSchema:S,autofocus:w,onBlur:b,onFocus:x,rawErrors:_,totalItems:j,title:C}=n,{disabled:T,hideError:A,idPrefix:k,idSeparator:O,readonly:M,uiSchema:z,registry:L,formContext:U}=this.props,{fields:{ArraySchemaField:F,SchemaField:q},globalUiOptions:V}=L,P=F||q,{orderable:K=!0,removable:H=!0,copyable:Z=!1}=at(z,V),J={moveUp:K&&d,moveDown:K&&f,copy:Z&&i,remove:H&&l,toolbar:!1};return J.toolbar=Object.keys(J).some(D=>J[D]),{children:c.jsx(P,{name:s,title:C,index:a,schema:h,uiSchema:g,formData:p,formContext:U,errorSchema:S,idPrefix:k,idSeparator:O,idSchema:y,required:this.isItemRequired(h),onChange:this.onChangeForIndex(a),onBlur:b,onFocus:x,registry:L,disabled:T,readonly:M,hideError:A,autofocus:w,rawErrors:_}),className:"array-item",disabled:T,canAdd:i,hasCopy:J.copy,hasToolbar:J.toolbar,hasMoveUp:J.moveUp,hasMoveDown:J.moveDown,hasRemove:J.remove,index:a,totalItems:j,key:r,onAddIndexClick:this.onAddIndexClick,onCopyIndexClick:this.onCopyIndexClick,onDropIndexClick:this.onDropIndexClick,onReorderClick:this.onReorderClick,readonly:M,registry:L,schema:h,uiSchema:g}}}function a0e(e){const{schema:t,name:n,uiSchema:r,idSchema:a,formData:s,registry:i,required:l,disabled:d,readonly:f,hideError:h,autofocus:p,title:g,onChange:y,onFocus:S,onBlur:w,rawErrors:b}=e,{title:x}=t,{widgets:_,formContext:j,translateString:C,globalUiOptions:T}=i,{widget:A="checkbox",title:k,label:O=!0,...M}=at(r,T),z=Es(t,A,_),L=C(Nt.YesLabel),U=C(Nt.NoLabel);let F;const q=k??x??g??n;if(Array.isArray(t.oneOf))F=Ef({oneOf:t.oneOf.map(V=>{if(Tt(V))return{...V,title:V.title||(V.const===!0?L:U)}}).filter(V=>V)},r);else{const V=t,P=t.enum??[!0,!1];!V.enumNames&&P.length===2&&P.every(K=>typeof K=="boolean")?F=[{value:P[0],label:P[0]?L:U},{value:P[1],label:P[1]?L:U}]:F=Ef({enum:P,enumNames:V.enumNames},r)}return c.jsx(z,{options:{...M,enumOptions:F},schema:t,uiSchema:r,id:a.$id,name:n,onChange:y,onFocus:S,onBlur:w,label:q,hideLabel:!O,value:s,required:l,disabled:d,readonly:f,hideError:h,registry:i,formContext:j,autofocus:p,rawErrors:b})}class R3 extends N.Component{constructor(n){super(n);ft(this,"onOptionChange",n=>{const{selectedOption:r,retrievedOptions:a}=this.state,{formData:s,onChange:i,registry:l}=this.props,{schemaUtils:d}=l,f=n!==void 0?parseInt(n,10):-1;if(f===r)return;const h=f>=0?a[f]:void 0,p=r>=0?a[r]:void 0;let g=d.sanitizeDataForNewSchema(h,p,s);h&&(g=d.getDefaultFormState(h,g,"excludeObjectChildren")),this.setState({selectedOption:f},()=>{i(g,void 0,this.getFieldId())})});const{formData:r,options:a,registry:{schemaUtils:s}}=this.props,i=a.map(l=>s.retrieveSchema(l,r));this.state={retrievedOptions:i,selectedOption:this.getMatchingOption(0,r,i)}}componentDidUpdate(n,r){const{formData:a,options:s,idSchema:i}=this.props,{selectedOption:l}=this.state;let d=this.state;if(!Pt(n.options,s)){const{registry:{schemaUtils:f}}=this.props,h=s.map(p=>f.retrieveSchema(p,a));d={selectedOption:l,retrievedOptions:h}}if(!Pt(a,n.formData)&&i.$id===n.idSchema.$id){const{retrievedOptions:f}=d,h=this.getMatchingOption(l,a,f);r&&h!==l&&(d={selectedOption:h,retrievedOptions:f})}d!==this.state&&this.setState(d)}getMatchingOption(n,r,a){const{schema:s,registry:{schemaUtils:i}}=this.props,l=Yc(s);return i.getClosestMatchingOption(r,a,n,l)}getFieldId(){const{idSchema:n,schema:r}=this.props;return`${n.$id}${r.oneOf?"__oneof_select":"__anyof_select"}`}render(){const{name:n,disabled:r=!1,errorSchema:a={},formContext:s,onBlur:i,onFocus:l,readonly:d,registry:f,schema:h,uiSchema:p}=this.props,{widgets:g,fields:y,translateString:S,globalUiOptions:w,schemaUtils:b}=f,{SchemaField:x}=y,{selectedOption:_,retrievedOptions:j}=this.state,{widget:C="select",placeholder:T,autofocus:A,autocomplete:k,title:O=h.title,...M}=at(p,w),z=Es({type:"number"},C,g),L=Oe(a,gr,[]),U=fy(a,[gr]),F=b.getDisplayLabel(h,p,w),q=_>=0&&j[_]||null;let V;if(q){const{required:D}=h;V=D?Ps({required:D},q):q}let P=[];vr in h&&p&&vr in p?Array.isArray(p[vr])?P=p[vr]:console.warn(`uiSchema.oneOf is not an array for "${O||n}"`):na in h&&p&&na in p&&(Array.isArray(p[na])?P=p[na]:console.warn(`uiSchema.anyOf is not an array for "${O||n}"`));let K=p;_>=0&&P.length>_&&(K=P[_]);const H=O?Nt.TitleOptionPrefix:Nt.OptionPrefix,Z=O?[O]:[],J=j.map((D,W)=>{const{title:B=D.title}=at(P[W]);return{label:B||S(H,Z.concat(String(W+1))),value:W}});return c.jsxs("div",{className:"panel panel-default panel-body",children:[c.jsx("div",{className:"form-group",children:c.jsx(z,{id:this.getFieldId(),name:`${n}${h.oneOf?"__oneof_select":"__anyof_select"}`,schema:{type:"number",default:0},onChange:this.onOptionChange,onBlur:i,onFocus:l,disabled:r||Kc(J),multiple:!1,rawErrors:L,errorSchema:U,value:_>=0?_:void 0,options:{enumOptions:J,...M},registry:f,formContext:s,placeholder:T,autocomplete:k,autofocus:A,label:O??n,hideLabel:!F,readonly:d})}),V&&V.type!=="null"&&c.jsx(x,{...this.props,schema:V,uiSchema:K})]})}}const s0e=/\.([0-9]*0)*$/,o0e=/[0.]0*$/;function i0e(e){const{registry:t,onChange:n,formData:r,value:a}=e,[s,i]=N.useState(a),{StringField:l}=t.fields;let d=r;const f=N.useCallback((h,p,g)=>{i(h),`${h}`.charAt(0)==="."&&(h=`0${h}`);const y=typeof h=="string"&&h.match(s0e)?FM(h.replace(o0e,"")):FM(h);n(y,p,g)},[n]);if(typeof s=="string"&&typeof d=="number"){const h=new RegExp(`^(${String(d).replace(".","\\.")})?\\.?0*$`);s.match(h)&&(d=s)}return c.jsx(l,{...e,formData:d,onChange:f})}function Pi(){return Pi=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},Pi.apply(this,arguments)}const l0e=["children","options"],k3=["allowFullScreen","allowTransparency","autoComplete","autoFocus","autoPlay","cellPadding","cellSpacing","charSet","classId","colSpan","contentEditable","contextMenu","crossOrigin","encType","formAction","formEncType","formMethod","formNoValidate","formTarget","frameBorder","hrefLang","inputMode","keyParams","keyType","marginHeight","marginWidth","maxLength","mediaGroup","minLength","noValidate","radioGroup","readOnly","rowSpan","spellCheck","srcDoc","srcLang","srcSet","tabIndex","useMap"].reduce((e,t)=>(e[t.toLowerCase()]=t,e),{class:"className",for:"htmlFor"}),O3={amp:"&",apos:"'",gt:">",lt:"<",nbsp:" ",quot:"“"},c0e=["style","script","pre"],u0e=["src","href","data","formAction","srcDoc","action"],d0e=/([-A-Z0-9_:]+)(?:\s*=\s*(?:(?:"((?:\\.|[^"])*)")|(?:'((?:\\.|[^'])*)')|(?:\{((?:\\.|{[^}]*?}|[^}])*)\})))?/gi,f0e=/\n{2,}$/,M3=/^(\s*>[\s\S]*?)(?=\n\n|$)/,h0e=/^ *> ?/gm,p0e=/^(?:\[!([^\]]*)\]\n)?([\s\S]*)/,m0e=/^ {2,}\n/,g0e=/^(?:([-*_])( *\1){2,}) *(?:\n *)+\n/,D3=/^(?: {1,3})?(`{3,}|~{3,}) *(\S+)? *([^\n]*?)?\n([\s\S]*?)(?:\1\n?|$)/,P3=/^(?: {4}[^\n]+\n*)+(?:\n *)+\n?/,y0e=/^(`+)((?:\\`|(?!\1)`|[^`])+)\1/,v0e=/^(?:\n *)*\n/,x0e=/\r\n?/g,b0e=/^\[\^([^\]]+)](:(.*)((\n+ {4,}.*)|(\n(?!\[\^).+))*)/,w0e=/^\[\^([^\]]+)]/,S0e=/\f/g,_0e=/^---[ \t]*\n(.|\n)*\n---[ \t]*\n/,N0e=/^\s*?\[(x|\s)\]/,$3=/^ *(#{1,6}) *([^\n]+?)(?: +#*)?(?:\n *)*(?:\n|$)/,I3=/^ *(#{1,6}) +([^\n]+?)(?: +#*)?(?:\n *)*(?:\n|$)/,L3=/^([^\n]+)\n *(=|-)\2{2,} *\n/,TN=/^ *(?!<[a-z][^ >/]* ?\/>)<([a-z][^ >/]*) ?((?:[^>]*[^/])?)>\n?(\s*(?:<\1[^>]*?>[\s\S]*?<\/\1>|(?!<\1\b)[\s\S])*?)<\/\1>(?!<\/\1>)\n*/i,j0e=/&([a-z0-9]+|#[0-9]{1,6}|#x[0-9a-fA-F]{1,6});/gi,z3=/^<!--[\s\S]*?(?:-->)/,C0e=/^(data|aria|x)-[a-z_][a-z\d_.-]*$/,AN=/^ *<([a-z][a-z0-9:]*)(?:\s+((?:<.*?>|[^>])*))?\/?>(?!<\/\1>)(\s*\n)?/i,E0e=/^\{.*\}$/,T0e=/^(https?:\/\/[^\s<]+[^<.,:;"')\]\s])/,A0e=/^<([^ >]+[:@\/][^ >]+)>/,R0e=/-([a-z])?/gi,q3=/^(\|.*)\n(?: *(\|? *[-:]+ *\|[-| :]*)\n((?:.*\|.*\n)*))?\n?/,k0e=/^[^\n]+(?: \n|\n{2,})/,O0e=/^\[([^\]]*)\]:\s+<?([^\s>]+)>?\s*("([^"]*)")?/,M0e=/^!\[([^\]]*)\] ?\[([^\]]*)\]/,D0e=/^\[([^\]]*)\] ?\[([^\]]*)\]/,P0e=/(\n|^[-*]\s|^#|^ {2,}|^-{2,}|^>\s)/,$0e=/\t/g,I0e=/(^ *\||\| *$)/g,L0e=/^ *:-+: *$/,z0e=/^ *:-+ *$/,q0e=/^ *-+: *$/,Wv=e=>`(?=[\\s\\S]+?\\1${e?"\\1":""})`,Gv="((?:\\[.*?\\][([].*?[)\\]]|<.*?>(?:.*?<.*?>)?|`.*?`|\\\\\\1|[\\s\\S])+?)",F0e=RegExp(`^([*_])\\1${Wv(1)}${Gv}\\1\\1(?!\\1)`),U0e=RegExp(`^([*_])${Wv(0)}${Gv}\\1(?!\\1)`),H0e=RegExp(`^(==)${Wv(0)}${Gv}\\1`),B0e=RegExp(`^(~~)${Wv(0)}${Gv}\\1`),V0e=/^(:[a-zA-Z0-9-_]+:)/,W0e=/^\\([^0-9A-Za-z\s])/,G0e=/\\([^0-9A-Za-z\s])/g,K0e=/^[\s\S](?:(?! \n|[0-9]\.|http)[^=*_~\-\n:<`\\\[!])*/,Y0e=/^\n+/,X0e=/^([ \t]*)/,Z0e=/(?:^|\n)( *)$/,FE="(?:\\d+\\.)",UE="(?:[*+-])";function pU(e){return"( *)("+(e===1?FE:UE)+") +"}const mU=pU(1),gU=pU(2);function yU(e){return RegExp("^"+(e===1?mU:gU))}const Q0e=yU(1),J0e=yU(2);function vU(e){return RegExp("^"+(e===1?mU:gU)+"[^\\n]*(?:\\n(?!\\1"+(e===1?FE:UE)+" )[^\\n]*)*(\\n|$)","gm")}const exe=vU(1),txe=vU(2);function xU(e){const t=e===1?FE:UE;return RegExp("^( *)("+t+") [\\s\\S]+?(?:\\n{2,}(?! )(?!\\1"+t+" (?!"+t+" ))\\n*|\\s*\\n*$)")}const bU=xU(1),wU=xU(2);function F3(e,t){const n=t===1,r=n?bU:wU,a=n?exe:txe,s=n?Q0e:J0e;return{t:i=>s.test(i),o:Zc(function(i,l){const d=Z0e.exec(l.prevCapture);return d&&(l.list||!l.inline&&!l.simple)?r.exec(i=d[1]+i):null}),i:1,u(i,l,d){const f=n?+i[2]:void 0,h=i[0].replace(f0e,`
|
|
721
|
+
`).match(a);let p=!1;return{items:h.map(function(g,y){const S=s.exec(g)[0].length,w=RegExp("^ {1,"+S+"}","gm"),b=g.replace(w,"").replace(s,""),x=y===h.length-1,_=b.indexOf(`
|
|
722
|
+
|
|
723
|
+
`)!==-1||x&&p;p=_;const j=d.inline,C=d.list;let T;d.list=!0,_?(d.inline=!1,T=sf(b)+`
|
|
724
|
+
|
|
725
|
+
`):(d.inline=!0,T=sf(b));const A=l(T,d);return d.inline=j,d.list=C,A}),ordered:n,start:f}},l:(i,l,d)=>e(i.ordered?"ol":"ul",{key:d.key,start:i.type==="20"?i.start:void 0},i.items.map(function(f,h){return e("li",{key:h},l(f,d))}))}}const nxe=RegExp(`^\\[((?:\\[[^\\[\\]]*(?:\\[[^\\[\\]]*\\][^\\[\\]]*)*\\]|[^\\[\\]])*)\\]\\(\\s*<?((?:\\([^)]*\\)|[^\\s\\\\]|\\\\.)*?)>?(?:\\s+['"]([\\s\\S]*?)['"])?\\s*\\)`),rxe=/^!\[(.*?)\]\( *((?:\([^)]*\)|[^() ])*) *"?([^)"]*)?"?\)/;function U3(e){return typeof e=="string"}function sf(e){let t=e.length;for(;t>0&&e[t-1]<=" ";)t--;return e.slice(0,t)}function Pg(e,t){return e.startsWith(t)}function axe(e,t,n){if(Array.isArray(n)){for(let r=0;r<n.length;r++)if(Pg(e,n[r]))return!0;return!1}return n(e,t)}function Rd(e){return e.replace(/[ÀÁÂÃÄÅàáâãä忯]/g,"a").replace(/[çÇ]/g,"c").replace(/[ðÐ]/g,"d").replace(/[ÈÉÊËéèêë]/g,"e").replace(/[ÏïÎîÍíÌì]/g,"i").replace(/[Ññ]/g,"n").replace(/[øØœŒÕõÔôÓóÒò]/g,"o").replace(/[ÜüÛûÚúÙù]/g,"u").replace(/[ŸÿÝý]/g,"y").replace(/[^a-z0-9- ]/gi,"").replace(/ /gi,"-").toLowerCase()}function sxe(e){return q0e.test(e)?"right":L0e.test(e)?"center":z0e.test(e)?"left":null}function H3(e,t,n,r){const a=n.inTable;n.inTable=!0;let s=[[]],i="";function l(){if(!i)return;const d=s[s.length-1];d.push.apply(d,t(i,n)),i=""}return e.trim().split(/(`[^`]*`|\\\||\|)/).filter(Boolean).forEach((d,f,h)=>{d.trim()==="|"&&(l(),r)?f!==0&&f!==h.length-1&&s.push([]):i+=d}),l(),n.inTable=a,s}function oxe(e,t,n){n.inline=!0;const r=e[2]?e[2].replace(I0e,"").split("|").map(sxe):[],a=e[3]?(function(i,l,d){return i.trim().split(`
|
|
726
|
+
`).map(function(f){return H3(f,l,d,!0)})})(e[3],t,n):[],s=H3(e[1],t,n,!!a.length);return n.inline=!1,a.length?{align:r,cells:a,header:s,type:"25"}:{children:s,type:"21"}}function B3(e,t){return e.align[t]==null?{}:{textAlign:e.align[t]}}function Zc(e){return e.inline=1,e}function Ei(e){return Zc(function(t,n){return n.inline?e.exec(t):null})}function bo(e){return Zc(function(t,n){return n.inline||n.simple?e.exec(t):null})}function ms(e){return function(t,n){return n.inline||n.simple?null:e.exec(t)}}function xm(e){return Zc(function(t){return e.exec(t)})}const ixe=/(javascript|vbscript|data(?!:image)):/i;function lxe(e){try{const t=decodeURIComponent(e).replace(/[^A-Za-z0-9/:]/g,"");if(ixe.test(t))return null}catch{return null}return e}function wa(e){return e&&e.replace(G0e,"$1")}function $g(e,t,n){const r=n.inline||!1,a=n.simple||!1;n.inline=!0,n.simple=!0;const s=e(t,n);return n.inline=r,n.simple=a,s}function cxe(e,t,n){const r=n.inline||!1,a=n.simple||!1;n.inline=!1,n.simple=!0;const s=e(t,n);return n.inline=r,n.simple=a,s}function uxe(e,t,n){const r=n.inline||!1;n.inline=!1;const a=e(t,n);return n.inline=r,a}const RN=(e,t,n)=>({children:$g(t,e[2],n)});function kN(){return{}}function ON(){return null}function dxe(...e){return e.filter(Boolean).join(" ")}function MN(e,t,n){let r=e;const a=t.split(".");for(;a.length&&(r=r[a[0]],r!==void 0);)a.shift();return r||n}function fxe(e="",t={}){t.overrides=t.overrides||{},t.namedCodesToUnicode=t.namedCodesToUnicode?Pi({},O3,t.namedCodesToUnicode):O3;const n=t.slugify||Rd,r=t.sanitizer||lxe,a=t.createElement||N.createElement,s=[M3,D3,P3,t.enforceAtxHeadings?I3:$3,L3,q3,bU,wU],i=[...s,k0e,TN,z3,AN];function l(x,_){for(let j=0;j<x.length;j++)if(x[j].test(_))return!0;return!1}function d(x,_,...j){const C=MN(t.overrides,x+".props",{});return a((function(T,A){const k=MN(A,T);return k?typeof k=="function"||typeof k=="object"&&"render"in k?k:MN(A,T+".component",T):T})(x,t.overrides),Pi({},_,C,{className:dxe(_==null?void 0:_.className,C.className)||void 0}),...j)}function f(x){x=x.replace(_0e,"");let _=!1;t.forceInline?_=!0:t.forceBlock||(_=P0e.test(x)===!1);const j=w(S(_?x:sf(x).replace(Y0e,"")+`
|
|
727
|
+
|
|
728
|
+
`,{inline:_}));for(;U3(j[j.length-1])&&!j[j.length-1].trim();)j.pop();if(t.wrapper===null)return j;const C=t.wrapper||(_?"span":"div");let T;if(j.length>1||t.forceWrapper)T=j;else{if(j.length===1)return T=j[0],typeof T=="string"?d("span",{key:"outer"},T):T;T=null}return a(C,{key:"outer"},T)}function h(x,_){if(!_||!_.trim())return null;const j=_.match(d0e);return j?j.reduce(function(C,T){const A=T.indexOf("=");if(A!==-1){const k=(function(L){return L.indexOf("-")!==-1&&L.match(C0e)===null&&(L=L.replace(R0e,function(U,F){return F.toUpperCase()})),L})(T.slice(0,A)).trim(),O=(function(L){const U=L[0];return(U==='"'||U==="'")&&L.length>=2&&L[L.length-1]===U?L.slice(1,-1):L})(T.slice(A+1).trim()),M=k3[k]||k;if(M==="ref")return C;const z=C[M]=(function(L,U,F,q){return U==="style"?(function(V){const P=[];let K="",H=!1,Z=!1,J="";if(!V)return P;for(let W=0;W<V.length;W++){const B=V[W];if(B!=='"'&&B!=="'"||H||(Z?B===J&&(Z=!1,J=""):(Z=!0,J=B)),B==="("&&K.endsWith("url")?H=!0:B===")"&&H&&(H=!1),B!==";"||Z||H)K+=B;else{const $=K.trim();if($){const G=$.indexOf(":");if(G>0){const ee=$.slice(0,G).trim(),re=$.slice(G+1).trim();P.push([ee,re])}}K=""}}const D=K.trim();if(D){const W=D.indexOf(":");if(W>0){const B=D.slice(0,W).trim(),$=D.slice(W+1).trim();P.push([B,$])}}return P})(F).reduce(function(V,[P,K]){return V[P.replace(/(-[a-z])/g,H=>H[1].toUpperCase())]=q(K,L,P),V},{}):u0e.indexOf(U)!==-1?q(wa(F),L,U):(F.match(E0e)&&(F=wa(F.slice(1,F.length-1))),F==="true"||F!=="false"&&F)})(x,k,O,r);typeof z=="string"&&(TN.test(z)||AN.test(z))&&(C[M]=f(z.trim()))}else T!=="style"&&(C[k3[T]||T]=!0);return C},{}):null}const p=[],g={},y={0:{t:[">"],o:ms(M3),i:1,u(x,_,j){const[,C,T]=x[0].replace(h0e,"").match(p0e);return{alert:C,children:_(T,j)}},l(x,_,j){const C={key:j.key};return x.alert&&(C.className="markdown-alert-"+n(x.alert.toLowerCase(),Rd),x.children.unshift({attrs:{},children:[{type:"27",text:x.alert}],noInnerParse:!0,type:"11",tag:"header"})),d("blockquote",C,_(x.children,j))}},1:{t:[" "],o:xm(m0e),i:1,u:kN,l:(x,_,j)=>d("br",{key:j.key})},2:{t:["--","__","**","- ","* ","_ "],o:ms(g0e),i:1,u:kN,l:(x,_,j)=>d("hr",{key:j.key})},3:{t:[" "],o:ms(P3),i:0,u:x=>({lang:void 0,text:wa(sf(x[0].replace(/^ {4}/gm,"")))}),l:(x,_,j)=>d("pre",{key:j.key},d("code",Pi({},x.attrs,{className:x.lang?"lang-"+x.lang:""}),x.text))},4:{t:["```","~~~"],o:ms(D3),i:0,u:x=>({attrs:h("code",x[3]||""),lang:x[2]||void 0,text:x[4],type:"3"})},5:{t:["`"],o:bo(y0e),i:3,u:x=>({text:wa(x[2])}),l:(x,_,j)=>d("code",{key:j.key},x.text)},6:{t:["[^"],o:ms(b0e),i:0,u:x=>(p.push({footnote:x[2],identifier:x[1]}),{}),l:ON},7:{t:["[^"],o:Ei(w0e),i:1,u:x=>({target:"#"+n(x[1],Rd),text:x[1]}),l:(x,_,j)=>d("a",{key:j.key,href:r(x.target,"a","href")},d("sup",{key:j.key},x.text))},8:{t:["[ ]","[x]"],o:Ei(N0e),i:1,u:x=>({completed:x[1].toLowerCase()==="x"}),l:(x,_,j)=>d("input",{checked:x.completed,key:j.key,readOnly:!0,type:"checkbox"})},9:{t:["#"],o:ms(t.enforceAtxHeadings?I3:$3),i:1,u:(x,_,j)=>({children:$g(_,x[2],j),id:n(x[2],Rd),level:x[1].length}),l:(x,_,j)=>d("h"+x.level,{id:x.id,key:j.key},_(x.children,j))},10:{t:x=>{const _=x.indexOf(`
|
|
729
|
+
`);return _>0&&_<x.length-1&&(x[_+1]==="="||x[_+1]==="-")},o:ms(L3),i:1,u:(x,_,j)=>({children:$g(_,x[1],j),level:x[2]==="="?1:2,type:"9"})},11:{t:["<"],o:xm(TN),i:1,u(x,_,j){const[,C]=x[3].match(X0e),T=RegExp("^"+C,"gm"),A=x[3].replace(T,""),k=l(i,A)?uxe:$g,O=x[1].toLowerCase(),M=c0e.indexOf(O)!==-1,z=(M?O:x[1]).trim(),L={attrs:h(z,x[2]),noInnerParse:M,tag:z};if(j.inAnchor=j.inAnchor||O==="a",M)L.text=x[3];else{const U=j.inHTML;j.inHTML=!0,L.children=k(_,A,j),j.inHTML=U}return j.inAnchor=!1,L},l:(x,_,j)=>d(x.tag,Pi({key:j.key},x.attrs),x.text||(x.children?_(x.children,j):""))},13:{t:["<"],o:xm(AN),i:1,u(x){const _=x[1].trim();return{attrs:h(_,x[2]||""),tag:_}},l:(x,_,j)=>d(x.tag,Pi({},x.attrs,{key:j.key}))},12:{t:["<!--"],o:xm(z3),i:1,u:()=>({}),l:ON},14:{t:["!["],o:bo(rxe),i:1,u:x=>({alt:wa(x[1]),target:wa(x[2]),title:wa(x[3])}),l:(x,_,j)=>d("img",{key:j.key,alt:x.alt||void 0,title:x.title||void 0,src:r(x.target,"img","src")})},15:{t:["["],o:Ei(nxe),i:3,u:(x,_,j)=>({children:cxe(_,x[1],j),target:wa(x[2]),title:wa(x[3])}),l:(x,_,j)=>d("a",{key:j.key,href:r(x.target,"a","href"),title:x.title},_(x.children,j))},16:{t:["<"],o:Ei(A0e),i:0,u(x){let _=x[1],j=!1;return _.indexOf("@")!==-1&&_.indexOf("//")===-1&&(j=!0,_=_.replace("mailto:","")),{children:[{text:_,type:"27"}],target:j?"mailto:"+_:_,type:"15"}}},17:{t:(x,_)=>!_.inAnchor&&!t.disableAutoLink&&(Pg(x,"http://")||Pg(x,"https://")),o:Ei(T0e),i:0,u:x=>({children:[{text:x[1],type:"27"}],target:x[1],title:void 0,type:"15"})},20:F3(d,1),33:F3(d,2),19:{t:[`
|
|
730
|
+
`],o:ms(v0e),i:3,u:kN,l:()=>`
|
|
731
|
+
`},21:{o:Zc(function(x,_){if(_.inline||_.simple||_.inHTML&&x.indexOf(`
|
|
732
|
+
|
|
733
|
+
`)===-1&&_.prevCapture.indexOf(`
|
|
734
|
+
|
|
735
|
+
`)===-1)return null;let j="",C=0;for(;;){const A=x.indexOf(`
|
|
736
|
+
`,C),k=x.slice(C,A===-1?void 0:A+1);if(l(s,k)||(j+=k,A===-1||!k.trim()))break;C=A+1}const T=sf(j);return T===""?null:[j,,T]}),i:3,u:RN,l:(x,_,j)=>d("p",{key:j.key},_(x.children,j))},22:{t:["["],o:Ei(O0e),i:0,u:x=>(g[x[1]]={target:x[2],title:x[4]},{}),l:ON},23:{t:["!["],o:bo(M0e),i:0,u:x=>({alt:x[1]?wa(x[1]):void 0,ref:x[2]}),l:(x,_,j)=>g[x.ref]?d("img",{key:j.key,alt:x.alt,src:r(g[x.ref].target,"img","src"),title:g[x.ref].title}):null},24:{t:x=>x[0]==="["&&x.indexOf("](")===-1,o:Ei(D0e),i:0,u:(x,_,j)=>({children:_(x[1],j),fallbackChildren:x[0],ref:x[2]}),l:(x,_,j)=>g[x.ref]?d("a",{key:j.key,href:r(g[x.ref].target,"a","href"),title:g[x.ref].title},_(x.children,j)):d("span",{key:j.key},x.fallbackChildren)},25:{t:["|"],o:ms(q3),i:1,u:oxe,l(x,_,j){const C=x;return d("table",{key:j.key},d("thead",null,d("tr",null,C.header.map(function(T,A){return d("th",{key:A,style:B3(C,A)},_(T,j))}))),d("tbody",null,C.cells.map(function(T,A){return d("tr",{key:A},T.map(function(k,O){return d("td",{key:O,style:B3(C,O)},_(k,j))}))})))}},27:{o:Zc(function(x,_){let j;return Pg(x,":")&&(j=V0e.exec(x)),j||K0e.exec(x)}),i:4,u(x){const _=x[0];return{text:_.indexOf("&")===-1?_:_.replace(j0e,(j,C)=>t.namedCodesToUnicode[C]||j)}},l:x=>x.text},28:{t:["**","__"],o:bo(F0e),i:2,u:(x,_,j)=>({children:_(x[2],j)}),l:(x,_,j)=>d("strong",{key:j.key},_(x.children,j))},29:{t:x=>{const _=x[0];return(_==="*"||_==="_")&&x[1]!==_},o:bo(U0e),i:3,u:(x,_,j)=>({children:_(x[2],j)}),l:(x,_,j)=>d("em",{key:j.key},_(x.children,j))},30:{t:["\\"],o:bo(W0e),i:1,u:x=>({text:x[1],type:"27"})},31:{t:["=="],o:bo(H0e),i:3,u:RN,l:(x,_,j)=>d("mark",{key:j.key},_(x.children,j))},32:{t:["~~"],o:bo(B0e),i:3,u:RN,l:(x,_,j)=>d("del",{key:j.key},_(x.children,j))}};t.disableParsingRawHTML===!0&&(delete y[11],delete y[13]);const S=(function(x){var _=Object.keys(x);function j(C,T){var A=[];if(T.prevCapture=T.prevCapture||"",C.trim())for(;C;)for(var k=0;k<_.length;){var O=_[k],M=x[O];if(!M.t||axe(C,T,M.t)){var z=M.o(C,T);if(z&&z[0]){C=C.substring(z[0].length);var L=M.u(z,j,T);T.prevCapture+=z[0],L.type||(L.type=O),A.push(L);break}k++}else k++}return T.prevCapture="",A}return _.sort(function(C,T){return x[C].i-x[T].i||(C<T?-1:1)}),function(C,T){return j((function(A){return A.replace(x0e,`
|
|
737
|
+
`).replace(S0e,"").replace($0e," ")})(C),T)}})(y),w=(function(x,_){return function j(C,T={}){if(Array.isArray(C)){const A=T.key,k=[];let O=!1;for(let M=0;M<C.length;M++){T.key=M;const z=j(C[M],T),L=U3(z);L&&O?k[k.length-1]+=z:z!==null&&k.push(z),O=L}return T.key=A,k}return(function(A,k,O){const M=x[A.type].l;return _?_(()=>M(A,k,O),A,k,O):M(A,k,O)})(C,j,T)}})(y,t.renderRule),b=f(e);return p.length?d("div",null,b,d("footer",{key:"footer"},p.map(function(x){return d("div",{id:n(x.identifier,Rd),key:x.identifier},x.identifier,w(S(x.footnote,{inline:!0})))}))):b}const Kv=e=>{let{children:t,options:n}=e,r=(function(a,s){if(a==null)return{};var i,l,d={},f=Object.keys(a);for(l=0;l<f.length;l++)s.indexOf(i=f[l])>=0||(d[i]=a[i]);return d})(e,l0e);return N.cloneElement(fxe(t??"",n),r)};function hxe(e,t){return e==null?!0:VF(e,t)}class pxe extends N.Component{constructor(){super(...arguments);ft(this,"state",{wasPropertyKeyModified:!1,additionalProperties:{}});ft(this,"onPropertyChange",(n,r=!1)=>(a,s,i)=>{const{formData:l,onChange:d,errorSchema:f}=this.props;a===void 0&&r&&(a="");const h={...l,[n]:a};d(h,f&&f&&{...f,[n]:s},i)});ft(this,"onDropPropertyClick",n=>r=>{r.preventDefault();const{onChange:a,formData:s}=this.props,i={...s};hxe(i,n),a(i)});ft(this,"getAvailableKey",(n,r)=>{const{uiSchema:a,registry:s}=this.props,{duplicateKeySuffixSeparator:i="-"}=at(a,s.globalUiOptions);let l=0,d=n;for(;Bn(r,d);)d=`${n}${i}${++l}`;return d});ft(this,"onKeyChange",n=>(r,a)=>{if(n===r)return;const{formData:s,onChange:i,errorSchema:l}=this.props;r=this.getAvailableKey(r,s);const d={...s},f={[n]:r},h=Object.keys(d).map(g=>({[f[g]||g]:d[g]})),p=Object.assign({},...h);this.setState({wasPropertyKeyModified:!0}),i(p,l&&l&&{...l,[r]:a})});ft(this,"handleAddClick",n=>()=>{if(!n.additionalProperties)return;const{formData:r,onChange:a,registry:s}=this.props,i={...r};let l,d,f;if(Tt(n.additionalProperties)){l=n.additionalProperties.type,d=n.additionalProperties.const,f=n.additionalProperties.default;let g=n.additionalProperties;if(mn in g){const{schemaUtils:y}=s;g=y.retrieveSchema({$ref:g[mn]},r),l=g.type,d=g.const,f=g.default}!l&&(na in g||vr in g)&&(l="object")}const h=this.getAvailableKey("newKey",i),p=d??f??this.getDefaultValue(l);Tn(i,h,p),a(i)})}isRequired(n){const{schema:r}=this.props;return Array.isArray(r.required)&&r.required.indexOf(n)!==-1}getDefaultValue(n){const{registry:{translateString:r}}=this.props;switch(n){case"array":return[];case"boolean":return!1;case"null":return null;case"number":return 0;case"object":return{};case"string":default:return r(Nt.NewStringDefault)}}render(){const{schema:n,uiSchema:r={},formData:a,errorSchema:s,idSchema:i,name:l,required:d=!1,disabled:f,readonly:h,hideError:p,idPrefix:g,idSeparator:y,onBlur:S,onFocus:w,registry:b,title:x}=this.props,{fields:_,formContext:j,schemaUtils:C,translateString:T,globalUiOptions:A}=b,{SchemaField:k}=_,O=C.retrieveSchema(n,a),M=at(r,A),{properties:z={}}=O,L=M.title??O.title??x??l,U=M.description??O.description;let F;try{const P=Object.keys(z);F=Uve(P,M.order)}catch(P){return c.jsxs("div",{children:[c.jsx("p",{className:"config-error",style:{color:"red"},children:c.jsx(Kv,{options:{disableParsingRawHTML:!0},children:T(Nt.InvalidObjectField,[l||"root",P.message])})}),c.jsx("pre",{children:JSON.stringify(O)})]})}const q=pt("ObjectFieldTemplate",b,M),V={title:M.label===!1?"":L,description:M.label===!1?void 0:U,properties:F.map(P=>{const K=Bn(O,[Xt,P,ch]),H=K?r.additionalProperties:r[P],Z=at(H).widget==="hidden",J=Oe(i,[P],{});return{content:c.jsx(k,{name:P,required:this.isRequired(P),schema:Oe(O,[Xt,P],{}),uiSchema:H,errorSchema:Oe(s,P),idSchema:J,idPrefix:g,idSeparator:y,formData:Oe(a,P),formContext:j,wasPropertyKeyModified:this.state.wasPropertyKeyModified,onKeyChange:this.onKeyChange(P),onChange:this.onPropertyChange(P,K),onBlur:S,onFocus:w,registry:b,disabled:f,readonly:h,hideError:p,onDropPropertyClick:this.onDropPropertyClick},P),name:P,readonly:h,disabled:f,required:d,hidden:Z}}),readonly:h,disabled:f,required:d,idSchema:i,uiSchema:r,errorSchema:s,schema:O,formData:a,formContext:j,registry:b};return c.jsx(q,{...V,onAddClick:this.handleAddClick})}}const mxe={array:"ArrayField",boolean:"BooleanField",integer:"NumberField",number:"NumberField",object:"ObjectField",string:"StringField",null:"NullField"};function gxe(e,t,n,r){const a=t.field,{fields:s,translateString:i}=r;if(typeof a=="function")return a;if(typeof a=="string"&&a in s)return s[a];const l=Ds(e),d=Array.isArray(l)?l[0]:l||"",f=e.$id;let h=mxe[d];return f&&f in s&&(h=f),!h&&(e.anyOf||e.oneOf)?()=>null:h in s?s[h]:()=>{const p=pt("UnsupportedFieldTemplate",r,t);return c.jsx(p,{schema:e,idSchema:n,reason:i(Nt.UnknownFieldType,[String(e.type)]),registry:r})}}function yxe(e){const{schema:t,idSchema:n,uiSchema:r,formData:a,errorSchema:s,idPrefix:i,idSeparator:l,name:d,onChange:f,onKeyChange:h,onDropPropertyClick:p,required:g,registry:y,wasPropertyKeyModified:S=!1}=e,{formContext:w,schemaUtils:b,globalUiOptions:x}=y,_=at(r,x),j=pt("FieldTemplate",y,_),C=pt("DescriptionFieldTemplate",y,_),T=pt("FieldHelpTemplate",y,_),A=pt("FieldErrorTemplate",y,_),k=b.retrieveSchema(t,a),O=n[Ao],M=_s(b.toIdSchema(k,O,a,i,l),n),z=N.useCallback((fe,ve,Se)=>f(fe,ve,Se||O),[O,f]),L=gxe(k,_,M,y),U=!!(_.disabled??e.disabled),F=!!(_.readonly??(e.readonly||e.schema.readOnly||k.readOnly)),q=_.hideError,V=q===void 0?e.hideError:!!q,P=!!(_.autofocus??e.autofocus);if(Object.keys(k).length===0)return null;const K=b.getDisplayLabel(k,r,x),{__errors:H,...Z}=s||{},J=fy(r,["ui:classNames","classNames","ui:style"]);tf in J&&(J[tf]=fy(J[tf],["classNames","style"]));const D=c.jsx(L,{...e,onChange:z,idSchema:M,schema:k,uiSchema:J,disabled:U,readonly:F,hideError:V,autofocus:P,errorSchema:Z,formContext:w,rawErrors:H}),W=M[Ao];let B;S?B=d:B=ch in k?d:_.title||e.schema.title||k.title||e.title||d;const $=_.description||e.schema.description||k.description||"",G=_.enableMarkdownInDescription?c.jsx(Kv,{options:{disableParsingRawHTML:!0},children:$}):$,ee=_.help,re=_.widget==="hidden",ne=["form-group","field",`field-${Ds(k)}`];!V&&H&&H.length>0&&ne.push("field-error has-error has-danger"),r!=null&&r.classNames&&ne.push(r.classNames),_.classNames&&ne.push(_.classNames);const Q=c.jsx(T,{help:ee,idSchema:M,schema:k,uiSchema:r,hasErrors:!V&&H&&H.length>0,registry:y}),ae=V||(k.anyOf||k.oneOf)&&!b.isSelect(k)?void 0:c.jsx(A,{errors:H,errorSchema:s,idSchema:M,schema:k,uiSchema:r,registry:y}),Y={description:c.jsx(C,{id:xh(W),description:G,schema:k,uiSchema:r,registry:y}),rawDescription:$,help:Q,rawHelp:typeof ee=="string"?ee:void 0,errors:ae,rawErrors:V?void 0:H,id:W,label:B,hidden:re,onChange:f,onKeyChange:h,onDropPropertyClick:p,required:g,disabled:U,readonly:F,hideError:V,displayLabel:K,classNames:ne.join(" ").trim(),style:_.style,formContext:w,formData:a,schema:k,uiSchema:r,registry:y},te=y.fields.AnyOfField,se=y.fields.OneOfField,le=(r==null?void 0:r["ui:field"])&&(r==null?void 0:r["ui:fieldReplacesAnyOrOneOf"])===!0;return c.jsx(j,{...Y,children:c.jsxs(c.Fragment,{children:[D,k.anyOf&&!le&&!b.isSelect(k)&&c.jsx(te,{name:d,disabled:U,readonly:F,hideError:V,errorSchema:s,formData:a,formContext:w,idPrefix:i,idSchema:M,idSeparator:l,onBlur:e.onBlur,onChange:e.onChange,onFocus:e.onFocus,options:k.anyOf.map(fe=>b.retrieveSchema(Tt(fe)?fe:{},a)),registry:y,required:g,schema:k,uiSchema:r}),k.oneOf&&!le&&!b.isSelect(k)&&c.jsx(se,{name:d,disabled:U,readonly:F,hideError:V,errorSchema:s,formData:a,formContext:w,idPrefix:i,idSchema:M,idSeparator:l,onBlur:e.onBlur,onChange:e.onChange,onFocus:e.onFocus,options:k.oneOf.map(fe=>b.retrieveSchema(Tt(fe)?fe:{},a)),registry:y,required:g,schema:k,uiSchema:r})]})})}class vxe extends N.Component{shouldComponentUpdate(t){return!Pt(this.props,t)}render(){return c.jsx(yxe,{...this.props})}}function xxe(e){const{schema:t,name:n,uiSchema:r,idSchema:a,formData:s,required:i,disabled:l=!1,readonly:d=!1,autofocus:f=!1,onChange:h,onBlur:p,onFocus:g,registry:y,rawErrors:S,hideError:w}=e,{title:b,format:x}=t,{widgets:_,formContext:j,schemaUtils:C,globalUiOptions:T}=y,A=C.isSelect(t)?Ef(t,r):void 0;let k=A?"select":"text";x&&zve(t,x,_)&&(k=x);const{widget:O=k,placeholder:M="",title:z,...L}=at(r),U=C.getDisplayLabel(t,r,T),F=z??b??n,q=Es(t,O,_);return c.jsx(q,{options:{...L,enumOptions:A},schema:t,uiSchema:r,id:a.$id,name:n,label:F,hideLabel:!U,hideError:w,value:s,onChange:h,onBlur:p,onFocus:g,required:i,disabled:l,readonly:d,formContext:j,autofocus:f,registry:y,placeholder:M,rawErrors:S})}function bxe(e){const{formData:t,onChange:n}=e;return N.useEffect(()=>{t===void 0&&n(null)},[t,n]),null}function wxe(){return{AnyOfField:R3,ArrayField:r0e,BooleanField:a0e,NumberField:i0e,ObjectField:pxe,OneOfField:R3,SchemaField:vxe,StringField:xxe,NullField:bxe}}function Sxe(e){const{idSchema:t,description:n,registry:r,schema:a,uiSchema:s}=e,i=at(s,r.globalUiOptions),{label:l=!0}=i;if(!n||!l)return null;const d=pt("DescriptionFieldTemplate",r,i);return c.jsx(d,{id:xh(t),description:n,schema:a,uiSchema:s,registry:r})}function _xe(e){const{children:t,className:n,disabled:r,hasToolbar:a,hasMoveDown:s,hasMoveUp:i,hasRemove:l,hasCopy:d,index:f,onCopyIndexClick:h,onDropIndexClick:p,onReorderClick:g,readonly:y,registry:S,uiSchema:w}=e,{CopyButton:b,MoveDownButton:x,MoveUpButton:_,RemoveButton:j}=S.templates.ButtonTemplates,C={flex:1,paddingLeft:6,paddingRight:6,fontWeight:"bold"};return c.jsxs("div",{className:n,children:[c.jsx("div",{className:a?"col-xs-9":"col-xs-12",children:t}),a&&c.jsx("div",{className:"col-xs-3 array-item-toolbox",children:c.jsxs("div",{className:"btn-group",style:{display:"flex",justifyContent:"space-around"},children:[(i||s)&&c.jsx(_,{style:C,disabled:r||y||!i,onClick:g(f,f-1),uiSchema:w,registry:S}),(i||s)&&c.jsx(x,{style:C,disabled:r||y||!s,onClick:g(f,f+1),uiSchema:w,registry:S}),d&&c.jsx(b,{style:C,disabled:r||y,onClick:h(f),uiSchema:w,registry:S}),l&&c.jsx(j,{style:C,disabled:r||y,onClick:p(f),uiSchema:w,registry:S})]})})]})}function Nxe(e){const{canAdd:t,className:n,disabled:r,idSchema:a,uiSchema:s,items:i,onAddClick:l,readonly:d,registry:f,required:h,schema:p,title:g}=e,y=at(s),S=pt("ArrayFieldDescriptionTemplate",f,y),w=pt("ArrayFieldItemTemplate",f,y),b=pt("ArrayFieldTitleTemplate",f,y),{ButtonTemplates:{AddButton:x}}=f.templates;return c.jsxs("fieldset",{className:n,id:a.$id,children:[c.jsx(b,{idSchema:a,title:y.title||g,required:h,schema:p,uiSchema:s,registry:f}),c.jsx(S,{idSchema:a,description:y.description||p.description,schema:p,uiSchema:s,registry:f}),c.jsx("div",{className:"row array-item-list",children:i&&i.map(({key:_,...j})=>c.jsx(w,{...j},_))}),t&&c.jsx(x,{className:"array-item-add",onClick:l,disabled:r||d,uiSchema:s,registry:f})]})}function jxe(e){const{idSchema:t,title:n,schema:r,uiSchema:a,required:s,registry:i}=e,l=at(a,i.globalUiOptions),{label:d=!0}=l;if(!n||!d)return null;const f=pt("TitleFieldTemplate",i,l);return c.jsx(f,{id:uU(t),title:n,required:s,schema:r,uiSchema:a,registry:i})}function Cxe(e){const{id:t,name:n,value:r,readonly:a,disabled:s,autofocus:i,onBlur:l,onFocus:d,onChange:f,onChangeOverride:h,options:p,schema:g,uiSchema:y,formContext:S,registry:w,rawErrors:b,type:x,hideLabel:_,hideError:j,...C}=e;if(!t)throw console.log("No id for",e),new Error(`no id for props ${JSON.stringify(e)}`);const T={...C,...kve(g,x,p)};let A;T.type==="number"||T.type==="integer"?A=r||r===0?r:"":A=r??"";const k=N.useCallback(({target:{value:z}})=>f(z===""?p.emptyValue:z),[f,p]),O=N.useCallback(({target:z})=>l(t,z&&z.value),[l,t]),M=N.useCallback(({target:z})=>d(t,z&&z.value),[d,t]);return c.jsxs(c.Fragment,{children:[c.jsx("input",{id:t,name:t,className:"form-control",readOnly:a,disabled:s,autoFocus:i,value:A,...T,list:g.examples?fC(t):void 0,onChange:h||k,onBlur:O,onFocus:M,"aria-describedby":Nl(t,!!g.examples)}),Array.isArray(g.examples)&&c.jsx("datalist",{id:fC(t),children:g.examples.concat(g.default&&!g.examples.includes(g.default)?[g.default]:[]).map(z=>c.jsx("option",{value:z},z))},`datalist_${t}`)]})}function Exe({uiSchema:e}){const{submitText:t,norender:n,props:r={}}=Ove(e);return n?null:c.jsx("div",{children:c.jsx("button",{type:"submit",...r,className:`btn btn-info ${r.className||""}`,children:t})})}function bh(e){const{iconType:t="default",icon:n,className:r,uiSchema:a,registry:s,...i}=e;return c.jsx("button",{type:"button",className:`btn btn-${t} ${r}`,...i,children:c.jsx("i",{className:`glyphicon glyphicon-${n}`})})}function Txe(e){const{registry:{translateString:t}}=e;return c.jsx(bh,{title:t(Nt.CopyButton),className:"array-item-copy",...e,icon:"copy"})}function Axe(e){const{registry:{translateString:t}}=e;return c.jsx(bh,{title:t(Nt.MoveDownButton),className:"array-item-move-down",...e,icon:"arrow-down"})}function Rxe(e){const{registry:{translateString:t}}=e;return c.jsx(bh,{title:t(Nt.MoveUpButton),className:"array-item-move-up",...e,icon:"arrow-up"})}function kxe(e){const{registry:{translateString:t}}=e;return c.jsx(bh,{title:t(Nt.RemoveButton),className:"array-item-remove",...e,iconType:"danger",icon:"remove"})}function Oxe({className:e,onClick:t,disabled:n,registry:r}){const{translateString:a}=r;return c.jsx("div",{className:"row",children:c.jsx("p",{className:`col-xs-3 col-xs-offset-9 text-right ${e}`,children:c.jsx(bh,{iconType:"info",icon:"plus",className:"btn-add col-xs-12",title:a(Nt.AddButton),onClick:t,disabled:n,registry:r})})})}function Mxe(){return{SubmitButton:Exe,AddButton:Oxe,CopyButton:Txe,MoveDownButton:Axe,MoveUpButton:Rxe,RemoveButton:kxe}}function Dxe(e){const{id:t,description:n}=e;return n?typeof n=="string"?c.jsx("p",{id:t,className:"field-description",children:n}):c.jsx("div",{id:t,className:"field-description",children:n}):null}function Pxe({errors:e,registry:t}){const{translateString:n}=t;return c.jsxs("div",{className:"panel panel-danger errors",children:[c.jsx("div",{className:"panel-heading",children:c.jsx("h3",{className:"panel-title",children:n(Nt.ErrorsLabel)})}),c.jsx("ul",{className:"list-group",children:e.map((r,a)=>c.jsx("li",{className:"list-group-item text-danger",children:r.stack},a))})]})}const $xe="*";function SU(e){const{label:t,required:n,id:r}=e;return t?c.jsxs("label",{className:"control-label",htmlFor:r,children:[t,n&&c.jsx("span",{className:"required",children:$xe})]}):null}function Ixe(e){const{id:t,label:n,children:r,errors:a,help:s,description:i,hidden:l,required:d,displayLabel:f,registry:h,uiSchema:p}=e,g=at(p),y=pt("WrapIfAdditionalTemplate",h,g);return l?c.jsx("div",{className:"hidden",children:r}):c.jsxs(y,{...e,children:[f&&c.jsx(SU,{label:n,required:d,id:t}),f&&i?i:null,r,a,s]})}function Lxe(e){const{errors:t=[],idSchema:n}=e;if(t.length===0)return null;const r=lU(n);return c.jsx("div",{children:c.jsx("ul",{id:r,className:"error-detail bs-callout bs-callout-info",children:t.filter(a=>!!a).map((a,s)=>c.jsx("li",{className:"text-danger",children:a},s))})})}function zxe(e){const{idSchema:t,help:n}=e;if(!n)return null;const r=cU(t);return typeof n=="string"?c.jsx("p",{id:r,className:"help-block",children:n}):c.jsx("div",{id:r,className:"help-block",children:n})}function qxe(e){const{description:t,disabled:n,formData:r,idSchema:a,onAddClick:s,properties:i,readonly:l,registry:d,required:f,schema:h,title:p,uiSchema:g}=e,y=at(g),S=pt("TitleFieldTemplate",d,y),w=pt("DescriptionFieldTemplate",d,y),{ButtonTemplates:{AddButton:b}}=d.templates;return c.jsxs("fieldset",{id:a.$id,children:[p&&c.jsx(S,{id:uU(a),title:p,required:f,schema:h,uiSchema:g,registry:d}),t&&c.jsx(w,{id:xh(a),description:t,schema:h,uiSchema:g,registry:d}),i.map(x=>x.content),due(h,g,r)&&c.jsx(b,{className:"object-property-expand",onClick:s(h),disabled:n||l,uiSchema:g,registry:d})]})}const Fxe="*";function Uxe(e){const{id:t,title:n,required:r}=e;return c.jsxs("legend",{id:t,children:[n,r&&c.jsx("span",{className:"required",children:Fxe})]})}function Hxe(e){const{schema:t,idSchema:n,reason:r,registry:a}=e,{translateString:s}=a;let i=Nt.UnsupportedField;const l=[];return n&&n.$id&&(i=Nt.UnsupportedFieldWithId,l.push(n.$id)),r&&(i=i===Nt.UnsupportedField?Nt.UnsupportedFieldWithReason:Nt.UnsupportedFieldWithIdAndReason,l.push(r)),c.jsxs("div",{className:"unsupported-field",children:[c.jsx("p",{children:c.jsx(Kv,{options:{disableParsingRawHTML:!0},children:s(i,l)})}),t&&c.jsx("pre",{children:JSON.stringify(t,null,2)})]})}function Bxe(e){const{id:t,classNames:n,style:r,disabled:a,label:s,onKeyChange:i,onDropPropertyClick:l,readonly:d,required:f,schema:h,children:p,uiSchema:g,registry:y}=e,{templates:S,translateString:w}=y,{RemoveButton:b}=S.ButtonTemplates,x=w(Nt.KeyLabel,[s]);return ch in h?c.jsx("div",{className:n,style:r,children:c.jsxs("div",{className:"row",children:[c.jsx("div",{className:"col-xs-5 form-additional",children:c.jsxs("div",{className:"form-group",children:[c.jsx(SU,{label:x,required:f,id:`${t}-key`}),c.jsx("input",{className:"form-control",type:"text",id:`${t}-key`,onBlur:({target:j})=>i(j&&j.value),defaultValue:s})]})}),c.jsx("div",{className:"form-additional form-group col-xs-5",children:p}),c.jsx("div",{className:"col-xs-2",children:c.jsx(b,{className:"array-item-remove btn-block",style:{border:"0"},disabled:a||d,onClick:l(s),uiSchema:g,registry:y})})]})}):c.jsx("div",{className:n,style:r,children:p})}function Vxe(){return{ArrayFieldDescriptionTemplate:Sxe,ArrayFieldItemTemplate:_xe,ArrayFieldTemplate:Nxe,ArrayFieldTitleTemplate:jxe,ButtonTemplates:Mxe(),BaseInputTemplate:Cxe,DescriptionFieldTemplate:Dxe,ErrorListTemplate:Pxe,FieldTemplate:Ixe,FieldErrorTemplate:Lxe,FieldHelpTemplate:zxe,ObjectFieldTemplate:qxe,TitleFieldTemplate:Uxe,UnsupportedFieldTemplate:Hxe,WrapIfAdditionalTemplate:Bxe}}function Wxe(e){return Object.values(e).every(t=>t!==-1)}function Gxe({type:e,range:t,value:n,select:r,rootId:a,name:s,disabled:i,readonly:l,autofocus:d,registry:f,onBlur:h,onFocus:p}){const g=a+"_"+e,{SelectWidget:y}=f.widgets;return c.jsx(y,{schema:{type:"integer"},id:g,name:s,className:"form-control",options:{enumOptions:oU(t[0],t[1])},placeholder:e,value:n,disabled:i,readonly:l,autofocus:d,onChange:S=>r(e,S),onBlur:h,onFocus:p,registry:f,label:"","aria-describedby":Nl(a)})}function Kxe({time:e=!1,disabled:t=!1,readonly:n=!1,autofocus:r=!1,options:a,id:s,name:i,registry:l,onBlur:d,onFocus:f,onChange:h,value:p}){const{translateString:g}=l,[y,S]=N.useState(p),[w,b]=N.useReducer((C,T)=>({...C,...T}),EN(p,e));N.useEffect(()=>{const C=E3(w,e);Wxe(w)&&C!==p?h(C):y!==p&&(S(p),b(EN(p,e)))},[e,p,h,w,y]);const x=N.useCallback((C,T)=>{b({[C]:T})},[]),_=N.useCallback(C=>{if(C.preventDefault(),t||n)return;const T=EN(new Date().toJSON(),e);h(E3(T,e))},[t,n,e]),j=N.useCallback(C=>{C.preventDefault(),!(t||n)&&h(void 0)},[t,n,h]);return c.jsxs("ul",{className:"list-inline",children:[Ave(w,e,a.yearsRange,a.format).map((C,T)=>c.jsx("li",{className:"list-inline-item",children:c.jsx(Gxe,{rootId:s,name:i,select:x,...C,disabled:t,readonly:n,registry:l,onBlur:d,onFocus:f,autofocus:r&&T===0})},T)),(a.hideNowButton!=="undefined"?!a.hideNowButton:!0)&&c.jsx("li",{className:"list-inline-item",children:c.jsx("a",{href:"#",className:"btn btn-info btn-now",onClick:_,children:g(Nt.NowLabel)})}),(a.hideClearButton!=="undefined"?!a.hideClearButton:!0)&&c.jsx("li",{className:"list-inline-item",children:c.jsx("a",{href:"#",className:"btn btn-warning btn-clear",onClick:j,children:g(Nt.ClearLabel)})})]})}function Yxe({time:e=!0,...t}){const{AltDateWidget:n}=t.registry.widgets;return c.jsx(n,{time:e,...t})}function Xxe({schema:e,uiSchema:t,options:n,id:r,value:a,disabled:s,readonly:i,label:l,hideLabel:d,autofocus:f=!1,onBlur:h,onFocus:p,onChange:g,registry:y}){const S=pt("DescriptionFieldTemplate",y,n),w=Mg(e),b=N.useCallback(C=>g(C.target.checked),[g]),x=N.useCallback(C=>h(r,C.target.checked),[h,r]),_=N.useCallback(C=>p(r,C.target.checked),[p,r]),j=n.description??e.description;return c.jsxs("div",{className:`checkbox ${s||i?"disabled":""}`,children:[!d&&!!j&&c.jsx(S,{id:xh(r),description:j,schema:e,uiSchema:t,registry:y}),c.jsxs("label",{children:[c.jsx("input",{type:"checkbox",id:r,name:r,checked:typeof a>"u"?!1:a,required:w,disabled:s||i,autoFocus:f,onChange:b,onBlur:x,onFocus:_,"aria-describedby":Nl(r)}),qve(c.jsx("span",{children:l}),d)]})]})}function Zxe({id:e,disabled:t,options:{inline:n=!1,enumOptions:r,enumDisabled:a,emptyValue:s},value:i,autofocus:l=!1,readonly:d,onChange:f,onBlur:h,onFocus:p}){const g=Array.isArray(i)?i:[i],y=N.useCallback(({target:w})=>h(e,Ra(w&&w.value,r,s)),[h,e]),S=N.useCallback(({target:w})=>p(e,Ra(w&&w.value,r,s)),[p,e]);return c.jsx("div",{className:"checkboxes",id:e,children:Array.isArray(r)&&r.map((w,b)=>{const x=LE(w.value,g),_=Array.isArray(a)&&a.indexOf(w.value)!==-1,j=t||_||d?"disabled":"",C=A=>{A.target.checked?f(Nve(b,g,r)):f(Sve(b,g,r))},T=c.jsxs("span",{children:[c.jsx("input",{type:"checkbox",id:dU(e,b),name:e,checked:x,value:String(b),disabled:t||_||d,autoFocus:l&&b===0,onChange:C,onBlur:y,onFocus:S,"aria-describedby":Nl(e)}),c.jsx("span",{children:w.label})]});return n?c.jsx("label",{className:`checkbox-inline ${j}`,children:T},b):c.jsx("div",{className:`checkbox ${j}`,children:c.jsx("label",{children:T})},b)})})}function Qxe(e){const{disabled:t,readonly:n,options:r,registry:a}=e,s=pt("BaseInputTemplate",a,r);return c.jsx(s,{type:"color",...e,disabled:t||n})}function Jxe(e){const{onChange:t,options:n,registry:r}=e,a=pt("BaseInputTemplate",r,n),s=N.useCallback(i=>t(i||void 0),[t]);return c.jsx(a,{type:"date",...e,onChange:s})}function ebe(e){const{onChange:t,value:n,options:r,registry:a}=e,s=pt("BaseInputTemplate",a,r);return c.jsx(s,{type:"datetime-local",...e,value:Vve(n),onChange:i=>t(Fve(i))})}function tbe(e){const{options:t,registry:n}=e,r=pt("BaseInputTemplate",n,t);return c.jsx(r,{type:"email",...e})}function nbe(e,t){return e===null?null:e.replace(";base64",`;name=${encodeURIComponent(t)};base64`)}function rbe(e){const{name:t,size:n,type:r}=e;return new Promise((a,s)=>{const i=new window.FileReader;i.onerror=s,i.onload=l=>{var d;typeof((d=l.target)==null?void 0:d.result)=="string"?a({dataURL:nbe(l.target.result,t),name:t,size:n,type:r}):a({dataURL:null,name:t,size:n,type:r})},i.readAsDataURL(e)})}function abe(e){return Promise.all(Array.from(e).map(rbe))}function sbe({fileInfo:e,registry:t}){const{translateString:n}=t,{dataURL:r,type:a,name:s}=e;return r?["image/jpeg","image/png"].includes(a)?c.jsx("img",{src:r,style:{maxWidth:"100%"},className:"file-preview"}):c.jsxs(c.Fragment,{children:[" ",c.jsx("a",{download:`preview-${s}`,href:r,className:"file-download",children:n(Nt.PreviewLabel)})]}):null}function obe({filesInfo:e,registry:t,preview:n,onRemove:r,options:a}){if(e.length===0)return null;const{translateString:s}=t,{RemoveButton:i}=pt("ButtonTemplates",t,a);return c.jsx("ul",{className:"file-info",children:e.map((l,d)=>{const{name:f,size:h,type:p}=l,g=()=>r(d);return c.jsxs("li",{children:[c.jsx(Kv,{children:s(Nt.FilesInfo,[f,p,String(h)])}),n&&c.jsx(sbe,{fileInfo:l,registry:t}),c.jsx(i,{onClick:g,registry:t})]},d)})})}function ibe(e){return e.reduce((t,n)=>{if(!n)return t;try{const{blob:r,name:a}=xve(n);return[...t,{dataURL:n,name:a,size:r.size,type:r.type}]}catch{return t}},[])}function lbe(e){const{disabled:t,readonly:n,required:r,multiple:a,onChange:s,value:i,options:l,registry:d}=e,f=pt("BaseInputTemplate",d,l),h=N.useCallback(y=>{y.target.files&&abe(y.target.files).then(S=>{const w=S.map(b=>b.dataURL);s(a?i.concat(w):w[0])})},[a,i,s]),p=N.useMemo(()=>ibe(Array.isArray(i)?i:[i]),[i]),g=N.useCallback(y=>{if(a){const S=i.filter((w,b)=>b!==y);s(S)}else s(void 0)},[a,i,s]);return c.jsxs("div",{children:[c.jsx(f,{...e,disabled:t||n,type:"file",required:i?!1:r,onChangeOverride:h,value:"",accept:l.accept?String(l.accept):void 0}),c.jsx(obe,{filesInfo:p,onRemove:g,registry:d,preview:l.filePreview,options:l})]})}function cbe({id:e,value:t}){return c.jsx("input",{type:"hidden",id:e,name:e,value:typeof t>"u"?"":t})}function ube(e){const{options:t,registry:n}=e,r=pt("BaseInputTemplate",n,t);return c.jsx(r,{type:"password",...e})}function dbe({options:e,value:t,required:n,disabled:r,readonly:a,autofocus:s=!1,onBlur:i,onFocus:l,onChange:d,id:f}){const{enumOptions:h,enumDisabled:p,inline:g,emptyValue:y}=e,S=N.useCallback(({target:b})=>i(f,Ra(b&&b.value,h,y)),[i,f]),w=N.useCallback(({target:b})=>l(f,Ra(b&&b.value,h,y)),[l,f]);return c.jsx("div",{className:"field-radio-group",id:f,children:Array.isArray(h)&&h.map((b,x)=>{const _=LE(b.value,t),j=Array.isArray(p)&&p.indexOf(b.value)!==-1,C=r||j||a?"disabled":"",T=()=>d(b.value),A=c.jsxs("span",{children:[c.jsx("input",{type:"radio",id:dU(f,x),checked:_,name:f,required:n,value:String(x),disabled:r||j||a,autoFocus:s&&x===0,onChange:T,onBlur:S,onFocus:w,"aria-describedby":Nl(f)}),c.jsx("span",{children:b.label})]});return g?c.jsx("label",{className:`radio-inline ${C}`,children:A},x):c.jsx("div",{className:`radio ${C}`,children:c.jsx("label",{children:A})},x)})})}function fbe(e){const{value:t,registry:{templates:{BaseInputTemplate:n}}}=e;return c.jsxs("div",{className:"field-range-wrapper",children:[c.jsx(n,{type:"range",...e}),c.jsx("span",{className:"range-view",children:t})]})}function DN(e,t){return t?Array.from(e.target.options).slice().filter(n=>n.selected).map(n=>n.value):e.target.value}function hbe({schema:e,id:t,options:n,value:r,required:a,disabled:s,readonly:i,multiple:l=!1,autofocus:d=!1,onChange:f,onBlur:h,onFocus:p,placeholder:g}){const{enumOptions:y,enumDisabled:S,emptyValue:w}=n,b=l?[]:"",x=N.useCallback(A=>{const k=DN(A,l);return p(t,Ra(k,y,w))},[p,t,e,l,y,w]),_=N.useCallback(A=>{const k=DN(A,l);return h(t,Ra(k,y,w))},[h,t,e,l,y,w]),j=N.useCallback(A=>{const k=DN(A,l);return f(Ra(k,y,w))},[f,e,l,y,w]),C=_ve(r,y,l),T=!l&&e.default===void 0;return c.jsxs("select",{id:t,name:t,multiple:l,className:"form-control",value:typeof C>"u"?b:C,required:a,disabled:s||i,autoFocus:d,onBlur:_,onFocus:x,onChange:j,"aria-describedby":Nl(t),children:[T&&c.jsx("option",{value:"",children:g}),Array.isArray(y)&&y.map(({value:A,label:k},O)=>{const M=S&&S.indexOf(A)!==-1;return c.jsx("option",{value:String(O),disabled:M,children:k},O)})]})}function _U({id:e,options:t={},placeholder:n,value:r,required:a,disabled:s,readonly:i,autofocus:l=!1,onChange:d,onBlur:f,onFocus:h}){const p=N.useCallback(({target:{value:S}})=>d(S===""?t.emptyValue:S),[d,t.emptyValue]),g=N.useCallback(({target:S})=>f(e,S&&S.value),[f,e]),y=N.useCallback(({target:S})=>h(e,S&&S.value),[e,h]);return c.jsx("textarea",{id:e,name:e,className:"form-control",value:r||"",placeholder:n,required:a,disabled:s,readOnly:i,autoFocus:l,rows:t.rows,onBlur:g,onFocus:y,onChange:p,"aria-describedby":Nl(e)})}_U.defaultProps={autofocus:!1,options:{}};function pbe(e){const{options:t,registry:n}=e,r=pt("BaseInputTemplate",n,t);return c.jsx(r,{...e})}function mbe(e){const{onChange:t,options:n,registry:r}=e,a=pt("BaseInputTemplate",r,n),s=N.useCallback(i=>t(i?`${i}:00`:void 0),[t]);return c.jsx(a,{type:"time",...e,onChange:s})}function gbe(e){const{options:t,registry:n}=e,r=pt("BaseInputTemplate",n,t);return c.jsx(r,{type:"url",...e})}function ybe(e){const{options:t,registry:n}=e,r=pt("BaseInputTemplate",n,t);return c.jsx(r,{type:"number",...e})}function vbe(){return{AltDateWidget:Kxe,AltDateTimeWidget:Yxe,CheckboxWidget:Xxe,CheckboxesWidget:Zxe,ColorWidget:Qxe,DateWidget:Jxe,DateTimeWidget:ebe,EmailWidget:tbe,FileWidget:lbe,HiddenWidget:cbe,PasswordWidget:ube,RadioWidget:dbe,RangeWidget:fbe,SelectWidget:hbe,TextWidget:pbe,TextareaWidget:_U,TimeWidget:mbe,UpDownWidget:ybe,URLWidget:gbe}}function xbe(){return{fields:wxe(),templates:Vxe(),widgets:vbe(),rootSchema:{},formContext:{},translateString:wve}}class bbe extends N.Component{constructor(n){super(n);ft(this,"formElement");ft(this,"getUsedFormData",(n,r)=>{if(r.length===0&&typeof n!="object")return n;const a=T3(n,r);return Array.isArray(n)?Object.keys(a).map(s=>a[s]):a});ft(this,"getFieldNames",(n,r)=>{const a=(s,i=[],l=[[]])=>(Object.keys(s).forEach(d=>{if(typeof s[d]=="object"){const f=l.map(h=>[...h,d]);s[d][F2]&&s[d][kg]!==""?i.push(s[d][kg]):a(s[d],i,f)}else d===kg&&s[d]!==""&&l.forEach(f=>{const h=Oe(r,f);(typeof h!="object"||Kc(h)||Array.isArray(h)&&h.every(p=>typeof p!="object"))&&i.push(f)})}),i);return a(n)});ft(this,"omitExtraData",n=>{const{schema:r,schemaUtils:a}=this.state,s=a.retrieveSchema(r,n),i=a.toPathSchema(s,"",n),l=this.getFieldNames(i,n);return this.getUsedFormData(n,l)});ft(this,"onChange",(n,r,a)=>{const{extraErrors:s,omitExtraData:i,liveOmit:l,noValidate:d,liveValidate:f,onChange:h}=this.props,{schemaUtils:p,schema:g}=this.state;let y=this.state.retrievedSchema;if(ot(n)||Array.isArray(n)){const x=this.getStateFromProps(this.props,n);n=x.formData,y=x.retrievedSchema}const S=!d&&f;let w={formData:n,schema:g},b=n;if(i===!0&&l===!0&&(b=this.omitExtraData(n),w={formData:b}),S){const x=this.validate(b,g,p,y);let _=x.errors,j=x.errorSchema;const C=_,T=j;if(s){const A=Dg(x,s);j=A.errorSchema,_=A.errors}if(r){const A=this.filterErrorsBasedOnSchema(r,y,b);j=_s(j,A,"preventDuplicates")}w={formData:b,errors:_,errorSchema:j,schemaValidationErrors:C,schemaValidationErrorSchema:T}}else if(!d&&r){const x=s?_s(r,s,"preventDuplicates"):r;w={formData:b,errorSchema:x,errors:Tf(x)}}this.setState(w,()=>h&&h({...this.state,...w},a))});ft(this,"reset",()=>{const{onChange:n}=this.props,s={formData:this.getStateFromProps(this.props,void 0).formData,errorSchema:{},errors:[],schemaValidationErrors:[],schemaValidationErrorSchema:{}};this.setState(s,()=>n&&n({...this.state,...s}))});ft(this,"onBlur",(n,r)=>{const{onBlur:a}=this.props;a&&a(n,r)});ft(this,"onFocus",(n,r)=>{const{onFocus:a}=this.props;a&&a(n,r)});ft(this,"onSubmit",n=>{if(n.preventDefault(),n.target!==n.currentTarget)return;n.persist();const{omitExtraData:r,extraErrors:a,noValidate:s,onSubmit:i}=this.props;let{formData:l}=this.state;if(r===!0&&(l=this.omitExtraData(l)),s||this.validateFormWithFormData(l)){const d=a||{},f=a?Tf(a):[];this.setState({formData:l,errors:f,errorSchema:d,schemaValidationErrors:[],schemaValidationErrorSchema:{}},()=>{i&&i({...this.state,formData:l,status:"submitted"},n)})}});ft(this,"submit",()=>{if(this.formElement.current){const n=new CustomEvent("submit",{cancelable:!0});n.preventDefault(),this.formElement.current.dispatchEvent(n),this.formElement.current.requestSubmit()}});ft(this,"validateFormWithFormData",n=>{const{extraErrors:r,extraErrorsBlockSubmit:a,focusOnFirstError:s,onError:i}=this.props,{errors:l}=this.state,d=this.validate(n);let f=d.errors,h=d.errorSchema;const p=f,g=h,y=f.length>0||r&&a;if(y){if(r){const S=Dg(d,r);h=S.errorSchema,f=S.errors}s&&(typeof s=="function"?s(f[0]):this.focusOnError(f[0])),this.setState({errors:f,errorSchema:h,schemaValidationErrors:p,schemaValidationErrorSchema:g},()=>{i?i(f):console.error("Form validation failed",f)})}else l.length>0&&this.setState({errors:[],errorSchema:{},schemaValidationErrors:[],schemaValidationErrorSchema:{}});return!y});if(!n.validator)throw new Error("A validator is required for Form functionality to work");this.state=this.getStateFromProps(n,n.formData),this.props.onChange&&!Pt(this.state.formData,this.props.formData)&&this.props.onChange(this.state),this.formElement=N.createRef()}getSnapshotBeforeUpdate(n,r){if(!Pt(this.props,n)){const a=Qve(this.props.formData,n.formData),s=!Pt(n.schema,this.props.schema),i=a.length>0||!Pt(n.formData,this.props.formData),l=this.getStateFromProps(this.props,this.props.formData,s||i?void 0:this.state.retrievedSchema,s,a),d=!Pt(l,r);return{nextState:l,shouldUpdate:d}}return{shouldUpdate:!1}}componentDidUpdate(n,r,a){if(a.shouldUpdate){const{nextState:s}=a;!Pt(s.formData,this.props.formData)&&!Pt(s.formData,r.formData)&&this.props.onChange&&this.props.onChange(s),this.setState(s)}}getStateFromProps(n,r,a,s=!1,i=[]){var z;const l=this.state||{},d="schema"in n?n.schema:this.props.schema,f=("uiSchema"in n?n.uiSchema:this.props.uiSchema)||{},h=typeof r<"u",p="liveValidate"in n?n.liveValidate:this.props.liveValidate,g=h&&!n.noValidate&&p,y=d,S="experimental_defaultFormStateBehavior"in n?n.experimental_defaultFormStateBehavior:this.props.experimental_defaultFormStateBehavior,w="experimental_customMergeAllOf"in n?n.experimental_customMergeAllOf:this.props.experimental_customMergeAllOf;let b=l.schemaUtils;(!b||b.doesSchemaUtilsDiffer(n.validator,y,S,w))&&(b=vve(n.validator,y,S,w));const x=b.getDefaultFormState(d,r),_=this.updateRetrievedSchema(a??b.retrieveSchema(d,x)),j=()=>n.noValidate||s?{errors:[],errorSchema:{}}:n.liveValidate?{errors:l.errors||[],errorSchema:l.errorSchema||{}}:{errors:l.schemaValidationErrors||[],errorSchema:l.schemaValidationErrorSchema||{}};let C,T,A=l.schemaValidationErrors,k=l.schemaValidationErrorSchema;if(g){const L=this.validate(x,d,b,_);C=L.errors,a===void 0?T=L.errorSchema:T=_s((z=this.state)==null?void 0:z.errorSchema,L.errorSchema,"preventDuplicates"),A=C,k=T}else{const L=j();if(C=L.errors,T=L.errorSchema,i.length>0){const U=i.reduce((F,q)=>(F[q]=void 0,F),{});T=k=_s(L.errorSchema,U,"preventDuplicates")}}if(n.extraErrors){const L=Dg({errorSchema:T,errors:C},n.extraErrors);T=L.errorSchema,C=L.errors}const O=b.toIdSchema(_,f["ui:rootFieldId"],x,n.idPrefix,n.idSeparator);return{schemaUtils:b,schema:d,uiSchema:f,idSchema:O,formData:x,edit:h,errors:C,errorSchema:T,schemaValidationErrors:A,schemaValidationErrorSchema:k,retrievedSchema:_}}shouldComponentUpdate(n,r){return Hve(this,n,r)}getPreviousCustomValidateErrors(){const{customValidate:n,uiSchema:r}=this.props,a=this.state.formData;let s={};if(typeof n=="function"){const i=n(a,cy(a),r);s=zE(i)}return s}validate(n,r=this.props.schema,a,s){const i=a||this.state.schemaUtils,{customValidate:l,transformErrors:d,uiSchema:f}=this.props,h=s??i.retrieveSchema(r,n);return i.getValidator().validateFormData(n,h,l,d,f)}renderErrors(n){const{errors:r,errorSchema:a,schema:s,uiSchema:i}=this.state,{formContext:l}=this.props,d=at(i),f=pt("ErrorListTemplate",n,d);return r&&r.length?c.jsx(f,{errors:r,errorSchema:a||{},schema:s,uiSchema:i,formContext:l,registry:n}):null}filterErrorsBasedOnSchema(n,r,a){const{retrievedSchema:s,schemaUtils:i}=this.state,l=r??s,d=i.toPathSchema(l,"",a),f=this.getFieldNames(d,a),h=T3(n,f);(r==null?void 0:r.type)!=="object"&&(r==null?void 0:r.type)!=="array"&&(h.__errors=n.__errors);const p=this.getPreviousCustomValidateErrors(),g=(S=[],w)=>S.length===0?S:S.filter(b=>!w.includes(b)),y=(S,w={})=>(Jve(S,(b,x)=>{const _=w[x];af(b)||Array.isArray(b)&&b.length===0?delete S[x]:ot(b)&&ot(_)&&Array.isArray(_==null?void 0:_.__errors)?S[x]=g(b.__errors,_.__errors):typeof b=="object"&&!Array.isArray(b.__errors)&&y(b,w[x])}),S);return y(h,p)}updateRetrievedSchema(n){var a;return Pt(n,(a=this.state)==null?void 0:a.retrievedSchema)?this.state.retrievedSchema:n}getRegistry(){var h;const{translateString:n,uiSchema:r={}}=this.props,{schemaUtils:a}=this.state,{fields:s,templates:i,widgets:l,formContext:d,translateString:f}=xbe();return{fields:{...s,...this.props.fields},templates:{...i,...this.props.templates,ButtonTemplates:{...i.ButtonTemplates,...(h=this.props.templates)==null?void 0:h.ButtonTemplates}},widgets:{...l,...this.props.widgets},rootSchema:this.props.schema,formContext:this.props.formContext||d,schemaUtils:a,translateString:n||f,globalUiOptions:r[uue]}}focusOnError(n){const{idPrefix:r="root",idSeparator:a="_"}=this.props,{property:s}=n,i=fU(s);i[0]===""?i[0]=r:i.unshift(r);const l=i.join(a);let d=this.formElement.current.elements[l];d||(d=this.formElement.current.querySelector(`input[id^="${l}"`)),d&&d.length&&(d=d[0]),d&&d.focus()}validateForm(){const{omitExtraData:n}=this.props;let{formData:r}=this.state;return n===!0&&(r=this.omitExtraData(r)),this.validateFormWithFormData(r)}render(){const{children:n,id:r,idPrefix:a,idSeparator:s,className:i="",tagName:l,name:d,method:f,target:h,action:p,autoComplete:g,enctype:y,acceptcharset:S,acceptCharset:w,noHtml5Validate:b=!1,disabled:x,readonly:_,formContext:j,showErrorList:C="top",_internalFormWrapper:T}=this.props,{schema:A,uiSchema:k,formData:O,errorSchema:M,idSchema:z}=this.state,L=this.getRegistry(),{SchemaField:U}=L.fields,{SubmitButton:F}=L.templates.ButtonTemplates,q=T?l:void 0,V=T||l||"form";let{[ly]:P={}}=at(k);x&&(P={...P,props:{...P.props,disabled:!0}});const K={[tf]:{[ly]:P}};return c.jsxs(V,{className:i||"rjsf",id:r,name:d,method:f,target:h,action:p,autoComplete:g,encType:y,acceptCharset:w||S,noValidate:b,onSubmit:this.onSubmit,as:q,ref:this.formElement,children:[C==="top"&&this.renderErrors(L),c.jsx(U,{name:"",schema:A,uiSchema:k,errorSchema:M,idSchema:z,idPrefix:a,idSeparator:s,formContext:j,formData:O,onChange:this.onChange,onBlur:this.onBlur,onFocus:this.onFocus,registry:L,disabled:x,readonly:_}),n||c.jsx(F,{uiSchema:K,registry:L}),C==="bottom"&&this.renderErrors(L)]})}}var bm={exports:{}},PN={},gs={},Ti={},$N={},IN={},LN={},V3;function py(){return V3||(V3=1,(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.regexpCode=e.getEsmExportName=e.getProperty=e.safeStringify=e.stringify=e.strConcat=e.addCodeArg=e.str=e._=e.nil=e._Code=e.Name=e.IDENTIFIER=e._CodeOrName=void 0;class t{}e._CodeOrName=t,e.IDENTIFIER=/^[a-z$_][a-z$_0-9]*$/i;class n extends t{constructor(_){if(super(),!e.IDENTIFIER.test(_))throw new Error("CodeGen: name must be a valid identifier");this.str=_}toString(){return this.str}emptyStr(){return!1}get names(){return{[this.str]:1}}}e.Name=n;class r extends t{constructor(_){super(),this._items=typeof _=="string"?[_]:_}toString(){return this.str}emptyStr(){if(this._items.length>1)return!1;const _=this._items[0];return _===""||_==='""'}get str(){var _;return(_=this._str)!==null&&_!==void 0?_:this._str=this._items.reduce((j,C)=>`${j}${C}`,"")}get names(){var _;return(_=this._names)!==null&&_!==void 0?_:this._names=this._items.reduce((j,C)=>(C instanceof n&&(j[C.str]=(j[C.str]||0)+1),j),{})}}e._Code=r,e.nil=new r("");function a(x,..._){const j=[x[0]];let C=0;for(;C<_.length;)l(j,_[C]),j.push(x[++C]);return new r(j)}e._=a;const s=new r("+");function i(x,..._){const j=[y(x[0])];let C=0;for(;C<_.length;)j.push(s),l(j,_[C]),j.push(s,y(x[++C]));return d(j),new r(j)}e.str=i;function l(x,_){_ instanceof r?x.push(..._._items):_ instanceof n?x.push(_):x.push(p(_))}e.addCodeArg=l;function d(x){let _=1;for(;_<x.length-1;){if(x[_]===s){const j=f(x[_-1],x[_+1]);if(j!==void 0){x.splice(_-1,3,j);continue}x[_++]="+"}_++}}function f(x,_){if(_==='""')return x;if(x==='""')return _;if(typeof x=="string")return _ instanceof n||x[x.length-1]!=='"'?void 0:typeof _!="string"?`${x.slice(0,-1)}${_}"`:_[0]==='"'?x.slice(0,-1)+_.slice(1):void 0;if(typeof _=="string"&&_[0]==='"'&&!(x instanceof n))return`"${x}${_.slice(1)}`}function h(x,_){return _.emptyStr()?x:x.emptyStr()?_:i`${x}${_}`}e.strConcat=h;function p(x){return typeof x=="number"||typeof x=="boolean"||x===null?x:y(Array.isArray(x)?x.join(","):x)}function g(x){return new r(y(x))}e.stringify=g;function y(x){return JSON.stringify(x).replace(/\u2028/g,"\\u2028").replace(/\u2029/g,"\\u2029")}e.safeStringify=y;function S(x){return typeof x=="string"&&e.IDENTIFIER.test(x)?new r(`.${x}`):a`[${x}]`}e.getProperty=S;function w(x){if(typeof x=="string"&&e.IDENTIFIER.test(x))return new r(`${x}`);throw new Error(`CodeGen: invalid export name: ${x}, use explicit $id name mapping`)}e.getEsmExportName=w;function b(x){return new r(x.toString())}e.regexpCode=b})(LN)),LN}var zN={},W3;function G3(){return W3||(W3=1,(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.ValueScope=e.ValueScopeName=e.Scope=e.varKinds=e.UsedValueState=void 0;const t=py();class n extends Error{constructor(f){super(`CodeGen: "code" for ${f} not defined`),this.value=f.value}}var r;(function(d){d[d.Started=0]="Started",d[d.Completed=1]="Completed"})(r||(e.UsedValueState=r={})),e.varKinds={const:new t.Name("const"),let:new t.Name("let"),var:new t.Name("var")};class a{constructor({prefixes:f,parent:h}={}){this._names={},this._prefixes=f,this._parent=h}toName(f){return f instanceof t.Name?f:this.name(f)}name(f){return new t.Name(this._newName(f))}_newName(f){const h=this._names[f]||this._nameGroup(f);return`${f}${h.index++}`}_nameGroup(f){var h,p;if(!((p=(h=this._parent)===null||h===void 0?void 0:h._prefixes)===null||p===void 0)&&p.has(f)||this._prefixes&&!this._prefixes.has(f))throw new Error(`CodeGen: prefix "${f}" is not allowed in this scope`);return this._names[f]={prefix:f,index:0}}}e.Scope=a;class s extends t.Name{constructor(f,h){super(h),this.prefix=f}setValue(f,{property:h,itemIndex:p}){this.value=f,this.scopePath=(0,t._)`.${new t.Name(h)}[${p}]`}}e.ValueScopeName=s;const i=(0,t._)`\n`;class l extends a{constructor(f){super(f),this._values={},this._scope=f.scope,this.opts={...f,_n:f.lines?i:t.nil}}get(){return this._scope}name(f){return new s(f,this._newName(f))}value(f,h){var p;if(h.ref===void 0)throw new Error("CodeGen: ref must be passed in value");const g=this.toName(f),{prefix:y}=g,S=(p=h.key)!==null&&p!==void 0?p:h.ref;let w=this._values[y];if(w){const _=w.get(S);if(_)return _}else w=this._values[y]=new Map;w.set(S,g);const b=this._scope[y]||(this._scope[y]=[]),x=b.length;return b[x]=h.ref,g.setValue(h,{property:y,itemIndex:x}),g}getValue(f,h){const p=this._values[f];if(p)return p.get(h)}scopeRefs(f,h=this._values){return this._reduceValues(h,p=>{if(p.scopePath===void 0)throw new Error(`CodeGen: name "${p}" has no value`);return(0,t._)`${f}${p.scopePath}`})}scopeCode(f=this._values,h,p){return this._reduceValues(f,g=>{if(g.value===void 0)throw new Error(`CodeGen: name "${g}" has no value`);return g.value.code},h,p)}_reduceValues(f,h,p={},g){let y=t.nil;for(const S in f){const w=f[S];if(!w)continue;const b=p[S]=p[S]||new Map;w.forEach(x=>{if(b.has(x))return;b.set(x,r.Started);let _=h(x);if(_){const j=this.opts.es5?e.varKinds.var:e.varKinds.const;y=(0,t._)`${y}${j} ${x} = ${_};${this.opts._n}`}else if(_=g==null?void 0:g(x))y=(0,t._)`${y}${_}${this.opts._n}`;else throw new n(x);b.set(x,r.Completed)})}return y}}e.ValueScope=l})(zN)),zN}var K3;function Ye(){return K3||(K3=1,(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.or=e.and=e.not=e.CodeGen=e.operators=e.varKinds=e.ValueScopeName=e.ValueScope=e.Scope=e.Name=e.regexpCode=e.stringify=e.getProperty=e.nil=e.strConcat=e.str=e._=void 0;const t=py(),n=G3();var r=py();Object.defineProperty(e,"_",{enumerable:!0,get:function(){return r._}}),Object.defineProperty(e,"str",{enumerable:!0,get:function(){return r.str}}),Object.defineProperty(e,"strConcat",{enumerable:!0,get:function(){return r.strConcat}}),Object.defineProperty(e,"nil",{enumerable:!0,get:function(){return r.nil}}),Object.defineProperty(e,"getProperty",{enumerable:!0,get:function(){return r.getProperty}}),Object.defineProperty(e,"stringify",{enumerable:!0,get:function(){return r.stringify}}),Object.defineProperty(e,"regexpCode",{enumerable:!0,get:function(){return r.regexpCode}}),Object.defineProperty(e,"Name",{enumerable:!0,get:function(){return r.Name}});var a=G3();Object.defineProperty(e,"Scope",{enumerable:!0,get:function(){return a.Scope}}),Object.defineProperty(e,"ValueScope",{enumerable:!0,get:function(){return a.ValueScope}}),Object.defineProperty(e,"ValueScopeName",{enumerable:!0,get:function(){return a.ValueScopeName}}),Object.defineProperty(e,"varKinds",{enumerable:!0,get:function(){return a.varKinds}}),e.operators={GT:new t._Code(">"),GTE:new t._Code(">="),LT:new t._Code("<"),LTE:new t._Code("<="),EQ:new t._Code("==="),NEQ:new t._Code("!=="),NOT:new t._Code("!"),OR:new t._Code("||"),AND:new t._Code("&&"),ADD:new t._Code("+")};class s{optimizeNodes(){return this}optimizeNames($,G){return this}}class i extends s{constructor($,G,ee){super(),this.varKind=$,this.name=G,this.rhs=ee}render({es5:$,_n:G}){const ee=$?n.varKinds.var:this.varKind,re=this.rhs===void 0?"":` = ${this.rhs}`;return`${ee} ${this.name}${re};`+G}optimizeNames($,G){if($[this.name.str])return this.rhs&&(this.rhs=q(this.rhs,$,G)),this}get names(){return this.rhs instanceof t._CodeOrName?this.rhs.names:{}}}class l extends s{constructor($,G,ee){super(),this.lhs=$,this.rhs=G,this.sideEffects=ee}render({_n:$}){return`${this.lhs} = ${this.rhs};`+$}optimizeNames($,G){if(!(this.lhs instanceof t.Name&&!$[this.lhs.str]&&!this.sideEffects))return this.rhs=q(this.rhs,$,G),this}get names(){const $=this.lhs instanceof t.Name?{}:{...this.lhs.names};return F($,this.rhs)}}class d extends l{constructor($,G,ee,re){super($,ee,re),this.op=G}render({_n:$}){return`${this.lhs} ${this.op}= ${this.rhs};`+$}}class f extends s{constructor($){super(),this.label=$,this.names={}}render({_n:$}){return`${this.label}:`+$}}class h extends s{constructor($){super(),this.label=$,this.names={}}render({_n:$}){return`break${this.label?` ${this.label}`:""};`+$}}class p extends s{constructor($){super(),this.error=$}render({_n:$}){return`throw ${this.error};`+$}get names(){return this.error.names}}class g extends s{constructor($){super(),this.code=$}render({_n:$}){return`${this.code};`+$}optimizeNodes(){return`${this.code}`?this:void 0}optimizeNames($,G){return this.code=q(this.code,$,G),this}get names(){return this.code instanceof t._CodeOrName?this.code.names:{}}}class y extends s{constructor($=[]){super(),this.nodes=$}render($){return this.nodes.reduce((G,ee)=>G+ee.render($),"")}optimizeNodes(){const{nodes:$}=this;let G=$.length;for(;G--;){const ee=$[G].optimizeNodes();Array.isArray(ee)?$.splice(G,1,...ee):ee?$[G]=ee:$.splice(G,1)}return $.length>0?this:void 0}optimizeNames($,G){const{nodes:ee}=this;let re=ee.length;for(;re--;){const ne=ee[re];ne.optimizeNames($,G)||(V($,ne.names),ee.splice(re,1))}return ee.length>0?this:void 0}get names(){return this.nodes.reduce(($,G)=>U($,G.names),{})}}class S extends y{render($){return"{"+$._n+super.render($)+"}"+$._n}}class w extends y{}class b extends S{}b.kind="else";class x extends S{constructor($,G){super(G),this.condition=$}render($){let G=`if(${this.condition})`+super.render($);return this.else&&(G+="else "+this.else.render($)),G}optimizeNodes(){super.optimizeNodes();const $=this.condition;if($===!0)return this.nodes;let G=this.else;if(G){const ee=G.optimizeNodes();G=this.else=Array.isArray(ee)?new b(ee):ee}if(G)return $===!1?G instanceof x?G:G.nodes:this.nodes.length?this:new x(P($),G instanceof x?[G]:G.nodes);if(!($===!1||!this.nodes.length))return this}optimizeNames($,G){var ee;if(this.else=(ee=this.else)===null||ee===void 0?void 0:ee.optimizeNames($,G),!!(super.optimizeNames($,G)||this.else))return this.condition=q(this.condition,$,G),this}get names(){const $=super.names;return F($,this.condition),this.else&&U($,this.else.names),$}}x.kind="if";class _ extends S{}_.kind="for";class j extends _{constructor($){super(),this.iteration=$}render($){return`for(${this.iteration})`+super.render($)}optimizeNames($,G){if(super.optimizeNames($,G))return this.iteration=q(this.iteration,$,G),this}get names(){return U(super.names,this.iteration.names)}}class C extends _{constructor($,G,ee,re){super(),this.varKind=$,this.name=G,this.from=ee,this.to=re}render($){const G=$.es5?n.varKinds.var:this.varKind,{name:ee,from:re,to:ne}=this;return`for(${G} ${ee}=${re}; ${ee}<${ne}; ${ee}++)`+super.render($)}get names(){const $=F(super.names,this.from);return F($,this.to)}}class T extends _{constructor($,G,ee,re){super(),this.loop=$,this.varKind=G,this.name=ee,this.iterable=re}render($){return`for(${this.varKind} ${this.name} ${this.loop} ${this.iterable})`+super.render($)}optimizeNames($,G){if(super.optimizeNames($,G))return this.iterable=q(this.iterable,$,G),this}get names(){return U(super.names,this.iterable.names)}}class A extends S{constructor($,G,ee){super(),this.name=$,this.args=G,this.async=ee}render($){return`${this.async?"async ":""}function ${this.name}(${this.args})`+super.render($)}}A.kind="func";class k extends y{render($){return"return "+super.render($)}}k.kind="return";class O extends S{render($){let G="try"+super.render($);return this.catch&&(G+=this.catch.render($)),this.finally&&(G+=this.finally.render($)),G}optimizeNodes(){var $,G;return super.optimizeNodes(),($=this.catch)===null||$===void 0||$.optimizeNodes(),(G=this.finally)===null||G===void 0||G.optimizeNodes(),this}optimizeNames($,G){var ee,re;return super.optimizeNames($,G),(ee=this.catch)===null||ee===void 0||ee.optimizeNames($,G),(re=this.finally)===null||re===void 0||re.optimizeNames($,G),this}get names(){const $=super.names;return this.catch&&U($,this.catch.names),this.finally&&U($,this.finally.names),$}}class M extends S{constructor($){super(),this.error=$}render($){return`catch(${this.error})`+super.render($)}}M.kind="catch";class z extends S{render($){return"finally"+super.render($)}}z.kind="finally";class L{constructor($,G={}){this._values={},this._blockStarts=[],this._constants={},this.opts={...G,_n:G.lines?`
|
|
738
|
+
`:""},this._extScope=$,this._scope=new n.Scope({parent:$}),this._nodes=[new w]}toString(){return this._root.render(this.opts)}name($){return this._scope.name($)}scopeName($){return this._extScope.name($)}scopeValue($,G){const ee=this._extScope.value($,G);return(this._values[ee.prefix]||(this._values[ee.prefix]=new Set)).add(ee),ee}getScopeValue($,G){return this._extScope.getValue($,G)}scopeRefs($){return this._extScope.scopeRefs($,this._values)}scopeCode(){return this._extScope.scopeCode(this._values)}_def($,G,ee,re){const ne=this._scope.toName(G);return ee!==void 0&&re&&(this._constants[ne.str]=ee),this._leafNode(new i($,ne,ee)),ne}const($,G,ee){return this._def(n.varKinds.const,$,G,ee)}let($,G,ee){return this._def(n.varKinds.let,$,G,ee)}var($,G,ee){return this._def(n.varKinds.var,$,G,ee)}assign($,G,ee){return this._leafNode(new l($,G,ee))}add($,G){return this._leafNode(new d($,e.operators.ADD,G))}code($){return typeof $=="function"?$():$!==t.nil&&this._leafNode(new g($)),this}object(...$){const G=["{"];for(const[ee,re]of $)G.length>1&&G.push(","),G.push(ee),(ee!==re||this.opts.es5)&&(G.push(":"),(0,t.addCodeArg)(G,re));return G.push("}"),new t._Code(G)}if($,G,ee){if(this._blockNode(new x($)),G&&ee)this.code(G).else().code(ee).endIf();else if(G)this.code(G).endIf();else if(ee)throw new Error('CodeGen: "else" body without "then" body');return this}elseIf($){return this._elseNode(new x($))}else(){return this._elseNode(new b)}endIf(){return this._endBlockNode(x,b)}_for($,G){return this._blockNode($),G&&this.code(G).endFor(),this}for($,G){return this._for(new j($),G)}forRange($,G,ee,re,ne=this.opts.es5?n.varKinds.var:n.varKinds.let){const Q=this._scope.toName($);return this._for(new C(ne,Q,G,ee),()=>re(Q))}forOf($,G,ee,re=n.varKinds.const){const ne=this._scope.toName($);if(this.opts.es5){const Q=G instanceof t.Name?G:this.var("_arr",G);return this.forRange("_i",0,(0,t._)`${Q}.length`,ae=>{this.var(ne,(0,t._)`${Q}[${ae}]`),ee(ne)})}return this._for(new T("of",re,ne,G),()=>ee(ne))}forIn($,G,ee,re=this.opts.es5?n.varKinds.var:n.varKinds.const){if(this.opts.ownProperties)return this.forOf($,(0,t._)`Object.keys(${G})`,ee);const ne=this._scope.toName($);return this._for(new T("in",re,ne,G),()=>ee(ne))}endFor(){return this._endBlockNode(_)}label($){return this._leafNode(new f($))}break($){return this._leafNode(new h($))}return($){const G=new k;if(this._blockNode(G),this.code($),G.nodes.length!==1)throw new Error('CodeGen: "return" should have one node');return this._endBlockNode(k)}try($,G,ee){if(!G&&!ee)throw new Error('CodeGen: "try" without "catch" and "finally"');const re=new O;if(this._blockNode(re),this.code($),G){const ne=this.name("e");this._currNode=re.catch=new M(ne),G(ne)}return ee&&(this._currNode=re.finally=new z,this.code(ee)),this._endBlockNode(M,z)}throw($){return this._leafNode(new p($))}block($,G){return this._blockStarts.push(this._nodes.length),$&&this.code($).endBlock(G),this}endBlock($){const G=this._blockStarts.pop();if(G===void 0)throw new Error("CodeGen: not in self-balancing block");const ee=this._nodes.length-G;if(ee<0||$!==void 0&&ee!==$)throw new Error(`CodeGen: wrong number of nodes: ${ee} vs ${$} expected`);return this._nodes.length=G,this}func($,G=t.nil,ee,re){return this._blockNode(new A($,G,ee)),re&&this.code(re).endFunc(),this}endFunc(){return this._endBlockNode(A)}optimize($=1){for(;$-- >0;)this._root.optimizeNodes(),this._root.optimizeNames(this._root.names,this._constants)}_leafNode($){return this._currNode.nodes.push($),this}_blockNode($){this._currNode.nodes.push($),this._nodes.push($)}_endBlockNode($,G){const ee=this._currNode;if(ee instanceof $||G&&ee instanceof G)return this._nodes.pop(),this;throw new Error(`CodeGen: not in block "${G?`${$.kind}/${G.kind}`:$.kind}"`)}_elseNode($){const G=this._currNode;if(!(G instanceof x))throw new Error('CodeGen: "else" without "if"');return this._currNode=G.else=$,this}get _root(){return this._nodes[0]}get _currNode(){const $=this._nodes;return $[$.length-1]}set _currNode($){const G=this._nodes;G[G.length-1]=$}}e.CodeGen=L;function U(B,$){for(const G in $)B[G]=(B[G]||0)+($[G]||0);return B}function F(B,$){return $ instanceof t._CodeOrName?U(B,$.names):B}function q(B,$,G){if(B instanceof t.Name)return ee(B);if(!re(B))return B;return new t._Code(B._items.reduce((ne,Q)=>(Q instanceof t.Name&&(Q=ee(Q)),Q instanceof t._Code?ne.push(...Q._items):ne.push(Q),ne),[]));function ee(ne){const Q=G[ne.str];return Q===void 0||$[ne.str]!==1?ne:(delete $[ne.str],Q)}function re(ne){return ne instanceof t._Code&&ne._items.some(Q=>Q instanceof t.Name&&$[Q.str]===1&&G[Q.str]!==void 0)}}function V(B,$){for(const G in $)B[G]=(B[G]||0)-($[G]||0)}function P(B){return typeof B=="boolean"||typeof B=="number"||B===null?!B:(0,t._)`!${W(B)}`}e.not=P;const K=D(e.operators.AND);function H(...B){return B.reduce(K)}e.and=H;const Z=D(e.operators.OR);function J(...B){return B.reduce(Z)}e.or=J;function D(B){return($,G)=>$===t.nil?G:G===t.nil?$:(0,t._)`${W($)} ${B} ${W(G)}`}function W(B){return B instanceof t.Name?B:(0,t._)`(${B})`}})(IN)),IN}var Ge={},Y3;function ct(){if(Y3)return Ge;Y3=1,Object.defineProperty(Ge,"__esModule",{value:!0}),Ge.checkStrictMode=Ge.getErrorPath=Ge.Type=Ge.useFunc=Ge.setEvaluated=Ge.evaluatedPropsToName=Ge.mergeEvaluated=Ge.eachItem=Ge.unescapeJsonPointer=Ge.escapeJsonPointer=Ge.escapeFragment=Ge.unescapeFragment=Ge.schemaRefOrVal=Ge.schemaHasRulesButRef=Ge.schemaHasRules=Ge.checkUnknownRules=Ge.alwaysValidSchema=Ge.toHash=void 0;const e=Ye(),t=py();function n(T){const A={};for(const k of T)A[k]=!0;return A}Ge.toHash=n;function r(T,A){return typeof A=="boolean"?A:Object.keys(A).length===0?!0:(a(T,A),!s(A,T.self.RULES.all))}Ge.alwaysValidSchema=r;function a(T,A=T.schema){const{opts:k,self:O}=T;if(!k.strictSchema||typeof A=="boolean")return;const M=O.RULES.keywords;for(const z in A)M[z]||C(T,`unknown keyword: "${z}"`)}Ge.checkUnknownRules=a;function s(T,A){if(typeof T=="boolean")return!T;for(const k in T)if(A[k])return!0;return!1}Ge.schemaHasRules=s;function i(T,A){if(typeof T=="boolean")return!T;for(const k in T)if(k!=="$ref"&&A.all[k])return!0;return!1}Ge.schemaHasRulesButRef=i;function l({topSchemaRef:T,schemaPath:A},k,O,M){if(!M){if(typeof k=="number"||typeof k=="boolean")return k;if(typeof k=="string")return(0,e._)`${k}`}return(0,e._)`${T}${A}${(0,e.getProperty)(O)}`}Ge.schemaRefOrVal=l;function d(T){return p(decodeURIComponent(T))}Ge.unescapeFragment=d;function f(T){return encodeURIComponent(h(T))}Ge.escapeFragment=f;function h(T){return typeof T=="number"?`${T}`:T.replace(/~/g,"~0").replace(/\//g,"~1")}Ge.escapeJsonPointer=h;function p(T){return T.replace(/~1/g,"/").replace(/~0/g,"~")}Ge.unescapeJsonPointer=p;function g(T,A){if(Array.isArray(T))for(const k of T)A(k);else A(T)}Ge.eachItem=g;function y({mergeNames:T,mergeToName:A,mergeValues:k,resultToName:O}){return(M,z,L,U)=>{const F=L===void 0?z:L instanceof e.Name?(z instanceof e.Name?T(M,z,L):A(M,z,L),L):z instanceof e.Name?(A(M,L,z),z):k(z,L);return U===e.Name&&!(F instanceof e.Name)?O(M,F):F}}Ge.mergeEvaluated={props:y({mergeNames:(T,A,k)=>T.if((0,e._)`${k} !== true && ${A} !== undefined`,()=>{T.if((0,e._)`${A} === true`,()=>T.assign(k,!0),()=>T.assign(k,(0,e._)`${k} || {}`).code((0,e._)`Object.assign(${k}, ${A})`))}),mergeToName:(T,A,k)=>T.if((0,e._)`${k} !== true`,()=>{A===!0?T.assign(k,!0):(T.assign(k,(0,e._)`${k} || {}`),w(T,k,A))}),mergeValues:(T,A)=>T===!0?!0:{...T,...A},resultToName:S}),items:y({mergeNames:(T,A,k)=>T.if((0,e._)`${k} !== true && ${A} !== undefined`,()=>T.assign(k,(0,e._)`${A} === true ? true : ${k} > ${A} ? ${k} : ${A}`)),mergeToName:(T,A,k)=>T.if((0,e._)`${k} !== true`,()=>T.assign(k,A===!0?!0:(0,e._)`${k} > ${A} ? ${k} : ${A}`)),mergeValues:(T,A)=>T===!0?!0:Math.max(T,A),resultToName:(T,A)=>T.var("items",A)})};function S(T,A){if(A===!0)return T.var("props",!0);const k=T.var("props",(0,e._)`{}`);return A!==void 0&&w(T,k,A),k}Ge.evaluatedPropsToName=S;function w(T,A,k){Object.keys(k).forEach(O=>T.assign((0,e._)`${A}${(0,e.getProperty)(O)}`,!0))}Ge.setEvaluated=w;const b={};function x(T,A){return T.scopeValue("func",{ref:A,code:b[A.code]||(b[A.code]=new t._Code(A.code))})}Ge.useFunc=x;var _;(function(T){T[T.Num=0]="Num",T[T.Str=1]="Str"})(_||(Ge.Type=_={}));function j(T,A,k){if(T instanceof e.Name){const O=A===_.Num;return k?O?(0,e._)`"[" + ${T} + "]"`:(0,e._)`"['" + ${T} + "']"`:O?(0,e._)`"/" + ${T}`:(0,e._)`"/" + ${T}.replace(/~/g, "~0").replace(/\\//g, "~1")`}return k?(0,e.getProperty)(T).toString():"/"+h(T)}Ge.getErrorPath=j;function C(T,A,k=T.opts.strictSchema){if(k){if(A=`strict mode: ${A}`,k===!0)throw new Error(A);T.self.logger.warn(A)}}return Ge.checkStrictMode=C,Ge}var wm={},X3;function ai(){if(X3)return wm;X3=1,Object.defineProperty(wm,"__esModule",{value:!0});const e=Ye(),t={data:new e.Name("data"),valCxt:new e.Name("valCxt"),instancePath:new e.Name("instancePath"),parentData:new e.Name("parentData"),parentDataProperty:new e.Name("parentDataProperty"),rootData:new e.Name("rootData"),dynamicAnchors:new e.Name("dynamicAnchors"),vErrors:new e.Name("vErrors"),errors:new e.Name("errors"),this:new e.Name("this"),self:new e.Name("self"),scope:new e.Name("scope"),json:new e.Name("json"),jsonPos:new e.Name("jsonPos"),jsonLen:new e.Name("jsonLen"),jsonPart:new e.Name("jsonPart")};return wm.default=t,wm}var Z3;function Yv(){return Z3||(Z3=1,(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.extendErrors=e.resetErrorsCount=e.reportExtraError=e.reportError=e.keyword$DataError=e.keywordError=void 0;const t=Ye(),n=ct(),r=ai();e.keywordError={message:({keyword:b})=>(0,t.str)`must pass "${b}" keyword validation`},e.keyword$DataError={message:({keyword:b,schemaType:x})=>x?(0,t.str)`"${b}" keyword must be ${x} ($data)`:(0,t.str)`"${b}" keyword is invalid ($data)`};function a(b,x=e.keywordError,_,j){const{it:C}=b,{gen:T,compositeRule:A,allErrors:k}=C,O=p(b,x,_);j??(A||k)?d(T,O):f(C,(0,t._)`[${O}]`)}e.reportError=a;function s(b,x=e.keywordError,_){const{it:j}=b,{gen:C,compositeRule:T,allErrors:A}=j,k=p(b,x,_);d(C,k),T||A||f(j,r.default.vErrors)}e.reportExtraError=s;function i(b,x){b.assign(r.default.errors,x),b.if((0,t._)`${r.default.vErrors} !== null`,()=>b.if(x,()=>b.assign((0,t._)`${r.default.vErrors}.length`,x),()=>b.assign(r.default.vErrors,null)))}e.resetErrorsCount=i;function l({gen:b,keyword:x,schemaValue:_,data:j,errsCount:C,it:T}){if(C===void 0)throw new Error("ajv implementation error");const A=b.name("err");b.forRange("i",C,r.default.errors,k=>{b.const(A,(0,t._)`${r.default.vErrors}[${k}]`),b.if((0,t._)`${A}.instancePath === undefined`,()=>b.assign((0,t._)`${A}.instancePath`,(0,t.strConcat)(r.default.instancePath,T.errorPath))),b.assign((0,t._)`${A}.schemaPath`,(0,t.str)`${T.errSchemaPath}/${x}`),T.opts.verbose&&(b.assign((0,t._)`${A}.schema`,_),b.assign((0,t._)`${A}.data`,j))})}e.extendErrors=l;function d(b,x){const _=b.const("err",x);b.if((0,t._)`${r.default.vErrors} === null`,()=>b.assign(r.default.vErrors,(0,t._)`[${_}]`),(0,t._)`${r.default.vErrors}.push(${_})`),b.code((0,t._)`${r.default.errors}++`)}function f(b,x){const{gen:_,validateName:j,schemaEnv:C}=b;C.$async?_.throw((0,t._)`new ${b.ValidationError}(${x})`):(_.assign((0,t._)`${j}.errors`,x),_.return(!1))}const h={keyword:new t.Name("keyword"),schemaPath:new t.Name("schemaPath"),params:new t.Name("params"),propertyName:new t.Name("propertyName"),message:new t.Name("message"),schema:new t.Name("schema"),parentSchema:new t.Name("parentSchema")};function p(b,x,_){const{createErrors:j}=b.it;return j===!1?(0,t._)`{}`:g(b,x,_)}function g(b,x,_={}){const{gen:j,it:C}=b,T=[y(C,_),S(b,_)];return w(b,x,T),j.object(...T)}function y({errorPath:b},{instancePath:x}){const _=x?(0,t.str)`${b}${(0,n.getErrorPath)(x,n.Type.Str)}`:b;return[r.default.instancePath,(0,t.strConcat)(r.default.instancePath,_)]}function S({keyword:b,it:{errSchemaPath:x}},{schemaPath:_,parentSchema:j}){let C=j?x:(0,t.str)`${x}/${b}`;return _&&(C=(0,t.str)`${C}${(0,n.getErrorPath)(_,n.Type.Str)}`),[h.schemaPath,C]}function w(b,{params:x,message:_},j){const{keyword:C,data:T,schemaValue:A,it:k}=b,{opts:O,propertyName:M,topSchemaRef:z,schemaPath:L}=k;j.push([h.keyword,C],[h.params,typeof x=="function"?x(b):x||(0,t._)`{}`]),O.messages&&j.push([h.message,typeof _=="function"?_(b):_]),O.verbose&&j.push([h.schema,A],[h.parentSchema,(0,t._)`${z}${L}`],[r.default.data,T]),M&&j.push([h.propertyName,M])}})($N)),$N}var Q3;function wbe(){if(Q3)return Ti;Q3=1,Object.defineProperty(Ti,"__esModule",{value:!0}),Ti.boolOrEmptySchema=Ti.topBoolOrEmptySchema=void 0;const e=Yv(),t=Ye(),n=ai(),r={message:"boolean schema is false"};function a(l){const{gen:d,schema:f,validateName:h}=l;f===!1?i(l,!1):typeof f=="object"&&f.$async===!0?d.return(n.default.data):(d.assign((0,t._)`${h}.errors`,null),d.return(!0))}Ti.topBoolOrEmptySchema=a;function s(l,d){const{gen:f,schema:h}=l;h===!1?(f.var(d,!1),i(l)):f.var(d,!0)}Ti.boolOrEmptySchema=s;function i(l,d){const{gen:f,data:h}=l,p={gen:f,keyword:"false schema",data:h,schema:!1,schemaCode:!1,schemaValue:!1,params:{},it:l};(0,e.reportError)(p,r,void 0,d)}return Ti}var En={},Ai={},J3;function NU(){if(J3)return Ai;J3=1,Object.defineProperty(Ai,"__esModule",{value:!0}),Ai.getRules=Ai.isJSONType=void 0;const e=["string","number","integer","boolean","null","object","array"],t=new Set(e);function n(a){return typeof a=="string"&&t.has(a)}Ai.isJSONType=n;function r(){const a={number:{type:"number",rules:[]},string:{type:"string",rules:[]},array:{type:"array",rules:[]},object:{type:"object",rules:[]}};return{types:{...a,integer:!0,boolean:!0,null:!0},rules:[{rules:[]},a.number,a.string,a.array,a.object],post:{rules:[]},all:{},keywords:{}}}return Ai.getRules=r,Ai}var ys={},e5;function jU(){if(e5)return ys;e5=1,Object.defineProperty(ys,"__esModule",{value:!0}),ys.shouldUseRule=ys.shouldUseGroup=ys.schemaHasRulesForType=void 0;function e({schema:r,self:a},s){const i=a.RULES.types[s];return i&&i!==!0&&t(r,i)}ys.schemaHasRulesForType=e;function t(r,a){return a.rules.some(s=>n(r,s))}ys.shouldUseGroup=t;function n(r,a){var s;return r[a.keyword]!==void 0||((s=a.definition.implements)===null||s===void 0?void 0:s.some(i=>r[i]!==void 0))}return ys.shouldUseRule=n,ys}var t5;function my(){if(t5)return En;t5=1,Object.defineProperty(En,"__esModule",{value:!0}),En.reportTypeError=En.checkDataTypes=En.checkDataType=En.coerceAndCheckDataType=En.getJSONTypes=En.getSchemaTypes=En.DataType=void 0;const e=NU(),t=jU(),n=Yv(),r=Ye(),a=ct();var s;(function(_){_[_.Correct=0]="Correct",_[_.Wrong=1]="Wrong"})(s||(En.DataType=s={}));function i(_){const j=l(_.type);if(j.includes("null")){if(_.nullable===!1)throw new Error("type: null contradicts nullable: false")}else{if(!j.length&&_.nullable!==void 0)throw new Error('"nullable" cannot be used without "type"');_.nullable===!0&&j.push("null")}return j}En.getSchemaTypes=i;function l(_){const j=Array.isArray(_)?_:_?[_]:[];if(j.every(e.isJSONType))return j;throw new Error("type must be JSONType or JSONType[]: "+j.join(","))}En.getJSONTypes=l;function d(_,j){const{gen:C,data:T,opts:A}=_,k=h(j,A.coerceTypes),O=j.length>0&&!(k.length===0&&j.length===1&&(0,t.schemaHasRulesForType)(_,j[0]));if(O){const M=S(j,T,A.strictNumbers,s.Wrong);C.if(M,()=>{k.length?p(_,j,k):b(_)})}return O}En.coerceAndCheckDataType=d;const f=new Set(["string","number","integer","boolean","null"]);function h(_,j){return j?_.filter(C=>f.has(C)||j==="array"&&C==="array"):[]}function p(_,j,C){const{gen:T,data:A,opts:k}=_,O=T.let("dataType",(0,r._)`typeof ${A}`),M=T.let("coerced",(0,r._)`undefined`);k.coerceTypes==="array"&&T.if((0,r._)`${O} == 'object' && Array.isArray(${A}) && ${A}.length == 1`,()=>T.assign(A,(0,r._)`${A}[0]`).assign(O,(0,r._)`typeof ${A}`).if(S(j,A,k.strictNumbers),()=>T.assign(M,A))),T.if((0,r._)`${M} !== undefined`);for(const L of C)(f.has(L)||L==="array"&&k.coerceTypes==="array")&&z(L);T.else(),b(_),T.endIf(),T.if((0,r._)`${M} !== undefined`,()=>{T.assign(A,M),g(_,M)});function z(L){switch(L){case"string":T.elseIf((0,r._)`${O} == "number" || ${O} == "boolean"`).assign(M,(0,r._)`"" + ${A}`).elseIf((0,r._)`${A} === null`).assign(M,(0,r._)`""`);return;case"number":T.elseIf((0,r._)`${O} == "boolean" || ${A} === null
|
|
739
|
+
|| (${O} == "string" && ${A} && ${A} == +${A})`).assign(M,(0,r._)`+${A}`);return;case"integer":T.elseIf((0,r._)`${O} === "boolean" || ${A} === null
|
|
740
|
+
|| (${O} === "string" && ${A} && ${A} == +${A} && !(${A} % 1))`).assign(M,(0,r._)`+${A}`);return;case"boolean":T.elseIf((0,r._)`${A} === "false" || ${A} === 0 || ${A} === null`).assign(M,!1).elseIf((0,r._)`${A} === "true" || ${A} === 1`).assign(M,!0);return;case"null":T.elseIf((0,r._)`${A} === "" || ${A} === 0 || ${A} === false`),T.assign(M,null);return;case"array":T.elseIf((0,r._)`${O} === "string" || ${O} === "number"
|
|
741
|
+
|| ${O} === "boolean" || ${A} === null`).assign(M,(0,r._)`[${A}]`)}}}function g({gen:_,parentData:j,parentDataProperty:C},T){_.if((0,r._)`${j} !== undefined`,()=>_.assign((0,r._)`${j}[${C}]`,T))}function y(_,j,C,T=s.Correct){const A=T===s.Correct?r.operators.EQ:r.operators.NEQ;let k;switch(_){case"null":return(0,r._)`${j} ${A} null`;case"array":k=(0,r._)`Array.isArray(${j})`;break;case"object":k=(0,r._)`${j} && typeof ${j} == "object" && !Array.isArray(${j})`;break;case"integer":k=O((0,r._)`!(${j} % 1) && !isNaN(${j})`);break;case"number":k=O();break;default:return(0,r._)`typeof ${j} ${A} ${_}`}return T===s.Correct?k:(0,r.not)(k);function O(M=r.nil){return(0,r.and)((0,r._)`typeof ${j} == "number"`,M,C?(0,r._)`isFinite(${j})`:r.nil)}}En.checkDataType=y;function S(_,j,C,T){if(_.length===1)return y(_[0],j,C,T);let A;const k=(0,a.toHash)(_);if(k.array&&k.object){const O=(0,r._)`typeof ${j} != "object"`;A=k.null?O:(0,r._)`!${j} || ${O}`,delete k.null,delete k.array,delete k.object}else A=r.nil;k.number&&delete k.integer;for(const O in k)A=(0,r.and)(A,y(O,j,C,T));return A}En.checkDataTypes=S;const w={message:({schema:_})=>`must be ${_}`,params:({schema:_,schemaValue:j})=>typeof _=="string"?(0,r._)`{type: ${_}}`:(0,r._)`{type: ${j}}`};function b(_){const j=x(_);(0,n.reportError)(j,w)}En.reportTypeError=b;function x(_){const{gen:j,data:C,schema:T}=_,A=(0,a.schemaRefOrVal)(_,T,"type");return{gen:j,keyword:"type",data:C,schema:T.type,schemaCode:A,schemaValue:A,parentSchema:T,params:{},it:_}}return En}var kd={},n5;function Sbe(){if(n5)return kd;n5=1,Object.defineProperty(kd,"__esModule",{value:!0}),kd.assignDefaults=void 0;const e=Ye(),t=ct();function n(a,s){const{properties:i,items:l}=a.schema;if(s==="object"&&i)for(const d in i)r(a,d,i[d].default);else s==="array"&&Array.isArray(l)&&l.forEach((d,f)=>r(a,f,d.default))}kd.assignDefaults=n;function r(a,s,i){const{gen:l,compositeRule:d,data:f,opts:h}=a;if(i===void 0)return;const p=(0,e._)`${f}${(0,e.getProperty)(s)}`;if(d){(0,t.checkStrictMode)(a,`default is ignored for: ${p}`);return}let g=(0,e._)`${p} === undefined`;h.useDefaults==="empty"&&(g=(0,e._)`${g} || ${p} === null || ${p} === ""`),l.if(g,(0,e._)`${p} = ${(0,e.stringify)(i)}`)}return kd}var Xr={},vt={},r5;function fa(){if(r5)return vt;r5=1,Object.defineProperty(vt,"__esModule",{value:!0}),vt.validateUnion=vt.validateArray=vt.usePattern=vt.callValidateCode=vt.schemaProperties=vt.allSchemaProperties=vt.noPropertyInData=vt.propertyInData=vt.isOwnProperty=vt.hasPropFunc=vt.reportMissingProp=vt.checkMissingProp=vt.checkReportMissingProp=void 0;const e=Ye(),t=ct(),n=ai(),r=ct();function a(_,j){const{gen:C,data:T,it:A}=_;C.if(h(C,T,j,A.opts.ownProperties),()=>{_.setParams({missingProperty:(0,e._)`${j}`},!0),_.error()})}vt.checkReportMissingProp=a;function s({gen:_,data:j,it:{opts:C}},T,A){return(0,e.or)(...T.map(k=>(0,e.and)(h(_,j,k,C.ownProperties),(0,e._)`${A} = ${k}`)))}vt.checkMissingProp=s;function i(_,j){_.setParams({missingProperty:j},!0),_.error()}vt.reportMissingProp=i;function l(_){return _.scopeValue("func",{ref:Object.prototype.hasOwnProperty,code:(0,e._)`Object.prototype.hasOwnProperty`})}vt.hasPropFunc=l;function d(_,j,C){return(0,e._)`${l(_)}.call(${j}, ${C})`}vt.isOwnProperty=d;function f(_,j,C,T){const A=(0,e._)`${j}${(0,e.getProperty)(C)} !== undefined`;return T?(0,e._)`${A} && ${d(_,j,C)}`:A}vt.propertyInData=f;function h(_,j,C,T){const A=(0,e._)`${j}${(0,e.getProperty)(C)} === undefined`;return T?(0,e.or)(A,(0,e.not)(d(_,j,C))):A}vt.noPropertyInData=h;function p(_){return _?Object.keys(_).filter(j=>j!=="__proto__"):[]}vt.allSchemaProperties=p;function g(_,j){return p(j).filter(C=>!(0,t.alwaysValidSchema)(_,j[C]))}vt.schemaProperties=g;function y({schemaCode:_,data:j,it:{gen:C,topSchemaRef:T,schemaPath:A,errorPath:k},it:O},M,z,L){const U=L?(0,e._)`${_}, ${j}, ${T}${A}`:j,F=[[n.default.instancePath,(0,e.strConcat)(n.default.instancePath,k)],[n.default.parentData,O.parentData],[n.default.parentDataProperty,O.parentDataProperty],[n.default.rootData,n.default.rootData]];O.opts.dynamicRef&&F.push([n.default.dynamicAnchors,n.default.dynamicAnchors]);const q=(0,e._)`${U}, ${C.object(...F)}`;return z!==e.nil?(0,e._)`${M}.call(${z}, ${q})`:(0,e._)`${M}(${q})`}vt.callValidateCode=y;const S=(0,e._)`new RegExp`;function w({gen:_,it:{opts:j}},C){const T=j.unicodeRegExp?"u":"",{regExp:A}=j.code,k=A(C,T);return _.scopeValue("pattern",{key:k.toString(),ref:k,code:(0,e._)`${A.code==="new RegExp"?S:(0,r.useFunc)(_,A)}(${C}, ${T})`})}vt.usePattern=w;function b(_){const{gen:j,data:C,keyword:T,it:A}=_,k=j.name("valid");if(A.allErrors){const M=j.let("valid",!0);return O(()=>j.assign(M,!1)),M}return j.var(k,!0),O(()=>j.break()),k;function O(M){const z=j.const("len",(0,e._)`${C}.length`);j.forRange("i",0,z,L=>{_.subschema({keyword:T,dataProp:L,dataPropType:t.Type.Num},k),j.if((0,e.not)(k),M)})}}vt.validateArray=b;function x(_){const{gen:j,schema:C,keyword:T,it:A}=_;if(!Array.isArray(C))throw new Error("ajv implementation error");if(C.some(z=>(0,t.alwaysValidSchema)(A,z))&&!A.opts.unevaluated)return;const O=j.let("valid",!1),M=j.name("_valid");j.block(()=>C.forEach((z,L)=>{const U=_.subschema({keyword:T,schemaProp:L,compositeRule:!0},M);j.assign(O,(0,e._)`${O} || ${M}`),_.mergeValidEvaluated(U,M)||j.if((0,e.not)(O))})),_.result(O,()=>_.reset(),()=>_.error(!0))}return vt.validateUnion=x,vt}var a5;function _be(){if(a5)return Xr;a5=1,Object.defineProperty(Xr,"__esModule",{value:!0}),Xr.validateKeywordUsage=Xr.validSchemaType=Xr.funcKeywordCode=Xr.macroKeywordCode=void 0;const e=Ye(),t=ai(),n=fa(),r=Yv();function a(g,y){const{gen:S,keyword:w,schema:b,parentSchema:x,it:_}=g,j=y.macro.call(_.self,b,x,_),C=f(S,w,j);_.opts.validateSchema!==!1&&_.self.validateSchema(j,!0);const T=S.name("valid");g.subschema({schema:j,schemaPath:e.nil,errSchemaPath:`${_.errSchemaPath}/${w}`,topSchemaRef:C,compositeRule:!0},T),g.pass(T,()=>g.error(!0))}Xr.macroKeywordCode=a;function s(g,y){var S;const{gen:w,keyword:b,schema:x,parentSchema:_,$data:j,it:C}=g;d(C,y);const T=!j&&y.compile?y.compile.call(C.self,x,_,C):y.validate,A=f(w,b,T),k=w.let("valid");g.block$data(k,O),g.ok((S=y.valid)!==null&&S!==void 0?S:k);function O(){if(y.errors===!1)L(),y.modifying&&i(g),U(()=>g.error());else{const F=y.async?M():z();y.modifying&&i(g),U(()=>l(g,F))}}function M(){const F=w.let("ruleErrs",null);return w.try(()=>L((0,e._)`await `),q=>w.assign(k,!1).if((0,e._)`${q} instanceof ${C.ValidationError}`,()=>w.assign(F,(0,e._)`${q}.errors`),()=>w.throw(q))),F}function z(){const F=(0,e._)`${A}.errors`;return w.assign(F,null),L(e.nil),F}function L(F=y.async?(0,e._)`await `:e.nil){const q=C.opts.passContext?t.default.this:t.default.self,V=!("compile"in y&&!j||y.schema===!1);w.assign(k,(0,e._)`${F}${(0,n.callValidateCode)(g,A,q,V)}`,y.modifying)}function U(F){var q;w.if((0,e.not)((q=y.valid)!==null&&q!==void 0?q:k),F)}}Xr.funcKeywordCode=s;function i(g){const{gen:y,data:S,it:w}=g;y.if(w.parentData,()=>y.assign(S,(0,e._)`${w.parentData}[${w.parentDataProperty}]`))}function l(g,y){const{gen:S}=g;S.if((0,e._)`Array.isArray(${y})`,()=>{S.assign(t.default.vErrors,(0,e._)`${t.default.vErrors} === null ? ${y} : ${t.default.vErrors}.concat(${y})`).assign(t.default.errors,(0,e._)`${t.default.vErrors}.length`),(0,r.extendErrors)(g)},()=>g.error())}function d({schemaEnv:g},y){if(y.async&&!g.$async)throw new Error("async keyword in sync schema")}function f(g,y,S){if(S===void 0)throw new Error(`keyword "${y}" failed to compile`);return g.scopeValue("keyword",typeof S=="function"?{ref:S}:{ref:S,code:(0,e.stringify)(S)})}function h(g,y,S=!1){return!y.length||y.some(w=>w==="array"?Array.isArray(g):w==="object"?g&&typeof g=="object"&&!Array.isArray(g):typeof g==w||S&&typeof g>"u")}Xr.validSchemaType=h;function p({schema:g,opts:y,self:S,errSchemaPath:w},b,x){if(Array.isArray(b.keyword)?!b.keyword.includes(x):b.keyword!==x)throw new Error("ajv implementation error");const _=b.dependencies;if(_!=null&&_.some(j=>!Object.prototype.hasOwnProperty.call(g,j)))throw new Error(`parent schema must have dependencies of ${x}: ${_.join(",")}`);if(b.validateSchema&&!b.validateSchema(g[x])){const C=`keyword "${x}" value is invalid at path "${w}": `+S.errorsText(b.validateSchema.errors);if(y.validateSchema==="log")S.logger.error(C);else throw new Error(C)}}return Xr.validateKeywordUsage=p,Xr}var vs={},s5;function Nbe(){if(s5)return vs;s5=1,Object.defineProperty(vs,"__esModule",{value:!0}),vs.extendSubschemaMode=vs.extendSubschemaData=vs.getSubschema=void 0;const e=Ye(),t=ct();function n(s,{keyword:i,schemaProp:l,schema:d,schemaPath:f,errSchemaPath:h,topSchemaRef:p}){if(i!==void 0&&d!==void 0)throw new Error('both "keyword" and "schema" passed, only one allowed');if(i!==void 0){const g=s.schema[i];return l===void 0?{schema:g,schemaPath:(0,e._)`${s.schemaPath}${(0,e.getProperty)(i)}`,errSchemaPath:`${s.errSchemaPath}/${i}`}:{schema:g[l],schemaPath:(0,e._)`${s.schemaPath}${(0,e.getProperty)(i)}${(0,e.getProperty)(l)}`,errSchemaPath:`${s.errSchemaPath}/${i}/${(0,t.escapeFragment)(l)}`}}if(d!==void 0){if(f===void 0||h===void 0||p===void 0)throw new Error('"schemaPath", "errSchemaPath" and "topSchemaRef" are required with "schema"');return{schema:d,schemaPath:f,topSchemaRef:p,errSchemaPath:h}}throw new Error('either "keyword" or "schema" must be passed')}vs.getSubschema=n;function r(s,i,{dataProp:l,dataPropType:d,data:f,dataTypes:h,propertyName:p}){if(f!==void 0&&l!==void 0)throw new Error('both "data" and "dataProp" passed, only one allowed');const{gen:g}=i;if(l!==void 0){const{errorPath:S,dataPathArr:w,opts:b}=i,x=g.let("data",(0,e._)`${i.data}${(0,e.getProperty)(l)}`,!0);y(x),s.errorPath=(0,e.str)`${S}${(0,t.getErrorPath)(l,d,b.jsPropertySyntax)}`,s.parentDataProperty=(0,e._)`${l}`,s.dataPathArr=[...w,s.parentDataProperty]}if(f!==void 0){const S=f instanceof e.Name?f:g.let("data",f,!0);y(S),p!==void 0&&(s.propertyName=p)}h&&(s.dataTypes=h);function y(S){s.data=S,s.dataLevel=i.dataLevel+1,s.dataTypes=[],i.definedProperties=new Set,s.parentData=i.data,s.dataNames=[...i.dataNames,S]}}vs.extendSubschemaData=r;function a(s,{jtdDiscriminator:i,jtdMetadata:l,compositeRule:d,createErrors:f,allErrors:h}){d!==void 0&&(s.compositeRule=d),f!==void 0&&(s.createErrors=f),h!==void 0&&(s.allErrors=h),s.jtdDiscriminator=i,s.jtdMetadata=l}return vs.extendSubschemaMode=a,vs}var Hn={},qN,o5;function CU(){return o5||(o5=1,qN=function e(t,n){if(t===n)return!0;if(t&&n&&typeof t=="object"&&typeof n=="object"){if(t.constructor!==n.constructor)return!1;var r,a,s;if(Array.isArray(t)){if(r=t.length,r!=n.length)return!1;for(a=r;a--!==0;)if(!e(t[a],n[a]))return!1;return!0}if(t.constructor===RegExp)return t.source===n.source&&t.flags===n.flags;if(t.valueOf!==Object.prototype.valueOf)return t.valueOf()===n.valueOf();if(t.toString!==Object.prototype.toString)return t.toString()===n.toString();if(s=Object.keys(t),r=s.length,r!==Object.keys(n).length)return!1;for(a=r;a--!==0;)if(!Object.prototype.hasOwnProperty.call(n,s[a]))return!1;for(a=r;a--!==0;){var i=s[a];if(!e(t[i],n[i]))return!1}return!0}return t!==t&&n!==n}),qN}var FN={exports:{}},i5;function jbe(){if(i5)return FN.exports;i5=1;var e=FN.exports=function(r,a,s){typeof a=="function"&&(s=a,a={}),s=a.cb||s;var i=typeof s=="function"?s:s.pre||function(){},l=s.post||function(){};t(a,i,l,r,"",r)};e.keywords={additionalItems:!0,items:!0,contains:!0,additionalProperties:!0,propertyNames:!0,not:!0,if:!0,then:!0,else:!0},e.arrayKeywords={items:!0,allOf:!0,anyOf:!0,oneOf:!0},e.propsKeywords={$defs:!0,definitions:!0,properties:!0,patternProperties:!0,dependencies:!0},e.skipKeywords={default:!0,enum:!0,const:!0,required:!0,maximum:!0,minimum:!0,exclusiveMaximum:!0,exclusiveMinimum:!0,multipleOf:!0,maxLength:!0,minLength:!0,pattern:!0,format:!0,maxItems:!0,minItems:!0,uniqueItems:!0,maxProperties:!0,minProperties:!0};function t(r,a,s,i,l,d,f,h,p,g){if(i&&typeof i=="object"&&!Array.isArray(i)){a(i,l,d,f,h,p,g);for(var y in i){var S=i[y];if(Array.isArray(S)){if(y in e.arrayKeywords)for(var w=0;w<S.length;w++)t(r,a,s,S[w],l+"/"+y+"/"+w,d,l,y,i,w)}else if(y in e.propsKeywords){if(S&&typeof S=="object")for(var b in S)t(r,a,s,S[b],l+"/"+y+"/"+n(b),d,l,y,i,b)}else(y in e.keywords||r.allKeys&&!(y in e.skipKeywords))&&t(r,a,s,S,l+"/"+y,d,l,y,i)}s(i,l,d,f,h,p,g)}}function n(r){return r.replace(/~/g,"~0").replace(/\//g,"~1")}return FN.exports}var l5;function Xv(){if(l5)return Hn;l5=1,Object.defineProperty(Hn,"__esModule",{value:!0}),Hn.getSchemaRefs=Hn.resolveUrl=Hn.normalizeId=Hn._getFullPath=Hn.getFullPath=Hn.inlineRef=void 0;const e=ct(),t=CU(),n=jbe(),r=new Set(["type","format","pattern","maxLength","minLength","maxProperties","minProperties","maxItems","minItems","maximum","minimum","uniqueItems","multipleOf","required","enum","const"]);function a(w,b=!0){return typeof w=="boolean"?!0:b===!0?!i(w):b?l(w)<=b:!1}Hn.inlineRef=a;const s=new Set(["$ref","$recursiveRef","$recursiveAnchor","$dynamicRef","$dynamicAnchor"]);function i(w){for(const b in w){if(s.has(b))return!0;const x=w[b];if(Array.isArray(x)&&x.some(i)||typeof x=="object"&&i(x))return!0}return!1}function l(w){let b=0;for(const x in w){if(x==="$ref")return 1/0;if(b++,!r.has(x)&&(typeof w[x]=="object"&&(0,e.eachItem)(w[x],_=>b+=l(_)),b===1/0))return 1/0}return b}function d(w,b="",x){x!==!1&&(b=p(b));const _=w.parse(b);return f(w,_)}Hn.getFullPath=d;function f(w,b){return w.serialize(b).split("#")[0]+"#"}Hn._getFullPath=f;const h=/#\/?$/;function p(w){return w?w.replace(h,""):""}Hn.normalizeId=p;function g(w,b,x){return x=p(x),w.resolve(b,x)}Hn.resolveUrl=g;const y=/^[a-z_][-a-z0-9._]*$/i;function S(w,b){if(typeof w=="boolean")return{};const{schemaId:x,uriResolver:_}=this.opts,j=p(w[x]||b),C={"":j},T=d(_,j,!1),A={},k=new Set;return n(w,{allKeys:!0},(z,L,U,F)=>{if(F===void 0)return;const q=T+L;let V=C[F];typeof z[x]=="string"&&(V=P.call(this,z[x])),K.call(this,z.$anchor),K.call(this,z.$dynamicAnchor),C[L]=V;function P(H){const Z=this.opts.uriResolver.resolve;if(H=p(V?Z(V,H):H),k.has(H))throw M(H);k.add(H);let J=this.refs[H];return typeof J=="string"&&(J=this.refs[J]),typeof J=="object"?O(z,J.schema,H):H!==p(q)&&(H[0]==="#"?(O(z,A[H],H),A[H]=z):this.refs[H]=q),H}function K(H){if(typeof H=="string"){if(!y.test(H))throw new Error(`invalid anchor "${H}"`);P.call(this,`#${H}`)}}}),A;function O(z,L,U){if(L!==void 0&&!t(z,L))throw M(U)}function M(z){return new Error(`reference "${z}" resolves to more than one schema`)}}return Hn.getSchemaRefs=S,Hn}var c5;function Zv(){if(c5)return gs;c5=1,Object.defineProperty(gs,"__esModule",{value:!0}),gs.getData=gs.KeywordCxt=gs.validateFunctionCode=void 0;const e=wbe(),t=my(),n=jU(),r=my(),a=Sbe(),s=_be(),i=Nbe(),l=Ye(),d=ai(),f=Xv(),h=ct(),p=Yv();function g(Y){if(T(Y)&&(k(Y),C(Y))){b(Y);return}y(Y,()=>(0,e.topBoolOrEmptySchema)(Y))}gs.validateFunctionCode=g;function y({gen:Y,validateName:te,schema:se,schemaEnv:le,opts:fe},ve){fe.code.es5?Y.func(te,(0,l._)`${d.default.data}, ${d.default.valCxt}`,le.$async,()=>{Y.code((0,l._)`"use strict"; ${_(se,fe)}`),w(Y,fe),Y.code(ve)}):Y.func(te,(0,l._)`${d.default.data}, ${S(fe)}`,le.$async,()=>Y.code(_(se,fe)).code(ve))}function S(Y){return(0,l._)`{${d.default.instancePath}="", ${d.default.parentData}, ${d.default.parentDataProperty}, ${d.default.rootData}=${d.default.data}${Y.dynamicRef?(0,l._)`, ${d.default.dynamicAnchors}={}`:l.nil}}={}`}function w(Y,te){Y.if(d.default.valCxt,()=>{Y.var(d.default.instancePath,(0,l._)`${d.default.valCxt}.${d.default.instancePath}`),Y.var(d.default.parentData,(0,l._)`${d.default.valCxt}.${d.default.parentData}`),Y.var(d.default.parentDataProperty,(0,l._)`${d.default.valCxt}.${d.default.parentDataProperty}`),Y.var(d.default.rootData,(0,l._)`${d.default.valCxt}.${d.default.rootData}`),te.dynamicRef&&Y.var(d.default.dynamicAnchors,(0,l._)`${d.default.valCxt}.${d.default.dynamicAnchors}`)},()=>{Y.var(d.default.instancePath,(0,l._)`""`),Y.var(d.default.parentData,(0,l._)`undefined`),Y.var(d.default.parentDataProperty,(0,l._)`undefined`),Y.var(d.default.rootData,d.default.data),te.dynamicRef&&Y.var(d.default.dynamicAnchors,(0,l._)`{}`)})}function b(Y){const{schema:te,opts:se,gen:le}=Y;y(Y,()=>{se.$comment&&te.$comment&&F(Y),z(Y),le.let(d.default.vErrors,null),le.let(d.default.errors,0),se.unevaluated&&x(Y),O(Y),q(Y)})}function x(Y){const{gen:te,validateName:se}=Y;Y.evaluated=te.const("evaluated",(0,l._)`${se}.evaluated`),te.if((0,l._)`${Y.evaluated}.dynamicProps`,()=>te.assign((0,l._)`${Y.evaluated}.props`,(0,l._)`undefined`)),te.if((0,l._)`${Y.evaluated}.dynamicItems`,()=>te.assign((0,l._)`${Y.evaluated}.items`,(0,l._)`undefined`))}function _(Y,te){const se=typeof Y=="object"&&Y[te.schemaId];return se&&(te.code.source||te.code.process)?(0,l._)`/*# sourceURL=${se} */`:l.nil}function j(Y,te){if(T(Y)&&(k(Y),C(Y))){A(Y,te);return}(0,e.boolOrEmptySchema)(Y,te)}function C({schema:Y,self:te}){if(typeof Y=="boolean")return!Y;for(const se in Y)if(te.RULES.all[se])return!0;return!1}function T(Y){return typeof Y.schema!="boolean"}function A(Y,te){const{schema:se,gen:le,opts:fe}=Y;fe.$comment&&se.$comment&&F(Y),L(Y),U(Y);const ve=le.const("_errs",d.default.errors);O(Y,ve),le.var(te,(0,l._)`${ve} === ${d.default.errors}`)}function k(Y){(0,h.checkUnknownRules)(Y),M(Y)}function O(Y,te){if(Y.opts.jtd)return P(Y,[],!1,te);const se=(0,t.getSchemaTypes)(Y.schema),le=(0,t.coerceAndCheckDataType)(Y,se);P(Y,se,!le,te)}function M(Y){const{schema:te,errSchemaPath:se,opts:le,self:fe}=Y;te.$ref&&le.ignoreKeywordsWithRef&&(0,h.schemaHasRulesButRef)(te,fe.RULES)&&fe.logger.warn(`$ref: keywords ignored in schema at path "${se}"`)}function z(Y){const{schema:te,opts:se}=Y;te.default!==void 0&&se.useDefaults&&se.strictSchema&&(0,h.checkStrictMode)(Y,"default is ignored in the schema root")}function L(Y){const te=Y.schema[Y.opts.schemaId];te&&(Y.baseId=(0,f.resolveUrl)(Y.opts.uriResolver,Y.baseId,te))}function U(Y){if(Y.schema.$async&&!Y.schemaEnv.$async)throw new Error("async schema in sync schema")}function F({gen:Y,schemaEnv:te,schema:se,errSchemaPath:le,opts:fe}){const ve=se.$comment;if(fe.$comment===!0)Y.code((0,l._)`${d.default.self}.logger.log(${ve})`);else if(typeof fe.$comment=="function"){const Se=(0,l.str)`${le}/$comment`,Re=Y.scopeValue("root",{ref:te.root});Y.code((0,l._)`${d.default.self}.opts.$comment(${ve}, ${Se}, ${Re}.schema)`)}}function q(Y){const{gen:te,schemaEnv:se,validateName:le,ValidationError:fe,opts:ve}=Y;se.$async?te.if((0,l._)`${d.default.errors} === 0`,()=>te.return(d.default.data),()=>te.throw((0,l._)`new ${fe}(${d.default.vErrors})`)):(te.assign((0,l._)`${le}.errors`,d.default.vErrors),ve.unevaluated&&V(Y),te.return((0,l._)`${d.default.errors} === 0`))}function V({gen:Y,evaluated:te,props:se,items:le}){se instanceof l.Name&&Y.assign((0,l._)`${te}.props`,se),le instanceof l.Name&&Y.assign((0,l._)`${te}.items`,le)}function P(Y,te,se,le){const{gen:fe,schema:ve,data:Se,allErrors:Re,opts:De,self:Ve}=Y,{RULES:Le}=Ve;if(ve.$ref&&(De.ignoreKeywordsWithRef||!(0,h.schemaHasRulesButRef)(ve,Le))){fe.block(()=>re(Y,"$ref",Le.all.$ref.definition));return}De.jtd||H(Y,te),fe.block(()=>{for(const qe of Le.rules)$e(qe);$e(Le.post)});function $e(qe){(0,n.shouldUseGroup)(ve,qe)&&(qe.type?(fe.if((0,r.checkDataType)(qe.type,Se,De.strictNumbers)),K(Y,qe),te.length===1&&te[0]===qe.type&&se&&(fe.else(),(0,r.reportTypeError)(Y)),fe.endIf()):K(Y,qe),Re||fe.if((0,l._)`${d.default.errors} === ${le||0}`))}}function K(Y,te){const{gen:se,schema:le,opts:{useDefaults:fe}}=Y;fe&&(0,a.assignDefaults)(Y,te.type),se.block(()=>{for(const ve of te.rules)(0,n.shouldUseRule)(le,ve)&&re(Y,ve.keyword,ve.definition,te.type)})}function H(Y,te){Y.schemaEnv.meta||!Y.opts.strictTypes||(Z(Y,te),Y.opts.allowUnionTypes||J(Y,te),D(Y,Y.dataTypes))}function Z(Y,te){if(te.length){if(!Y.dataTypes.length){Y.dataTypes=te;return}te.forEach(se=>{B(Y.dataTypes,se)||G(Y,`type "${se}" not allowed by context "${Y.dataTypes.join(",")}"`)}),$(Y,te)}}function J(Y,te){te.length>1&&!(te.length===2&&te.includes("null"))&&G(Y,"use allowUnionTypes to allow union type keyword")}function D(Y,te){const se=Y.self.RULES.all;for(const le in se){const fe=se[le];if(typeof fe=="object"&&(0,n.shouldUseRule)(Y.schema,fe)){const{type:ve}=fe.definition;ve.length&&!ve.some(Se=>W(te,Se))&&G(Y,`missing type "${ve.join(",")}" for keyword "${le}"`)}}}function W(Y,te){return Y.includes(te)||te==="number"&&Y.includes("integer")}function B(Y,te){return Y.includes(te)||te==="integer"&&Y.includes("number")}function $(Y,te){const se=[];for(const le of Y.dataTypes)B(te,le)?se.push(le):te.includes("integer")&&le==="number"&&se.push("integer");Y.dataTypes=se}function G(Y,te){const se=Y.schemaEnv.baseId+Y.errSchemaPath;te+=` at "${se}" (strictTypes)`,(0,h.checkStrictMode)(Y,te,Y.opts.strictTypes)}class ee{constructor(te,se,le){if((0,s.validateKeywordUsage)(te,se,le),this.gen=te.gen,this.allErrors=te.allErrors,this.keyword=le,this.data=te.data,this.schema=te.schema[le],this.$data=se.$data&&te.opts.$data&&this.schema&&this.schema.$data,this.schemaValue=(0,h.schemaRefOrVal)(te,this.schema,le,this.$data),this.schemaType=se.schemaType,this.parentSchema=te.schema,this.params={},this.it=te,this.def=se,this.$data)this.schemaCode=te.gen.const("vSchema",ae(this.$data,te));else if(this.schemaCode=this.schemaValue,!(0,s.validSchemaType)(this.schema,se.schemaType,se.allowUndefined))throw new Error(`${le} value must be ${JSON.stringify(se.schemaType)}`);("code"in se?se.trackErrors:se.errors!==!1)&&(this.errsCount=te.gen.const("_errs",d.default.errors))}result(te,se,le){this.failResult((0,l.not)(te),se,le)}failResult(te,se,le){this.gen.if(te),le?le():this.error(),se?(this.gen.else(),se(),this.allErrors&&this.gen.endIf()):this.allErrors?this.gen.endIf():this.gen.else()}pass(te,se){this.failResult((0,l.not)(te),void 0,se)}fail(te){if(te===void 0){this.error(),this.allErrors||this.gen.if(!1);return}this.gen.if(te),this.error(),this.allErrors?this.gen.endIf():this.gen.else()}fail$data(te){if(!this.$data)return this.fail(te);const{schemaCode:se}=this;this.fail((0,l._)`${se} !== undefined && (${(0,l.or)(this.invalid$data(),te)})`)}error(te,se,le){if(se){this.setParams(se),this._error(te,le),this.setParams({});return}this._error(te,le)}_error(te,se){(te?p.reportExtraError:p.reportError)(this,this.def.error,se)}$dataError(){(0,p.reportError)(this,this.def.$dataError||p.keyword$DataError)}reset(){if(this.errsCount===void 0)throw new Error('add "trackErrors" to keyword definition');(0,p.resetErrorsCount)(this.gen,this.errsCount)}ok(te){this.allErrors||this.gen.if(te)}setParams(te,se){se?Object.assign(this.params,te):this.params=te}block$data(te,se,le=l.nil){this.gen.block(()=>{this.check$data(te,le),se()})}check$data(te=l.nil,se=l.nil){if(!this.$data)return;const{gen:le,schemaCode:fe,schemaType:ve,def:Se}=this;le.if((0,l.or)((0,l._)`${fe} === undefined`,se)),te!==l.nil&&le.assign(te,!0),(ve.length||Se.validateSchema)&&(le.elseIf(this.invalid$data()),this.$dataError(),te!==l.nil&&le.assign(te,!1)),le.else()}invalid$data(){const{gen:te,schemaCode:se,schemaType:le,def:fe,it:ve}=this;return(0,l.or)(Se(),Re());function Se(){if(le.length){if(!(se instanceof l.Name))throw new Error("ajv implementation error");const De=Array.isArray(le)?le:[le];return(0,l._)`${(0,r.checkDataTypes)(De,se,ve.opts.strictNumbers,r.DataType.Wrong)}`}return l.nil}function Re(){if(fe.validateSchema){const De=te.scopeValue("validate$data",{ref:fe.validateSchema});return(0,l._)`!${De}(${se})`}return l.nil}}subschema(te,se){const le=(0,i.getSubschema)(this.it,te);(0,i.extendSubschemaData)(le,this.it,te),(0,i.extendSubschemaMode)(le,te);const fe={...this.it,...le,items:void 0,props:void 0};return j(fe,se),fe}mergeEvaluated(te,se){const{it:le,gen:fe}=this;le.opts.unevaluated&&(le.props!==!0&&te.props!==void 0&&(le.props=h.mergeEvaluated.props(fe,te.props,le.props,se)),le.items!==!0&&te.items!==void 0&&(le.items=h.mergeEvaluated.items(fe,te.items,le.items,se)))}mergeValidEvaluated(te,se){const{it:le,gen:fe}=this;if(le.opts.unevaluated&&(le.props!==!0||le.items!==!0))return fe.if(se,()=>this.mergeEvaluated(te,l.Name)),!0}}gs.KeywordCxt=ee;function re(Y,te,se,le){const fe=new ee(Y,se,te);"code"in se?se.code(fe,le):fe.$data&&se.validate?(0,s.funcKeywordCode)(fe,se):"macro"in se?(0,s.macroKeywordCode)(fe,se):(se.compile||se.validate)&&(0,s.funcKeywordCode)(fe,se)}const ne=/^\/(?:[^~]|~0|~1)*$/,Q=/^([0-9]+)(#|\/(?:[^~]|~0|~1)*)?$/;function ae(Y,{dataLevel:te,dataNames:se,dataPathArr:le}){let fe,ve;if(Y==="")return d.default.rootData;if(Y[0]==="/"){if(!ne.test(Y))throw new Error(`Invalid JSON-pointer: ${Y}`);fe=Y,ve=d.default.rootData}else{const Ve=Q.exec(Y);if(!Ve)throw new Error(`Invalid JSON-pointer: ${Y}`);const Le=+Ve[1];if(fe=Ve[2],fe==="#"){if(Le>=te)throw new Error(De("property/index",Le));return le[te-Le]}if(Le>te)throw new Error(De("data",Le));if(ve=se[te-Le],!fe)return ve}let Se=ve;const Re=fe.split("/");for(const Ve of Re)Ve&&(ve=(0,l._)`${ve}${(0,l.getProperty)((0,h.unescapeJsonPointer)(Ve))}`,Se=(0,l._)`${Se} && ${ve}`);return Se;function De(Ve,Le){return`Cannot access ${Ve} ${Le} levels up, current level is ${te}`}}return gs.getData=ae,gs}var Sm={},u5;function HE(){if(u5)return Sm;u5=1,Object.defineProperty(Sm,"__esModule",{value:!0});class e extends Error{constructor(n){super("validation failed"),this.errors=n,this.ajv=this.validation=!0}}return Sm.default=e,Sm}var _m={},d5;function Qv(){if(d5)return _m;d5=1,Object.defineProperty(_m,"__esModule",{value:!0});const e=Xv();class t extends Error{constructor(r,a,s,i){super(i||`can't resolve reference ${s} from id ${a}`),this.missingRef=(0,e.resolveUrl)(r,a,s),this.missingSchema=(0,e.normalizeId)((0,e.getFullPath)(r,this.missingRef))}}return _m.default=t,_m}var dr={},f5;function BE(){if(f5)return dr;f5=1,Object.defineProperty(dr,"__esModule",{value:!0}),dr.resolveSchema=dr.getCompilingSchema=dr.resolveRef=dr.compileSchema=dr.SchemaEnv=void 0;const e=Ye(),t=HE(),n=ai(),r=Xv(),a=ct(),s=Zv();class i{constructor(x){var _;this.refs={},this.dynamicAnchors={};let j;typeof x.schema=="object"&&(j=x.schema),this.schema=x.schema,this.schemaId=x.schemaId,this.root=x.root||this,this.baseId=(_=x.baseId)!==null&&_!==void 0?_:(0,r.normalizeId)(j==null?void 0:j[x.schemaId||"$id"]),this.schemaPath=x.schemaPath,this.localRefs=x.localRefs,this.meta=x.meta,this.$async=j==null?void 0:j.$async,this.refs={}}}dr.SchemaEnv=i;function l(b){const x=h.call(this,b);if(x)return x;const _=(0,r.getFullPath)(this.opts.uriResolver,b.root.baseId),{es5:j,lines:C}=this.opts.code,{ownProperties:T}=this.opts,A=new e.CodeGen(this.scope,{es5:j,lines:C,ownProperties:T});let k;b.$async&&(k=A.scopeValue("Error",{ref:t.default,code:(0,e._)`require("ajv/dist/runtime/validation_error").default`}));const O=A.scopeName("validate");b.validateName=O;const M={gen:A,allErrors:this.opts.allErrors,data:n.default.data,parentData:n.default.parentData,parentDataProperty:n.default.parentDataProperty,dataNames:[n.default.data],dataPathArr:[e.nil],dataLevel:0,dataTypes:[],definedProperties:new Set,topSchemaRef:A.scopeValue("schema",this.opts.code.source===!0?{ref:b.schema,code:(0,e.stringify)(b.schema)}:{ref:b.schema}),validateName:O,ValidationError:k,schema:b.schema,schemaEnv:b,rootId:_,baseId:b.baseId||_,schemaPath:e.nil,errSchemaPath:b.schemaPath||(this.opts.jtd?"":"#"),errorPath:(0,e._)`""`,opts:this.opts,self:this};let z;try{this._compilations.add(b),(0,s.validateFunctionCode)(M),A.optimize(this.opts.code.optimize);const L=A.toString();z=`${A.scopeRefs(n.default.scope)}return ${L}`,this.opts.code.process&&(z=this.opts.code.process(z,b));const F=new Function(`${n.default.self}`,`${n.default.scope}`,z)(this,this.scope.get());if(this.scope.value(O,{ref:F}),F.errors=null,F.schema=b.schema,F.schemaEnv=b,b.$async&&(F.$async=!0),this.opts.code.source===!0&&(F.source={validateName:O,validateCode:L,scopeValues:A._values}),this.opts.unevaluated){const{props:q,items:V}=M;F.evaluated={props:q instanceof e.Name?void 0:q,items:V instanceof e.Name?void 0:V,dynamicProps:q instanceof e.Name,dynamicItems:V instanceof e.Name},F.source&&(F.source.evaluated=(0,e.stringify)(F.evaluated))}return b.validate=F,b}catch(L){throw delete b.validate,delete b.validateName,z&&this.logger.error("Error compiling schema, function code:",z),L}finally{this._compilations.delete(b)}}dr.compileSchema=l;function d(b,x,_){var j;_=(0,r.resolveUrl)(this.opts.uriResolver,x,_);const C=b.refs[_];if(C)return C;let T=g.call(this,b,_);if(T===void 0){const A=(j=b.localRefs)===null||j===void 0?void 0:j[_],{schemaId:k}=this.opts;A&&(T=new i({schema:A,schemaId:k,root:b,baseId:x}))}if(T!==void 0)return b.refs[_]=f.call(this,T)}dr.resolveRef=d;function f(b){return(0,r.inlineRef)(b.schema,this.opts.inlineRefs)?b.schema:b.validate?b:l.call(this,b)}function h(b){for(const x of this._compilations)if(p(x,b))return x}dr.getCompilingSchema=h;function p(b,x){return b.schema===x.schema&&b.root===x.root&&b.baseId===x.baseId}function g(b,x){let _;for(;typeof(_=this.refs[x])=="string";)x=_;return _||this.schemas[x]||y.call(this,b,x)}function y(b,x){const _=this.opts.uriResolver.parse(x),j=(0,r._getFullPath)(this.opts.uriResolver,_);let C=(0,r.getFullPath)(this.opts.uriResolver,b.baseId,void 0);if(Object.keys(b.schema).length>0&&j===C)return w.call(this,_,b);const T=(0,r.normalizeId)(j),A=this.refs[T]||this.schemas[T];if(typeof A=="string"){const k=y.call(this,b,A);return typeof(k==null?void 0:k.schema)!="object"?void 0:w.call(this,_,k)}if(typeof(A==null?void 0:A.schema)=="object"){if(A.validate||l.call(this,A),T===(0,r.normalizeId)(x)){const{schema:k}=A,{schemaId:O}=this.opts,M=k[O];return M&&(C=(0,r.resolveUrl)(this.opts.uriResolver,C,M)),new i({schema:k,schemaId:O,root:b,baseId:C})}return w.call(this,_,A)}}dr.resolveSchema=y;const S=new Set(["properties","patternProperties","enum","dependencies","definitions"]);function w(b,{baseId:x,schema:_,root:j}){var C;if(((C=b.fragment)===null||C===void 0?void 0:C[0])!=="/")return;for(const k of b.fragment.slice(1).split("/")){if(typeof _=="boolean")return;const O=_[(0,a.unescapeFragment)(k)];if(O===void 0)return;_=O;const M=typeof _=="object"&&_[this.opts.schemaId];!S.has(k)&&M&&(x=(0,r.resolveUrl)(this.opts.uriResolver,x,M))}let T;if(typeof _!="boolean"&&_.$ref&&!(0,a.schemaHasRulesButRef)(_,this.RULES)){const k=(0,r.resolveUrl)(this.opts.uriResolver,x,_.$ref);T=y.call(this,j,k)}const{schemaId:A}=this.opts;if(T=T||new i({schema:_,schemaId:A,root:j,baseId:x}),T.schema!==T.root.schema)return T}return dr}const Cbe="https://raw.githubusercontent.com/ajv-validator/ajv/master/lib/refs/data.json#",Ebe="Meta-schema for $data reference (JSON AnySchema extension proposal)",Tbe="object",Abe=["$data"],Rbe={$data:{type:"string",anyOf:[{format:"relative-json-pointer"},{format:"json-pointer"}]}},kbe=!1,Obe={$id:Cbe,description:Ebe,type:Tbe,required:Abe,properties:Rbe,additionalProperties:kbe};var Nm={},Od={exports:{}},UN,h5;function EU(){if(h5)return UN;h5=1;const e=RegExp.prototype.test.bind(/^[\da-f]{8}-[\da-f]{4}-[\da-f]{4}-[\da-f]{4}-[\da-f]{12}$/iu),t=RegExp.prototype.test.bind(/^(?:(?:25[0-5]|2[0-4]\d|1\d{2}|[1-9]\d|\d)\.){3}(?:25[0-5]|2[0-4]\d|1\d{2}|[1-9]\d|\d)$/u);function n(g){let y="",S=0,w=0;for(w=0;w<g.length;w++)if(S=g[w].charCodeAt(0),S!==48){if(!(S>=48&&S<=57||S>=65&&S<=70||S>=97&&S<=102))return"";y+=g[w];break}for(w+=1;w<g.length;w++){if(S=g[w].charCodeAt(0),!(S>=48&&S<=57||S>=65&&S<=70||S>=97&&S<=102))return"";y+=g[w]}return y}const r=RegExp.prototype.test.bind(/[^!"$&'()*+,\-.;=_`a-z{}~]/u);function a(g){return g.length=0,!0}function s(g,y,S){if(g.length){const w=n(g);if(w!=="")y.push(w);else return S.error=!0,!1;g.length=0}return!0}function i(g){let y=0;const S={error:!1,address:"",zone:""},w=[],b=[];let x=!1,_=!1,j=s;for(let C=0;C<g.length;C++){const T=g[C];if(!(T==="["||T==="]"))if(T===":"){if(x===!0&&(_=!0),!j(b,w,S))break;if(++y>7){S.error=!0;break}C>0&&g[C-1]===":"&&(x=!0),w.push(":");continue}else if(T==="%"){if(!j(b,w,S))break;j=a}else{b.push(T);continue}}return b.length&&(j===a?S.zone=b.join(""):_?w.push(b.join("")):w.push(n(b))),S.address=w.join(""),S}function l(g){if(d(g,":")<2)return{host:g,isIPV6:!1};const y=i(g);if(y.error)return{host:g,isIPV6:!1};{let S=y.address,w=y.address;return y.zone&&(S+="%"+y.zone,w+="%25"+y.zone),{host:S,isIPV6:!0,escapedHost:w}}}function d(g,y){let S=0;for(let w=0;w<g.length;w++)g[w]===y&&S++;return S}function f(g){let y=g;const S=[];let w=-1,b=0;for(;b=y.length;){if(b===1){if(y===".")break;if(y==="/"){S.push("/");break}else{S.push(y);break}}else if(b===2){if(y[0]==="."){if(y[1]===".")break;if(y[1]==="/"){y=y.slice(2);continue}}else if(y[0]==="/"&&(y[1]==="."||y[1]==="/")){S.push("/");break}}else if(b===3&&y==="/.."){S.length!==0&&S.pop(),S.push("/");break}if(y[0]==="."){if(y[1]==="."){if(y[2]==="/"){y=y.slice(3);continue}}else if(y[1]==="/"){y=y.slice(2);continue}}else if(y[0]==="/"&&y[1]==="."){if(y[2]==="/"){y=y.slice(2);continue}else if(y[2]==="."&&y[3]==="/"){y=y.slice(3),S.length!==0&&S.pop();continue}}if((w=y.indexOf("/",1))===-1){S.push(y);break}else S.push(y.slice(0,w)),y=y.slice(w)}return S.join("")}function h(g,y){const S=y!==!0?escape:unescape;return g.scheme!==void 0&&(g.scheme=S(g.scheme)),g.userinfo!==void 0&&(g.userinfo=S(g.userinfo)),g.host!==void 0&&(g.host=S(g.host)),g.path!==void 0&&(g.path=S(g.path)),g.query!==void 0&&(g.query=S(g.query)),g.fragment!==void 0&&(g.fragment=S(g.fragment)),g}function p(g){const y=[];if(g.userinfo!==void 0&&(y.push(g.userinfo),y.push("@")),g.host!==void 0){let S=unescape(g.host);if(!t(S)){const w=l(S);w.isIPV6===!0?S=`[${w.escapedHost}]`:S=g.host}y.push(S)}return(typeof g.port=="number"||typeof g.port=="string")&&(y.push(":"),y.push(String(g.port))),y.length?y.join(""):void 0}return UN={nonSimpleDomain:r,recomposeAuthority:p,normalizeComponentEncoding:h,removeDotSegments:f,isIPv4:t,isUUID:e,normalizeIPv6:l,stringArrayToHexStripped:n},UN}var HN,p5;function Mbe(){if(p5)return HN;p5=1;const{isUUID:e}=EU(),t=/([\da-z][\d\-a-z]{0,31}):((?:[\w!$'()*+,\-.:;=@]|%[\da-f]{2})+)/iu,n=["http","https","ws","wss","urn","urn:uuid"];function r(T){return n.indexOf(T)!==-1}function a(T){return T.secure===!0?!0:T.secure===!1?!1:T.scheme?T.scheme.length===3&&(T.scheme[0]==="w"||T.scheme[0]==="W")&&(T.scheme[1]==="s"||T.scheme[1]==="S")&&(T.scheme[2]==="s"||T.scheme[2]==="S"):!1}function s(T){return T.host||(T.error=T.error||"HTTP URIs must have a host."),T}function i(T){const A=String(T.scheme).toLowerCase()==="https";return(T.port===(A?443:80)||T.port==="")&&(T.port=void 0),T.path||(T.path="/"),T}function l(T){return T.secure=a(T),T.resourceName=(T.path||"/")+(T.query?"?"+T.query:""),T.path=void 0,T.query=void 0,T}function d(T){if((T.port===(a(T)?443:80)||T.port==="")&&(T.port=void 0),typeof T.secure=="boolean"&&(T.scheme=T.secure?"wss":"ws",T.secure=void 0),T.resourceName){const[A,k]=T.resourceName.split("?");T.path=A&&A!=="/"?A:void 0,T.query=k,T.resourceName=void 0}return T.fragment=void 0,T}function f(T,A){if(!T.path)return T.error="URN can not be parsed",T;const k=T.path.match(t);if(k){const O=A.scheme||T.scheme||"urn";T.nid=k[1].toLowerCase(),T.nss=k[2];const M=`${O}:${A.nid||T.nid}`,z=C(M);T.path=void 0,z&&(T=z.parse(T,A))}else T.error=T.error||"URN can not be parsed.";return T}function h(T,A){if(T.nid===void 0)throw new Error("URN without nid cannot be serialized");const k=A.scheme||T.scheme||"urn",O=T.nid.toLowerCase(),M=`${k}:${A.nid||O}`,z=C(M);z&&(T=z.serialize(T,A));const L=T,U=T.nss;return L.path=`${O||A.nid}:${U}`,A.skipEscape=!0,L}function p(T,A){const k=T;return k.uuid=k.nss,k.nss=void 0,!A.tolerant&&(!k.uuid||!e(k.uuid))&&(k.error=k.error||"UUID is not valid."),k}function g(T){const A=T;return A.nss=(T.uuid||"").toLowerCase(),A}const y={scheme:"http",domainHost:!0,parse:s,serialize:i},S={scheme:"https",domainHost:y.domainHost,parse:s,serialize:i},w={scheme:"ws",domainHost:!0,parse:l,serialize:d},b={scheme:"wss",domainHost:w.domainHost,parse:w.parse,serialize:w.serialize},j={http:y,https:S,ws:w,wss:b,urn:{scheme:"urn",parse:f,serialize:h,skipNormalize:!0},"urn:uuid":{scheme:"urn:uuid",parse:p,serialize:g,skipNormalize:!0}};Object.setPrototypeOf(j,null);function C(T){return T&&(j[T]||j[T.toLowerCase()])||void 0}return HN={wsIsSecure:a,SCHEMES:j,isValidSchemeName:r,getSchemeHandler:C},HN}var m5;function Dbe(){if(m5)return Od.exports;m5=1;const{normalizeIPv6:e,removeDotSegments:t,recomposeAuthority:n,normalizeComponentEncoding:r,isIPv4:a,nonSimpleDomain:s}=EU(),{SCHEMES:i,getSchemeHandler:l}=Mbe();function d(b,x){return typeof b=="string"?b=g(S(b,x),x):typeof b=="object"&&(b=S(g(b,x),x)),b}function f(b,x,_){const j=_?Object.assign({scheme:"null"},_):{scheme:"null"},C=h(S(b,j),S(x,j),j,!0);return j.skipEscape=!0,g(C,j)}function h(b,x,_,j){const C={};return j||(b=S(g(b,_),_),x=S(g(x,_),_)),_=_||{},!_.tolerant&&x.scheme?(C.scheme=x.scheme,C.userinfo=x.userinfo,C.host=x.host,C.port=x.port,C.path=t(x.path||""),C.query=x.query):(x.userinfo!==void 0||x.host!==void 0||x.port!==void 0?(C.userinfo=x.userinfo,C.host=x.host,C.port=x.port,C.path=t(x.path||""),C.query=x.query):(x.path?(x.path[0]==="/"?C.path=t(x.path):((b.userinfo!==void 0||b.host!==void 0||b.port!==void 0)&&!b.path?C.path="/"+x.path:b.path?C.path=b.path.slice(0,b.path.lastIndexOf("/")+1)+x.path:C.path=x.path,C.path=t(C.path)),C.query=x.query):(C.path=b.path,x.query!==void 0?C.query=x.query:C.query=b.query),C.userinfo=b.userinfo,C.host=b.host,C.port=b.port),C.scheme=b.scheme),C.fragment=x.fragment,C}function p(b,x,_){return typeof b=="string"?(b=unescape(b),b=g(r(S(b,_),!0),{..._,skipEscape:!0})):typeof b=="object"&&(b=g(r(b,!0),{..._,skipEscape:!0})),typeof x=="string"?(x=unescape(x),x=g(r(S(x,_),!0),{..._,skipEscape:!0})):typeof x=="object"&&(x=g(r(x,!0),{..._,skipEscape:!0})),b.toLowerCase()===x.toLowerCase()}function g(b,x){const _={host:b.host,scheme:b.scheme,userinfo:b.userinfo,port:b.port,path:b.path,query:b.query,nid:b.nid,nss:b.nss,uuid:b.uuid,fragment:b.fragment,reference:b.reference,resourceName:b.resourceName,secure:b.secure,error:""},j=Object.assign({},x),C=[],T=l(j.scheme||_.scheme);T&&T.serialize&&T.serialize(_,j),_.path!==void 0&&(j.skipEscape?_.path=unescape(_.path):(_.path=escape(_.path),_.scheme!==void 0&&(_.path=_.path.split("%3A").join(":")))),j.reference!=="suffix"&&_.scheme&&C.push(_.scheme,":");const A=n(_);if(A!==void 0&&(j.reference!=="suffix"&&C.push("//"),C.push(A),_.path&&_.path[0]!=="/"&&C.push("/")),_.path!==void 0){let k=_.path;!j.absolutePath&&(!T||!T.absolutePath)&&(k=t(k)),A===void 0&&k[0]==="/"&&k[1]==="/"&&(k="/%2F"+k.slice(2)),C.push(k)}return _.query!==void 0&&C.push("?",_.query),_.fragment!==void 0&&C.push("#",_.fragment),C.join("")}const y=/^(?:([^#/:?]+):)?(?:\/\/((?:([^#/?@]*)@)?(\[[^#/?\]]+\]|[^#/:?]*)(?::(\d*))?))?([^#?]*)(?:\?([^#]*))?(?:#((?:.|[\n\r])*))?/u;function S(b,x){const _=Object.assign({},x),j={scheme:void 0,userinfo:void 0,host:"",port:void 0,path:"",query:void 0,fragment:void 0};let C=!1;_.reference==="suffix"&&(_.scheme?b=_.scheme+":"+b:b="//"+b);const T=b.match(y);if(T){if(j.scheme=T[1],j.userinfo=T[3],j.host=T[4],j.port=parseInt(T[5],10),j.path=T[6]||"",j.query=T[7],j.fragment=T[8],isNaN(j.port)&&(j.port=T[5]),j.host)if(a(j.host)===!1){const O=e(j.host);j.host=O.host.toLowerCase(),C=O.isIPV6}else C=!0;j.scheme===void 0&&j.userinfo===void 0&&j.host===void 0&&j.port===void 0&&j.query===void 0&&!j.path?j.reference="same-document":j.scheme===void 0?j.reference="relative":j.fragment===void 0?j.reference="absolute":j.reference="uri",_.reference&&_.reference!=="suffix"&&_.reference!==j.reference&&(j.error=j.error||"URI is not a "+_.reference+" reference.");const A=l(_.scheme||j.scheme);if(!_.unicodeSupport&&(!A||!A.unicodeSupport)&&j.host&&(_.domainHost||A&&A.domainHost)&&C===!1&&s(j.host))try{j.host=URL.domainToASCII(j.host.toLowerCase())}catch(k){j.error=j.error||"Host's domain name can not be converted to ASCII: "+k}(!A||A&&!A.skipNormalize)&&(b.indexOf("%")!==-1&&(j.scheme!==void 0&&(j.scheme=unescape(j.scheme)),j.host!==void 0&&(j.host=unescape(j.host))),j.path&&(j.path=escape(unescape(j.path))),j.fragment&&(j.fragment=encodeURI(decodeURIComponent(j.fragment)))),A&&A.parse&&A.parse(j,_)}else j.error=j.error||"URI can not be parsed.";return j}const w={SCHEMES:i,normalize:d,resolve:f,resolveComponent:h,equal:p,serialize:g,parse:S};return Od.exports=w,Od.exports.default=w,Od.exports.fastUri=w,Od.exports}var g5;function Pbe(){if(g5)return Nm;g5=1,Object.defineProperty(Nm,"__esModule",{value:!0});const e=Dbe();return e.code='require("ajv/dist/runtime/uri").default',Nm.default=e,Nm}var y5;function $be(){return y5||(y5=1,(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.CodeGen=e.Name=e.nil=e.stringify=e.str=e._=e.KeywordCxt=void 0;var t=Zv();Object.defineProperty(e,"KeywordCxt",{enumerable:!0,get:function(){return t.KeywordCxt}});var n=Ye();Object.defineProperty(e,"_",{enumerable:!0,get:function(){return n._}}),Object.defineProperty(e,"str",{enumerable:!0,get:function(){return n.str}}),Object.defineProperty(e,"stringify",{enumerable:!0,get:function(){return n.stringify}}),Object.defineProperty(e,"nil",{enumerable:!0,get:function(){return n.nil}}),Object.defineProperty(e,"Name",{enumerable:!0,get:function(){return n.Name}}),Object.defineProperty(e,"CodeGen",{enumerable:!0,get:function(){return n.CodeGen}});const r=HE(),a=Qv(),s=NU(),i=BE(),l=Ye(),d=Xv(),f=my(),h=ct(),p=Obe,g=Pbe(),y=(J,D)=>new RegExp(J,D);y.code="new RegExp";const S=["removeAdditional","useDefaults","coerceTypes"],w=new Set(["validate","serialize","parse","wrapper","root","schema","keyword","pattern","formats","validate$data","func","obj","Error"]),b={errorDataPath:"",format:"`validateFormats: false` can be used instead.",nullable:'"nullable" keyword is supported by default.',jsonPointers:"Deprecated jsPropertySyntax can be used instead.",extendRefs:"Deprecated ignoreKeywordsWithRef can be used instead.",missingRefs:"Pass empty schema with $id that should be ignored to ajv.addSchema.",processCode:"Use option `code: {process: (code, schemaEnv: object) => string}`",sourceCode:"Use option `code: {source: true}`",strictDefaults:"It is default now, see option `strict`.",strictKeywords:"It is default now, see option `strict`.",uniqueItems:'"uniqueItems" keyword is always validated.',unknownFormats:"Disable strict mode or pass `true` to `ajv.addFormat` (or `formats` option).",cache:"Map is used as cache, schema object as key.",serialize:"Map is used as cache, schema object as key.",ajvErrors:"It is default now."},x={ignoreKeywordsWithRef:"",jsPropertySyntax:"",unicode:'"minLength"/"maxLength" account for unicode characters by default.'},_=200;function j(J){var D,W,B,$,G,ee,re,ne,Q,ae,Y,te,se,le,fe,ve,Se,Re,De,Ve,Le,$e,qe,Je,qt;const ln=J.strict,Sn=(D=J.code)===null||D===void 0?void 0:D.optimize,cn=Sn===!0||Sn===void 0?1:Sn||0,Wa=(B=(W=J.code)===null||W===void 0?void 0:W.regExp)!==null&&B!==void 0?B:y,Fr=($=J.uriResolver)!==null&&$!==void 0?$:g.default;return{strictSchema:(ee=(G=J.strictSchema)!==null&&G!==void 0?G:ln)!==null&&ee!==void 0?ee:!0,strictNumbers:(ne=(re=J.strictNumbers)!==null&&re!==void 0?re:ln)!==null&&ne!==void 0?ne:!0,strictTypes:(ae=(Q=J.strictTypes)!==null&&Q!==void 0?Q:ln)!==null&&ae!==void 0?ae:"log",strictTuples:(te=(Y=J.strictTuples)!==null&&Y!==void 0?Y:ln)!==null&&te!==void 0?te:"log",strictRequired:(le=(se=J.strictRequired)!==null&&se!==void 0?se:ln)!==null&&le!==void 0?le:!1,code:J.code?{...J.code,optimize:cn,regExp:Wa}:{optimize:cn,regExp:Wa},loopRequired:(fe=J.loopRequired)!==null&&fe!==void 0?fe:_,loopEnum:(ve=J.loopEnum)!==null&&ve!==void 0?ve:_,meta:(Se=J.meta)!==null&&Se!==void 0?Se:!0,messages:(Re=J.messages)!==null&&Re!==void 0?Re:!0,inlineRefs:(De=J.inlineRefs)!==null&&De!==void 0?De:!0,schemaId:(Ve=J.schemaId)!==null&&Ve!==void 0?Ve:"$id",addUsedSchema:(Le=J.addUsedSchema)!==null&&Le!==void 0?Le:!0,validateSchema:($e=J.validateSchema)!==null&&$e!==void 0?$e:!0,validateFormats:(qe=J.validateFormats)!==null&&qe!==void 0?qe:!0,unicodeRegExp:(Je=J.unicodeRegExp)!==null&&Je!==void 0?Je:!0,int32range:(qt=J.int32range)!==null&&qt!==void 0?qt:!0,uriResolver:Fr}}class C{constructor(D={}){this.schemas={},this.refs={},this.formats={},this._compilations=new Set,this._loading={},this._cache=new Map,D=this.opts={...D,...j(D)};const{es5:W,lines:B}=this.opts.code;this.scope=new l.ValueScope({scope:{},prefixes:w,es5:W,lines:B}),this.logger=U(D.logger);const $=D.validateFormats;D.validateFormats=!1,this.RULES=(0,s.getRules)(),T.call(this,b,D,"NOT SUPPORTED"),T.call(this,x,D,"DEPRECATED","warn"),this._metaOpts=z.call(this),D.formats&&O.call(this),this._addVocabularies(),this._addDefaultMetaSchema(),D.keywords&&M.call(this,D.keywords),typeof D.meta=="object"&&this.addMetaSchema(D.meta),k.call(this),D.validateFormats=$}_addVocabularies(){this.addKeyword("$async")}_addDefaultMetaSchema(){const{$data:D,meta:W,schemaId:B}=this.opts;let $=p;B==="id"&&($={...p},$.id=$.$id,delete $.$id),W&&D&&this.addMetaSchema($,$[B],!1)}defaultMeta(){const{meta:D,schemaId:W}=this.opts;return this.opts.defaultMeta=typeof D=="object"?D[W]||D:void 0}validate(D,W){let B;if(typeof D=="string"){if(B=this.getSchema(D),!B)throw new Error(`no schema with key or ref "${D}"`)}else B=this.compile(D);const $=B(W);return"$async"in B||(this.errors=B.errors),$}compile(D,W){const B=this._addSchema(D,W);return B.validate||this._compileSchemaEnv(B)}compileAsync(D,W){if(typeof this.opts.loadSchema!="function")throw new Error("options.loadSchema should be a function");const{loadSchema:B}=this.opts;return $.call(this,D,W);async function $(ae,Y){await G.call(this,ae.$schema);const te=this._addSchema(ae,Y);return te.validate||ee.call(this,te)}async function G(ae){ae&&!this.getSchema(ae)&&await $.call(this,{$ref:ae},!0)}async function ee(ae){try{return this._compileSchemaEnv(ae)}catch(Y){if(!(Y instanceof a.default))throw Y;return re.call(this,Y),await ne.call(this,Y.missingSchema),ee.call(this,ae)}}function re({missingSchema:ae,missingRef:Y}){if(this.refs[ae])throw new Error(`AnySchema ${ae} is loaded but ${Y} cannot be resolved`)}async function ne(ae){const Y=await Q.call(this,ae);this.refs[ae]||await G.call(this,Y.$schema),this.refs[ae]||this.addSchema(Y,ae,W)}async function Q(ae){const Y=this._loading[ae];if(Y)return Y;try{return await(this._loading[ae]=B(ae))}finally{delete this._loading[ae]}}}addSchema(D,W,B,$=this.opts.validateSchema){if(Array.isArray(D)){for(const ee of D)this.addSchema(ee,void 0,B,$);return this}let G;if(typeof D=="object"){const{schemaId:ee}=this.opts;if(G=D[ee],G!==void 0&&typeof G!="string")throw new Error(`schema ${ee} must be string`)}return W=(0,d.normalizeId)(W||G),this._checkUnique(W),this.schemas[W]=this._addSchema(D,B,W,$,!0),this}addMetaSchema(D,W,B=this.opts.validateSchema){return this.addSchema(D,W,!0,B),this}validateSchema(D,W){if(typeof D=="boolean")return!0;let B;if(B=D.$schema,B!==void 0&&typeof B!="string")throw new Error("$schema must be a string");if(B=B||this.opts.defaultMeta||this.defaultMeta(),!B)return this.logger.warn("meta-schema not available"),this.errors=null,!0;const $=this.validate(B,D);if(!$&&W){const G="schema is invalid: "+this.errorsText();if(this.opts.validateSchema==="log")this.logger.error(G);else throw new Error(G)}return $}getSchema(D){let W;for(;typeof(W=A.call(this,D))=="string";)D=W;if(W===void 0){const{schemaId:B}=this.opts,$=new i.SchemaEnv({schema:{},schemaId:B});if(W=i.resolveSchema.call(this,$,D),!W)return;this.refs[D]=W}return W.validate||this._compileSchemaEnv(W)}removeSchema(D){if(D instanceof RegExp)return this._removeAllSchemas(this.schemas,D),this._removeAllSchemas(this.refs,D),this;switch(typeof D){case"undefined":return this._removeAllSchemas(this.schemas),this._removeAllSchemas(this.refs),this._cache.clear(),this;case"string":{const W=A.call(this,D);return typeof W=="object"&&this._cache.delete(W.schema),delete this.schemas[D],delete this.refs[D],this}case"object":{const W=D;this._cache.delete(W);let B=D[this.opts.schemaId];return B&&(B=(0,d.normalizeId)(B),delete this.schemas[B],delete this.refs[B]),this}default:throw new Error("ajv.removeSchema: invalid parameter")}}addVocabulary(D){for(const W of D)this.addKeyword(W);return this}addKeyword(D,W){let B;if(typeof D=="string")B=D,typeof W=="object"&&(this.logger.warn("these parameters are deprecated, see docs for addKeyword"),W.keyword=B);else if(typeof D=="object"&&W===void 0){if(W=D,B=W.keyword,Array.isArray(B)&&!B.length)throw new Error("addKeywords: keyword must be string or non-empty array")}else throw new Error("invalid addKeywords parameters");if(q.call(this,B,W),!W)return(0,h.eachItem)(B,G=>V.call(this,G)),this;K.call(this,W);const $={...W,type:(0,f.getJSONTypes)(W.type),schemaType:(0,f.getJSONTypes)(W.schemaType)};return(0,h.eachItem)(B,$.type.length===0?G=>V.call(this,G,$):G=>$.type.forEach(ee=>V.call(this,G,$,ee))),this}getKeyword(D){const W=this.RULES.all[D];return typeof W=="object"?W.definition:!!W}removeKeyword(D){const{RULES:W}=this;delete W.keywords[D],delete W.all[D];for(const B of W.rules){const $=B.rules.findIndex(G=>G.keyword===D);$>=0&&B.rules.splice($,1)}return this}addFormat(D,W){return typeof W=="string"&&(W=new RegExp(W)),this.formats[D]=W,this}errorsText(D=this.errors,{separator:W=", ",dataVar:B="data"}={}){return!D||D.length===0?"No errors":D.map($=>`${B}${$.instancePath} ${$.message}`).reduce(($,G)=>$+W+G)}$dataMetaSchema(D,W){const B=this.RULES.all;D=JSON.parse(JSON.stringify(D));for(const $ of W){const G=$.split("/").slice(1);let ee=D;for(const re of G)ee=ee[re];for(const re in B){const ne=B[re];if(typeof ne!="object")continue;const{$data:Q}=ne.definition,ae=ee[re];Q&&ae&&(ee[re]=Z(ae))}}return D}_removeAllSchemas(D,W){for(const B in D){const $=D[B];(!W||W.test(B))&&(typeof $=="string"?delete D[B]:$&&!$.meta&&(this._cache.delete($.schema),delete D[B]))}}_addSchema(D,W,B,$=this.opts.validateSchema,G=this.opts.addUsedSchema){let ee;const{schemaId:re}=this.opts;if(typeof D=="object")ee=D[re];else{if(this.opts.jtd)throw new Error("schema must be object");if(typeof D!="boolean")throw new Error("schema must be object or boolean")}let ne=this._cache.get(D);if(ne!==void 0)return ne;B=(0,d.normalizeId)(ee||B);const Q=d.getSchemaRefs.call(this,D,B);return ne=new i.SchemaEnv({schema:D,schemaId:re,meta:W,baseId:B,localRefs:Q}),this._cache.set(ne.schema,ne),G&&!B.startsWith("#")&&(B&&this._checkUnique(B),this.refs[B]=ne),$&&this.validateSchema(D,!0),ne}_checkUnique(D){if(this.schemas[D]||this.refs[D])throw new Error(`schema with key or id "${D}" already exists`)}_compileSchemaEnv(D){if(D.meta?this._compileMetaSchema(D):i.compileSchema.call(this,D),!D.validate)throw new Error("ajv implementation error");return D.validate}_compileMetaSchema(D){const W=this.opts;this.opts=this._metaOpts;try{i.compileSchema.call(this,D)}finally{this.opts=W}}}C.ValidationError=r.default,C.MissingRefError=a.default,e.default=C;function T(J,D,W,B="error"){for(const $ in J){const G=$;G in D&&this.logger[B](`${W}: option ${$}. ${J[G]}`)}}function A(J){return J=(0,d.normalizeId)(J),this.schemas[J]||this.refs[J]}function k(){const J=this.opts.schemas;if(J)if(Array.isArray(J))this.addSchema(J);else for(const D in J)this.addSchema(J[D],D)}function O(){for(const J in this.opts.formats){const D=this.opts.formats[J];D&&this.addFormat(J,D)}}function M(J){if(Array.isArray(J)){this.addVocabulary(J);return}this.logger.warn("keywords option as map is deprecated, pass array");for(const D in J){const W=J[D];W.keyword||(W.keyword=D),this.addKeyword(W)}}function z(){const J={...this.opts};for(const D of S)delete J[D];return J}const L={log(){},warn(){},error(){}};function U(J){if(J===!1)return L;if(J===void 0)return console;if(J.log&&J.warn&&J.error)return J;throw new Error("logger must implement log, warn and error methods")}const F=/^[a-z_$][a-z0-9_$:-]*$/i;function q(J,D){const{RULES:W}=this;if((0,h.eachItem)(J,B=>{if(W.keywords[B])throw new Error(`Keyword ${B} is already defined`);if(!F.test(B))throw new Error(`Keyword ${B} has invalid name`)}),!!D&&D.$data&&!("code"in D||"validate"in D))throw new Error('$data keyword must have "code" or "validate" function')}function V(J,D,W){var B;const $=D==null?void 0:D.post;if(W&&$)throw new Error('keyword with "post" flag cannot have "type"');const{RULES:G}=this;let ee=$?G.post:G.rules.find(({type:ne})=>ne===W);if(ee||(ee={type:W,rules:[]},G.rules.push(ee)),G.keywords[J]=!0,!D)return;const re={keyword:J,definition:{...D,type:(0,f.getJSONTypes)(D.type),schemaType:(0,f.getJSONTypes)(D.schemaType)}};D.before?P.call(this,ee,re,D.before):ee.rules.push(re),G.all[J]=re,(B=D.implements)===null||B===void 0||B.forEach(ne=>this.addKeyword(ne))}function P(J,D,W){const B=J.rules.findIndex($=>$.keyword===W);B>=0?J.rules.splice(B,0,D):(J.rules.push(D),this.logger.warn(`rule ${W} is not defined`))}function K(J){let{metaSchema:D}=J;D!==void 0&&(J.$data&&this.opts.$data&&(D=Z(D)),J.validateSchema=this.compile(D,!0))}const H={$ref:"https://raw.githubusercontent.com/ajv-validator/ajv/master/lib/refs/data.json#"};function Z(J){return{anyOf:[J,H]}}})(PN)),PN}var jm={},Cm={},Em={},v5;function Ibe(){if(v5)return Em;v5=1,Object.defineProperty(Em,"__esModule",{value:!0});const e={keyword:"id",code(){throw new Error('NOT SUPPORTED: keyword "id", use "$id" for schema ID')}};return Em.default=e,Em}var wo={},x5;function Lbe(){if(x5)return wo;x5=1,Object.defineProperty(wo,"__esModule",{value:!0}),wo.callRef=wo.getValidate=void 0;const e=Qv(),t=fa(),n=Ye(),r=ai(),a=BE(),s=ct(),i={keyword:"$ref",schemaType:"string",code(f){const{gen:h,schema:p,it:g}=f,{baseId:y,schemaEnv:S,validateName:w,opts:b,self:x}=g,{root:_}=S;if((p==="#"||p==="#/")&&y===_.baseId)return C();const j=a.resolveRef.call(x,_,y,p);if(j===void 0)throw new e.default(g.opts.uriResolver,y,p);if(j instanceof a.SchemaEnv)return T(j);return A(j);function C(){if(S===_)return d(f,w,S,S.$async);const k=h.scopeValue("root",{ref:_});return d(f,(0,n._)`${k}.validate`,_,_.$async)}function T(k){const O=l(f,k);d(f,O,k,k.$async)}function A(k){const O=h.scopeValue("schema",b.code.source===!0?{ref:k,code:(0,n.stringify)(k)}:{ref:k}),M=h.name("valid"),z=f.subschema({schema:k,dataTypes:[],schemaPath:n.nil,topSchemaRef:O,errSchemaPath:p},M);f.mergeEvaluated(z),f.ok(M)}}};function l(f,h){const{gen:p}=f;return h.validate?p.scopeValue("validate",{ref:h.validate}):(0,n._)`${p.scopeValue("wrapper",{ref:h})}.validate`}wo.getValidate=l;function d(f,h,p,g){const{gen:y,it:S}=f,{allErrors:w,schemaEnv:b,opts:x}=S,_=x.passContext?r.default.this:n.nil;g?j():C();function j(){if(!b.$async)throw new Error("async schema referenced by sync schema");const k=y.let("valid");y.try(()=>{y.code((0,n._)`await ${(0,t.callValidateCode)(f,h,_)}`),A(h),w||y.assign(k,!0)},O=>{y.if((0,n._)`!(${O} instanceof ${S.ValidationError})`,()=>y.throw(O)),T(O),w||y.assign(k,!1)}),f.ok(k)}function C(){f.result((0,t.callValidateCode)(f,h,_),()=>A(h),()=>T(h))}function T(k){const O=(0,n._)`${k}.errors`;y.assign(r.default.vErrors,(0,n._)`${r.default.vErrors} === null ? ${O} : ${r.default.vErrors}.concat(${O})`),y.assign(r.default.errors,(0,n._)`${r.default.vErrors}.length`)}function A(k){var O;if(!S.opts.unevaluated)return;const M=(O=p==null?void 0:p.validate)===null||O===void 0?void 0:O.evaluated;if(S.props!==!0)if(M&&!M.dynamicProps)M.props!==void 0&&(S.props=s.mergeEvaluated.props(y,M.props,S.props));else{const z=y.var("props",(0,n._)`${k}.evaluated.props`);S.props=s.mergeEvaluated.props(y,z,S.props,n.Name)}if(S.items!==!0)if(M&&!M.dynamicItems)M.items!==void 0&&(S.items=s.mergeEvaluated.items(y,M.items,S.items));else{const z=y.var("items",(0,n._)`${k}.evaluated.items`);S.items=s.mergeEvaluated.items(y,z,S.items,n.Name)}}}return wo.callRef=d,wo.default=i,wo}var b5;function zbe(){if(b5)return Cm;b5=1,Object.defineProperty(Cm,"__esModule",{value:!0});const e=Ibe(),t=Lbe(),n=["$schema","$id","$defs","$vocabulary",{keyword:"$comment"},"definitions",e.default,t.default];return Cm.default=n,Cm}var Tm={},Am={},w5;function qbe(){if(w5)return Am;w5=1,Object.defineProperty(Am,"__esModule",{value:!0});const e=Ye(),t=e.operators,n={maximum:{okStr:"<=",ok:t.LTE,fail:t.GT},minimum:{okStr:">=",ok:t.GTE,fail:t.LT},exclusiveMaximum:{okStr:"<",ok:t.LT,fail:t.GTE},exclusiveMinimum:{okStr:">",ok:t.GT,fail:t.LTE}},r={message:({keyword:s,schemaCode:i})=>(0,e.str)`must be ${n[s].okStr} ${i}`,params:({keyword:s,schemaCode:i})=>(0,e._)`{comparison: ${n[s].okStr}, limit: ${i}}`},a={keyword:Object.keys(n),type:"number",schemaType:"number",$data:!0,error:r,code(s){const{keyword:i,data:l,schemaCode:d}=s;s.fail$data((0,e._)`${l} ${n[i].fail} ${d} || isNaN(${l})`)}};return Am.default=a,Am}var Rm={},S5;function Fbe(){if(S5)return Rm;S5=1,Object.defineProperty(Rm,"__esModule",{value:!0});const e=Ye(),n={keyword:"multipleOf",type:"number",schemaType:"number",$data:!0,error:{message:({schemaCode:r})=>(0,e.str)`must be multiple of ${r}`,params:({schemaCode:r})=>(0,e._)`{multipleOf: ${r}}`},code(r){const{gen:a,data:s,schemaCode:i,it:l}=r,d=l.opts.multipleOfPrecision,f=a.let("res"),h=d?(0,e._)`Math.abs(Math.round(${f}) - ${f}) > 1e-${d}`:(0,e._)`${f} !== parseInt(${f})`;r.fail$data((0,e._)`(${i} === 0 || (${f} = ${s}/${i}, ${h}))`)}};return Rm.default=n,Rm}var km={},Om={},_5;function Ube(){if(_5)return Om;_5=1,Object.defineProperty(Om,"__esModule",{value:!0});function e(t){const n=t.length;let r=0,a=0,s;for(;a<n;)r++,s=t.charCodeAt(a++),s>=55296&&s<=56319&&a<n&&(s=t.charCodeAt(a),(s&64512)===56320&&a++);return r}return Om.default=e,e.code='require("ajv/dist/runtime/ucs2length").default',Om}var N5;function Hbe(){if(N5)return km;N5=1,Object.defineProperty(km,"__esModule",{value:!0});const e=Ye(),t=ct(),n=Ube(),a={keyword:["maxLength","minLength"],type:"string",schemaType:"number",$data:!0,error:{message({keyword:s,schemaCode:i}){const l=s==="maxLength"?"more":"fewer";return(0,e.str)`must NOT have ${l} than ${i} characters`},params:({schemaCode:s})=>(0,e._)`{limit: ${s}}`},code(s){const{keyword:i,data:l,schemaCode:d,it:f}=s,h=i==="maxLength"?e.operators.GT:e.operators.LT,p=f.opts.unicode===!1?(0,e._)`${l}.length`:(0,e._)`${(0,t.useFunc)(s.gen,n.default)}(${l})`;s.fail$data((0,e._)`${p} ${h} ${d}`)}};return km.default=a,km}var Mm={},j5;function Bbe(){if(j5)return Mm;j5=1,Object.defineProperty(Mm,"__esModule",{value:!0});const e=fa(),t=Ye(),r={keyword:"pattern",type:"string",schemaType:"string",$data:!0,error:{message:({schemaCode:a})=>(0,t.str)`must match pattern "${a}"`,params:({schemaCode:a})=>(0,t._)`{pattern: ${a}}`},code(a){const{data:s,$data:i,schema:l,schemaCode:d,it:f}=a,h=f.opts.unicodeRegExp?"u":"",p=i?(0,t._)`(new RegExp(${d}, ${h}))`:(0,e.usePattern)(a,l);a.fail$data((0,t._)`!${p}.test(${s})`)}};return Mm.default=r,Mm}var Dm={},C5;function Vbe(){if(C5)return Dm;C5=1,Object.defineProperty(Dm,"__esModule",{value:!0});const e=Ye(),n={keyword:["maxProperties","minProperties"],type:"object",schemaType:"number",$data:!0,error:{message({keyword:r,schemaCode:a}){const s=r==="maxProperties"?"more":"fewer";return(0,e.str)`must NOT have ${s} than ${a} properties`},params:({schemaCode:r})=>(0,e._)`{limit: ${r}}`},code(r){const{keyword:a,data:s,schemaCode:i}=r,l=a==="maxProperties"?e.operators.GT:e.operators.LT;r.fail$data((0,e._)`Object.keys(${s}).length ${l} ${i}`)}};return Dm.default=n,Dm}var Pm={},E5;function Wbe(){if(E5)return Pm;E5=1,Object.defineProperty(Pm,"__esModule",{value:!0});const e=fa(),t=Ye(),n=ct(),a={keyword:"required",type:"object",schemaType:"array",$data:!0,error:{message:({params:{missingProperty:s}})=>(0,t.str)`must have required property '${s}'`,params:({params:{missingProperty:s}})=>(0,t._)`{missingProperty: ${s}}`},code(s){const{gen:i,schema:l,schemaCode:d,data:f,$data:h,it:p}=s,{opts:g}=p;if(!h&&l.length===0)return;const y=l.length>=g.loopRequired;if(p.allErrors?S():w(),g.strictRequired){const _=s.parentSchema.properties,{definedProperties:j}=s.it;for(const C of l)if((_==null?void 0:_[C])===void 0&&!j.has(C)){const T=p.schemaEnv.baseId+p.errSchemaPath,A=`required property "${C}" is not defined at "${T}" (strictRequired)`;(0,n.checkStrictMode)(p,A,p.opts.strictRequired)}}function S(){if(y||h)s.block$data(t.nil,b);else for(const _ of l)(0,e.checkReportMissingProp)(s,_)}function w(){const _=i.let("missing");if(y||h){const j=i.let("valid",!0);s.block$data(j,()=>x(_,j)),s.ok(j)}else i.if((0,e.checkMissingProp)(s,l,_)),(0,e.reportMissingProp)(s,_),i.else()}function b(){i.forOf("prop",d,_=>{s.setParams({missingProperty:_}),i.if((0,e.noPropertyInData)(i,f,_,g.ownProperties),()=>s.error())})}function x(_,j){s.setParams({missingProperty:_}),i.forOf(_,d,()=>{i.assign(j,(0,e.propertyInData)(i,f,_,g.ownProperties)),i.if((0,t.not)(j),()=>{s.error(),i.break()})},t.nil)}}};return Pm.default=a,Pm}var $m={},T5;function Gbe(){if(T5)return $m;T5=1,Object.defineProperty($m,"__esModule",{value:!0});const e=Ye(),n={keyword:["maxItems","minItems"],type:"array",schemaType:"number",$data:!0,error:{message({keyword:r,schemaCode:a}){const s=r==="maxItems"?"more":"fewer";return(0,e.str)`must NOT have ${s} than ${a} items`},params:({schemaCode:r})=>(0,e._)`{limit: ${r}}`},code(r){const{keyword:a,data:s,schemaCode:i}=r,l=a==="maxItems"?e.operators.GT:e.operators.LT;r.fail$data((0,e._)`${s}.length ${l} ${i}`)}};return $m.default=n,$m}var Im={},Lm={},A5;function VE(){if(A5)return Lm;A5=1,Object.defineProperty(Lm,"__esModule",{value:!0});const e=CU();return e.code='require("ajv/dist/runtime/equal").default',Lm.default=e,Lm}var R5;function Kbe(){if(R5)return Im;R5=1,Object.defineProperty(Im,"__esModule",{value:!0});const e=my(),t=Ye(),n=ct(),r=VE(),s={keyword:"uniqueItems",type:"array",schemaType:"boolean",$data:!0,error:{message:({params:{i,j:l}})=>(0,t.str)`must NOT have duplicate items (items ## ${l} and ${i} are identical)`,params:({params:{i,j:l}})=>(0,t._)`{i: ${i}, j: ${l}}`},code(i){const{gen:l,data:d,$data:f,schema:h,parentSchema:p,schemaCode:g,it:y}=i;if(!f&&!h)return;const S=l.let("valid"),w=p.items?(0,e.getSchemaTypes)(p.items):[];i.block$data(S,b,(0,t._)`${g} === false`),i.ok(S);function b(){const C=l.let("i",(0,t._)`${d}.length`),T=l.let("j");i.setParams({i:C,j:T}),l.assign(S,!0),l.if((0,t._)`${C} > 1`,()=>(x()?_:j)(C,T))}function x(){return w.length>0&&!w.some(C=>C==="object"||C==="array")}function _(C,T){const A=l.name("item"),k=(0,e.checkDataTypes)(w,A,y.opts.strictNumbers,e.DataType.Wrong),O=l.const("indices",(0,t._)`{}`);l.for((0,t._)`;${C}--;`,()=>{l.let(A,(0,t._)`${d}[${C}]`),l.if(k,(0,t._)`continue`),w.length>1&&l.if((0,t._)`typeof ${A} == "string"`,(0,t._)`${A} += "_"`),l.if((0,t._)`typeof ${O}[${A}] == "number"`,()=>{l.assign(T,(0,t._)`${O}[${A}]`),i.error(),l.assign(S,!1).break()}).code((0,t._)`${O}[${A}] = ${C}`)})}function j(C,T){const A=(0,n.useFunc)(l,r.default),k=l.name("outer");l.label(k).for((0,t._)`;${C}--;`,()=>l.for((0,t._)`${T} = ${C}; ${T}--;`,()=>l.if((0,t._)`${A}(${d}[${C}], ${d}[${T}])`,()=>{i.error(),l.assign(S,!1).break(k)})))}}};return Im.default=s,Im}var zm={},k5;function Ybe(){if(k5)return zm;k5=1,Object.defineProperty(zm,"__esModule",{value:!0});const e=Ye(),t=ct(),n=VE(),a={keyword:"const",$data:!0,error:{message:"must be equal to constant",params:({schemaCode:s})=>(0,e._)`{allowedValue: ${s}}`},code(s){const{gen:i,data:l,$data:d,schemaCode:f,schema:h}=s;d||h&&typeof h=="object"?s.fail$data((0,e._)`!${(0,t.useFunc)(i,n.default)}(${l}, ${f})`):s.fail((0,e._)`${h} !== ${l}`)}};return zm.default=a,zm}var qm={},O5;function Xbe(){if(O5)return qm;O5=1,Object.defineProperty(qm,"__esModule",{value:!0});const e=Ye(),t=ct(),n=VE(),a={keyword:"enum",schemaType:"array",$data:!0,error:{message:"must be equal to one of the allowed values",params:({schemaCode:s})=>(0,e._)`{allowedValues: ${s}}`},code(s){const{gen:i,data:l,$data:d,schema:f,schemaCode:h,it:p}=s;if(!d&&f.length===0)throw new Error("enum must have non-empty array");const g=f.length>=p.opts.loopEnum;let y;const S=()=>y??(y=(0,t.useFunc)(i,n.default));let w;if(g||d)w=i.let("valid"),s.block$data(w,b);else{if(!Array.isArray(f))throw new Error("ajv implementation error");const _=i.const("vSchema",h);w=(0,e.or)(...f.map((j,C)=>x(_,C)))}s.pass(w);function b(){i.assign(w,!1),i.forOf("v",h,_=>i.if((0,e._)`${S()}(${l}, ${_})`,()=>i.assign(w,!0).break()))}function x(_,j){const C=f[j];return typeof C=="object"&&C!==null?(0,e._)`${S()}(${l}, ${_}[${j}])`:(0,e._)`${l} === ${C}`}}};return qm.default=a,qm}var M5;function Zbe(){if(M5)return Tm;M5=1,Object.defineProperty(Tm,"__esModule",{value:!0});const e=qbe(),t=Fbe(),n=Hbe(),r=Bbe(),a=Vbe(),s=Wbe(),i=Gbe(),l=Kbe(),d=Ybe(),f=Xbe(),h=[e.default,t.default,n.default,r.default,a.default,s.default,i.default,l.default,{keyword:"type",schemaType:["string","array"]},{keyword:"nullable",schemaType:"boolean"},d.default,f.default];return Tm.default=h,Tm}var Fm={},xc={},D5;function TU(){if(D5)return xc;D5=1,Object.defineProperty(xc,"__esModule",{value:!0}),xc.validateAdditionalItems=void 0;const e=Ye(),t=ct(),r={keyword:"additionalItems",type:"array",schemaType:["boolean","object"],before:"uniqueItems",error:{message:({params:{len:s}})=>(0,e.str)`must NOT have more than ${s} items`,params:({params:{len:s}})=>(0,e._)`{limit: ${s}}`},code(s){const{parentSchema:i,it:l}=s,{items:d}=i;if(!Array.isArray(d)){(0,t.checkStrictMode)(l,'"additionalItems" is ignored when "items" is not an array of schemas');return}a(s,d)}};function a(s,i){const{gen:l,schema:d,data:f,keyword:h,it:p}=s;p.items=!0;const g=l.const("len",(0,e._)`${f}.length`);if(d===!1)s.setParams({len:i.length}),s.pass((0,e._)`${g} <= ${i.length}`);else if(typeof d=="object"&&!(0,t.alwaysValidSchema)(p,d)){const S=l.var("valid",(0,e._)`${g} <= ${i.length}`);l.if((0,e.not)(S),()=>y(S)),s.ok(S)}function y(S){l.forRange("i",i.length,g,w=>{s.subschema({keyword:h,dataProp:w,dataPropType:t.Type.Num},S),p.allErrors||l.if((0,e.not)(S),()=>l.break())})}}return xc.validateAdditionalItems=a,xc.default=r,xc}var Um={},bc={},P5;function AU(){if(P5)return bc;P5=1,Object.defineProperty(bc,"__esModule",{value:!0}),bc.validateTuple=void 0;const e=Ye(),t=ct(),n=fa(),r={keyword:"items",type:"array",schemaType:["object","array","boolean"],before:"uniqueItems",code(s){const{schema:i,it:l}=s;if(Array.isArray(i))return a(s,"additionalItems",i);l.items=!0,!(0,t.alwaysValidSchema)(l,i)&&s.ok((0,n.validateArray)(s))}};function a(s,i,l=s.schema){const{gen:d,parentSchema:f,data:h,keyword:p,it:g}=s;w(f),g.opts.unevaluated&&l.length&&g.items!==!0&&(g.items=t.mergeEvaluated.items(d,l.length,g.items));const y=d.name("valid"),S=d.const("len",(0,e._)`${h}.length`);l.forEach((b,x)=>{(0,t.alwaysValidSchema)(g,b)||(d.if((0,e._)`${S} > ${x}`,()=>s.subschema({keyword:p,schemaProp:x,dataProp:x},y)),s.ok(y))});function w(b){const{opts:x,errSchemaPath:_}=g,j=l.length,C=j===b.minItems&&(j===b.maxItems||b[i]===!1);if(x.strictTuples&&!C){const T=`"${p}" is ${j}-tuple, but minItems or maxItems/${i} are not specified or different at path "${_}"`;(0,t.checkStrictMode)(g,T,x.strictTuples)}}}return bc.validateTuple=a,bc.default=r,bc}var $5;function Qbe(){if($5)return Um;$5=1,Object.defineProperty(Um,"__esModule",{value:!0});const e=AU(),t={keyword:"prefixItems",type:"array",schemaType:["array"],before:"uniqueItems",code:n=>(0,e.validateTuple)(n,"items")};return Um.default=t,Um}var Hm={},I5;function Jbe(){if(I5)return Hm;I5=1,Object.defineProperty(Hm,"__esModule",{value:!0});const e=Ye(),t=ct(),n=fa(),r=TU(),s={keyword:"items",type:"array",schemaType:["object","boolean"],before:"uniqueItems",error:{message:({params:{len:i}})=>(0,e.str)`must NOT have more than ${i} items`,params:({params:{len:i}})=>(0,e._)`{limit: ${i}}`},code(i){const{schema:l,parentSchema:d,it:f}=i,{prefixItems:h}=d;f.items=!0,!(0,t.alwaysValidSchema)(f,l)&&(h?(0,r.validateAdditionalItems)(i,h):i.ok((0,n.validateArray)(i)))}};return Hm.default=s,Hm}var Bm={},L5;function ewe(){if(L5)return Bm;L5=1,Object.defineProperty(Bm,"__esModule",{value:!0});const e=Ye(),t=ct(),r={keyword:"contains",type:"array",schemaType:["object","boolean"],before:"uniqueItems",trackErrors:!0,error:{message:({params:{min:a,max:s}})=>s===void 0?(0,e.str)`must contain at least ${a} valid item(s)`:(0,e.str)`must contain at least ${a} and no more than ${s} valid item(s)`,params:({params:{min:a,max:s}})=>s===void 0?(0,e._)`{minContains: ${a}}`:(0,e._)`{minContains: ${a}, maxContains: ${s}}`},code(a){const{gen:s,schema:i,parentSchema:l,data:d,it:f}=a;let h,p;const{minContains:g,maxContains:y}=l;f.opts.next?(h=g===void 0?1:g,p=y):h=1;const S=s.const("len",(0,e._)`${d}.length`);if(a.setParams({min:h,max:p}),p===void 0&&h===0){(0,t.checkStrictMode)(f,'"minContains" == 0 without "maxContains": "contains" keyword ignored');return}if(p!==void 0&&h>p){(0,t.checkStrictMode)(f,'"minContains" > "maxContains" is always invalid'),a.fail();return}if((0,t.alwaysValidSchema)(f,i)){let j=(0,e._)`${S} >= ${h}`;p!==void 0&&(j=(0,e._)`${j} && ${S} <= ${p}`),a.pass(j);return}f.items=!0;const w=s.name("valid");p===void 0&&h===1?x(w,()=>s.if(w,()=>s.break())):h===0?(s.let(w,!0),p!==void 0&&s.if((0,e._)`${d}.length > 0`,b)):(s.let(w,!1),b()),a.result(w,()=>a.reset());function b(){const j=s.name("_valid"),C=s.let("count",0);x(j,()=>s.if(j,()=>_(C)))}function x(j,C){s.forRange("i",0,S,T=>{a.subschema({keyword:"contains",dataProp:T,dataPropType:t.Type.Num,compositeRule:!0},j),C()})}function _(j){s.code((0,e._)`${j}++`),p===void 0?s.if((0,e._)`${j} >= ${h}`,()=>s.assign(w,!0).break()):(s.if((0,e._)`${j} > ${p}`,()=>s.assign(w,!1).break()),h===1?s.assign(w,!0):s.if((0,e._)`${j} >= ${h}`,()=>s.assign(w,!0)))}}};return Bm.default=r,Bm}var BN={},z5;function twe(){return z5||(z5=1,(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.validateSchemaDeps=e.validatePropertyDeps=e.error=void 0;const t=Ye(),n=ct(),r=fa();e.error={message:({params:{property:d,depsCount:f,deps:h}})=>{const p=f===1?"property":"properties";return(0,t.str)`must have ${p} ${h} when property ${d} is present`},params:({params:{property:d,depsCount:f,deps:h,missingProperty:p}})=>(0,t._)`{property: ${d},
|
|
742
|
+
missingProperty: ${p},
|
|
743
|
+
depsCount: ${f},
|
|
744
|
+
deps: ${h}}`};const a={keyword:"dependencies",type:"object",schemaType:"object",error:e.error,code(d){const[f,h]=s(d);i(d,f),l(d,h)}};function s({schema:d}){const f={},h={};for(const p in d){if(p==="__proto__")continue;const g=Array.isArray(d[p])?f:h;g[p]=d[p]}return[f,h]}function i(d,f=d.schema){const{gen:h,data:p,it:g}=d;if(Object.keys(f).length===0)return;const y=h.let("missing");for(const S in f){const w=f[S];if(w.length===0)continue;const b=(0,r.propertyInData)(h,p,S,g.opts.ownProperties);d.setParams({property:S,depsCount:w.length,deps:w.join(", ")}),g.allErrors?h.if(b,()=>{for(const x of w)(0,r.checkReportMissingProp)(d,x)}):(h.if((0,t._)`${b} && (${(0,r.checkMissingProp)(d,w,y)})`),(0,r.reportMissingProp)(d,y),h.else())}}e.validatePropertyDeps=i;function l(d,f=d.schema){const{gen:h,data:p,keyword:g,it:y}=d,S=h.name("valid");for(const w in f)(0,n.alwaysValidSchema)(y,f[w])||(h.if((0,r.propertyInData)(h,p,w,y.opts.ownProperties),()=>{const b=d.subschema({keyword:g,schemaProp:w},S);d.mergeValidEvaluated(b,S)},()=>h.var(S,!0)),d.ok(S))}e.validateSchemaDeps=l,e.default=a})(BN)),BN}var Vm={},q5;function nwe(){if(q5)return Vm;q5=1,Object.defineProperty(Vm,"__esModule",{value:!0});const e=Ye(),t=ct(),r={keyword:"propertyNames",type:"object",schemaType:["object","boolean"],error:{message:"property name must be valid",params:({params:a})=>(0,e._)`{propertyName: ${a.propertyName}}`},code(a){const{gen:s,schema:i,data:l,it:d}=a;if((0,t.alwaysValidSchema)(d,i))return;const f=s.name("valid");s.forIn("key",l,h=>{a.setParams({propertyName:h}),a.subschema({keyword:"propertyNames",data:h,dataTypes:["string"],propertyName:h,compositeRule:!0},f),s.if((0,e.not)(f),()=>{a.error(!0),d.allErrors||s.break()})}),a.ok(f)}};return Vm.default=r,Vm}var Wm={},F5;function RU(){if(F5)return Wm;F5=1,Object.defineProperty(Wm,"__esModule",{value:!0});const e=fa(),t=Ye(),n=ai(),r=ct(),s={keyword:"additionalProperties",type:["object"],schemaType:["boolean","object"],allowUndefined:!0,trackErrors:!0,error:{message:"must NOT have additional properties",params:({params:i})=>(0,t._)`{additionalProperty: ${i.additionalProperty}}`},code(i){const{gen:l,schema:d,parentSchema:f,data:h,errsCount:p,it:g}=i;if(!p)throw new Error("ajv implementation error");const{allErrors:y,opts:S}=g;if(g.props=!0,S.removeAdditional!=="all"&&(0,r.alwaysValidSchema)(g,d))return;const w=(0,e.allSchemaProperties)(f.properties),b=(0,e.allSchemaProperties)(f.patternProperties);x(),i.ok((0,t._)`${p} === ${n.default.errors}`);function x(){l.forIn("key",h,A=>{!w.length&&!b.length?C(A):l.if(_(A),()=>C(A))})}function _(A){let k;if(w.length>8){const O=(0,r.schemaRefOrVal)(g,f.properties,"properties");k=(0,e.isOwnProperty)(l,O,A)}else w.length?k=(0,t.or)(...w.map(O=>(0,t._)`${A} === ${O}`)):k=t.nil;return b.length&&(k=(0,t.or)(k,...b.map(O=>(0,t._)`${(0,e.usePattern)(i,O)}.test(${A})`))),(0,t.not)(k)}function j(A){l.code((0,t._)`delete ${h}[${A}]`)}function C(A){if(S.removeAdditional==="all"||S.removeAdditional&&d===!1){j(A);return}if(d===!1){i.setParams({additionalProperty:A}),i.error(),y||l.break();return}if(typeof d=="object"&&!(0,r.alwaysValidSchema)(g,d)){const k=l.name("valid");S.removeAdditional==="failing"?(T(A,k,!1),l.if((0,t.not)(k),()=>{i.reset(),j(A)})):(T(A,k),y||l.if((0,t.not)(k),()=>l.break()))}}function T(A,k,O){const M={keyword:"additionalProperties",dataProp:A,dataPropType:r.Type.Str};O===!1&&Object.assign(M,{compositeRule:!0,createErrors:!1,allErrors:!1}),i.subschema(M,k)}}};return Wm.default=s,Wm}var Gm={},U5;function rwe(){if(U5)return Gm;U5=1,Object.defineProperty(Gm,"__esModule",{value:!0});const e=Zv(),t=fa(),n=ct(),r=RU(),a={keyword:"properties",type:"object",schemaType:"object",code(s){const{gen:i,schema:l,parentSchema:d,data:f,it:h}=s;h.opts.removeAdditional==="all"&&d.additionalProperties===void 0&&r.default.code(new e.KeywordCxt(h,r.default,"additionalProperties"));const p=(0,t.allSchemaProperties)(l);for(const b of p)h.definedProperties.add(b);h.opts.unevaluated&&p.length&&h.props!==!0&&(h.props=n.mergeEvaluated.props(i,(0,n.toHash)(p),h.props));const g=p.filter(b=>!(0,n.alwaysValidSchema)(h,l[b]));if(g.length===0)return;const y=i.name("valid");for(const b of g)S(b)?w(b):(i.if((0,t.propertyInData)(i,f,b,h.opts.ownProperties)),w(b),h.allErrors||i.else().var(y,!0),i.endIf()),s.it.definedProperties.add(b),s.ok(y);function S(b){return h.opts.useDefaults&&!h.compositeRule&&l[b].default!==void 0}function w(b){s.subschema({keyword:"properties",schemaProp:b,dataProp:b},y)}}};return Gm.default=a,Gm}var Km={},H5;function awe(){if(H5)return Km;H5=1,Object.defineProperty(Km,"__esModule",{value:!0});const e=fa(),t=Ye(),n=ct(),r=ct(),a={keyword:"patternProperties",type:"object",schemaType:"object",code(s){const{gen:i,schema:l,data:d,parentSchema:f,it:h}=s,{opts:p}=h,g=(0,e.allSchemaProperties)(l),y=g.filter(C=>(0,n.alwaysValidSchema)(h,l[C]));if(g.length===0||y.length===g.length&&(!h.opts.unevaluated||h.props===!0))return;const S=p.strictSchema&&!p.allowMatchingProperties&&f.properties,w=i.name("valid");h.props!==!0&&!(h.props instanceof t.Name)&&(h.props=(0,r.evaluatedPropsToName)(i,h.props));const{props:b}=h;x();function x(){for(const C of g)S&&_(C),h.allErrors?j(C):(i.var(w,!0),j(C),i.if(w))}function _(C){for(const T in S)new RegExp(C).test(T)&&(0,n.checkStrictMode)(h,`property ${T} matches pattern ${C} (use allowMatchingProperties)`)}function j(C){i.forIn("key",d,T=>{i.if((0,t._)`${(0,e.usePattern)(s,C)}.test(${T})`,()=>{const A=y.includes(C);A||s.subschema({keyword:"patternProperties",schemaProp:C,dataProp:T,dataPropType:r.Type.Str},w),h.opts.unevaluated&&b!==!0?i.assign((0,t._)`${b}[${T}]`,!0):!A&&!h.allErrors&&i.if((0,t.not)(w),()=>i.break())})})}}};return Km.default=a,Km}var Ym={},B5;function swe(){if(B5)return Ym;B5=1,Object.defineProperty(Ym,"__esModule",{value:!0});const e=ct(),t={keyword:"not",schemaType:["object","boolean"],trackErrors:!0,code(n){const{gen:r,schema:a,it:s}=n;if((0,e.alwaysValidSchema)(s,a)){n.fail();return}const i=r.name("valid");n.subschema({keyword:"not",compositeRule:!0,createErrors:!1,allErrors:!1},i),n.failResult(i,()=>n.reset(),()=>n.error())},error:{message:"must NOT be valid"}};return Ym.default=t,Ym}var Xm={},V5;function owe(){if(V5)return Xm;V5=1,Object.defineProperty(Xm,"__esModule",{value:!0});const t={keyword:"anyOf",schemaType:"array",trackErrors:!0,code:fa().validateUnion,error:{message:"must match a schema in anyOf"}};return Xm.default=t,Xm}var Zm={},W5;function iwe(){if(W5)return Zm;W5=1,Object.defineProperty(Zm,"__esModule",{value:!0});const e=Ye(),t=ct(),r={keyword:"oneOf",schemaType:"array",trackErrors:!0,error:{message:"must match exactly one schema in oneOf",params:({params:a})=>(0,e._)`{passingSchemas: ${a.passing}}`},code(a){const{gen:s,schema:i,parentSchema:l,it:d}=a;if(!Array.isArray(i))throw new Error("ajv implementation error");if(d.opts.discriminator&&l.discriminator)return;const f=i,h=s.let("valid",!1),p=s.let("passing",null),g=s.name("_valid");a.setParams({passing:p}),s.block(y),a.result(h,()=>a.reset(),()=>a.error(!0));function y(){f.forEach((S,w)=>{let b;(0,t.alwaysValidSchema)(d,S)?s.var(g,!0):b=a.subschema({keyword:"oneOf",schemaProp:w,compositeRule:!0},g),w>0&&s.if((0,e._)`${g} && ${h}`).assign(h,!1).assign(p,(0,e._)`[${p}, ${w}]`).else(),s.if(g,()=>{s.assign(h,!0),s.assign(p,w),b&&a.mergeEvaluated(b,e.Name)})})}}};return Zm.default=r,Zm}var Qm={},G5;function lwe(){if(G5)return Qm;G5=1,Object.defineProperty(Qm,"__esModule",{value:!0});const e=ct(),t={keyword:"allOf",schemaType:"array",code(n){const{gen:r,schema:a,it:s}=n;if(!Array.isArray(a))throw new Error("ajv implementation error");const i=r.name("valid");a.forEach((l,d)=>{if((0,e.alwaysValidSchema)(s,l))return;const f=n.subschema({keyword:"allOf",schemaProp:d},i);n.ok(i),n.mergeEvaluated(f)})}};return Qm.default=t,Qm}var Jm={},K5;function cwe(){if(K5)return Jm;K5=1,Object.defineProperty(Jm,"__esModule",{value:!0});const e=Ye(),t=ct(),r={keyword:"if",schemaType:["object","boolean"],trackErrors:!0,error:{message:({params:s})=>(0,e.str)`must match "${s.ifClause}" schema`,params:({params:s})=>(0,e._)`{failingKeyword: ${s.ifClause}}`},code(s){const{gen:i,parentSchema:l,it:d}=s;l.then===void 0&&l.else===void 0&&(0,t.checkStrictMode)(d,'"if" without "then" and "else" is ignored');const f=a(d,"then"),h=a(d,"else");if(!f&&!h)return;const p=i.let("valid",!0),g=i.name("_valid");if(y(),s.reset(),f&&h){const w=i.let("ifClause");s.setParams({ifClause:w}),i.if(g,S("then",w),S("else",w))}else f?i.if(g,S("then")):i.if((0,e.not)(g),S("else"));s.pass(p,()=>s.error(!0));function y(){const w=s.subschema({keyword:"if",compositeRule:!0,createErrors:!1,allErrors:!1},g);s.mergeEvaluated(w)}function S(w,b){return()=>{const x=s.subschema({keyword:w},g);i.assign(p,g),s.mergeValidEvaluated(x,p),b?i.assign(b,(0,e._)`${w}`):s.setParams({ifClause:w})}}}};function a(s,i){const l=s.schema[i];return l!==void 0&&!(0,t.alwaysValidSchema)(s,l)}return Jm.default=r,Jm}var eg={},Y5;function uwe(){if(Y5)return eg;Y5=1,Object.defineProperty(eg,"__esModule",{value:!0});const e=ct(),t={keyword:["then","else"],schemaType:["object","boolean"],code({keyword:n,parentSchema:r,it:a}){r.if===void 0&&(0,e.checkStrictMode)(a,`"${n}" without "if" is ignored`)}};return eg.default=t,eg}var X5;function dwe(){if(X5)return Fm;X5=1,Object.defineProperty(Fm,"__esModule",{value:!0});const e=TU(),t=Qbe(),n=AU(),r=Jbe(),a=ewe(),s=twe(),i=nwe(),l=RU(),d=rwe(),f=awe(),h=swe(),p=owe(),g=iwe(),y=lwe(),S=cwe(),w=uwe();function b(x=!1){const _=[h.default,p.default,g.default,y.default,S.default,w.default,i.default,l.default,s.default,d.default,f.default];return x?_.push(t.default,r.default):_.push(e.default,n.default),_.push(a.default),_}return Fm.default=b,Fm}var tg={},ng={},Z5;function fwe(){if(Z5)return ng;Z5=1,Object.defineProperty(ng,"__esModule",{value:!0});const e=Ye(),n={keyword:"format",type:["number","string"],schemaType:"string",$data:!0,error:{message:({schemaCode:r})=>(0,e.str)`must match format "${r}"`,params:({schemaCode:r})=>(0,e._)`{format: ${r}}`},code(r,a){const{gen:s,data:i,$data:l,schema:d,schemaCode:f,it:h}=r,{opts:p,errSchemaPath:g,schemaEnv:y,self:S}=h;if(!p.validateFormats)return;l?w():b();function w(){const x=s.scopeValue("formats",{ref:S.formats,code:p.code.formats}),_=s.const("fDef",(0,e._)`${x}[${f}]`),j=s.let("fType"),C=s.let("format");s.if((0,e._)`typeof ${_} == "object" && !(${_} instanceof RegExp)`,()=>s.assign(j,(0,e._)`${_}.type || "string"`).assign(C,(0,e._)`${_}.validate`),()=>s.assign(j,(0,e._)`"string"`).assign(C,_)),r.fail$data((0,e.or)(T(),A()));function T(){return p.strictSchema===!1?e.nil:(0,e._)`${f} && !${C}`}function A(){const k=y.$async?(0,e._)`(${_}.async ? await ${C}(${i}) : ${C}(${i}))`:(0,e._)`${C}(${i})`,O=(0,e._)`(typeof ${C} == "function" ? ${k} : ${C}.test(${i}))`;return(0,e._)`${C} && ${C} !== true && ${j} === ${a} && !${O}`}}function b(){const x=S.formats[d];if(!x){T();return}if(x===!0)return;const[_,j,C]=A(x);_===a&&r.pass(k());function T(){if(p.strictSchema===!1){S.logger.warn(O());return}throw new Error(O());function O(){return`unknown format "${d}" ignored in schema at path "${g}"`}}function A(O){const M=O instanceof RegExp?(0,e.regexpCode)(O):p.code.formats?(0,e._)`${p.code.formats}${(0,e.getProperty)(d)}`:void 0,z=s.scopeValue("formats",{key:d,ref:O,code:M});return typeof O=="object"&&!(O instanceof RegExp)?[O.type||"string",O.validate,(0,e._)`${z}.validate`]:["string",O,z]}function k(){if(typeof x=="object"&&!(x instanceof RegExp)&&x.async){if(!y.$async)throw new Error("async format in sync schema");return(0,e._)`await ${C}(${i})`}return typeof j=="function"?(0,e._)`${C}(${i})`:(0,e._)`${C}.test(${i})`}}}};return ng.default=n,ng}var Q5;function hwe(){if(Q5)return tg;Q5=1,Object.defineProperty(tg,"__esModule",{value:!0});const t=[fwe().default];return tg.default=t,tg}var Ri={},J5;function pwe(){return J5||(J5=1,Object.defineProperty(Ri,"__esModule",{value:!0}),Ri.contentVocabulary=Ri.metadataVocabulary=void 0,Ri.metadataVocabulary=["title","description","default","deprecated","readOnly","writeOnly","examples"],Ri.contentVocabulary=["contentMediaType","contentEncoding","contentSchema"]),Ri}var eI;function mwe(){if(eI)return jm;eI=1,Object.defineProperty(jm,"__esModule",{value:!0});const e=zbe(),t=Zbe(),n=dwe(),r=hwe(),a=pwe(),s=[e.default,t.default,(0,n.default)(),r.default,a.metadataVocabulary,a.contentVocabulary];return jm.default=s,jm}var rg={},Md={},tI;function gwe(){if(tI)return Md;tI=1,Object.defineProperty(Md,"__esModule",{value:!0}),Md.DiscrError=void 0;var e;return(function(t){t.Tag="tag",t.Mapping="mapping"})(e||(Md.DiscrError=e={})),Md}var nI;function ywe(){if(nI)return rg;nI=1,Object.defineProperty(rg,"__esModule",{value:!0});const e=Ye(),t=gwe(),n=BE(),r=Qv(),a=ct(),i={keyword:"discriminator",type:"object",schemaType:"object",error:{message:({params:{discrError:l,tagName:d}})=>l===t.DiscrError.Tag?`tag "${d}" must be string`:`value of tag "${d}" must be in oneOf`,params:({params:{discrError:l,tag:d,tagName:f}})=>(0,e._)`{error: ${l}, tag: ${f}, tagValue: ${d}}`},code(l){const{gen:d,data:f,schema:h,parentSchema:p,it:g}=l,{oneOf:y}=p;if(!g.opts.discriminator)throw new Error("discriminator: requires discriminator option");const S=h.propertyName;if(typeof S!="string")throw new Error("discriminator: requires propertyName");if(h.mapping)throw new Error("discriminator: mapping is not supported");if(!y)throw new Error("discriminator: requires oneOf keyword");const w=d.let("valid",!1),b=d.const("tag",(0,e._)`${f}${(0,e.getProperty)(S)}`);d.if((0,e._)`typeof ${b} == "string"`,()=>x(),()=>l.error(!1,{discrError:t.DiscrError.Tag,tag:b,tagName:S})),l.ok(w);function x(){const C=j();d.if(!1);for(const T in C)d.elseIf((0,e._)`${b} === ${T}`),d.assign(w,_(C[T]));d.else(),l.error(!1,{discrError:t.DiscrError.Mapping,tag:b,tagName:S}),d.endIf()}function _(C){const T=d.name("valid"),A=l.subschema({keyword:"oneOf",schemaProp:C},T);return l.mergeEvaluated(A,e.Name),T}function j(){var C;const T={},A=O(p);let k=!0;for(let L=0;L<y.length;L++){let U=y[L];if(U!=null&&U.$ref&&!(0,a.schemaHasRulesButRef)(U,g.self.RULES)){const q=U.$ref;if(U=n.resolveRef.call(g.self,g.schemaEnv.root,g.baseId,q),U instanceof n.SchemaEnv&&(U=U.schema),U===void 0)throw new r.default(g.opts.uriResolver,g.baseId,q)}const F=(C=U==null?void 0:U.properties)===null||C===void 0?void 0:C[S];if(typeof F!="object")throw new Error(`discriminator: oneOf subschemas (or referenced schemas) must have "properties/${S}"`);k=k&&(A||O(U)),M(F,L)}if(!k)throw new Error(`discriminator: "${S}" must be required`);return T;function O({required:L}){return Array.isArray(L)&&L.includes(S)}function M(L,U){if(L.const)z(L.const,U);else if(L.enum)for(const F of L.enum)z(F,U);else throw new Error(`discriminator: "properties/${S}" must have "const" or "enum"`)}function z(L,U){if(typeof L!="string"||L in T)throw new Error(`discriminator: "${S}" values must be unique strings`);T[L]=U}}}};return rg.default=i,rg}const vwe="http://json-schema.org/draft-07/schema#",xwe="http://json-schema.org/draft-07/schema#",bwe="Core schema meta-schema",wwe={schemaArray:{type:"array",minItems:1,items:{$ref:"#"}},nonNegativeInteger:{type:"integer",minimum:0},nonNegativeIntegerDefault0:{allOf:[{$ref:"#/definitions/nonNegativeInteger"},{default:0}]},simpleTypes:{enum:["array","boolean","integer","null","number","object","string"]},stringArray:{type:"array",items:{type:"string"},uniqueItems:!0,default:[]}},Swe=["object","boolean"],_we={$id:{type:"string",format:"uri-reference"},$schema:{type:"string",format:"uri"},$ref:{type:"string",format:"uri-reference"},$comment:{type:"string"},title:{type:"string"},description:{type:"string"},default:!0,readOnly:{type:"boolean",default:!1},examples:{type:"array",items:!0},multipleOf:{type:"number",exclusiveMinimum:0},maximum:{type:"number"},exclusiveMaximum:{type:"number"},minimum:{type:"number"},exclusiveMinimum:{type:"number"},maxLength:{$ref:"#/definitions/nonNegativeInteger"},minLength:{$ref:"#/definitions/nonNegativeIntegerDefault0"},pattern:{type:"string",format:"regex"},additionalItems:{$ref:"#"},items:{anyOf:[{$ref:"#"},{$ref:"#/definitions/schemaArray"}],default:!0},maxItems:{$ref:"#/definitions/nonNegativeInteger"},minItems:{$ref:"#/definitions/nonNegativeIntegerDefault0"},uniqueItems:{type:"boolean",default:!1},contains:{$ref:"#"},maxProperties:{$ref:"#/definitions/nonNegativeInteger"},minProperties:{$ref:"#/definitions/nonNegativeIntegerDefault0"},required:{$ref:"#/definitions/stringArray"},additionalProperties:{$ref:"#"},definitions:{type:"object",additionalProperties:{$ref:"#"},default:{}},properties:{type:"object",additionalProperties:{$ref:"#"},default:{}},patternProperties:{type:"object",additionalProperties:{$ref:"#"},propertyNames:{format:"regex"},default:{}},dependencies:{type:"object",additionalProperties:{anyOf:[{$ref:"#"},{$ref:"#/definitions/stringArray"}]}},propertyNames:{$ref:"#"},const:!0,enum:{type:"array",items:!0,minItems:1,uniqueItems:!0},type:{anyOf:[{$ref:"#/definitions/simpleTypes"},{type:"array",items:{$ref:"#/definitions/simpleTypes"},minItems:1,uniqueItems:!0}]},format:{type:"string"},contentMediaType:{type:"string"},contentEncoding:{type:"string"},if:{$ref:"#"},then:{$ref:"#"},else:{$ref:"#"},allOf:{$ref:"#/definitions/schemaArray"},anyOf:{$ref:"#/definitions/schemaArray"},oneOf:{$ref:"#/definitions/schemaArray"},not:{$ref:"#"}},Nwe={$schema:vwe,$id:xwe,title:bwe,definitions:wwe,type:Swe,properties:_we,default:!0};var rI;function kU(){return rI||(rI=1,(function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.MissingRefError=t.ValidationError=t.CodeGen=t.Name=t.nil=t.stringify=t.str=t._=t.KeywordCxt=t.Ajv=void 0;const n=$be(),r=mwe(),a=ywe(),s=Nwe,i=["/properties"],l="http://json-schema.org/draft-07/schema";class d extends n.default{_addVocabularies(){super._addVocabularies(),r.default.forEach(S=>this.addVocabulary(S)),this.opts.discriminator&&this.addKeyword(a.default)}_addDefaultMetaSchema(){if(super._addDefaultMetaSchema(),!this.opts.meta)return;const S=this.opts.$data?this.$dataMetaSchema(s,i):s;this.addMetaSchema(S,l,!1),this.refs["http://json-schema.org/schema"]=l}defaultMeta(){return this.opts.defaultMeta=super.defaultMeta()||(this.getSchema(l)?l:void 0)}}t.Ajv=d,e.exports=t=d,e.exports.Ajv=d,Object.defineProperty(t,"__esModule",{value:!0}),t.default=d;var f=Zv();Object.defineProperty(t,"KeywordCxt",{enumerable:!0,get:function(){return f.KeywordCxt}});var h=Ye();Object.defineProperty(t,"_",{enumerable:!0,get:function(){return h._}}),Object.defineProperty(t,"str",{enumerable:!0,get:function(){return h.str}}),Object.defineProperty(t,"stringify",{enumerable:!0,get:function(){return h.stringify}}),Object.defineProperty(t,"nil",{enumerable:!0,get:function(){return h.nil}}),Object.defineProperty(t,"Name",{enumerable:!0,get:function(){return h.Name}}),Object.defineProperty(t,"CodeGen",{enumerable:!0,get:function(){return h.CodeGen}});var p=HE();Object.defineProperty(t,"ValidationError",{enumerable:!0,get:function(){return p.default}});var g=Qv();Object.defineProperty(t,"MissingRefError",{enumerable:!0,get:function(){return g.default}})})(bm,bm.exports)),bm.exports}var jwe=kU();const Cwe=zr(jwe);var ag={exports:{}},VN={},aI;function Ewe(){return aI||(aI=1,(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.formatNames=e.fastFormats=e.fullFormats=void 0;function t(M,z){return{validate:M,compare:z}}e.fullFormats={date:t(s,i),time:t(d,f),"date-time":t(p,g),duration:/^P(?!$)((\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+S)?)?|(\d+W)?)$/,uri:w,"uri-reference":/^(?:[a-z][a-z0-9+\-.]*:)?(?:\/?\/(?:(?:[a-z0-9\-._~!$&'()*+,;=:]|%[0-9a-f]{2})*@)?(?:\[(?:(?:(?:(?:[0-9a-f]{1,4}:){6}|::(?:[0-9a-f]{1,4}:){5}|(?:[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){4}|(?:(?:[0-9a-f]{1,4}:){0,1}[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){3}|(?:(?:[0-9a-f]{1,4}:){0,2}[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){2}|(?:(?:[0-9a-f]{1,4}:){0,3}[0-9a-f]{1,4})?::[0-9a-f]{1,4}:|(?:(?:[0-9a-f]{1,4}:){0,4}[0-9a-f]{1,4})?::)(?:[0-9a-f]{1,4}:[0-9a-f]{1,4}|(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?))|(?:(?:[0-9a-f]{1,4}:){0,5}[0-9a-f]{1,4})?::[0-9a-f]{1,4}|(?:(?:[0-9a-f]{1,4}:){0,6}[0-9a-f]{1,4})?::)|[Vv][0-9a-f]+\.[a-z0-9\-._~!$&'()*+,;=:]+)\]|(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?)|(?:[a-z0-9\-._~!$&'"()*+,;=]|%[0-9a-f]{2})*)(?::\d*)?(?:\/(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})*)*|\/(?:(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})+(?:\/(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})*)*)?|(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})+(?:\/(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})*)*)?(?:\?(?:[a-z0-9\-._~!$&'"()*+,;=:@/?]|%[0-9a-f]{2})*)?(?:#(?:[a-z0-9\-._~!$&'"()*+,;=:@/?]|%[0-9a-f]{2})*)?$/i,"uri-template":/^(?:(?:[^\x00-\x20"'<>%\\^`{|}]|%[0-9a-f]{2})|\{[+#./;?&=,!@|]?(?:[a-z0-9_]|%[0-9a-f]{2})+(?::[1-9][0-9]{0,3}|\*)?(?:,(?:[a-z0-9_]|%[0-9a-f]{2})+(?::[1-9][0-9]{0,3}|\*)?)*\})*$/i,url:/^(?:https?|ftp):\/\/(?:\S+(?::\S*)?@)?(?:(?!(?:10|127)(?:\.\d{1,3}){3})(?!(?:169\.254|192\.168)(?:\.\d{1,3}){2})(?!172\.(?:1[6-9]|2\d|3[0-1])(?:\.\d{1,3}){2})(?:[1-9]\d?|1\d\d|2[01]\d|22[0-3])(?:\.(?:1?\d{1,2}|2[0-4]\d|25[0-5])){2}(?:\.(?:[1-9]\d?|1\d\d|2[0-4]\d|25[0-4]))|(?:(?:[a-z0-9\u{00a1}-\u{ffff}]+-)*[a-z0-9\u{00a1}-\u{ffff}]+)(?:\.(?:[a-z0-9\u{00a1}-\u{ffff}]+-)*[a-z0-9\u{00a1}-\u{ffff}]+)*(?:\.(?:[a-z\u{00a1}-\u{ffff}]{2,})))(?::\d{2,5})?(?:\/[^\s]*)?$/iu,email:/^[a-z0-9!#$%&'*+/=?^_`{|}~-]+(?:\.[a-z0-9!#$%&'*+/=?^_`{|}~-]+)*@(?:[a-z0-9](?:[a-z0-9-]*[a-z0-9])?\.)+[a-z0-9](?:[a-z0-9-]*[a-z0-9])?$/i,hostname:/^(?=.{1,253}\.?$)[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?(?:\.[a-z0-9](?:[-0-9a-z]{0,61}[0-9a-z])?)*\.?$/i,ipv4:/^(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?)$/,ipv6:/^((([0-9a-f]{1,4}:){7}([0-9a-f]{1,4}|:))|(([0-9a-f]{1,4}:){6}(:[0-9a-f]{1,4}|((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3})|:))|(([0-9a-f]{1,4}:){5}(((:[0-9a-f]{1,4}){1,2})|:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3})|:))|(([0-9a-f]{1,4}:){4}(((:[0-9a-f]{1,4}){1,3})|((:[0-9a-f]{1,4})?:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9a-f]{1,4}:){3}(((:[0-9a-f]{1,4}){1,4})|((:[0-9a-f]{1,4}){0,2}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9a-f]{1,4}:){2}(((:[0-9a-f]{1,4}){1,5})|((:[0-9a-f]{1,4}){0,3}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9a-f]{1,4}:){1}(((:[0-9a-f]{1,4}){1,6})|((:[0-9a-f]{1,4}){0,4}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(:(((:[0-9a-f]{1,4}){1,7})|((:[0-9a-f]{1,4}){0,5}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:)))$/i,regex:O,uuid:/^(?:urn:uuid:)?[0-9a-f]{8}-(?:[0-9a-f]{4}-){3}[0-9a-f]{12}$/i,"json-pointer":/^(?:\/(?:[^~/]|~0|~1)*)*$/,"json-pointer-uri-fragment":/^#(?:\/(?:[a-z0-9_\-.!$&'()*+,;:=@]|%[0-9a-f]{2}|~0|~1)*)*$/i,"relative-json-pointer":/^(?:0|[1-9][0-9]*)(?:#|(?:\/(?:[^~/]|~0|~1)*)*)$/,byte:x,int32:{type:"number",validate:C},int64:{type:"number",validate:T},float:{type:"number",validate:A},double:{type:"number",validate:A},password:!0,binary:!0},e.fastFormats={...e.fullFormats,date:t(/^\d\d\d\d-[0-1]\d-[0-3]\d$/,i),time:t(/^(?:[0-2]\d:[0-5]\d:[0-5]\d|23:59:60)(?:\.\d+)?(?:z|[+-]\d\d(?::?\d\d)?)?$/i,f),"date-time":t(/^\d\d\d\d-[0-1]\d-[0-3]\d[t\s](?:[0-2]\d:[0-5]\d:[0-5]\d|23:59:60)(?:\.\d+)?(?:z|[+-]\d\d(?::?\d\d)?)$/i,g),uri:/^(?:[a-z][a-z0-9+\-.]*:)(?:\/?\/)?[^\s]*$/i,"uri-reference":/^(?:(?:[a-z][a-z0-9+\-.]*:)?\/?\/)?(?:[^\\\s#][^\s#]*)?(?:#[^\\\s]*)?$/i,email:/^[a-z0-9.!#$%&'*+/=?^_`{|}~-]+@[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?(?:\.[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?)*$/i},e.formatNames=Object.keys(e.fullFormats);function n(M){return M%4===0&&(M%100!==0||M%400===0)}const r=/^(\d\d\d\d)-(\d\d)-(\d\d)$/,a=[0,31,28,31,30,31,30,31,31,30,31,30,31];function s(M){const z=r.exec(M);if(!z)return!1;const L=+z[1],U=+z[2],F=+z[3];return U>=1&&U<=12&&F>=1&&F<=(U===2&&n(L)?29:a[U])}function i(M,z){if(M&&z)return M>z?1:M<z?-1:0}const l=/^(\d\d):(\d\d):(\d\d)(\.\d+)?(z|[+-]\d\d(?::?\d\d)?)?$/i;function d(M,z){const L=l.exec(M);if(!L)return!1;const U=+L[1],F=+L[2],q=+L[3],V=L[5];return(U<=23&&F<=59&&q<=59||U===23&&F===59&&q===60)&&(!z||V!=="")}function f(M,z){if(!(M&&z))return;const L=l.exec(M),U=l.exec(z);if(L&&U)return M=L[1]+L[2]+L[3]+(L[4]||""),z=U[1]+U[2]+U[3]+(U[4]||""),M>z?1:M<z?-1:0}const h=/t|\s/i;function p(M){const z=M.split(h);return z.length===2&&s(z[0])&&d(z[1],!0)}function g(M,z){if(!(M&&z))return;const[L,U]=M.split(h),[F,q]=z.split(h),V=i(L,F);if(V!==void 0)return V||f(U,q)}const y=/\/|:/,S=/^(?:[a-z][a-z0-9+\-.]*:)(?:\/?\/(?:(?:[a-z0-9\-._~!$&'()*+,;=:]|%[0-9a-f]{2})*@)?(?:\[(?:(?:(?:(?:[0-9a-f]{1,4}:){6}|::(?:[0-9a-f]{1,4}:){5}|(?:[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){4}|(?:(?:[0-9a-f]{1,4}:){0,1}[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){3}|(?:(?:[0-9a-f]{1,4}:){0,2}[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){2}|(?:(?:[0-9a-f]{1,4}:){0,3}[0-9a-f]{1,4})?::[0-9a-f]{1,4}:|(?:(?:[0-9a-f]{1,4}:){0,4}[0-9a-f]{1,4})?::)(?:[0-9a-f]{1,4}:[0-9a-f]{1,4}|(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?))|(?:(?:[0-9a-f]{1,4}:){0,5}[0-9a-f]{1,4})?::[0-9a-f]{1,4}|(?:(?:[0-9a-f]{1,4}:){0,6}[0-9a-f]{1,4})?::)|[Vv][0-9a-f]+\.[a-z0-9\-._~!$&'()*+,;=:]+)\]|(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?)|(?:[a-z0-9\-._~!$&'()*+,;=]|%[0-9a-f]{2})*)(?::\d*)?(?:\/(?:[a-z0-9\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})*)*|\/(?:(?:[a-z0-9\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})+(?:\/(?:[a-z0-9\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})*)*)?|(?:[a-z0-9\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})+(?:\/(?:[a-z0-9\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})*)*)(?:\?(?:[a-z0-9\-._~!$&'()*+,;=:@/?]|%[0-9a-f]{2})*)?(?:#(?:[a-z0-9\-._~!$&'()*+,;=:@/?]|%[0-9a-f]{2})*)?$/i;function w(M){return y.test(M)&&S.test(M)}const b=/^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=)?$/gm;function x(M){return b.lastIndex=0,b.test(M)}const _=-2147483648,j=2**31-1;function C(M){return Number.isInteger(M)&&M<=j&&M>=_}function T(M){return Number.isInteger(M)}function A(){return!0}const k=/[^\\]\\Z/;function O(M){if(k.test(M))return!1;try{return new RegExp(M),!0}catch{return!1}}})(VN)),VN}var WN={},sI;function Twe(){return sI||(sI=1,(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.formatLimitDefinition=void 0;const t=kU(),n=Ye(),r=n.operators,a={formatMaximum:{okStr:"<=",ok:r.LTE,fail:r.GT},formatMinimum:{okStr:">=",ok:r.GTE,fail:r.LT},formatExclusiveMaximum:{okStr:"<",ok:r.LT,fail:r.GTE},formatExclusiveMinimum:{okStr:">",ok:r.GT,fail:r.LTE}},s={message:({keyword:l,schemaCode:d})=>n.str`should be ${a[l].okStr} ${d}`,params:({keyword:l,schemaCode:d})=>n._`{comparison: ${a[l].okStr}, limit: ${d}}`};e.formatLimitDefinition={keyword:Object.keys(a),type:"string",schemaType:"string",$data:!0,error:s,code(l){const{gen:d,data:f,schemaCode:h,keyword:p,it:g}=l,{opts:y,self:S}=g;if(!y.validateFormats)return;const w=new t.KeywordCxt(g,S.RULES.all.format.definition,"format");w.$data?b():x();function b(){const j=d.scopeValue("formats",{ref:S.formats,code:y.code.formats}),C=d.const("fmt",n._`${j}[${w.schemaCode}]`);l.fail$data(n.or(n._`typeof ${C} != "object"`,n._`${C} instanceof RegExp`,n._`typeof ${C}.compare != "function"`,_(C)))}function x(){const j=w.schema,C=S.formats[j];if(!C||C===!0)return;if(typeof C!="object"||C instanceof RegExp||typeof C.compare!="function")throw new Error(`"${p}": format "${j}" does not define "compare" function`);const T=d.scopeValue("formats",{key:j,ref:C,code:y.code.formats?n._`${y.code.formats}${n.getProperty(j)}`:void 0});l.fail$data(_(T))}function _(j){return n._`${j}.compare(${f}, ${h}) ${a[p].fail} 0`}},dependencies:["format"]};const i=l=>(l.addKeyword(e.formatLimitDefinition),l);e.default=i})(WN)),WN}var oI;function Awe(){return oI||(oI=1,(function(e,t){Object.defineProperty(t,"__esModule",{value:!0});const n=Ewe(),r=Twe(),a=Ye(),s=new a.Name("fullFormats"),i=new a.Name("fastFormats"),l=(f,h={keywords:!0})=>{if(Array.isArray(h))return d(f,h,n.fullFormats,s),f;const[p,g]=h.mode==="fast"?[n.fastFormats,i]:[n.fullFormats,s],y=h.formats||n.formatNames;return d(f,y,p,g),h.keywords&&r.default(f),f};l.get=(f,h="full")=>{const g=(h==="fast"?n.fastFormats:n.fullFormats)[f];if(!g)throw new Error(`Unknown format "${f}"`);return g};function d(f,h,p,g){var y,S;(y=(S=f.opts.code).formats)!==null&&y!==void 0||(S.formats=a._`require("ajv-formats/dist/formats").${g}`);for(const w of h)f.addFormat(w,p[w])}e.exports=t=l,Object.defineProperty(t,"__esModule",{value:!0}),t.default=l})(ag,ag.exports)),ag.exports}var Rwe=Awe();const iI=zr(Rwe),kwe={allErrors:!0,multipleOfPrecision:8,strict:!1,verbose:!0,discriminator:!1},Owe=/^(#?([0-9A-Fa-f]{3}){1,2}\b|aqua|black|blue|fuchsia|gray|green|lime|maroon|navy|olive|orange|purple|red|silver|teal|white|yellow|(rgb\(\s*\b([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\b\s*,\s*\b([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\b\s*,\s*\b([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\b\s*\))|(rgb\(\s*(\d?\d%|100%)+\s*,\s*(\d?\d%|100%)+\s*,\s*(\d?\d%|100%)+\s*\)))$/,Mwe=/^data:([a-z]+\/[a-z0-9-+.]+)?;(?:name=(.*);)?base64,(.*)$/;function Dwe(e,t,n={},r,a=Cwe){const s=new a({...kwe,...n});return r?iI(s,r):r!==!1&&iI(s),s.addFormat("data-url",Mwe),s.addFormat("color",Owe),s.addKeyword(ch),s.addKeyword(F2),Array.isArray(e)&&s.addMetaSchema(e),Tt(t)&&Object.keys(t).forEach(i=>{s.addFormat(i,t[i])}),s}function Pwe(e=[],t){return e.map(n=>{var r;const{instancePath:a,keyword:s,params:i,schemaPath:l,parentSchema:d,...f}=n;let{message:h=""}=f,p=a.replace(/\//g,"."),g=`${p} ${h}`.trim();const y=[...((r=i.deps)===null||r===void 0?void 0:r.split(", "))||[],i.missingProperty,i.property].filter(S=>S);if(y.length>0)y.forEach(S=>{const w=p?`${p}.${S}`:S;let b=at(Oe(t,`${w.replace(/^\./,"")}`)).title;if(b===void 0){const x=l.replace(/\/properties\//g,"/").split("/").slice(1,-1).concat([S]);b=at(Oe(t,x)).title}if(b)h=h.replace(`'${S}'`,`'${b}'`);else{const x=Oe(d,[Xt,S,"title"]);x&&(h=h.replace(`'${S}'`,`'${x}'`))}}),g=h;else{const S=at(Oe(t,`${p.replace(/^\./,"")}`)).title;if(S)g=`'${S}' ${h}`.trim();else{const w=d==null?void 0:d.title;w&&(g=`'${w}' ${h}`.trim())}}return"missingProperty"in i&&(p=p?`${p}.${i.missingProperty}`:i.missingProperty),{name:s,property:p,message:h,params:i,stack:g,schemaPath:l}})}function $we(e,t,n,r,a,s,i){const{validationError:l}=t;let d=Pwe(t.errors,i);l&&(d=[...d,{stack:l.message}]),typeof s=="function"&&(d=s(d,i));let f=Bve(d);if(l&&(f={...f,$schema:{__errors:[l.message]}}),typeof a!="function")return{errors:d,errorSchema:f};const h=rU(e,r,n,r,!0),p=a(h,cy(h),i),g=zE(p);return Dg({errors:d,errorSchema:f},g)}class Iwe{constructor(t,n){const{additionalMetaSchemas:r,customFormats:a,ajvOptionsOverrides:s,ajvFormatOptions:i,AjvClass:l}=t;this.ajv=Dwe(r,a,s,i,l),this.localizer=n}reset(){this.ajv.removeSchema()}toErrorList(t,n=[]){return Tf(t,n)}rawValidation(t,n){var r,a;let s,i;t[Ao]&&(i=this.ajv.getSchema(t[Ao]));try{i===void 0&&(i=this.ajv.compile(t)),i(n)}catch(d){s=d}let l;return i&&(typeof this.localizer=="function"&&(((r=i.errors)!==null&&r!==void 0?r:[]).forEach(d=>{var f;["missingProperty","property"].forEach(h=>{var p;!((p=d.params)===null||p===void 0)&&p[h]&&(d.params[h]=`'${d.params[h]}'`)}),!((f=d.params)===null||f===void 0)&&f.deps&&(d.params.deps=d.params.deps.split(", ").map(h=>`'${h}'`).join(", "))}),this.localizer(i.errors),((a=i.errors)!==null&&a!==void 0?a:[]).forEach(d=>{var f;["missingProperty","property"].forEach(h=>{var p;!((p=d.params)===null||p===void 0)&&p[h]&&(d.params[h]=d.params[h].slice(1,-1))}),!((f=d.params)===null||f===void 0)&&f.deps&&(d.params.deps=d.params.deps.split(", ").map(h=>h.slice(1,-1)).join(", "))})),l=i.errors||void 0,i.errors=null),{errors:l,validationError:s}}validateFormData(t,n,r,a,s){const i=this.rawValidation(n,t);return $we(this,i,t,n,r,a,s)}handleSchemaUpdate(t){var n,r;const a=(n=t[Ao])!==null&&n!==void 0?n:bF;this.ajv.getSchema(a)===void 0?this.ajv.addSchema(t,a):Pt(t,(r=this.ajv.getSchema(a))===null||r===void 0?void 0:r.schema)||(this.ajv.removeSchema(a),this.ajv.addSchema(t,a))}isValid(t,n,r){var a;try{this.handleSchemaUpdate(r);const s=qE(t),i=(a=s[Ao])!==null&&a!==void 0?a:Lve(s);let l;return l=this.ajv.getSchema(i),l===void 0&&(l=this.ajv.addSchema(s,i).getSchema(i)||this.ajv.compile(s)),l(n)}catch(s){return console.warn("Error encountered compiling schema:",s),!1}}}function Lwe(e={},t){return new Iwe(e,t)}const zwe=Lwe();var Jv="Switch",[qwe]=wn(Jv),[Fwe,Uwe]=qwe(Jv),OU=N.forwardRef((e,t)=>{const{__scopeSwitch:n,name:r,checked:a,defaultChecked:s,required:i,disabled:l,value:d="on",onCheckedChange:f,form:h,...p}=e,[g,y]=N.useState(null),S=ze(t,j=>y(j)),w=N.useRef(!1),b=g?h||!!g.closest("form"):!0,[x,_]=bn({prop:a,defaultProp:s??!1,onChange:f,caller:Jv});return c.jsxs(Fwe,{scope:n,checked:x,disabled:l,children:[c.jsx(Ae.button,{type:"button",role:"switch","aria-checked":x,"aria-required":i,"data-state":$U(x),"data-disabled":l?"":void 0,disabled:l,value:d,...p,ref:S,onClick:_e(e.onClick,j=>{_(C=>!C),b&&(w.current=j.isPropagationStopped(),w.current||j.stopPropagation())})}),b&&c.jsx(PU,{control:g,bubbles:!w.current,name:r,value:d,checked:x,required:i,disabled:l,form:h,style:{transform:"translateX(-100%)"}})]})});OU.displayName=Jv;var MU="SwitchThumb",DU=N.forwardRef((e,t)=>{const{__scopeSwitch:n,...r}=e,a=Uwe(MU,n);return c.jsx(Ae.span,{"data-state":$U(a.checked),"data-disabled":a.disabled?"":void 0,...r,ref:t})});DU.displayName=MU;var Hwe="SwitchBubbleInput",PU=N.forwardRef(({__scopeSwitch:e,control:t,checked:n,bubbles:r=!0,...a},s)=>{const i=N.useRef(null),l=ze(i,s),d=av(n),f=Wy(t);return N.useEffect(()=>{const h=i.current;if(!h)return;const p=window.HTMLInputElement.prototype,y=Object.getOwnPropertyDescriptor(p,"checked").set;if(d!==n&&y){const S=new Event("click",{bubbles:r});y.call(h,n),h.dispatchEvent(S)}},[d,n,r]),c.jsx("input",{type:"checkbox","aria-hidden":!0,defaultChecked:n,...a,tabIndex:-1,ref:l,style:{...a.style,...f,position:"absolute",pointerEvents:"none",opacity:0,margin:0}})});PU.displayName=Hwe;function $U(e){return e?"checked":"unchecked"}var IU=OU,Bwe=DU;const tr=N.forwardRef(({className:e,...t},n)=>c.jsx(IU,{className:ye("peer inline-flex h-5 w-9 shrink-0 cursor-pointer items-center rounded-full border-2 border-transparent shadow-sm transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 focus-visible:ring-offset-background disabled:cursor-not-allowed disabled:opacity-50 data-[state=checked]:bg-primary data-[state=unchecked]:bg-input",e),...t,ref:n,children:c.jsx(Bwe,{className:ye("pointer-events-none block h-4 w-4 rounded-full bg-background shadow-lg ring-0 transition-transform data-[state=checked]:translate-x-4 data-[state=unchecked]:translate-x-0")})}));tr.displayName=IU.displayName;function Vwe(e){const{id:t,value:n,onChange:r,required:a,disabled:s,readonly:i,placeholder:l,schema:d}=e;return c.jsx(Ct,{id:t,type:"number",value:n??"",onChange:f=>{const h=f.target.value;r(h===""?void 0:Number(h))},required:a,disabled:s,readOnly:i,placeholder:l,min:d.minimum,max:d.maximum,step:d.multipleOf||(d.type==="integer"?1:"any")})}function Wwe(e){const{id:t,value:n,onChange:r,label:a,disabled:s,readonly:i}=e;return c.jsxs("div",{className:"flex items-center space-x-2",children:[c.jsx(tr,{id:t,checked:!!n,onCheckedChange:r,disabled:s||i}),c.jsx(jt,{htmlFor:t,children:a})]})}function Gwe(e){const{id:t,value:n,onChange:r,options:a,disabled:s,readonly:i,placeholder:l}=e,{enumOptions:d}=a;return c.jsxs(Fc,{value:n?String(n):void 0,onValueChange:r,disabled:s||i,children:[c.jsx(Yi,{id:t,children:c.jsx(Uc,{placeholder:l||"Select an option"})}),c.jsx(Xi,{children:d==null?void 0:d.map(f=>c.jsx(Pn,{value:String(f.value),children:f.label},f.value))})]})}const Kwe={NumberWidget:Vwe,CheckboxWidget:Wwe,SelectWidget:Gwe},LU=(e,t,n)=>{const r=Me.useCallback(s=>{e||t||Yq(s.dataTransfer)&&(s.preventDefault(),s.dataTransfer.dropEffect="copy")},[e,t]),a=Me.useCallback(s=>{if(e||t)return;const i=Xq(s.dataTransfer);if(!(i!=null&&i.path))return;s.preventDefault(),s.stopPropagation();const l=s.target,{value:d,selectionStart:f}=Zq(l,i.path);l.value=d,l.focus();const h=()=>l.setSelectionRange(f,f);typeof window<"u"&&window.requestAnimationFrame?window.requestAnimationFrame(h):h(),n(d)},[e,n,t]);return{handleDragOver:r,handleDrop:a}};function Ywe(e){const{id:t,value:n,onChange:r,required:a,disabled:s,readonly:i,placeholder:l}=e,{handleDragOver:d,handleDrop:f}=LU(s,i,r);return c.jsx(Ct,{id:t,type:"text",value:n||"",onChange:h=>r(h.target.value),required:a,disabled:s,readOnly:i,placeholder:l,onDragOver:d,onDrop:f})}function Xwe(e){const{id:t,value:n,onChange:r,required:a,disabled:s,readonly:i,placeholder:l}=e,f=at(e.uiSchema||{}).rows||3,{handleDragOver:h,handleDrop:p}=LU(s,i,r);return c.jsx(ih,{id:t,value:n||"",onChange:g=>r(g.target.value),required:a,disabled:s,readOnly:i,placeholder:l,rows:f,onDragOver:h,onDrop:p})}const Zwe={TextWidget:Ywe,TextareaWidget:Xwe},Qwe={...Zwe,...Kwe},e0=[{key:"any",label:"Any",options:[{value:"equals",label:"Equals (=)",description:"Left equals right"},{value:"not_equals",label:"Not Equals (≠)",description:"Left does not equal right"}]},{key:"number",label:"Number",options:[{value:"greater_than",label:"Greater Than (>)",description:"Left is greater than right"},{value:"greater_than_or_equal",label:"Greater Than or Equal (≥)",description:"Left is greater than or equal to right"},{value:"less_than",label:"Less Than (<)",description:"Left is less than right"},{value:"less_than_or_equal",label:"Less Than or Equal (≤)",description:"Left is less than or equal to right"}]},{key:"string",label:"String",options:[{value:"contains",label:"Contains",description:"Left contains right"},{value:"not_contains",label:"Does Not Contain",description:"Left does not contain right"}]},{key:"collection",label:"Collection",options:[{value:"in",label:"In",description:"Left is a member of right"},{value:"not_in",label:"Not In",description:"Left is not a member of right"}]},{key:"boolean",label:"Boolean",options:[{value:"is_truthy",label:"Is Truthy",description:"Left is evaluated as truthy"},{value:"is_falsy",label:"Is Falsy",description:"Left is evaluated as falsy"}]}],Jwe=e0.flatMap(e=>e.options.map(t=>t.value)),Ln={type:"object",properties:{label:{type:"string",title:"Node Name",description:"Human-readable label for this node"},description:{type:"string",title:"Description",description:"Optional description of what this node does"}}},lI={type:"object",title:"Condition",properties:{left:{title:"Left Operand",description:"Left-hand operand",type:["string","number","boolean","null"]},operator:{type:"string",title:"Operator",description:"Comparison operator to evaluate",enum:Jwe,default:"equals"},right:{title:"Right Operand",description:"Right-hand operand (if required)",type:["string","number","boolean","null"]},caseSensitive:{type:"boolean",title:"Case Sensitive",description:"Apply case-sensitive comparison for string operands",default:!0}},required:["operator"]},e1e={type:"object",title:"Variable",properties:{name:{type:"string",title:"Variable Name",description:"Name of the variable (e.g., user_name, count)"},valueType:{type:"string",title:"Type",description:"The type of value to store",enum:["string","number","boolean","object","array"],default:"string"},value:{title:"Value",description:"Value to persist"}},required:["name","valueType","value"],dependencies:{valueType:{oneOf:[{properties:{valueType:{const:"string"},value:{type:"string"}}},{properties:{valueType:{const:"number"},value:{type:"number"}}},{properties:{valueType:{const:"boolean"},value:{type:"boolean"}}},{properties:{valueType:{const:"object"},value:{type:"object"}}},{properties:{valueType:{const:"array"},value:{type:"array",items:{}}}}]}}},t1e={type:"object",title:"Switch Case",properties:{match:{title:"Match Value",description:"Value that activates this branch",oneOf:[{type:"string"},{type:"number"},{type:"boolean"},{type:"null"}]},label:{type:"string",title:"Label",description:"Optional label used in the canvas"},branchKey:{type:"string",title:"Branch Key",description:"Identifier emitted when this branch is selected"},caseSensitive:{type:"boolean",title:"Case Sensitive",description:"Override case-sensitivity for this branch"}}},n1e={Agent:{type:"object",properties:{...Ln.properties,modelSettings:{type:"object",title:"Model Settings",description:"Configuration for the AI model",properties:{model:{type:"string",title:"Model",description:"Model identifier (e.g., gpt-4, claude-3-opus)"},temperature:{type:"number",title:"Temperature",description:"Controls randomness in responses",minimum:0,maximum:2,default:.7},maxTokens:{type:"integer",title:"Max Tokens",description:"Maximum number of tokens to generate",minimum:1}}},systemPrompt:{type:"string",title:"System Prompt",description:"System prompt for the agent"},checkpointer:{type:"string",title:"Checkpointer",description:"Checkpointer used to save the agent's state",enum:["memory","sqlite","postgres"]},structuredOutput:{type:"object",title:"Structured Output",description:"Configuration for structured output",properties:{schemaType:{type:"string",title:"Schema Type",enum:["json_schema","json_dict","pydantic","typed_dict"]},schemaStr:{type:"string",title:"Schema Definition",description:"The schema definition as a string"}}}},required:["modelSettings"]},PythonCode:{type:"object",properties:{...Ln.properties,code:{type:"string",title:"Python Code",description:"Python code to execute",default:`def run(state, config):
|
|
745
|
+
return {}
|
|
746
|
+
`}},required:["code"]}},r1e={MongoDBNode:{type:"object",properties:{...Ln.properties,database:{type:"string",title:"Database",description:"Database to target"},collection:{type:"string",title:"Collection",description:"Collection to operate on"},operation:{type:"string",title:"Operation",description:"MongoDB operation to perform",enum:["find","find_one","find_raw_batches","insert_one","insert_many","update_one","update_many","replace_one","delete_one","delete_many","aggregate","aggregate_raw_batches","count_documents","estimated_document_count","distinct","find_one_and_delete","find_one_and_replace","find_one_and_update","bulk_write","create_index","create_indexes","drop_index","drop_indexes","list_indexes","index_information","create_search_index","create_search_indexes","drop_search_index","update_search_index","list_search_indexes","drop","rename","options","watch"],default:"find"},query:{type:"object",title:"Query",description:"Arguments passed to the selected operation",additionalProperties:!0,default:{}}},required:["database","collection","operation"]},RSSNode:{type:"object",properties:{...Ln.properties,feedUrl:{type:"string",title:"Feed URL",description:"URL of the RSS feed",format:"uri"},maxItems:{type:"integer",title:"Max Items",description:"Maximum number of items to fetch",minimum:1,default:10}},required:["feedUrl"]},SlackNode:{type:"object",properties:{...Ln.properties,tool_name:{type:"string",title:"Slack Tool",description:"Select the MCP Slack tool to invoke",enum:["slack_list_channels","slack_post_message","slack_reply_to_thread","slack_add_reaction","slack_get_channel_history","slack_get_thread_replies","slack_get_users","slack_get_user_profile"]},kwargs:{type:"object",title:"Tool Arguments",description:"Arguments passed to the selected Slack MCP tool (JSON object)",additionalProperties:!0,default:{}}},required:["tool_name"]},MessageTelegram:{type:"object",properties:{...Ln.properties,token:{type:"string",title:"Bot Token",description:"Bot token used to authenticate with Telegram"},chat_id:{type:"string",title:"Chat ID",description:"Telegram chat ID"},message:{type:"string",title:"Message",description:"Message text to send"},parse_mode:{type:"string",title:"Parse Mode",description:"Message parsing mode",enum:["Markdown","HTML","MarkdownV2"]}},required:["token","chat_id","message"]}},a1e={IfElseNode:{type:"object",properties:{...Ln.properties,conditions:{type:"array",title:"Conditions",description:"Collection of conditions that control branching",items:lI,minItems:1,default:[{left:!0,operator:"is_truthy",right:null,caseSensitive:!0}]},conditionLogic:{type:"string",title:"Condition Logic",description:"Combine conditions using logical AND/OR semantics",enum:["and","or"],default:"and"}},required:["conditions","conditionLogic"]},SwitchNode:{type:"object",properties:{...Ln.properties,value:{title:"Value",description:"Value to inspect for routing decisions",oneOf:[{type:"string"},{type:"number"},{type:"boolean"},{type:"object"}]},caseSensitive:{type:"boolean",title:"Case Sensitive",description:"Preserve case when deriving branch keys",default:!0},defaultBranchKey:{type:"string",title:"Default Branch Key",description:"Branch identifier returned when no cases match",default:"default"},cases:{type:"array",title:"Cases",description:"Collection of matchable branches",items:t1e,minItems:1}},required:["value","cases"]},WhileNode:{type:"object",properties:{...Ln.properties,conditions:{type:"array",title:"Loop Conditions",description:"Collection of conditions that control continuation",items:lI,minItems:1,default:[{operator:"less_than",caseSensitive:!0}]},conditionLogic:{type:"string",title:"Condition Logic",description:"Combine conditions using logical AND/OR semantics",enum:["and","or"],default:"and"},maxIterations:{type:"integer",title:"Max Iterations",description:"Optional guard to stop after this many iterations",minimum:1}},required:["conditions","conditionLogic"]}},s1e={description:{"ui:widget":"textarea","ui:options":{rows:3}}},cI=()=>({conditions:{items:{left:{"ui:widget":"conditionOperand","ui:placeholder":"Enter left operand"},operator:{"ui:widget":"conditionOperator","ui:options":{operatorGroups:e0}},right:{"ui:widget":"conditionOperand","ui:placeholder":"Enter right operand (if required)"}}}}),GN={default:s1e,IfElseNode:cI(),WhileNode:cI(),PythonCode:{code:{"ui:widget":"textarea","ui:options":{rows:15}}},Agent:{systemPrompt:{"ui:widget":"textarea","ui:options":{rows:5}},structuredOutput:{schemaStr:{"ui:widget":"textarea","ui:options":{rows:10}}}},MessageTelegram:{message:{"ui:widget":"textarea","ui:options":{rows:5}},token:{"ui:widget":"password"}},SlackNode:{kwargs:{"ui:widget":"textarea","ui:options":{rows:5}}},WebhookTriggerNode:{allowed_methods:{"ui:widget":"checkboxes"},shared_secret:{"ui:widget":"password"}}},o1e={SetVariableNode:{type:"object",properties:{...Ln.properties,variables:{type:"array",title:"Variables",description:"Collection of variables to store",items:e1e,minItems:1,default:[{name:"my_variable",valueType:"string",value:""}]}},required:["variables"]},DelayNode:{type:"object",properties:{...Ln.properties,durationSeconds:{type:"number",title:"Duration (seconds)",description:"Duration of the pause expressed in seconds",minimum:0,default:0}},required:["durationSeconds"]}},i1e={WebhookTriggerNode:{type:"object",properties:{...Ln.properties,allowed_methods:{type:"array",title:"Allowed Methods",description:"HTTP methods accepted by this webhook",items:{type:"string",enum:["GET","POST","PUT","PATCH","DELETE","HEAD"]},minItems:1,default:["POST"]},required_headers:{type:"object",title:"Required Headers",description:"Headers that must be present with specific values",additionalProperties:{type:"string"},default:{}},required_query_params:{type:"object",title:"Required Query Parameters",description:"Query parameters that must match expected values",additionalProperties:{type:"string"},default:{}},shared_secret_header:{type:"string",title:"Shared Secret Header",description:"Optional HTTP header containing a shared secret"},shared_secret:{type:"string",title:"Shared Secret",description:"Secret value required when validating webhook requests"},rate_limit:{type:"object",title:"Rate Limit",description:"Optional rate limiting configuration",properties:{limit:{type:"integer",title:"Limit",description:"Maximum number of requests in the interval",minimum:1,default:60},interval_seconds:{type:"integer",title:"Interval (seconds)",description:"Time window in seconds for the rate limit",minimum:1,default:60}}}}},CronTriggerNode:{type:"object",properties:{...Ln.properties,expression:{type:"string",title:"Cron Expression",description:"Cron expression (e.g., '0 0 * * *' for daily at midnight)",default:"0 * * * *"},timezone:{type:"string",title:"Timezone",description:"Timezone for the schedule (e.g., 'America/New_York')",default:"UTC"},allow_overlapping:{type:"boolean",title:"Allow Overlapping Runs",description:"Permit multiple runs to overlap in time",default:!1},start_at:{type:"string",format:"date-time",title:"Start At",description:"Optional ISO timestamp for when the schedule begins"},end_at:{type:"string",format:"date-time",title:"End At",description:"Optional ISO timestamp for when the schedule ends"}},required:["expression"]},ManualTriggerNode:{type:"object",properties:{...Ln.properties,label:{type:"string",title:"Label",description:"Label displayed for manual trigger actions",default:"manual"},allowed_actors:{type:"array",title:"Allowed Actors",description:"Users permitted to trigger this workflow",items:{type:"string"},default:[]},require_comment:{type:"boolean",title:"Require Comment",description:"Require users to supply a comment when triggering",default:!1},default_payload:{type:"object",title:"Default Payload",description:"JSON payload provided to the workflow on trigger",default:{}},cooldown_seconds:{type:"integer",title:"Cooldown (seconds)",description:"Minimum seconds between manual trigger runs",minimum:0,default:0}}},HttpPollingTriggerNode:{type:"object",properties:{...Ln.properties,url:{type:"string",title:"URL",description:"URL to poll",format:"uri"},method:{type:"string",title:"HTTP Method",description:"HTTP method to use when polling",enum:["GET","POST","PUT","PATCH","DELETE"],default:"GET"},headers:{type:"object",title:"Headers",description:"HTTP headers to send with the request",default:{}},query_params:{type:"object",title:"Query Parameters",description:"Query parameters to include in the request",default:{}},body:{type:"object",title:"Request Body",description:"JSON body to send with the request"},interval_seconds:{type:"integer",title:"Poll Interval (seconds)",description:"How often to poll the URL",minimum:1,default:300},timeout_seconds:{type:"integer",title:"Timeout (seconds)",description:"How long to wait for the request before timing out",minimum:1,default:30},verify_tls:{type:"boolean",title:"Verify TLS",description:"Verify TLS certificates for HTTPS requests",default:!0},follow_redirects:{type:"boolean",title:"Follow Redirects",description:"Follow HTTP redirects when polling",default:!1},deduplicate_on:{type:"string",title:"Deduplicate On",description:"Optional key in the response used to deduplicate trigger events"}},required:["url","interval_seconds"]}},l1e=[a1e,o1e,n1e,r1e,i1e],KN=l1e.reduce((e,t)=>({...e,...t}),{default:{...Ln}}),c1e=e=>e&&KN[e]||KN.default,u1e=e=>e?{...GN.default,...GN[e]||{}}:GN.default,d1e=e=>{if(e===void 0)return"";if(e===null)return"null";if(typeof e=="object")try{return JSON.stringify(e)}catch(t){return console.error("Failed to stringify operand",t),""}return String(e)},sg=e=>{const t=e.trim();return t.length===0?void 0:t==="null"?null:t==="true"?!0:t==="false"?!1:/^-?\d+(\.\d+)?$/.test(t)?Number(t):e};function f1e(e){const{id:t,value:n,onChange:r,disabled:a,readonly:s,placeholder:i,onBlur:l,onFocus:d}=e,f=d1e(n),h=Me.useCallback(g=>{a||s||Yq(g.dataTransfer)&&(g.preventDefault(),g.dataTransfer.dropEffect="copy")},[a,s]),p=Me.useCallback(g=>{if(a||s)return;const y=Xq(g.dataTransfer);if(!(y!=null&&y.path))return;g.preventDefault(),g.stopPropagation();const S=g.target,{value:w,selectionStart:b}=Zq(S,y.path);S.value=w,S.focus();const x=()=>S.setSelectionRange(b,b);typeof window<"u"&&window.requestAnimationFrame?window.requestAnimationFrame(x):x();const _=sg(w);r(_)},[a,r,s]);return c.jsx(Ct,{id:t,value:f,onChange:g=>r(sg(g.target.value)),onBlur:g=>l==null?void 0:l(t,sg(g.target.value)),onFocus:g=>d==null?void 0:d(t,sg(g.target.value)),disabled:a||s,placeholder:i,onDragOver:h,onDrop:p})}const h1e=e=>{if(typeof e!="string")return null;for(const t of e0){const n=t.options.find(r=>r.value===e);if(n)return{group:t,option:n}}return null};function p1e(e){const{id:t,value:n,onChange:r,disabled:a,readonly:s,options:i,uiSchema:l}=e,f=at(l).operatorGroups??e0,h=h1e(n),p=h?`${h.group.label} · ${h.option.label}`:"Select operator",g=new Set((i.enumOptions??[]).map(S=>String(S.value))),y=S=>{(!g.size||g.has(S))&&r(S)};return c.jsxs(ul,{children:[c.jsx(dl,{asChild:!0,children:c.jsx(me,{id:t,variant:"outline",className:"w-full justify-between",disabled:a||s,children:c.jsx("span",{className:"truncate text-left",children:p})})}),c.jsx(Qo,{className:"w-64",children:f.map(S=>c.jsxs(qae,{children:[c.jsx(q9,{children:S.label}),c.jsx(F9,{className:"w-64",children:S.options.map(w=>c.jsxs(Lt,{onSelect:()=>y(w.value),className:"justify-between",children:[c.jsxs("div",{className:"flex flex-col text-left",children:[c.jsx("span",{children:w.label}),w.description&&c.jsx("span",{className:"text-xs text-muted-foreground",children:w.description})]}),(h==null?void 0:h.option.value)===w.value&&c.jsx(Is,{className:"h-4 w-4"})]},w.value))})]},S.key))})]})}const m1e={conditionOperand:f1e,conditionOperator:p1e};var g1e=Symbol("radix.slottable");function y1e(e){const t=({children:n})=>c.jsx(c.Fragment,{children:n});return t.displayName=`${e}.Slottable`,t.__radixId=g1e,t}var[t0]=wn("Tooltip",[Yo]),n0=Yo(),zU="TooltipProvider",v1e=700,pC="tooltip.open",[x1e,WE]=t0(zU),qU=e=>{const{__scopeTooltip:t,delayDuration:n=v1e,skipDelayDuration:r=300,disableHoverableContent:a=!1,children:s}=e,i=N.useRef(!0),l=N.useRef(!1),d=N.useRef(0);return N.useEffect(()=>{const f=d.current;return()=>window.clearTimeout(f)},[]),c.jsx(x1e,{scope:t,isOpenDelayedRef:i,delayDuration:n,onOpen:N.useCallback(()=>{window.clearTimeout(d.current),i.current=!1},[]),onClose:N.useCallback(()=>{window.clearTimeout(d.current),d.current=window.setTimeout(()=>i.current=!0,r)},[r]),isPointerInTransitRef:l,onPointerInTransitChange:N.useCallback(f=>{l.current=f},[]),disableHoverableContent:a,children:s})};qU.displayName=zU;var Af="Tooltip",[b1e,wh]=t0(Af),FU=e=>{const{__scopeTooltip:t,children:n,open:r,defaultOpen:a,onOpenChange:s,disableHoverableContent:i,delayDuration:l}=e,d=WE(Af,e.__scopeTooltip),f=n0(t),[h,p]=N.useState(null),g=zn(),y=N.useRef(0),S=i??d.disableHoverableContent,w=l??d.delayDuration,b=N.useRef(!1),[x,_]=bn({prop:r,defaultProp:a??!1,onChange:k=>{k?(d.onOpen(),document.dispatchEvent(new CustomEvent(pC))):d.onClose(),s==null||s(k)},caller:Af}),j=N.useMemo(()=>x?b.current?"delayed-open":"instant-open":"closed",[x]),C=N.useCallback(()=>{window.clearTimeout(y.current),y.current=0,b.current=!1,_(!0)},[_]),T=N.useCallback(()=>{window.clearTimeout(y.current),y.current=0,_(!1)},[_]),A=N.useCallback(()=>{window.clearTimeout(y.current),y.current=window.setTimeout(()=>{b.current=!0,_(!0),y.current=0},w)},[w,_]);return N.useEffect(()=>()=>{y.current&&(window.clearTimeout(y.current),y.current=0)},[]),c.jsx(Zf,{...f,children:c.jsx(b1e,{scope:t,contentId:g,open:x,stateAttribute:j,trigger:h,onTriggerChange:p,onTriggerEnter:N.useCallback(()=>{d.isOpenDelayedRef.current?A():C()},[d.isOpenDelayedRef,A,C]),onTriggerLeave:N.useCallback(()=>{S?T():(window.clearTimeout(y.current),y.current=0)},[T,S]),onOpen:C,onClose:T,disableHoverableContent:S,children:n})})};FU.displayName=Af;var mC="TooltipTrigger",UU=N.forwardRef((e,t)=>{const{__scopeTooltip:n,...r}=e,a=wh(mC,n),s=WE(mC,n),i=n0(n),l=N.useRef(null),d=ze(t,l,a.onTriggerChange),f=N.useRef(!1),h=N.useRef(!1),p=N.useCallback(()=>f.current=!1,[]);return N.useEffect(()=>()=>document.removeEventListener("pointerup",p),[p]),c.jsx(Qf,{asChild:!0,...i,children:c.jsx(Ae.button,{"aria-describedby":a.open?a.contentId:void 0,"data-state":a.stateAttribute,...r,ref:d,onPointerMove:_e(e.onPointerMove,g=>{g.pointerType!=="touch"&&!h.current&&!s.isPointerInTransitRef.current&&(a.onTriggerEnter(),h.current=!0)}),onPointerLeave:_e(e.onPointerLeave,()=>{a.onTriggerLeave(),h.current=!1}),onPointerDown:_e(e.onPointerDown,()=>{a.open&&a.onClose(),f.current=!0,document.addEventListener("pointerup",p,{once:!0})}),onFocus:_e(e.onFocus,()=>{f.current||a.onOpen()}),onBlur:_e(e.onBlur,a.onClose),onClick:_e(e.onClick,a.onClose)})})});UU.displayName=mC;var GE="TooltipPortal",[w1e,S1e]=t0(GE,{forceMount:void 0}),HU=e=>{const{__scopeTooltip:t,forceMount:n,children:r,container:a}=e,s=wh(GE,t);return c.jsx(w1e,{scope:t,forceMount:n,children:c.jsx(sn,{present:n||s.open,children:c.jsx(gu,{asChild:!0,container:a,children:r})})})};HU.displayName=GE;var Qc="TooltipContent",BU=N.forwardRef((e,t)=>{const n=S1e(Qc,e.__scopeTooltip),{forceMount:r=n.forceMount,side:a="top",...s}=e,i=wh(Qc,e.__scopeTooltip);return c.jsx(sn,{present:r||i.open,children:i.disableHoverableContent?c.jsx(VU,{side:a,...s,ref:t}):c.jsx(_1e,{side:a,...s,ref:t})})}),_1e=N.forwardRef((e,t)=>{const n=wh(Qc,e.__scopeTooltip),r=WE(Qc,e.__scopeTooltip),a=N.useRef(null),s=ze(t,a),[i,l]=N.useState(null),{trigger:d,onClose:f}=n,h=a.current,{onPointerInTransitChange:p}=r,g=N.useCallback(()=>{l(null),p(!1)},[p]),y=N.useCallback((S,w)=>{const b=S.currentTarget,x={x:S.clientX,y:S.clientY},_=T1e(x,b.getBoundingClientRect()),j=A1e(x,_),C=R1e(w.getBoundingClientRect()),T=O1e([...j,...C]);l(T),p(!0)},[p]);return N.useEffect(()=>()=>g(),[g]),N.useEffect(()=>{if(d&&h){const S=b=>y(b,h),w=b=>y(b,d);return d.addEventListener("pointerleave",S),h.addEventListener("pointerleave",w),()=>{d.removeEventListener("pointerleave",S),h.removeEventListener("pointerleave",w)}}},[d,h,y,g]),N.useEffect(()=>{if(i){const S=w=>{const b=w.target,x={x:w.clientX,y:w.clientY},_=(d==null?void 0:d.contains(b))||(h==null?void 0:h.contains(b)),j=!k1e(x,i);_?g():j&&(g(),f())};return document.addEventListener("pointermove",S),()=>document.removeEventListener("pointermove",S)}},[d,h,i,f,g]),c.jsx(VU,{...e,ref:s})}),[N1e,j1e]=t0(Af,{isInside:!1}),C1e=y1e("TooltipContent"),VU=N.forwardRef((e,t)=>{const{__scopeTooltip:n,children:r,"aria-label":a,onEscapeKeyDown:s,onPointerDownOutside:i,...l}=e,d=wh(Qc,n),f=n0(n),{onClose:h}=d;return N.useEffect(()=>(document.addEventListener(pC,h),()=>document.removeEventListener(pC,h)),[h]),N.useEffect(()=>{if(d.trigger){const p=g=>{const y=g.target;y!=null&&y.contains(d.trigger)&&h()};return window.addEventListener("scroll",p,{capture:!0}),()=>window.removeEventListener("scroll",p,{capture:!0})}},[d.trigger,h]),c.jsx(hu,{asChild:!0,disableOutsidePointerEvents:!1,onEscapeKeyDown:s,onPointerDownOutside:i,onFocusOutside:p=>p.preventDefault(),onDismiss:h,children:c.jsxs(Gy,{"data-state":d.stateAttribute,...f,...l,ref:t,style:{...l.style,"--radix-tooltip-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-tooltip-content-available-width":"var(--radix-popper-available-width)","--radix-tooltip-content-available-height":"var(--radix-popper-available-height)","--radix-tooltip-trigger-width":"var(--radix-popper-anchor-width)","--radix-tooltip-trigger-height":"var(--radix-popper-anchor-height)"},children:[c.jsx(C1e,{children:r}),c.jsx(N1e,{scope:n,isInside:!0,children:c.jsx(wse,{id:d.contentId,role:"tooltip",children:a||r})})]})})});BU.displayName=Qc;var WU="TooltipArrow",E1e=N.forwardRef((e,t)=>{const{__scopeTooltip:n,...r}=e,a=n0(n);return j1e(WU,n).isInside?null:c.jsx(Ky,{...a,...r,ref:t})});E1e.displayName=WU;function T1e(e,t){const n=Math.abs(t.top-e.y),r=Math.abs(t.bottom-e.y),a=Math.abs(t.right-e.x),s=Math.abs(t.left-e.x);switch(Math.min(n,r,a,s)){case s:return"left";case a:return"right";case n:return"top";case r:return"bottom";default:throw new Error("unreachable")}}function A1e(e,t,n=5){const r=[];switch(t){case"top":r.push({x:e.x-n,y:e.y+n},{x:e.x+n,y:e.y+n});break;case"bottom":r.push({x:e.x-n,y:e.y-n},{x:e.x+n,y:e.y-n});break;case"left":r.push({x:e.x+n,y:e.y-n},{x:e.x+n,y:e.y+n});break;case"right":r.push({x:e.x-n,y:e.y-n},{x:e.x-n,y:e.y+n});break}return r}function R1e(e){const{top:t,right:n,bottom:r,left:a}=e;return[{x:a,y:t},{x:n,y:t},{x:n,y:r},{x:a,y:r}]}function k1e(e,t){const{x:n,y:r}=e;let a=!1;for(let s=0,i=t.length-1;s<t.length;i=s++){const l=t[s],d=t[i],f=l.x,h=l.y,p=d.x,g=d.y;h>r!=g>r&&n<(p-f)*(r-h)/(g-h)+f&&(a=!a)}return a}function O1e(e){const t=e.slice();return t.sort((n,r)=>n.x<r.x?-1:n.x>r.x?1:n.y<r.y?-1:n.y>r.y?1:0),M1e(t)}function M1e(e){if(e.length<=1)return e.slice();const t=[];for(let r=0;r<e.length;r++){const a=e[r];for(;t.length>=2;){const s=t[t.length-1],i=t[t.length-2];if((s.x-i.x)*(a.y-i.y)>=(s.y-i.y)*(a.x-i.x))t.pop();else break}t.push(a)}t.pop();const n=[];for(let r=e.length-1;r>=0;r--){const a=e[r];for(;n.length>=2;){const s=n[n.length-1],i=n[n.length-2];if((s.x-i.x)*(a.y-i.y)>=(s.y-i.y)*(a.x-i.x))n.pop();else break}n.push(a)}return n.pop(),t.length===1&&n.length===1&&t[0].x===n[0].x&&t[0].y===n[0].y?t:t.concat(n)}var D1e=qU,P1e=FU,$1e=UU,I1e=HU,GU=BU;const Vn=D1e,Wn=P1e,Gn=$1e,In=N.forwardRef(({className:e,sideOffset:t=4,...n},r)=>c.jsx(I1e,{children:c.jsx(GU,{ref:r,sideOffset:t,className:ye("z-50 overflow-hidden rounded-md bg-primary px-3 py-1.5 text-xs text-primary-foreground animate-in fade-in-0 zoom-in-95 data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95 data-[side=bottom]:slide-in-from-top-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",e),...n})}));In.displayName=GU.displayName;function L1e(e){const{id:t,label:n,children:r,errors:a,help:s,description:i,hidden:l,required:d,displayLabel:f}=e;return l?c.jsx("div",{className:"hidden",children:r}):c.jsxs("div",{className:"grid gap-2 mb-4",children:[f&&n&&c.jsxs("div",{className:"flex items-center gap-1.5",children:[c.jsxs(jt,{htmlFor:t,children:[n,d&&c.jsx("span",{className:"text-destructive ml-1",children:"*"})]}),i&&c.jsx(Vn,{delayDuration:300,children:c.jsxs(Wn,{children:[c.jsx(Gn,{asChild:!0,children:c.jsx("button",{type:"button",className:"inline-flex items-center justify-center rounded-full h-4 w-4 text-muted-foreground hover:text-foreground hover:bg-muted transition-colors",children:c.jsx(KC,{className:"h-3.5 w-3.5"})})}),c.jsx(In,{side:"right",className:"max-w-[300px]",children:c.jsx("p",{className:"text-xs",children:i})})]})})]}),r,a&&c.jsx("div",{className:"text-xs text-destructive",children:a}),s&&c.jsx("p",{className:"text-xs text-muted-foreground",children:s})]})}function z1e(e){const{title:t,description:n,properties:r}=e;return c.jsxs("div",{className:"space-y-4",children:[t&&c.jsx("h4",{className:"font-medium text-sm",children:t}),n&&c.jsx("p",{className:"text-xs text-muted-foreground mb-2",children:n}),c.jsx("div",{className:"space-y-3",children:r.map(a=>c.jsx("div",{children:a.content},a.name))})]})}function q1e(e){const{title:t,items:n,canAdd:r,onAddClick:a}=e;return c.jsxs("div",{className:"space-y-3",children:[t&&c.jsx("h4",{className:"font-medium text-sm",children:t}),c.jsx("div",{className:"space-y-3",children:n.map(s=>c.jsxs("div",{className:"rounded-md border border-border bg-muted/30 p-3 space-y-3",children:[c.jsxs("div",{className:"flex items-center justify-between",children:[c.jsxs("span",{className:"text-xs font-medium text-muted-foreground",children:["Item ",s.index+1]}),s.hasRemove&&c.jsx(me,{variant:"ghost",size:"icon",className:"h-6 w-6 text-muted-foreground",onClick:s.onDropIndexClick(s.index),children:c.jsx(la,{className:"h-3 w-3"})})]}),s.children]},s.key))}),r&&c.jsxs(me,{variant:"outline",size:"sm",onClick:a,children:[c.jsx(ll,{className:"h-3 w-3 mr-1"})," Add Item"]})]})}const F1e={FieldTemplate:L1e,ObjectFieldTemplate:z1e,ArrayFieldTemplate:q1e},U1e={...Qwe,...m1e};function H1e({backendType:e,isPythonNode:t,draftData:n,setDraftData:r,node:a,pythonCode:s,onPythonCodeChange:i,onEditorMount:l}){const d=N.useMemo(()=>c1e(e),[e]),f=N.useMemo(()=>u1e(e),[e]);return t?c.jsx(Mo,{className:"h-full",children:c.jsxs("div",{className:"p-6 space-y-4",children:[c.jsxs("div",{className:"grid gap-2",children:[c.jsx(jt,{htmlFor:"node-name",children:"Node Name"}),c.jsx(Ct,{id:"node-name",value:typeof n.label=="string"?n.label:a.data.label||"",placeholder:"Enter node name",onChange:h=>r(p=>({...p,label:h.target.value}))})]}),c.jsxs("div",{className:"grid gap-2",children:[c.jsx(jt,{htmlFor:"node-description",children:"Description"}),c.jsx(ih,{id:"node-description",value:typeof n.description=="string"?n.description:a.data.description||"",placeholder:"Enter description",rows:3,onChange:h=>r(p=>({...p,description:h.target.value}))})]}),c.jsxs("div",{className:"grid gap-2",children:[c.jsx(jt,{htmlFor:"python-code",children:"Python Code"}),c.jsx("div",{className:"border rounded-md overflow-hidden h-[400px]",children:typeof window<"u"&&c.jsx(nue,{height:"100%",defaultLanguage:"python",value:s,onChange:h=>i(h||""),onMount:l,options:{minimap:{enabled:!1},scrollBeyondLastLine:!1,fontSize:14,lineNumbers:"on"},theme:"vs-dark"})})]})]})}):c.jsx(Mo,{className:"h-full",children:c.jsx("div",{className:"p-6",children:c.jsx(bbe,{schema:d,uiSchema:f,formData:n,onChange:h=>{h.formData&&r(h.formData)},validator:zwe,widgets:U1e,templates:F1e,children:c.jsx("div",{className:"hidden"})})})})}function B1e({outputViewMode:e,onOutputViewModeChange:t,useLiveData:n,onToggleLiveData:r,runtime:a,formattedUpdatedAt:s,testResult:i,testError:l,hasRuntime:d,hasLiveOutputs:f,outputDisplay:h}){return c.jsxs("div",{className:"flex h-full flex-col",children:[c.jsx("div",{className:"border-b border-border",children:c.jsx("div",{className:"flex items-center justify-between",children:c.jsxs(Da,{defaultValue:e,onValueChange:t,children:[c.jsxs(Ls,{className:"w-full justify-start h-10 rounded-none bg-transparent p-0",children:[c.jsxs(St,{value:"output-json",className:"rounded-none data-[state=active]:bg-muted",children:[c.jsx(kz,{className:"h-4 w-4 mr-2"}),"JSON"]}),c.jsxs(St,{value:"output-table",className:"rounded-none data-[state=active]:bg-muted",children:[c.jsx(Vz,{className:"h-4 w-4 mr-2"}),"Table"]}),c.jsxs(St,{value:"output-schema",className:"rounded-none data-[state=active]:bg-muted",children:[c.jsx(Jd,{className:"h-4 w-4 mr-2"}),"Schema"]})]}),c.jsxs("div",{className:"flex items-center gap-2 pr-2",children:[c.jsxs("div",{className:"flex items-center space-x-2 mr-2",children:[c.jsx(tr,{id:"live-data",checked:n,onCheckedChange:r,disabled:!a}),c.jsx(jt,{htmlFor:"live-data",className:"text-xs",children:"Live data"})]}),c.jsx(me,{variant:"ghost",size:"icon",className:"h-8 w-8",children:c.jsx(XC,{className:"h-4 w-4"})}),s&&a&&c.jsxs("span",{className:"text-[10px] text-muted-foreground",children:["Updated ",s]})]})]})})}),c.jsxs(Da,{defaultValue:e,children:[c.jsx($t,{value:"output-json",className:"p-0 m-0 h-full",children:c.jsx("div",{className:"flex-1 p-4 bg-muted/30 relative h-full",children:i!==null?c.jsxs("div",{className:"h-full",children:[c.jsx("div",{className:"mb-2 flex items-center gap-2",children:c.jsx(Ue,{variant:"secondary",children:"Test Result"})}),c.jsx("pre",{className:"font-mono text-sm whitespace-pre overflow-auto rounded-md bg-muted p-4",children:JSON.stringify(i,null,2)})]}):l!==null?c.jsxs("div",{className:"h-full",children:[c.jsx("div",{className:"mb-2 flex items-center gap-2",children:c.jsx(Ue,{variant:"destructive",children:"Test Error"})}),c.jsx("pre",{className:"font-mono text-sm whitespace-pre overflow-auto rounded-md bg-destructive/10 p-4 text-destructive",children:l})]}):n?f&&h!==void 0?c.jsx("pre",{className:"font-mono text-sm whitespace-pre overflow-auto rounded-md bg-muted p-4 h-full",children:JSON.stringify(h,null,2)}):c.jsx(Kq,{label:"Live Output",hasRuntime:d}):c.jsx("div",{className:"flex items-center justify-center h-full",children:c.jsxs("div",{className:"text-center",children:[c.jsx(Ue,{variant:"outline",className:"mb-2",children:"Sample Data"}),c.jsx("p",{className:"text-sm text-muted-foreground",children:'Click "Test Node" to execute this node in isolation'})]})})})}),c.jsx($t,{value:"output-table",className:"p-0 m-0 h-full",children:c.jsx("div",{className:"flex-1 p-4 bg-muted/30 relative h-full",children:c.jsx("div",{className:"font-mono text-sm overflow-auto rounded-md bg-muted p-4 h-full",children:c.jsx("p",{children:"Table view not implemented"})})})}),c.jsx($t,{value:"output-schema",className:"p-0 m-0 h-full",children:c.jsx("div",{className:"flex-1 p-4 bg-muted/30 relative h-full",children:c.jsx("div",{className:"font-mono text-sm overflow-auto rounded-md bg-muted p-4 h-full",children:c.jsx("p",{children:"Schema view not implemented"})})})})]})]})}const V1e=()=>({backgroundColor:"hsl(var(--border))",width:"4px",margin:"0 2px",cursor:"col-resize","&:hover":{backgroundColor:"hsl(var(--primary))"},"&:active":{backgroundColor:"hsl(var(--primary))"}}),uI={minSize:150,gutterSize:10,gutterAlign:"center",snapOffset:30,dragInterval:1,direction:"horizontal",cursor:"col-resize",className:"flex h-full",gutterStyle:V1e};function W1e({node:e,className:t,nodeLabel:n,formattedSemanticType:r,onClose:a,inputViewMode:s,onInputViewModeChange:i,useLiveData:l,hasRuntime:d,hasLiveInputs:f,liveInputs:h,hasUpstreamConnections:p,upstreamOutputs:g,schemaFields:y,backendType:S,isPythonNode:w,draftData:b,setDraftData:x,pythonCode:_,onPythonCodeChange:j,onEditorMount:C,outputViewMode:T,onOutputViewModeChange:A,onToggleLiveData:k,runtime:O,formattedUpdatedAt:M,testResult:z,testError:L,hasLiveOutputs:U,outputDisplay:F,onTestNode:q,isTestingNode:V,onSave:P}){return c.jsxs(c.Fragment,{children:[c.jsx("div",{className:"fixed inset-0 bg-background/80 backdrop-blur-sm z-50",onClick:a}),c.jsxs("div",{className:ye("flex flex-col border border-border rounded-lg bg-background shadow-lg","fixed top-[5vh] left-[5vw] w-[90vw] h-[90vh] z-50",t),tabIndex:0,children:[c.jsxs("div",{className:"flex items-center justify-between p-4 border-b border-border",children:[c.jsx("div",{className:"flex items-center gap-3",children:c.jsxs("div",{className:"flex flex-col",children:[c.jsx("h3",{className:"font-medium",children:n}),c.jsxs("p",{className:"text-xs text-muted-foreground",children:["ID: ",e.id]}),r&&c.jsxs("p",{className:"text-xs text-muted-foreground",children:["Node type: ",r]})]})}),c.jsx("div",{className:"flex items-center gap-2",children:c.jsx(me,{variant:"ghost",size:"icon",onClick:a,children:c.jsx(la,{className:"h-4 w-4"})})})]}),c.jsx("div",{className:"flex-1 flex flex-col overflow-hidden",children:c.jsx("div",{className:"flex-1 overflow-hidden",children:c.jsxs(ay,{...uI,sizes:[33,67],children:[c.jsxs("div",{className:"h-full overflow-hidden flex flex-col",children:[c.jsx("div",{className:"p-2 bg-muted/20 border-b border-border flex-shrink-0",children:c.jsx("h3",{className:"text-sm font-medium",children:"Input"})}),c.jsx("div",{className:"flex-1 overflow-auto",children:c.jsx(Dle,{inputViewMode:s,onInputViewModeChange:i,useLiveData:l,hasRuntime:d,hasLiveInputs:f,liveInputs:h,hasUpstreamConnections:p,upstreamInputs:p?g:{},schemaFields:y})})]}),c.jsxs(ay,{...uI,sizes:[50,50],children:[c.jsxs("div",{className:"h-full overflow-hidden flex flex-col",children:[c.jsx("div",{className:"p-2 bg-muted/20 border-b border-border flex-shrink-0",children:c.jsx("h3",{className:"text-sm font-medium",children:"Configuration"})}),c.jsx("div",{className:"flex-1 overflow-auto",children:c.jsx(H1e,{backendType:S,isPythonNode:w,draftData:b,setDraftData:x,node:e,pythonCode:_,onPythonCodeChange:j,onEditorMount:C})})]}),c.jsxs("div",{className:"h-full overflow-hidden flex flex-col",children:[c.jsx("div",{className:"p-2 bg-muted/20 border-b border-border flex-shrink-0",children:c.jsx("h3",{className:"text-sm font-medium",children:"Output"})}),c.jsx("div",{className:"flex-1 overflow-auto",children:c.jsx(B1e,{outputViewMode:T,onOutputViewModeChange:A,useLiveData:l,onToggleLiveData:k,runtime:O,formattedUpdatedAt:M,testResult:z,testError:L,hasRuntime:d,hasLiveOutputs:U,outputDisplay:F})})]})]})]})})}),c.jsxs("div",{className:"flex items-center justify-between p-4 border-t border-border",children:[c.jsxs("div",{className:"flex items-center gap-2",children:[c.jsx(me,{variant:"outline",size:"sm",onClick:q,disabled:V,children:V?c.jsxs(c.Fragment,{children:[c.jsx(zo,{className:"h-4 w-4 mr-2 animate-spin"}),"Testing..."]}):c.jsxs(c.Fragment,{children:[c.jsx(Wf,{className:"h-4 w-4 mr-2"}),"Test Node"]})}),c.jsxs(me,{variant:"outline",size:"sm",children:[c.jsx(Rz,{className:"h-4 w-4 mr-2"}),"Export"]})]}),c.jsxs("div",{className:"flex items-center gap-2",children:[c.jsx(me,{variant:"outline",size:"sm",onClick:a,children:"Cancel"}),c.jsxs(me,{size:"sm",onClick:P,children:[c.jsx(Uz,{className:"h-4 w-4 mr-2"}),"Save"]})]})]})]})]})}function G1e(e){if(typeof document>"u")return;let t=document.head||document.getElementsByTagName("head")[0],n=document.createElement("style");n.type="text/css",t.appendChild(n),n.styleSheet?n.styleSheet.cssText=e:n.appendChild(document.createTextNode(e))}Array(12).fill(0);let gC=1;class K1e{constructor(){this.subscribe=t=>(this.subscribers.push(t),()=>{const n=this.subscribers.indexOf(t);this.subscribers.splice(n,1)}),this.publish=t=>{this.subscribers.forEach(n=>n(t))},this.addToast=t=>{this.publish(t),this.toasts=[...this.toasts,t]},this.create=t=>{var n;const{message:r,...a}=t,s=typeof(t==null?void 0:t.id)=="number"||((n=t.id)==null?void 0:n.length)>0?t.id:gC++,i=this.toasts.find(d=>d.id===s),l=t.dismissible===void 0?!0:t.dismissible;return this.dismissedToasts.has(s)&&this.dismissedToasts.delete(s),i?this.toasts=this.toasts.map(d=>d.id===s?(this.publish({...d,...t,id:s,title:r}),{...d,...t,id:s,dismissible:l,title:r}):d):this.addToast({title:r,...a,dismissible:l,id:s}),s},this.dismiss=t=>(t?(this.dismissedToasts.add(t),requestAnimationFrame(()=>this.subscribers.forEach(n=>n({id:t,dismiss:!0})))):this.toasts.forEach(n=>{this.subscribers.forEach(r=>r({id:n.id,dismiss:!0}))}),t),this.message=(t,n)=>this.create({...n,message:t}),this.error=(t,n)=>this.create({...n,message:t,type:"error"}),this.success=(t,n)=>this.create({...n,type:"success",message:t}),this.info=(t,n)=>this.create({...n,type:"info",message:t}),this.warning=(t,n)=>this.create({...n,type:"warning",message:t}),this.loading=(t,n)=>this.create({...n,type:"loading",message:t}),this.promise=(t,n)=>{if(!n)return;let r;n.loading!==void 0&&(r=this.create({...n,promise:t,type:"loading",message:n.loading,description:typeof n.description!="function"?n.description:void 0}));const a=Promise.resolve(t instanceof Function?t():t);let s=r!==void 0,i;const l=a.then(async f=>{if(i=["resolve",f],Me.isValidElement(f))s=!1,this.create({id:r,type:"default",message:f});else if(X1e(f)&&!f.ok){s=!1;const p=typeof n.error=="function"?await n.error(`HTTP error! status: ${f.status}`):n.error,g=typeof n.description=="function"?await n.description(`HTTP error! status: ${f.status}`):n.description,S=typeof p=="object"&&!Me.isValidElement(p)?p:{message:p};this.create({id:r,type:"error",description:g,...S})}else if(f instanceof Error){s=!1;const p=typeof n.error=="function"?await n.error(f):n.error,g=typeof n.description=="function"?await n.description(f):n.description,S=typeof p=="object"&&!Me.isValidElement(p)?p:{message:p};this.create({id:r,type:"error",description:g,...S})}else if(n.success!==void 0){s=!1;const p=typeof n.success=="function"?await n.success(f):n.success,g=typeof n.description=="function"?await n.description(f):n.description,S=typeof p=="object"&&!Me.isValidElement(p)?p:{message:p};this.create({id:r,type:"success",description:g,...S})}}).catch(async f=>{if(i=["reject",f],n.error!==void 0){s=!1;const h=typeof n.error=="function"?await n.error(f):n.error,p=typeof n.description=="function"?await n.description(f):n.description,y=typeof h=="object"&&!Me.isValidElement(h)?h:{message:h};this.create({id:r,type:"error",description:p,...y})}}).finally(()=>{s&&(this.dismiss(r),r=void 0),n.finally==null||n.finally.call(n)}),d=()=>new Promise((f,h)=>l.then(()=>i[0]==="reject"?h(i[1]):f(i[1])).catch(h));return typeof r!="string"&&typeof r!="number"?{unwrap:d}:Object.assign(r,{unwrap:d})},this.custom=(t,n)=>{const r=(n==null?void 0:n.id)||gC++;return this.create({jsx:t(r),id:r,...n}),r},this.getActiveToasts=()=>this.toasts.filter(t=>!this.dismissedToasts.has(t.id)),this.subscribers=[],this.toasts=[],this.dismissedToasts=new Set}}const Dr=new K1e,Y1e=(e,t)=>{const n=(t==null?void 0:t.id)||gC++;return Dr.addToast({title:e,...t,id:n}),n},X1e=e=>e&&typeof e=="object"&&"ok"in e&&typeof e.ok=="boolean"&&"status"in e&&typeof e.status=="number",Z1e=Y1e,Q1e=()=>Dr.toasts,J1e=()=>Dr.getActiveToasts(),Dd=Object.assign(Z1e,{success:Dr.success,info:Dr.info,warning:Dr.warning,error:Dr.error,custom:Dr.custom,message:Dr.message,promise:Dr.promise,dismiss:Dr.dismiss,loading:Dr.loading},{getHistory:Q1e,getToasts:J1e});G1e("[data-sonner-toaster][dir=ltr],html[dir=ltr]{--toast-icon-margin-start:-3px;--toast-icon-margin-end:4px;--toast-svg-margin-start:-1px;--toast-svg-margin-end:0px;--toast-button-margin-start:auto;--toast-button-margin-end:0;--toast-close-button-start:0;--toast-close-button-end:unset;--toast-close-button-transform:translate(-35%, -35%)}[data-sonner-toaster][dir=rtl],html[dir=rtl]{--toast-icon-margin-start:4px;--toast-icon-margin-end:-3px;--toast-svg-margin-start:0px;--toast-svg-margin-end:-1px;--toast-button-margin-start:0;--toast-button-margin-end:auto;--toast-close-button-start:unset;--toast-close-button-end:0;--toast-close-button-transform:translate(35%, -35%)}[data-sonner-toaster]{position:fixed;width:var(--width);font-family:ui-sans-serif,system-ui,-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Helvetica Neue,Arial,Noto Sans,sans-serif,Apple Color Emoji,Segoe UI Emoji,Segoe UI Symbol,Noto Color Emoji;--gray1:hsl(0, 0%, 99%);--gray2:hsl(0, 0%, 97.3%);--gray3:hsl(0, 0%, 95.1%);--gray4:hsl(0, 0%, 93%);--gray5:hsl(0, 0%, 90.9%);--gray6:hsl(0, 0%, 88.7%);--gray7:hsl(0, 0%, 85.8%);--gray8:hsl(0, 0%, 78%);--gray9:hsl(0, 0%, 56.1%);--gray10:hsl(0, 0%, 52.3%);--gray11:hsl(0, 0%, 43.5%);--gray12:hsl(0, 0%, 9%);--border-radius:8px;box-sizing:border-box;padding:0;margin:0;list-style:none;outline:0;z-index:999999999;transition:transform .4s ease}@media (hover:none) and (pointer:coarse){[data-sonner-toaster][data-lifted=true]{transform:none}}[data-sonner-toaster][data-x-position=right]{right:var(--offset-right)}[data-sonner-toaster][data-x-position=left]{left:var(--offset-left)}[data-sonner-toaster][data-x-position=center]{left:50%;transform:translateX(-50%)}[data-sonner-toaster][data-y-position=top]{top:var(--offset-top)}[data-sonner-toaster][data-y-position=bottom]{bottom:var(--offset-bottom)}[data-sonner-toast]{--y:translateY(100%);--lift-amount:calc(var(--lift) * var(--gap));z-index:var(--z-index);position:absolute;opacity:0;transform:var(--y);touch-action:none;transition:transform .4s,opacity .4s,height .4s,box-shadow .2s;box-sizing:border-box;outline:0;overflow-wrap:anywhere}[data-sonner-toast][data-styled=true]{padding:16px;background:var(--normal-bg);border:1px solid var(--normal-border);color:var(--normal-text);border-radius:var(--border-radius);box-shadow:0 4px 12px rgba(0,0,0,.1);width:var(--width);font-size:13px;display:flex;align-items:center;gap:6px}[data-sonner-toast]:focus-visible{box-shadow:0 4px 12px rgba(0,0,0,.1),0 0 0 2px rgba(0,0,0,.2)}[data-sonner-toast][data-y-position=top]{top:0;--y:translateY(-100%);--lift:1;--lift-amount:calc(1 * var(--gap))}[data-sonner-toast][data-y-position=bottom]{bottom:0;--y:translateY(100%);--lift:-1;--lift-amount:calc(var(--lift) * var(--gap))}[data-sonner-toast][data-styled=true] [data-description]{font-weight:400;line-height:1.4;color:#3f3f3f}[data-rich-colors=true][data-sonner-toast][data-styled=true] [data-description]{color:inherit}[data-sonner-toaster][data-sonner-theme=dark] [data-description]{color:#e8e8e8}[data-sonner-toast][data-styled=true] [data-title]{font-weight:500;line-height:1.5;color:inherit}[data-sonner-toast][data-styled=true] [data-icon]{display:flex;height:16px;width:16px;position:relative;justify-content:flex-start;align-items:center;flex-shrink:0;margin-left:var(--toast-icon-margin-start);margin-right:var(--toast-icon-margin-end)}[data-sonner-toast][data-promise=true] [data-icon]>svg{opacity:0;transform:scale(.8);transform-origin:center;animation:sonner-fade-in .3s ease forwards}[data-sonner-toast][data-styled=true] [data-icon]>*{flex-shrink:0}[data-sonner-toast][data-styled=true] [data-icon] svg{margin-left:var(--toast-svg-margin-start);margin-right:var(--toast-svg-margin-end)}[data-sonner-toast][data-styled=true] [data-content]{display:flex;flex-direction:column;gap:2px}[data-sonner-toast][data-styled=true] [data-button]{border-radius:4px;padding-left:8px;padding-right:8px;height:24px;font-size:12px;color:var(--normal-bg);background:var(--normal-text);margin-left:var(--toast-button-margin-start);margin-right:var(--toast-button-margin-end);border:none;font-weight:500;cursor:pointer;outline:0;display:flex;align-items:center;flex-shrink:0;transition:opacity .4s,box-shadow .2s}[data-sonner-toast][data-styled=true] [data-button]:focus-visible{box-shadow:0 0 0 2px rgba(0,0,0,.4)}[data-sonner-toast][data-styled=true] [data-button]:first-of-type{margin-left:var(--toast-button-margin-start);margin-right:var(--toast-button-margin-end)}[data-sonner-toast][data-styled=true] [data-cancel]{color:var(--normal-text);background:rgba(0,0,0,.08)}[data-sonner-toaster][data-sonner-theme=dark] [data-sonner-toast][data-styled=true] [data-cancel]{background:rgba(255,255,255,.3)}[data-sonner-toast][data-styled=true] [data-close-button]{position:absolute;left:var(--toast-close-button-start);right:var(--toast-close-button-end);top:0;height:20px;width:20px;display:flex;justify-content:center;align-items:center;padding:0;color:var(--gray12);background:var(--normal-bg);border:1px solid var(--gray4);transform:var(--toast-close-button-transform);border-radius:50%;cursor:pointer;z-index:1;transition:opacity .1s,background .2s,border-color .2s}[data-sonner-toast][data-styled=true] [data-close-button]:focus-visible{box-shadow:0 4px 12px rgba(0,0,0,.1),0 0 0 2px rgba(0,0,0,.2)}[data-sonner-toast][data-styled=true] [data-disabled=true]{cursor:not-allowed}[data-sonner-toast][data-styled=true]:hover [data-close-button]:hover{background:var(--gray2);border-color:var(--gray5)}[data-sonner-toast][data-swiping=true]::before{content:'';position:absolute;left:-100%;right:-100%;height:100%;z-index:-1}[data-sonner-toast][data-y-position=top][data-swiping=true]::before{bottom:50%;transform:scaleY(3) translateY(50%)}[data-sonner-toast][data-y-position=bottom][data-swiping=true]::before{top:50%;transform:scaleY(3) translateY(-50%)}[data-sonner-toast][data-swiping=false][data-removed=true]::before{content:'';position:absolute;inset:0;transform:scaleY(2)}[data-sonner-toast][data-expanded=true]::after{content:'';position:absolute;left:0;height:calc(var(--gap) + 1px);bottom:100%;width:100%}[data-sonner-toast][data-mounted=true]{--y:translateY(0);opacity:1}[data-sonner-toast][data-expanded=false][data-front=false]{--scale:var(--toasts-before) * 0.05 + 1;--y:translateY(calc(var(--lift-amount) * var(--toasts-before))) scale(calc(-1 * var(--scale)));height:var(--front-toast-height)}[data-sonner-toast]>*{transition:opacity .4s}[data-sonner-toast][data-x-position=right]{right:0}[data-sonner-toast][data-x-position=left]{left:0}[data-sonner-toast][data-expanded=false][data-front=false][data-styled=true]>*{opacity:0}[data-sonner-toast][data-visible=false]{opacity:0;pointer-events:none}[data-sonner-toast][data-mounted=true][data-expanded=true]{--y:translateY(calc(var(--lift) * var(--offset)));height:var(--initial-height)}[data-sonner-toast][data-removed=true][data-front=true][data-swipe-out=false]{--y:translateY(calc(var(--lift) * -100%));opacity:0}[data-sonner-toast][data-removed=true][data-front=false][data-swipe-out=false][data-expanded=true]{--y:translateY(calc(var(--lift) * var(--offset) + var(--lift) * -100%));opacity:0}[data-sonner-toast][data-removed=true][data-front=false][data-swipe-out=false][data-expanded=false]{--y:translateY(40%);opacity:0;transition:transform .5s,opacity .2s}[data-sonner-toast][data-removed=true][data-front=false]::before{height:calc(var(--initial-height) + 20%)}[data-sonner-toast][data-swiping=true]{transform:var(--y) translateY(var(--swipe-amount-y,0)) translateX(var(--swipe-amount-x,0));transition:none}[data-sonner-toast][data-swiped=true]{user-select:none}[data-sonner-toast][data-swipe-out=true][data-y-position=bottom],[data-sonner-toast][data-swipe-out=true][data-y-position=top]{animation-duration:.2s;animation-timing-function:ease-out;animation-fill-mode:forwards}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=left]{animation-name:swipe-out-left}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=right]{animation-name:swipe-out-right}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=up]{animation-name:swipe-out-up}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=down]{animation-name:swipe-out-down}@keyframes swipe-out-left{from{transform:var(--y) translateX(var(--swipe-amount-x));opacity:1}to{transform:var(--y) translateX(calc(var(--swipe-amount-x) - 100%));opacity:0}}@keyframes swipe-out-right{from{transform:var(--y) translateX(var(--swipe-amount-x));opacity:1}to{transform:var(--y) translateX(calc(var(--swipe-amount-x) + 100%));opacity:0}}@keyframes swipe-out-up{from{transform:var(--y) translateY(var(--swipe-amount-y));opacity:1}to{transform:var(--y) translateY(calc(var(--swipe-amount-y) - 100%));opacity:0}}@keyframes swipe-out-down{from{transform:var(--y) translateY(var(--swipe-amount-y));opacity:1}to{transform:var(--y) translateY(calc(var(--swipe-amount-y) + 100%));opacity:0}}@media (max-width:600px){[data-sonner-toaster]{position:fixed;right:var(--mobile-offset-right);left:var(--mobile-offset-left);width:100%}[data-sonner-toaster][dir=rtl]{left:calc(var(--mobile-offset-left) * -1)}[data-sonner-toaster] [data-sonner-toast]{left:0;right:0;width:calc(100% - var(--mobile-offset-left) * 2)}[data-sonner-toaster][data-x-position=left]{left:var(--mobile-offset-left)}[data-sonner-toaster][data-y-position=bottom]{bottom:var(--mobile-offset-bottom)}[data-sonner-toaster][data-y-position=top]{top:var(--mobile-offset-top)}[data-sonner-toaster][data-x-position=center]{left:var(--mobile-offset-left);right:var(--mobile-offset-right);transform:none}}[data-sonner-toaster][data-sonner-theme=light]{--normal-bg:#fff;--normal-border:var(--gray4);--normal-text:var(--gray12);--success-bg:hsl(143, 85%, 96%);--success-border:hsl(145, 92%, 87%);--success-text:hsl(140, 100%, 27%);--info-bg:hsl(208, 100%, 97%);--info-border:hsl(221, 91%, 93%);--info-text:hsl(210, 92%, 45%);--warning-bg:hsl(49, 100%, 97%);--warning-border:hsl(49, 91%, 84%);--warning-text:hsl(31, 92%, 45%);--error-bg:hsl(359, 100%, 97%);--error-border:hsl(359, 100%, 94%);--error-text:hsl(360, 100%, 45%)}[data-sonner-toaster][data-sonner-theme=light] [data-sonner-toast][data-invert=true]{--normal-bg:#000;--normal-border:hsl(0, 0%, 20%);--normal-text:var(--gray1)}[data-sonner-toaster][data-sonner-theme=dark] [data-sonner-toast][data-invert=true]{--normal-bg:#fff;--normal-border:var(--gray3);--normal-text:var(--gray12)}[data-sonner-toaster][data-sonner-theme=dark]{--normal-bg:#000;--normal-bg-hover:hsl(0, 0%, 12%);--normal-border:hsl(0, 0%, 20%);--normal-border-hover:hsl(0, 0%, 25%);--normal-text:var(--gray1);--success-bg:hsl(150, 100%, 6%);--success-border:hsl(147, 100%, 12%);--success-text:hsl(150, 86%, 65%);--info-bg:hsl(215, 100%, 6%);--info-border:hsl(223, 43%, 17%);--info-text:hsl(216, 87%, 65%);--warning-bg:hsl(64, 100%, 6%);--warning-border:hsl(60, 100%, 9%);--warning-text:hsl(46, 87%, 65%);--error-bg:hsl(358, 76%, 10%);--error-border:hsl(357, 89%, 16%);--error-text:hsl(358, 100%, 81%)}[data-sonner-toaster][data-sonner-theme=dark] [data-sonner-toast] [data-close-button]{background:var(--normal-bg);border-color:var(--normal-border);color:var(--normal-text)}[data-sonner-toaster][data-sonner-theme=dark] [data-sonner-toast] [data-close-button]:hover{background:var(--normal-bg-hover);border-color:var(--normal-border-hover)}[data-rich-colors=true][data-sonner-toast][data-type=success]{background:var(--success-bg);border-color:var(--success-border);color:var(--success-text)}[data-rich-colors=true][data-sonner-toast][data-type=success] [data-close-button]{background:var(--success-bg);border-color:var(--success-border);color:var(--success-text)}[data-rich-colors=true][data-sonner-toast][data-type=info]{background:var(--info-bg);border-color:var(--info-border);color:var(--info-text)}[data-rich-colors=true][data-sonner-toast][data-type=info] [data-close-button]{background:var(--info-bg);border-color:var(--info-border);color:var(--info-text)}[data-rich-colors=true][data-sonner-toast][data-type=warning]{background:var(--warning-bg);border-color:var(--warning-border);color:var(--warning-text)}[data-rich-colors=true][data-sonner-toast][data-type=warning] [data-close-button]{background:var(--warning-bg);border-color:var(--warning-border);color:var(--warning-text)}[data-rich-colors=true][data-sonner-toast][data-type=error]{background:var(--error-bg);border-color:var(--error-border);color:var(--error-text)}[data-rich-colors=true][data-sonner-toast][data-type=error] [data-close-button]{background:var(--error-bg);border-color:var(--error-border);color:var(--error-text)}.sonner-loading-wrapper{--size:16px;height:var(--size);width:var(--size);position:absolute;inset:0;z-index:10}.sonner-loading-wrapper[data-visible=false]{transform-origin:center;animation:sonner-fade-out .2s ease forwards}.sonner-spinner{position:relative;top:50%;left:50%;height:var(--size);width:var(--size)}.sonner-loading-bar{animation:sonner-spin 1.2s linear infinite;background:var(--gray11);border-radius:6px;height:8%;left:-10%;position:absolute;top:-3.9%;width:24%}.sonner-loading-bar:first-child{animation-delay:-1.2s;transform:rotate(.0001deg) translate(146%)}.sonner-loading-bar:nth-child(2){animation-delay:-1.1s;transform:rotate(30deg) translate(146%)}.sonner-loading-bar:nth-child(3){animation-delay:-1s;transform:rotate(60deg) translate(146%)}.sonner-loading-bar:nth-child(4){animation-delay:-.9s;transform:rotate(90deg) translate(146%)}.sonner-loading-bar:nth-child(5){animation-delay:-.8s;transform:rotate(120deg) translate(146%)}.sonner-loading-bar:nth-child(6){animation-delay:-.7s;transform:rotate(150deg) translate(146%)}.sonner-loading-bar:nth-child(7){animation-delay:-.6s;transform:rotate(180deg) translate(146%)}.sonner-loading-bar:nth-child(8){animation-delay:-.5s;transform:rotate(210deg) translate(146%)}.sonner-loading-bar:nth-child(9){animation-delay:-.4s;transform:rotate(240deg) translate(146%)}.sonner-loading-bar:nth-child(10){animation-delay:-.3s;transform:rotate(270deg) translate(146%)}.sonner-loading-bar:nth-child(11){animation-delay:-.2s;transform:rotate(300deg) translate(146%)}.sonner-loading-bar:nth-child(12){animation-delay:-.1s;transform:rotate(330deg) translate(146%)}@keyframes sonner-fade-in{0%{opacity:0;transform:scale(.8)}100%{opacity:1;transform:scale(1)}}@keyframes sonner-fade-out{0%{opacity:1;transform:scale(1)}100%{opacity:0;transform:scale(.8)}}@keyframes sonner-spin{0%{opacity:1}100%{opacity:.15}}@media (prefers-reduced-motion){.sonner-loading-bar,[data-sonner-toast],[data-sonner-toast]>*{transition:none!important;animation:none!important}}.sonner-loader{position:absolute;top:50%;left:50%;transform:translate(-50%,-50%);transform-origin:center;transition:opacity .2s,transform .2s}.sonner-loader[data-visible=false]{opacity:0;transform:scale(.8) translate(-50%,-50%)}");async function eSe(e,t){const n=gn("/api/nodes/execute",t),r=await fetch(n,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(e)});if(!r.ok){const a=await r.json().catch(()=>({detail:"Failed to execute node"}));throw new Error(a.detail||`HTTP ${r.status}`)}return r.json()}const yC=e=>typeof e=="object"&&e!==null,dI=e=>{var n;if(!e)return Uo;const t=(n=e.data)==null?void 0:n.code;return typeof t=="string"&&t.length>0?t:Uo},tSe=e=>{var n;if(!e)return null;const t=(n=e.data)==null?void 0:n.type;return typeof t=="string"&&t.length>0?t.toLowerCase():typeof e.type=="string"&&e.type.length>0?e.type.toLowerCase():null},nSe=e=>{if(!e)return null;const t=new Date(e);return Number.isNaN(t.getTime())?e:t.toLocaleTimeString([],{hour:"2-digit",minute:"2-digit",second:"2-digit"})},rSe=e=>{if(!e)return{outputDisplay:void 0,hasLiveOutputs:!1};const{outputs:t,messages:n,raw:r}=e;let a=r;if(t!==void 0||n!==void 0){const i={};t!==void 0&&(i.outputs=t),n!==void 0&&(i.messages=n),a=t!==void 0&&n===void 0?t:i}return{outputDisplay:a,hasLiveOutputs:t!==void 0||n!==void 0||a!==void 0}},aSe=(e,t,n)=>{const r={name:e.id,...t};if(delete r.runtime,delete r.label,delete r.description,delete r.iconKey,delete r.backendType,delete r.type,r.type=n,n==="SetVariableNode"&&Array.isArray(r.variables)){const a=r.variables,s={};for(const i of a){if(!(i!=null&&i.name))continue;const l=String(i.name),d=typeof i.valueType=="string"?i.valueType:"string";let f=i.value??null;if(f!=null)switch(d){case"number":f=Number(f);break;case"boolean":f=f===!0||f==="true"||f===1;break;case"object":if(typeof f=="string")try{f=JSON.parse(f)}catch{console.warn(`Failed to parse object value for ${l}, using empty object`),f={}}break;default:f=String(f)}s[l]=f}r.variables=s}return r};function sSe({node:e,backendType:t,draftData:n,liveInputs:r,upstreamOutputs:a,useLiveData:s,onCacheRuntime:i}){const[l,d]=N.useState(!1),[f,h]=N.useState(null),[p,g]=N.useState(null);N.useEffect(()=>{h(null),g(null)},[e==null?void 0:e.id]);const y=N.useCallback(async()=>{if(!e){Dd.error("Cannot test node: node not found");return}const S=typeof(n==null?void 0:n.backendType)=="string"?n.backendType:t;if(!S){Dd.error("Cannot test node: missing backend type information. This node may not support testing yet.");return}d(!0),g(null),h(null);try{const w=aSe(e,n,S);let b={};s&&yC(r)?b={...r}:Object.keys(a).length>0&&(b={...a});const x=await eSe({node_config:w,inputs:b});if(x.status==="success"){h(x.result);const _=new Date().toISOString(),j={...b},C={...Object.keys(j).length>0?{inputs:j}:{},raw:x.result,updatedAt:_};if(x.result!==void 0)if(yC(x.result)){const T=x.result;T.outputs!==void 0?C.outputs=T.outputs:C.outputs===void 0&&(C.outputs=x.result),T.messages!==void 0&&(C.messages=T.messages)}else C.outputs=x.result;i==null||i(e.id,C),Dd.success("Node executed successfully")}else g(x.error||"Unknown error"),Dd.error("Node execution failed")}catch(w){const b=w instanceof Error?w.message:"Failed to execute node";g(b),Dd.error(b)}finally{d(!1)}},[t,n,r,e,i,a,s]);return{isTestingNode:l,testResult:f,testError:p,handleTestNode:y}}function oSe(e){const t=[];if(!e)return t;const n=(r,a,s)=>{const i=Array.isArray(r)?"array":r===null?"null":typeof r;if(t.push({name:a,type:i,path:s}),i==="object"&&r!==null)for(const[l,d]of Object.entries(r))n(d,l,`${s}.${l}`)};for(const[r,a]of Object.entries(e))n(a,r,r);return t}function KU({node:e,nodes:t=[],edges:n=[],onClose:r,onSave:a,runtimeCache:s,onCacheRuntime:i,className:l}){var Y;const d=e?e.data.runtime:void 0,f=yC(d)?d:void 0,h=e?s==null?void 0:s[e.id]:void 0,p=Vq(f,h)??null,g=!!p,[y,S]=N.useState(g),[w,b]=N.useState(()=>e!=null&&e.data?{...e.data}:{}),[x,_]=N.useState(()=>dI(e)),[j,C]=N.useState("input-json"),[T,A]=N.useState("output-json"),k=N.useRef(g),O=N.useRef(null),M=N.useRef(),z=N.useMemo(()=>e?Sle(e.id,t,n):[],[e,t,n]),L=N.useMemo(()=>Nle(z,s),[s,z]),U=N.useMemo(()=>e?_le(e.id,n):!1,[e,n]),F=tSe(e),q=F==="python";N.useEffect(()=>{g?k.current||S(!0):S(!1),k.current=g},[g]),N.useEffect(()=>{e&&(q&&_(dI(e)),b(e.data?{...e.data}:{}))},[q,e]),N.useEffect(()=>()=>{var te;(te=O.current)==null||te.dispose()},[]);const V=N.useCallback(()=>{if(a&&e){const te={...w};q&&(te.code=x&&x.length>0?x:Uo),a(e.id,te)}},[w,q,e,a,x]);N.useEffect(()=>{M.current=V},[V]);const P=N.useCallback(te=>{var se;(se=O.current)==null||se.dispose(),O.current=te.onKeyDown(le=>{var Ve;const{key:fe,ctrlKey:ve,metaKey:Se,altKey:Re}=le.browserEvent;if((fe===" "||fe==="Spacebar")&&!ve&&!Se&&!Re){le.browserEvent.stopPropagation();return}(ve||Se)&&(fe==="s"||fe==="S")&&(le.browserEvent.preventDefault(),le.browserEvent.stopPropagation(),(Ve=M.current)==null||Ve.call(M))})},[]),K=p==null?void 0:p.inputs,H=K!==void 0,{outputDisplay:Z,hasLiveOutputs:J}=N.useMemo(()=>rSe(p),[p]),D=N.useMemo(()=>nSe(p==null?void 0:p.updatedAt),[p==null?void 0:p.updatedAt]),W=N.useMemo(()=>oSe(U?L:void 0),[U,L]),B=N.useMemo(()=>{var te;return typeof(w==null?void 0:w.backendType)=="string"?w.backendType:typeof((te=e==null?void 0:e.data)==null?void 0:te.backendType)=="string"?e.data.backendType:null},[w,e]),{isTestingNode:$,testResult:G,testError:ee,handleTestNode:re}=sSe({node:e,backendType:B,draftData:w,liveInputs:K,upstreamOutputs:L,useLiveData:y,onCacheRuntime:i});if(!e)return null;const ne=(Y=e.data)==null?void 0:Y.label,Q=typeof ne=="string"&&ne.length>0?ne:e.type??"",ae=F?`${F.charAt(0).toUpperCase()}${F.slice(1)}`:null;return c.jsx(W1e,{node:e,className:l,nodeLabel:Q,formattedSemanticType:ae,onClose:r,inputViewMode:j,onInputViewModeChange:C,useLiveData:y,hasRuntime:g,hasLiveInputs:H,liveInputs:K,hasUpstreamConnections:U,upstreamOutputs:L,schemaFields:W,backendType:B,isPythonNode:q,draftData:w,setDraftData:b,pythonCode:x,onPythonCodeChange:_,onEditorMount:P,outputViewMode:T,onOutputViewModeChange:A,onToggleLiveData:S,runtime:p,formattedUpdatedAt:D,testResult:G,testError:ee,hasLiveOutputs:J,outputDisplay:Z,onTestNode:re,isTestingNode:$,onSave:V})}function iSe({activeTab:e,onTabChange:t,readinessAlertCount:n=0}){return c.jsx("div",{className:"border-b border-border",children:c.jsx(Da,{value:e,onValueChange:t,className:"w-full",children:c.jsxs(Ls,{className:"h-9",children:[c.jsx(St,{value:"canvas",className:"gap-1.5 text-sm px-3 py-1.5",children:"Editor"}),c.jsx(St,{value:"execution",className:"gap-1.5 text-sm px-3 py-1.5",children:"Execution"}),c.jsx(St,{value:"trace",className:"gap-1.5 text-sm px-3 py-1.5",children:"Trace"}),c.jsxs(St,{value:"readiness",className:"gap-1.5 text-sm px-3 py-1.5",children:["Readiness",n>0&&c.jsx(Ue,{variant:"destructive",className:"ml-1 text-xs px-1 py-0",children:n})]}),c.jsx(St,{value:"settings",className:"gap-1.5 text-sm px-3 py-1.5",children:"Settings"})]})})})}const lSe="modulepreload",cSe=function(e){return"/"+e},fI={},uSe=function(t,n,r){let a=Promise.resolve();if(n&&n.length>0){let i=function(f){return Promise.all(f.map(h=>Promise.resolve(h).then(p=>({status:"fulfilled",value:p}),p=>({status:"rejected",reason:p}))))};document.getElementsByTagName("link");const l=document.querySelector("meta[property=csp-nonce]"),d=(l==null?void 0:l.nonce)||(l==null?void 0:l.getAttribute("nonce"));a=i(n.map(f=>{if(f=cSe(f),f in fI)return;fI[f]=!0;const h=f.endsWith(".css"),p=h?'[rel="stylesheet"]':"";if(document.querySelector(`link[href="${f}"]${p}`))return;const g=document.createElement("link");if(g.rel=h?"stylesheet":lSe,h||(g.as="script"),g.crossOrigin="",g.href=f,d&&g.setAttribute("nonce",d),document.head.appendChild(g),h)return new Promise((y,S)=>{g.addEventListener("load",y),g.addEventListener("error",()=>S(new Error(`Unable to preload CSS for ${f}`)))})}))}function s(i){const l=new Event("vite:preloadError",{cancelable:!0});if(l.payload=i,window.dispatchEvent(l),!l.defaultPrevented)throw i}return a.then(i=>{for(const l of i||[])l.status==="rejected"&&s(l.reason);return t().catch(s)})},dSe=Kf("relative w-full rounded-lg border px-4 py-3 text-sm [&>svg+div]:translate-y-[-3px] [&>svg]:absolute [&>svg]:left-4 [&>svg]:top-4 [&>svg]:text-foreground [&>svg~*]:pl-7",{variants:{variant:{default:"bg-background text-foreground",destructive:"border-destructive/50 text-destructive dark:border-destructive [&>svg]:text-destructive"}},defaultVariants:{variant:"default"}}),Ho=N.forwardRef(({className:e,variant:t,...n},r)=>c.jsx("div",{ref:r,role:"alert",className:ye(dSe({variant:t}),e),...n}));Ho.displayName="Alert";const Bo=N.forwardRef(({className:e,...t},n)=>c.jsx("h5",{ref:n,className:ye("mb-1 font-medium leading-none tracking-tight",e),...t}));Bo.displayName="AlertTitle";const Vo=N.forwardRef(({className:e,...t},n)=>c.jsx("div",{ref:n,className:ye("text-sm [&_p]:leading-relaxed",e),...t}));Vo.displayName="AlertDescription";function Ro({className:e,...t}){return c.jsx("div",{className:ye("animate-pulse rounded-md bg-primary/10",e),...t})}const Pc={},Ii=e=>{if(typeof e=="string"&&e.trim())return e.trim()},fSe=Ii(Pc==null?void 0:Pc.VITE_ORCHEO_CHATKIT_DEFAULT_DOMAIN_KEY)??"domain_pk_localhost_dev",hSe=()=>{if(typeof window>"u")return;const e=window.__ORCHEO_CONFIG__;return Ii(e==null?void 0:e.chatkitDomainKey)},pSe=async e=>{try{const t=await e.json();if(!t)return{message:e.statusText||"ChatKit request failed."};if(typeof t=="string")return{message:t};if(typeof t=="object"){const n=("detail"in t?t.detail:void 0)??t,r=Ii(n==null?void 0:n.message)??Ii(t.message),a=Ii(n==null?void 0:n.code)??Ii(t.code);return{message:r??(e.statusText||"ChatKit request failed. Please retry shortly."),code:a}}return{message:e.statusText||"ChatKit request failed."}}catch{return{message:e.statusText||"ChatKit request failed."}}},YU=()=>{const e=Ii(Pc==null?void 0:Pc.VITE_ORCHEO_CHATKIT_DOMAIN_KEY),t=hSe();return e??t??fSe},vC=({workflowId:e,backendBaseUrl:t,onHttpError:n,metadata:r})=>{const a=window.fetch.bind(window),s=gn("/api/chatkit",t),i=async l=>{if(!n)return;const d=await pSe(l);n({status:l.status,message:d.message,code:d.code})};return async(l,d={})=>{const f={...d,credentials:"include"},h=new Headers(f.headers??{}),g=(h.get("Content-Type")??"").includes("application/json"),y=typeof f.body=="string",S=x=>{if(!x)return JSON.stringify({workflow_id:e,metadata:{...r??{},workflow_id:e}});try{const _=JSON.parse(x);if(_&&typeof _=="object"){_.workflow_id||(_.workflow_id=e);const j=_.metadata&&typeof _.metadata=="object"?{..._.metadata}:{};r&&Object.assign(j,r),j.workflow_id=e,_.metadata=j}return JSON.stringify(_)}catch{return x}};(g||y||!f.body)&&(f.body=S(y?f.body:null),h.set("Content-Type","application/json")),f.headers=h;const b=await a(l??s,f);return b.ok||await i(b.clone()),b}},xC=e=>typeof e!="string"?null:e.trim()||null,mSe=e=>{if(!e)return null;const t=xC(e.workflowId);return t||xC(e.workflow_id)},gSe=e=>!!(e&&typeof e.getClientSecret=="function"),ySe=e=>!!(e&&typeof e=="object"&&typeof e.url=="string"&&typeof e.domainKey=="string"),vSe=(e,t)=>N.useMemo(()=>{const n=e==null?void 0:e.find(r=>{var a;return typeof r.content=="string"&&((a=r.sender)==null?void 0:a.id)===t});return n==null?void 0:n.content},[t,e]),xSe=({getClientSecret:e,backendBaseUrl:t,sessionPayload:n,title:r,user:a,ai:s})=>N.useCallback(async i=>{if(e)return e(i);const l=gn("/api/chatkit/session",t),d=await fetch(l,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({current_client_secret:i,currentClientSecret:i,user:a,assistant:s,metadata:{title:r,...n}})});if(!d.ok)throw new Error("Failed to fetch ChatKit client secret");const f=await d.json(),h=f.client_secret??f.clientSecret;if(!h)throw new Error("ChatKit session response missing client secret");return h},[s,t,e,n,r,a]),bSe=()=>N.useCallback((...e)=>{const t=e.filter(Boolean);if(t.length!==0)return(...n)=>{t.forEach(r=>r(...n))}},[]),XU=({chatkitOptions:e,getClientSecret:t,backendBaseUrl:n,workflowId:r,sessionPayload:a,title:s,user:i,ai:l,initialMessages:d,onResponseStart:f,onResponseEnd:h,onThreadChange:p,onLog:g})=>{const y=xSe({getClientSecret:t,backendBaseUrl:n,sessionPayload:a,title:s,user:i,ai:l}),S=bSe(),w=vSe(d,l.id),b=N.useMemo(()=>xC(r)??mSe(a),[a,r]),x=N.useMemo(()=>{if(!b)return;const A=gn("/api/chatkit",n),k=YU();if(typeof window>"u")return{url:A,domainKey:k};const M=t?(z=>{const L=vC({workflowId:b,backendBaseUrl:n,metadata:a});return async(U,F={})=>{const q=await z(null),V=new Headers(F.headers??{});return q&&V.set("Authorization",`Bearer ${q}`),L(U,{...F,headers:V})}})(t):vC({workflowId:b,backendBaseUrl:n,metadata:a});return{url:A,domainKey:k,fetch:M}},[n,t,b,a]),_=e==null?void 0:e.api,j=N.useMemo(()=>gSe(_)?_.getClientSecret:null,[_]),C=N.useMemo(()=>{if(ySe(_))return _},[_]),T=b?null:t??j??(!x&&!C?y:null);return N.useMemo(()=>{const A={...e};let k;return T?k={getClientSecret:T}:k={...x??{},...C??{}},A.api=k,A.header||(A.header={enabled:!0,title:{enabled:!0,text:s}}),!A.startScreen&&w&&(A.startScreen={greeting:w}),A.onResponseStart=S(e==null?void 0:e.onResponseStart,f),A.onResponseEnd=S(e==null?void 0:e.onResponseEnd,h),A.onThreadChange=S(e==null?void 0:e.onThreadChange,p),A.onThreadLoadStart=e==null?void 0:e.onThreadLoadStart,A.onThreadLoadEnd=e==null?void 0:e.onThreadLoadEnd,A.onLog=S(e==null?void 0:e.onLog,g),A.onError=e==null?void 0:e.onError,A},[e,S,x,T,w,g,h,f,p,C,s])},wSe=e=>({timestamp:new Date().toISOString(),...e??{}});function $i(e,t){typeof window<"u"&&window.dispatchEvent(new CustomEvent("chatkit:telemetry",{detail:{event:e,...wSe(t)}}))}const hI=()=>typeof document<"u"?document.documentElement.classList.contains("dark")?"dark":"light":typeof window<"u"&&typeof window.matchMedia=="function"&&window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light",SSe=()=>{const[e,t]=N.useState(()=>hI());return N.useEffect(()=>{if(typeof MutationObserver>"u"||typeof document>"u")return;const n=document.documentElement,r=new MutationObserver(()=>{t(hI())});return r.observe(n,{attributes:!0,attributeFilter:["class"]}),()=>r.disconnect()},[]),N.useEffect(()=>{if(typeof window>"u"||typeof window.matchMedia!="function")return;const n=window.matchMedia("(prefers-color-scheme: dark)"),r=a=>{t(a.matches?"dark":"light")};return typeof n.addEventListener=="function"?n.addEventListener("change",r):typeof n.addListener=="function"&&n.addListener(r),()=>{typeof n.removeEventListener=="function"?n.removeEventListener("change",r):typeof n.removeListener=="function"&&n.removeListener(r)}},[]),e},ZU=e=>({colorScheme:e,color:{grayscale:{hue:220,tint:6,shade:e==="dark"?-1:-4},accent:{primary:e==="dark"?"#f1f5f9":"#0f172a",level:1}},radius:"round"}),_Se=N.lazy(()=>uSe(()=>Promise.resolve().then(()=>dPe),[]).then(e=>({default:e.ChatKitSurface}))),NSe=".react-flow__panel.react-flow__minimap",YN=96,jSe=16;function CSe({title:e,user:t,ai:n,workflowId:r,sessionPayload:a,backendBaseUrl:s,getClientSecret:i,sessionStatus:l,sessionError:d,onRetry:f,onResponseStart:h,onResponseEnd:p,onClientTool:g,onDismiss:y,onOpen:S,isExternallyOpen:w}){const[b,x]=N.useState(!1),[_,j]=N.useState(!1),[C,T]=N.useState(!1),[A,k]=N.useState(YN),O=SSe();N.useEffect(()=>{w?(x(!0),j(!0)):x(!1)},[w]),N.useEffect(()=>{if(typeof window>"u"||typeof document>"u")return;let P=null,K=null,H=null;const Z=()=>{if(typeof window>"u")return;const D=document.querySelector(NSe);if(!D){k(YN);return}const W=D.getBoundingClientRect(),B=window.innerHeight-W.top+jSe;k(Math.max(B,YN)),typeof ResizeObserver<"u"&&D!==H&&(P==null||P.disconnect(),P=new ResizeObserver(()=>Z()),P.observe(D),H=D)},J=()=>Z();return Z(),window.addEventListener("resize",J),typeof MutationObserver<"u"&&document.body&&(K=new MutationObserver(()=>Z()),K.observe(document.body,{childList:!0,subtree:!0})),()=>{window.removeEventListener("resize",J),P==null||P.disconnect(),K==null||K.disconnect()}},[]);const M=N.useMemo(()=>({bottom:A}),[A]),z=()=>{x(!0),j(!0),$i("canvas.chat.open",{workflowId:r,source:"bubble"}),S==null||S()},L=()=>{x(!1),$i("canvas.chat.close",{workflowId:r,source:"bubble"})},U=()=>{L(),y==null||y()},F=N.useCallback(async()=>{T(!0);try{await f()}finally{T(!1)}},[f]),q=XU({chatkitOptions:{composer:{placeholder:`Ask ${e} a question`},onClientTool:g,theme:ZU(O)},getClientSecret:i,backendBaseUrl:s??void 0,sessionPayload:{...a,workflowId:r,workflowLabel:e},workflowId:r??null,title:e,user:t,ai:n,initialMessages:[{id:"canvas-chat-greeting",content:`You're chatting with ${e}.`,sender:{...n,isAI:!0},timestamp:new Date}],onResponseStart:h,onResponseEnd:p}),V=N.useMemo(()=>l==="loading"?c.jsxs("div",{className:"flex h-full flex-col items-center justify-center space-y-3 text-sm text-muted-foreground",children:[c.jsx(zo,{className:"h-5 w-5 animate-spin"}),c.jsx("p",{children:"Starting a secure chat session…"})]}):l==="error"?c.jsxs(Ho,{variant:"destructive",className:"mt-4 text-left",children:[c.jsx(Bo,{children:"Chat unavailable"}),c.jsx(Vo,{className:"mt-1 text-sm",children:d||"We couldn't reach the chat service. Try again in a moment."}),c.jsx("div",{className:"mt-3 flex gap-2",children:c.jsxs(me,{variant:"outline",size:"sm",onClick:F,disabled:C,children:[C&&c.jsx(zo,{className:"mr-2 h-4 w-4 animate-spin"}),"Retry"]})})]}):null,[F,C,d,l]);return c.jsxs(c.Fragment,{children:[!b&&c.jsxs(me,{className:"fixed right-6 z-50 h-14 w-14 rounded-full shadow-xl",style:M,size:"icon",onClick:z,children:[c.jsx(Ea,{className:"h-5 w-5"}),c.jsx("span",{className:"sr-only",children:"Open ChatKit"})]}),b&&c.jsxs("div",{className:"fixed right-6 z-50 flex h-[520px] w-full max-w-md flex-col rounded-2xl border border-border bg-card text-foreground shadow-2xl",style:M,children:[c.jsxs("div",{className:"flex items-center justify-between border-b border-border px-4 py-3",children:[c.jsxs("div",{children:[c.jsx("p",{className:"text-sm uppercase text-muted-foreground",children:"Chatting"}),c.jsx("p",{className:"text-base font-semibold",children:e})]}),c.jsxs("div",{className:"flex items-center gap-1",children:[c.jsxs(me,{variant:"ghost",size:"icon",className:"h-8 w-8",onClick:L,children:[c.jsx($z,{className:"h-4 w-4"}),c.jsx("span",{className:"sr-only",children:"Collapse chat"})]}),c.jsxs(me,{variant:"ghost",size:"icon",className:"h-8 w-8",onClick:U,children:[c.jsx(la,{className:"h-4 w-4"}),c.jsx("span",{className:"sr-only",children:"Hide chat"})]})]})]}),c.jsxs("div",{className:"flex-1 overflow-hidden px-2 py-2",children:[V,l!=="error"&&_&&c.jsx(N.Suspense,{fallback:c.jsxs("div",{className:"flex h-full w-full flex-col gap-3",children:[c.jsx(Ro,{className:"h-10 w-1/2 self-center"}),c.jsx(Ro,{className:"h-full w-full"})]}),children:c.jsx(_Se,{options:q,className:ye(l!=="ready"&&"pointer-events-none opacity-50")})})]})]})]})}function on(e){if(typeof e=="string"||typeof e=="number")return""+e;let t="";if(Array.isArray(e))for(let n=0,r;n<e.length;n++)(r=on(e[n]))!==""&&(t+=(t&&" ")+r);else for(let n in e)e[n]&&(t+=(t&&" ")+n);return t}var ESe={value:()=>{}};function r0(){for(var e=0,t=arguments.length,n={},r;e<t;++e){if(!(r=arguments[e]+"")||r in n||/[\s.]/.test(r))throw new Error("illegal type: "+r);n[r]=[]}return new Ig(n)}function Ig(e){this._=e}function TSe(e,t){return e.trim().split(/^|\s+/).map(function(n){var r="",a=n.indexOf(".");if(a>=0&&(r=n.slice(a+1),n=n.slice(0,a)),n&&!t.hasOwnProperty(n))throw new Error("unknown type: "+n);return{type:n,name:r}})}Ig.prototype=r0.prototype={constructor:Ig,on:function(e,t){var n=this._,r=TSe(e+"",n),a,s=-1,i=r.length;if(arguments.length<2){for(;++s<i;)if((a=(e=r[s]).type)&&(a=ASe(n[a],e.name)))return a;return}if(t!=null&&typeof t!="function")throw new Error("invalid callback: "+t);for(;++s<i;)if(a=(e=r[s]).type)n[a]=pI(n[a],e.name,t);else if(t==null)for(a in n)n[a]=pI(n[a],e.name,null);return this},copy:function(){var e={},t=this._;for(var n in t)e[n]=t[n].slice();return new Ig(e)},call:function(e,t){if((a=arguments.length-2)>0)for(var n=new Array(a),r=0,a,s;r<a;++r)n[r]=arguments[r+2];if(!this._.hasOwnProperty(e))throw new Error("unknown type: "+e);for(s=this._[e],r=0,a=s.length;r<a;++r)s[r].value.apply(t,n)},apply:function(e,t,n){if(!this._.hasOwnProperty(e))throw new Error("unknown type: "+e);for(var r=this._[e],a=0,s=r.length;a<s;++a)r[a].value.apply(t,n)}};function ASe(e,t){for(var n=0,r=e.length,a;n<r;++n)if((a=e[n]).name===t)return a.value}function pI(e,t,n){for(var r=0,a=e.length;r<a;++r)if(e[r].name===t){e[r]=ESe,e=e.slice(0,r).concat(e.slice(r+1));break}return n!=null&&e.push({name:t,value:n}),e}var bC="http://www.w3.org/1999/xhtml";const mI={svg:"http://www.w3.org/2000/svg",xhtml:bC,xlink:"http://www.w3.org/1999/xlink",xml:"http://www.w3.org/XML/1998/namespace",xmlns:"http://www.w3.org/2000/xmlns/"};function a0(e){var t=e+="",n=t.indexOf(":");return n>=0&&(t=e.slice(0,n))!=="xmlns"&&(e=e.slice(n+1)),mI.hasOwnProperty(t)?{space:mI[t],local:e}:e}function RSe(e){return function(){var t=this.ownerDocument,n=this.namespaceURI;return n===bC&&t.documentElement.namespaceURI===bC?t.createElement(e):t.createElementNS(n,e)}}function kSe(e){return function(){return this.ownerDocument.createElementNS(e.space,e.local)}}function QU(e){var t=a0(e);return(t.local?kSe:RSe)(t)}function OSe(){}function KE(e){return e==null?OSe:function(){return this.querySelector(e)}}function MSe(e){typeof e!="function"&&(e=KE(e));for(var t=this._groups,n=t.length,r=new Array(n),a=0;a<n;++a)for(var s=t[a],i=s.length,l=r[a]=new Array(i),d,f,h=0;h<i;++h)(d=s[h])&&(f=e.call(d,d.__data__,h,s))&&("__data__"in d&&(f.__data__=d.__data__),l[h]=f);return new _r(r,this._parents)}function DSe(e){return e==null?[]:Array.isArray(e)?e:Array.from(e)}function PSe(){return[]}function JU(e){return e==null?PSe:function(){return this.querySelectorAll(e)}}function $Se(e){return function(){return DSe(e.apply(this,arguments))}}function ISe(e){typeof e=="function"?e=$Se(e):e=JU(e);for(var t=this._groups,n=t.length,r=[],a=[],s=0;s<n;++s)for(var i=t[s],l=i.length,d,f=0;f<l;++f)(d=i[f])&&(r.push(e.call(d,d.__data__,f,i)),a.push(d));return new _r(r,a)}function eH(e){return function(){return this.matches(e)}}function tH(e){return function(t){return t.matches(e)}}var LSe=Array.prototype.find;function zSe(e){return function(){return LSe.call(this.children,e)}}function qSe(){return this.firstElementChild}function FSe(e){return this.select(e==null?qSe:zSe(typeof e=="function"?e:tH(e)))}var USe=Array.prototype.filter;function HSe(){return Array.from(this.children)}function BSe(e){return function(){return USe.call(this.children,e)}}function VSe(e){return this.selectAll(e==null?HSe:BSe(typeof e=="function"?e:tH(e)))}function WSe(e){typeof e!="function"&&(e=eH(e));for(var t=this._groups,n=t.length,r=new Array(n),a=0;a<n;++a)for(var s=t[a],i=s.length,l=r[a]=[],d,f=0;f<i;++f)(d=s[f])&&e.call(d,d.__data__,f,s)&&l.push(d);return new _r(r,this._parents)}function nH(e){return new Array(e.length)}function GSe(){return new _r(this._enter||this._groups.map(nH),this._parents)}function gy(e,t){this.ownerDocument=e.ownerDocument,this.namespaceURI=e.namespaceURI,this._next=null,this._parent=e,this.__data__=t}gy.prototype={constructor:gy,appendChild:function(e){return this._parent.insertBefore(e,this._next)},insertBefore:function(e,t){return this._parent.insertBefore(e,t)},querySelector:function(e){return this._parent.querySelector(e)},querySelectorAll:function(e){return this._parent.querySelectorAll(e)}};function KSe(e){return function(){return e}}function YSe(e,t,n,r,a,s){for(var i=0,l,d=t.length,f=s.length;i<f;++i)(l=t[i])?(l.__data__=s[i],r[i]=l):n[i]=new gy(e,s[i]);for(;i<d;++i)(l=t[i])&&(a[i]=l)}function XSe(e,t,n,r,a,s,i){var l,d,f=new Map,h=t.length,p=s.length,g=new Array(h),y;for(l=0;l<h;++l)(d=t[l])&&(g[l]=y=i.call(d,d.__data__,l,t)+"",f.has(y)?a[l]=d:f.set(y,d));for(l=0;l<p;++l)y=i.call(e,s[l],l,s)+"",(d=f.get(y))?(r[l]=d,d.__data__=s[l],f.delete(y)):n[l]=new gy(e,s[l]);for(l=0;l<h;++l)(d=t[l])&&f.get(g[l])===d&&(a[l]=d)}function ZSe(e){return e.__data__}function QSe(e,t){if(!arguments.length)return Array.from(this,ZSe);var n=t?XSe:YSe,r=this._parents,a=this._groups;typeof e!="function"&&(e=KSe(e));for(var s=a.length,i=new Array(s),l=new Array(s),d=new Array(s),f=0;f<s;++f){var h=r[f],p=a[f],g=p.length,y=JSe(e.call(h,h&&h.__data__,f,r)),S=y.length,w=l[f]=new Array(S),b=i[f]=new Array(S),x=d[f]=new Array(g);n(h,p,w,b,x,y,t);for(var _=0,j=0,C,T;_<S;++_)if(C=w[_]){for(_>=j&&(j=_+1);!(T=b[j])&&++j<S;);C._next=T||null}}return i=new _r(i,r),i._enter=l,i._exit=d,i}function JSe(e){return typeof e=="object"&&"length"in e?e:Array.from(e)}function e_e(){return new _r(this._exit||this._groups.map(nH),this._parents)}function t_e(e,t,n){var r=this.enter(),a=this,s=this.exit();return typeof e=="function"?(r=e(r),r&&(r=r.selection())):r=r.append(e+""),t!=null&&(a=t(a),a&&(a=a.selection())),n==null?s.remove():n(s),r&&a?r.merge(a).order():a}function n_e(e){for(var t=e.selection?e.selection():e,n=this._groups,r=t._groups,a=n.length,s=r.length,i=Math.min(a,s),l=new Array(a),d=0;d<i;++d)for(var f=n[d],h=r[d],p=f.length,g=l[d]=new Array(p),y,S=0;S<p;++S)(y=f[S]||h[S])&&(g[S]=y);for(;d<a;++d)l[d]=n[d];return new _r(l,this._parents)}function r_e(){for(var e=this._groups,t=-1,n=e.length;++t<n;)for(var r=e[t],a=r.length-1,s=r[a],i;--a>=0;)(i=r[a])&&(s&&i.compareDocumentPosition(s)^4&&s.parentNode.insertBefore(i,s),s=i);return this}function a_e(e){e||(e=s_e);function t(p,g){return p&&g?e(p.__data__,g.__data__):!p-!g}for(var n=this._groups,r=n.length,a=new Array(r),s=0;s<r;++s){for(var i=n[s],l=i.length,d=a[s]=new Array(l),f,h=0;h<l;++h)(f=i[h])&&(d[h]=f);d.sort(t)}return new _r(a,this._parents).order()}function s_e(e,t){return e<t?-1:e>t?1:e>=t?0:NaN}function o_e(){var e=arguments[0];return arguments[0]=this,e.apply(null,arguments),this}function i_e(){return Array.from(this)}function l_e(){for(var e=this._groups,t=0,n=e.length;t<n;++t)for(var r=e[t],a=0,s=r.length;a<s;++a){var i=r[a];if(i)return i}return null}function c_e(){let e=0;for(const t of this)++e;return e}function u_e(){return!this.node()}function d_e(e){for(var t=this._groups,n=0,r=t.length;n<r;++n)for(var a=t[n],s=0,i=a.length,l;s<i;++s)(l=a[s])&&e.call(l,l.__data__,s,a);return this}function f_e(e){return function(){this.removeAttribute(e)}}function h_e(e){return function(){this.removeAttributeNS(e.space,e.local)}}function p_e(e,t){return function(){this.setAttribute(e,t)}}function m_e(e,t){return function(){this.setAttributeNS(e.space,e.local,t)}}function g_e(e,t){return function(){var n=t.apply(this,arguments);n==null?this.removeAttribute(e):this.setAttribute(e,n)}}function y_e(e,t){return function(){var n=t.apply(this,arguments);n==null?this.removeAttributeNS(e.space,e.local):this.setAttributeNS(e.space,e.local,n)}}function v_e(e,t){var n=a0(e);if(arguments.length<2){var r=this.node();return n.local?r.getAttributeNS(n.space,n.local):r.getAttribute(n)}return this.each((t==null?n.local?h_e:f_e:typeof t=="function"?n.local?y_e:g_e:n.local?m_e:p_e)(n,t))}function rH(e){return e.ownerDocument&&e.ownerDocument.defaultView||e.document&&e||e.defaultView}function x_e(e){return function(){this.style.removeProperty(e)}}function b_e(e,t,n){return function(){this.style.setProperty(e,t,n)}}function w_e(e,t,n){return function(){var r=t.apply(this,arguments);r==null?this.style.removeProperty(e):this.style.setProperty(e,r,n)}}function S_e(e,t,n){return arguments.length>1?this.each((t==null?x_e:typeof t=="function"?w_e:b_e)(e,t,n??"")):Jc(this.node(),e)}function Jc(e,t){return e.style.getPropertyValue(t)||rH(e).getComputedStyle(e,null).getPropertyValue(t)}function __e(e){return function(){delete this[e]}}function N_e(e,t){return function(){this[e]=t}}function j_e(e,t){return function(){var n=t.apply(this,arguments);n==null?delete this[e]:this[e]=n}}function C_e(e,t){return arguments.length>1?this.each((t==null?__e:typeof t=="function"?j_e:N_e)(e,t)):this.node()[e]}function aH(e){return e.trim().split(/^|\s+/)}function YE(e){return e.classList||new sH(e)}function sH(e){this._node=e,this._names=aH(e.getAttribute("class")||"")}sH.prototype={add:function(e){var t=this._names.indexOf(e);t<0&&(this._names.push(e),this._node.setAttribute("class",this._names.join(" ")))},remove:function(e){var t=this._names.indexOf(e);t>=0&&(this._names.splice(t,1),this._node.setAttribute("class",this._names.join(" ")))},contains:function(e){return this._names.indexOf(e)>=0}};function oH(e,t){for(var n=YE(e),r=-1,a=t.length;++r<a;)n.add(t[r])}function iH(e,t){for(var n=YE(e),r=-1,a=t.length;++r<a;)n.remove(t[r])}function E_e(e){return function(){oH(this,e)}}function T_e(e){return function(){iH(this,e)}}function A_e(e,t){return function(){(t.apply(this,arguments)?oH:iH)(this,e)}}function R_e(e,t){var n=aH(e+"");if(arguments.length<2){for(var r=YE(this.node()),a=-1,s=n.length;++a<s;)if(!r.contains(n[a]))return!1;return!0}return this.each((typeof t=="function"?A_e:t?E_e:T_e)(n,t))}function k_e(){this.textContent=""}function O_e(e){return function(){this.textContent=e}}function M_e(e){return function(){var t=e.apply(this,arguments);this.textContent=t??""}}function D_e(e){return arguments.length?this.each(e==null?k_e:(typeof e=="function"?M_e:O_e)(e)):this.node().textContent}function P_e(){this.innerHTML=""}function $_e(e){return function(){this.innerHTML=e}}function I_e(e){return function(){var t=e.apply(this,arguments);this.innerHTML=t??""}}function L_e(e){return arguments.length?this.each(e==null?P_e:(typeof e=="function"?I_e:$_e)(e)):this.node().innerHTML}function z_e(){this.nextSibling&&this.parentNode.appendChild(this)}function q_e(){return this.each(z_e)}function F_e(){this.previousSibling&&this.parentNode.insertBefore(this,this.parentNode.firstChild)}function U_e(){return this.each(F_e)}function H_e(e){var t=typeof e=="function"?e:QU(e);return this.select(function(){return this.appendChild(t.apply(this,arguments))})}function B_e(){return null}function V_e(e,t){var n=typeof e=="function"?e:QU(e),r=t==null?B_e:typeof t=="function"?t:KE(t);return this.select(function(){return this.insertBefore(n.apply(this,arguments),r.apply(this,arguments)||null)})}function W_e(){var e=this.parentNode;e&&e.removeChild(this)}function G_e(){return this.each(W_e)}function K_e(){var e=this.cloneNode(!1),t=this.parentNode;return t?t.insertBefore(e,this.nextSibling):e}function Y_e(){var e=this.cloneNode(!0),t=this.parentNode;return t?t.insertBefore(e,this.nextSibling):e}function X_e(e){return this.select(e?Y_e:K_e)}function Z_e(e){return arguments.length?this.property("__data__",e):this.node().__data__}function Q_e(e){return function(t){e.call(this,t,this.__data__)}}function J_e(e){return e.trim().split(/^|\s+/).map(function(t){var n="",r=t.indexOf(".");return r>=0&&(n=t.slice(r+1),t=t.slice(0,r)),{type:t,name:n}})}function eNe(e){return function(){var t=this.__on;if(t){for(var n=0,r=-1,a=t.length,s;n<a;++n)s=t[n],(!e.type||s.type===e.type)&&s.name===e.name?this.removeEventListener(s.type,s.listener,s.options):t[++r]=s;++r?t.length=r:delete this.__on}}}function tNe(e,t,n){return function(){var r=this.__on,a,s=Q_e(t);if(r){for(var i=0,l=r.length;i<l;++i)if((a=r[i]).type===e.type&&a.name===e.name){this.removeEventListener(a.type,a.listener,a.options),this.addEventListener(a.type,a.listener=s,a.options=n),a.value=t;return}}this.addEventListener(e.type,s,n),a={type:e.type,name:e.name,value:t,listener:s,options:n},r?r.push(a):this.__on=[a]}}function nNe(e,t,n){var r=J_e(e+""),a,s=r.length,i;if(arguments.length<2){var l=this.node().__on;if(l){for(var d=0,f=l.length,h;d<f;++d)for(a=0,h=l[d];a<s;++a)if((i=r[a]).type===h.type&&i.name===h.name)return h.value}return}for(l=t?tNe:eNe,a=0;a<s;++a)this.each(l(r[a],t,n));return this}function lH(e,t,n){var r=rH(e),a=r.CustomEvent;typeof a=="function"?a=new a(t,n):(a=r.document.createEvent("Event"),n?(a.initEvent(t,n.bubbles,n.cancelable),a.detail=n.detail):a.initEvent(t,!1,!1)),e.dispatchEvent(a)}function rNe(e,t){return function(){return lH(this,e,t)}}function aNe(e,t){return function(){return lH(this,e,t.apply(this,arguments))}}function sNe(e,t){return this.each((typeof t=="function"?aNe:rNe)(e,t))}function*oNe(){for(var e=this._groups,t=0,n=e.length;t<n;++t)for(var r=e[t],a=0,s=r.length,i;a<s;++a)(i=r[a])&&(yield i)}var cH=[null];function _r(e,t){this._groups=e,this._parents=t}function Sh(){return new _r([[document.documentElement]],cH)}function iNe(){return this}_r.prototype=Sh.prototype={constructor:_r,select:MSe,selectAll:ISe,selectChild:FSe,selectChildren:VSe,filter:WSe,data:QSe,enter:GSe,exit:e_e,join:t_e,merge:n_e,selection:iNe,order:r_e,sort:a_e,call:o_e,nodes:i_e,node:l_e,size:c_e,empty:u_e,each:d_e,attr:v_e,style:S_e,property:C_e,classed:R_e,text:D_e,html:L_e,raise:q_e,lower:U_e,append:H_e,insert:V_e,remove:G_e,clone:X_e,datum:Z_e,on:nNe,dispatch:sNe,[Symbol.iterator]:oNe};function yr(e){return typeof e=="string"?new _r([[document.querySelector(e)]],[document.documentElement]):new _r([[e]],cH)}function lNe(e){let t;for(;t=e.sourceEvent;)e=t;return e}function ea(e,t){if(e=lNe(e),t===void 0&&(t=e.currentTarget),t){var n=t.ownerSVGElement||t;if(n.createSVGPoint){var r=n.createSVGPoint();return r.x=e.clientX,r.y=e.clientY,r=r.matrixTransform(t.getScreenCTM().inverse()),[r.x,r.y]}if(t.getBoundingClientRect){var a=t.getBoundingClientRect();return[e.clientX-a.left-t.clientLeft,e.clientY-a.top-t.clientTop]}}return[e.pageX,e.pageY]}const cNe={passive:!1},Rf={capture:!0,passive:!1};function XN(e){e.stopImmediatePropagation()}function $c(e){e.preventDefault(),e.stopImmediatePropagation()}function uH(e){var t=e.document.documentElement,n=yr(e).on("dragstart.drag",$c,Rf);"onselectstart"in t?n.on("selectstart.drag",$c,Rf):(t.__noselect=t.style.MozUserSelect,t.style.MozUserSelect="none")}function dH(e,t){var n=e.document.documentElement,r=yr(e).on("dragstart.drag",null);t&&(r.on("click.drag",$c,Rf),setTimeout(function(){r.on("click.drag",null)},0)),"onselectstart"in n?r.on("selectstart.drag",null):(n.style.MozUserSelect=n.__noselect,delete n.__noselect)}const og=e=>()=>e;function wC(e,{sourceEvent:t,subject:n,target:r,identifier:a,active:s,x:i,y:l,dx:d,dy:f,dispatch:h}){Object.defineProperties(this,{type:{value:e,enumerable:!0,configurable:!0},sourceEvent:{value:t,enumerable:!0,configurable:!0},subject:{value:n,enumerable:!0,configurable:!0},target:{value:r,enumerable:!0,configurable:!0},identifier:{value:a,enumerable:!0,configurable:!0},active:{value:s,enumerable:!0,configurable:!0},x:{value:i,enumerable:!0,configurable:!0},y:{value:l,enumerable:!0,configurable:!0},dx:{value:d,enumerable:!0,configurable:!0},dy:{value:f,enumerable:!0,configurable:!0},_:{value:h}})}wC.prototype.on=function(){var e=this._.on.apply(this._,arguments);return e===this._?this:e};function uNe(e){return!e.ctrlKey&&!e.button}function dNe(){return this.parentNode}function fNe(e,t){return t??{x:e.x,y:e.y}}function hNe(){return navigator.maxTouchPoints||"ontouchstart"in this}function fH(){var e=uNe,t=dNe,n=fNe,r=hNe,a={},s=r0("start","drag","end"),i=0,l,d,f,h,p=0;function g(C){C.on("mousedown.drag",y).filter(r).on("touchstart.drag",b).on("touchmove.drag",x,cNe).on("touchend.drag touchcancel.drag",_).style("touch-action","none").style("-webkit-tap-highlight-color","rgba(0,0,0,0)")}function y(C,T){if(!(h||!e.call(this,C,T))){var A=j(this,t.call(this,C,T),C,T,"mouse");A&&(yr(C.view).on("mousemove.drag",S,Rf).on("mouseup.drag",w,Rf),uH(C.view),XN(C),f=!1,l=C.clientX,d=C.clientY,A("start",C))}}function S(C){if($c(C),!f){var T=C.clientX-l,A=C.clientY-d;f=T*T+A*A>p}a.mouse("drag",C)}function w(C){yr(C.view).on("mousemove.drag mouseup.drag",null),dH(C.view,f),$c(C),a.mouse("end",C)}function b(C,T){if(e.call(this,C,T)){var A=C.changedTouches,k=t.call(this,C,T),O=A.length,M,z;for(M=0;M<O;++M)(z=j(this,k,C,T,A[M].identifier,A[M]))&&(XN(C),z("start",C,A[M]))}}function x(C){var T=C.changedTouches,A=T.length,k,O;for(k=0;k<A;++k)(O=a[T[k].identifier])&&($c(C),O("drag",C,T[k]))}function _(C){var T=C.changedTouches,A=T.length,k,O;for(h&&clearTimeout(h),h=setTimeout(function(){h=null},500),k=0;k<A;++k)(O=a[T[k].identifier])&&(XN(C),O("end",C,T[k]))}function j(C,T,A,k,O,M){var z=s.copy(),L=ea(M||A,T),U,F,q;if((q=n.call(C,new wC("beforestart",{sourceEvent:A,target:g,identifier:O,active:i,x:L[0],y:L[1],dx:0,dy:0,dispatch:z}),k))!=null)return U=q.x-L[0]||0,F=q.y-L[1]||0,function V(P,K,H){var Z=L,J;switch(P){case"start":a[O]=V,J=i++;break;case"end":delete a[O],--i;case"drag":L=ea(H||K,T),J=i;break}z.call(P,C,new wC(P,{sourceEvent:K,subject:q,target:g,identifier:O,active:J,x:L[0]+U,y:L[1]+F,dx:L[0]-Z[0],dy:L[1]-Z[1],dispatch:z}),k)}}return g.filter=function(C){return arguments.length?(e=typeof C=="function"?C:og(!!C),g):e},g.container=function(C){return arguments.length?(t=typeof C=="function"?C:og(C),g):t},g.subject=function(C){return arguments.length?(n=typeof C=="function"?C:og(C),g):n},g.touchable=function(C){return arguments.length?(r=typeof C=="function"?C:og(!!C),g):r},g.on=function(){var C=s.on.apply(s,arguments);return C===s?g:C},g.clickDistance=function(C){return arguments.length?(p=(C=+C)*C,g):Math.sqrt(p)},g}function XE(e,t,n){e.prototype=t.prototype=n,n.constructor=e}function hH(e,t){var n=Object.create(e.prototype);for(var r in t)n[r]=t[r];return n}function _h(){}var kf=.7,yy=1/kf,Ic="\\s*([+-]?\\d+)\\s*",Of="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)\\s*",ka="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)%\\s*",pNe=/^#([0-9a-f]{3,8})$/,mNe=new RegExp(`^rgb\\(${Ic},${Ic},${Ic}\\)$`),gNe=new RegExp(`^rgb\\(${ka},${ka},${ka}\\)$`),yNe=new RegExp(`^rgba\\(${Ic},${Ic},${Ic},${Of}\\)$`),vNe=new RegExp(`^rgba\\(${ka},${ka},${ka},${Of}\\)$`),xNe=new RegExp(`^hsl\\(${Of},${ka},${ka}\\)$`),bNe=new RegExp(`^hsla\\(${Of},${ka},${ka},${Of}\\)$`),gI={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};XE(_h,nl,{copy(e){return Object.assign(new this.constructor,this,e)},displayable(){return this.rgb().displayable()},hex:yI,formatHex:yI,formatHex8:wNe,formatHsl:SNe,formatRgb:vI,toString:vI});function yI(){return this.rgb().formatHex()}function wNe(){return this.rgb().formatHex8()}function SNe(){return pH(this).formatHsl()}function vI(){return this.rgb().formatRgb()}function nl(e){var t,n;return e=(e+"").trim().toLowerCase(),(t=pNe.exec(e))?(n=t[1].length,t=parseInt(t[1],16),n===6?xI(t):n===3?new nr(t>>8&15|t>>4&240,t>>4&15|t&240,(t&15)<<4|t&15,1):n===8?ig(t>>24&255,t>>16&255,t>>8&255,(t&255)/255):n===4?ig(t>>12&15|t>>8&240,t>>8&15|t>>4&240,t>>4&15|t&240,((t&15)<<4|t&15)/255):null):(t=mNe.exec(e))?new nr(t[1],t[2],t[3],1):(t=gNe.exec(e))?new nr(t[1]*255/100,t[2]*255/100,t[3]*255/100,1):(t=yNe.exec(e))?ig(t[1],t[2],t[3],t[4]):(t=vNe.exec(e))?ig(t[1]*255/100,t[2]*255/100,t[3]*255/100,t[4]):(t=xNe.exec(e))?SI(t[1],t[2]/100,t[3]/100,1):(t=bNe.exec(e))?SI(t[1],t[2]/100,t[3]/100,t[4]):gI.hasOwnProperty(e)?xI(gI[e]):e==="transparent"?new nr(NaN,NaN,NaN,0):null}function xI(e){return new nr(e>>16&255,e>>8&255,e&255,1)}function ig(e,t,n,r){return r<=0&&(e=t=n=NaN),new nr(e,t,n,r)}function _Ne(e){return e instanceof _h||(e=nl(e)),e?(e=e.rgb(),new nr(e.r,e.g,e.b,e.opacity)):new nr}function SC(e,t,n,r){return arguments.length===1?_Ne(e):new nr(e,t,n,r??1)}function nr(e,t,n,r){this.r=+e,this.g=+t,this.b=+n,this.opacity=+r}XE(nr,SC,hH(_h,{brighter(e){return e=e==null?yy:Math.pow(yy,e),new nr(this.r*e,this.g*e,this.b*e,this.opacity)},darker(e){return e=e==null?kf:Math.pow(kf,e),new nr(this.r*e,this.g*e,this.b*e,this.opacity)},rgb(){return this},clamp(){return new nr(Fi(this.r),Fi(this.g),Fi(this.b),vy(this.opacity))},displayable(){return-.5<=this.r&&this.r<255.5&&-.5<=this.g&&this.g<255.5&&-.5<=this.b&&this.b<255.5&&0<=this.opacity&&this.opacity<=1},hex:bI,formatHex:bI,formatHex8:NNe,formatRgb:wI,toString:wI}));function bI(){return`#${Li(this.r)}${Li(this.g)}${Li(this.b)}`}function NNe(){return`#${Li(this.r)}${Li(this.g)}${Li(this.b)}${Li((isNaN(this.opacity)?1:this.opacity)*255)}`}function wI(){const e=vy(this.opacity);return`${e===1?"rgb(":"rgba("}${Fi(this.r)}, ${Fi(this.g)}, ${Fi(this.b)}${e===1?")":`, ${e})`}`}function vy(e){return isNaN(e)?1:Math.max(0,Math.min(1,e))}function Fi(e){return Math.max(0,Math.min(255,Math.round(e)||0))}function Li(e){return e=Fi(e),(e<16?"0":"")+e.toString(16)}function SI(e,t,n,r){return r<=0?e=t=n=NaN:n<=0||n>=1?e=t=NaN:t<=0&&(e=NaN),new ta(e,t,n,r)}function pH(e){if(e instanceof ta)return new ta(e.h,e.s,e.l,e.opacity);if(e instanceof _h||(e=nl(e)),!e)return new ta;if(e instanceof ta)return e;e=e.rgb();var t=e.r/255,n=e.g/255,r=e.b/255,a=Math.min(t,n,r),s=Math.max(t,n,r),i=NaN,l=s-a,d=(s+a)/2;return l?(t===s?i=(n-r)/l+(n<r)*6:n===s?i=(r-t)/l+2:i=(t-n)/l+4,l/=d<.5?s+a:2-s-a,i*=60):l=d>0&&d<1?0:i,new ta(i,l,d,e.opacity)}function jNe(e,t,n,r){return arguments.length===1?pH(e):new ta(e,t,n,r??1)}function ta(e,t,n,r){this.h=+e,this.s=+t,this.l=+n,this.opacity=+r}XE(ta,jNe,hH(_h,{brighter(e){return e=e==null?yy:Math.pow(yy,e),new ta(this.h,this.s,this.l*e,this.opacity)},darker(e){return e=e==null?kf:Math.pow(kf,e),new ta(this.h,this.s,this.l*e,this.opacity)},rgb(){var e=this.h%360+(this.h<0)*360,t=isNaN(e)||isNaN(this.s)?0:this.s,n=this.l,r=n+(n<.5?n:1-n)*t,a=2*n-r;return new nr(ZN(e>=240?e-240:e+120,a,r),ZN(e,a,r),ZN(e<120?e+240:e-120,a,r),this.opacity)},clamp(){return new ta(_I(this.h),lg(this.s),lg(this.l),vy(this.opacity))},displayable(){return(0<=this.s&&this.s<=1||isNaN(this.s))&&0<=this.l&&this.l<=1&&0<=this.opacity&&this.opacity<=1},formatHsl(){const e=vy(this.opacity);return`${e===1?"hsl(":"hsla("}${_I(this.h)}, ${lg(this.s)*100}%, ${lg(this.l)*100}%${e===1?")":`, ${e})`}`}}));function _I(e){return e=(e||0)%360,e<0?e+360:e}function lg(e){return Math.max(0,Math.min(1,e||0))}function ZN(e,t,n){return(e<60?t+(n-t)*e/60:e<180?n:e<240?t+(n-t)*(240-e)/60:t)*255}const ZE=e=>()=>e;function CNe(e,t){return function(n){return e+n*t}}function ENe(e,t,n){return e=Math.pow(e,n),t=Math.pow(t,n)-e,n=1/n,function(r){return Math.pow(e+r*t,n)}}function TNe(e){return(e=+e)==1?mH:function(t,n){return n-t?ENe(t,n,e):ZE(isNaN(t)?n:t)}}function mH(e,t){var n=t-e;return n?CNe(e,n):ZE(isNaN(e)?t:e)}const xy=(function e(t){var n=TNe(t);function r(a,s){var i=n((a=SC(a)).r,(s=SC(s)).r),l=n(a.g,s.g),d=n(a.b,s.b),f=mH(a.opacity,s.opacity);return function(h){return a.r=i(h),a.g=l(h),a.b=d(h),a.opacity=f(h),a+""}}return r.gamma=e,r})(1);function ANe(e,t){t||(t=[]);var n=e?Math.min(t.length,e.length):0,r=t.slice(),a;return function(s){for(a=0;a<n;++a)r[a]=e[a]*(1-s)+t[a]*s;return r}}function RNe(e){return ArrayBuffer.isView(e)&&!(e instanceof DataView)}function kNe(e,t){var n=t?t.length:0,r=e?Math.min(n,e.length):0,a=new Array(r),s=new Array(n),i;for(i=0;i<r;++i)a[i]=of(e[i],t[i]);for(;i<n;++i)s[i]=t[i];return function(l){for(i=0;i<r;++i)s[i]=a[i](l);return s}}function ONe(e,t){var n=new Date;return e=+e,t=+t,function(r){return n.setTime(e*(1-r)+t*r),n}}function Sa(e,t){return e=+e,t=+t,function(n){return e*(1-n)+t*n}}function MNe(e,t){var n={},r={},a;(e===null||typeof e!="object")&&(e={}),(t===null||typeof t!="object")&&(t={});for(a in t)a in e?n[a]=of(e[a],t[a]):r[a]=t[a];return function(s){for(a in n)r[a]=n[a](s);return r}}var _C=/[-+]?(?:\d+\.?\d*|\.?\d+)(?:[eE][-+]?\d+)?/g,QN=new RegExp(_C.source,"g");function DNe(e){return function(){return e}}function PNe(e){return function(t){return e(t)+""}}function gH(e,t){var n=_C.lastIndex=QN.lastIndex=0,r,a,s,i=-1,l=[],d=[];for(e=e+"",t=t+"";(r=_C.exec(e))&&(a=QN.exec(t));)(s=a.index)>n&&(s=t.slice(n,s),l[i]?l[i]+=s:l[++i]=s),(r=r[0])===(a=a[0])?l[i]?l[i]+=a:l[++i]=a:(l[++i]=null,d.push({i,x:Sa(r,a)})),n=QN.lastIndex;return n<t.length&&(s=t.slice(n),l[i]?l[i]+=s:l[++i]=s),l.length<2?d[0]?PNe(d[0].x):DNe(t):(t=d.length,function(f){for(var h=0,p;h<t;++h)l[(p=d[h]).i]=p.x(f);return l.join("")})}function of(e,t){var n=typeof t,r;return t==null||n==="boolean"?ZE(t):(n==="number"?Sa:n==="string"?(r=nl(t))?(t=r,xy):gH:t instanceof nl?xy:t instanceof Date?ONe:RNe(t)?ANe:Array.isArray(t)?kNe:typeof t.valueOf!="function"&&typeof t.toString!="function"||isNaN(t)?MNe:Sa)(e,t)}var NI=180/Math.PI,NC={translateX:0,translateY:0,rotate:0,skewX:0,scaleX:1,scaleY:1};function yH(e,t,n,r,a,s){var i,l,d;return(i=Math.sqrt(e*e+t*t))&&(e/=i,t/=i),(d=e*n+t*r)&&(n-=e*d,r-=t*d),(l=Math.sqrt(n*n+r*r))&&(n/=l,r/=l,d/=l),e*r<t*n&&(e=-e,t=-t,d=-d,i=-i),{translateX:a,translateY:s,rotate:Math.atan2(t,e)*NI,skewX:Math.atan(d)*NI,scaleX:i,scaleY:l}}var cg;function $Ne(e){const t=new(typeof DOMMatrix=="function"?DOMMatrix:WebKitCSSMatrix)(e+"");return t.isIdentity?NC:yH(t.a,t.b,t.c,t.d,t.e,t.f)}function INe(e){return e==null||(cg||(cg=document.createElementNS("http://www.w3.org/2000/svg","g")),cg.setAttribute("transform",e),!(e=cg.transform.baseVal.consolidate()))?NC:(e=e.matrix,yH(e.a,e.b,e.c,e.d,e.e,e.f))}function vH(e,t,n,r){function a(f){return f.length?f.pop()+" ":""}function s(f,h,p,g,y,S){if(f!==p||h!==g){var w=y.push("translate(",null,t,null,n);S.push({i:w-4,x:Sa(f,p)},{i:w-2,x:Sa(h,g)})}else(p||g)&&y.push("translate("+p+t+g+n)}function i(f,h,p,g){f!==h?(f-h>180?h+=360:h-f>180&&(f+=360),g.push({i:p.push(a(p)+"rotate(",null,r)-2,x:Sa(f,h)})):h&&p.push(a(p)+"rotate("+h+r)}function l(f,h,p,g){f!==h?g.push({i:p.push(a(p)+"skewX(",null,r)-2,x:Sa(f,h)}):h&&p.push(a(p)+"skewX("+h+r)}function d(f,h,p,g,y,S){if(f!==p||h!==g){var w=y.push(a(y)+"scale(",null,",",null,")");S.push({i:w-4,x:Sa(f,p)},{i:w-2,x:Sa(h,g)})}else(p!==1||g!==1)&&y.push(a(y)+"scale("+p+","+g+")")}return function(f,h){var p=[],g=[];return f=e(f),h=e(h),s(f.translateX,f.translateY,h.translateX,h.translateY,p,g),i(f.rotate,h.rotate,p,g),l(f.skewX,h.skewX,p,g),d(f.scaleX,f.scaleY,h.scaleX,h.scaleY,p,g),f=h=null,function(y){for(var S=-1,w=g.length,b;++S<w;)p[(b=g[S]).i]=b.x(y);return p.join("")}}}var LNe=vH($Ne,"px, ","px)","deg)"),zNe=vH(INe,", ",")",")"),qNe=1e-12;function jI(e){return((e=Math.exp(e))+1/e)/2}function FNe(e){return((e=Math.exp(e))-1/e)/2}function UNe(e){return((e=Math.exp(2*e))-1)/(e+1)}const Lg=(function e(t,n,r){function a(s,i){var l=s[0],d=s[1],f=s[2],h=i[0],p=i[1],g=i[2],y=h-l,S=p-d,w=y*y+S*S,b,x;if(w<qNe)x=Math.log(g/f)/t,b=function(k){return[l+k*y,d+k*S,f*Math.exp(t*k*x)]};else{var _=Math.sqrt(w),j=(g*g-f*f+r*w)/(2*f*n*_),C=(g*g-f*f-r*w)/(2*g*n*_),T=Math.log(Math.sqrt(j*j+1)-j),A=Math.log(Math.sqrt(C*C+1)-C);x=(A-T)/t,b=function(k){var O=k*x,M=jI(T),z=f/(n*_)*(M*UNe(t*O+T)-FNe(T));return[l+z*y,d+z*S,f*M/jI(t*O+T)]}}return b.duration=x*1e3*t/Math.SQRT2,b}return a.rho=function(s){var i=Math.max(.001,+s),l=i*i,d=l*l;return e(i,l,d)},a})(Math.SQRT2,2,4);var eu=0,Gd=0,Pd=0,xH=1e3,by,Kd,wy=0,rl=0,s0=0,Mf=typeof performance=="object"&&performance.now?performance:Date,bH=typeof window=="object"&&window.requestAnimationFrame?window.requestAnimationFrame.bind(window):function(e){setTimeout(e,17)};function QE(){return rl||(bH(HNe),rl=Mf.now()+s0)}function HNe(){rl=0}function Sy(){this._call=this._time=this._next=null}Sy.prototype=wH.prototype={constructor:Sy,restart:function(e,t,n){if(typeof e!="function")throw new TypeError("callback is not a function");n=(n==null?QE():+n)+(t==null?0:+t),!this._next&&Kd!==this&&(Kd?Kd._next=this:by=this,Kd=this),this._call=e,this._time=n,jC()},stop:function(){this._call&&(this._call=null,this._time=1/0,jC())}};function wH(e,t,n){var r=new Sy;return r.restart(e,t,n),r}function BNe(){QE(),++eu;for(var e=by,t;e;)(t=rl-e._time)>=0&&e._call.call(void 0,t),e=e._next;--eu}function CI(){rl=(wy=Mf.now())+s0,eu=Gd=0;try{BNe()}finally{eu=0,WNe(),rl=0}}function VNe(){var e=Mf.now(),t=e-wy;t>xH&&(s0-=t,wy=e)}function WNe(){for(var e,t=by,n,r=1/0;t;)t._call?(r>t._time&&(r=t._time),e=t,t=t._next):(n=t._next,t._next=null,t=e?e._next=n:by=n);Kd=e,jC(r)}function jC(e){if(!eu){Gd&&(Gd=clearTimeout(Gd));var t=e-rl;t>24?(e<1/0&&(Gd=setTimeout(CI,e-Mf.now()-s0)),Pd&&(Pd=clearInterval(Pd))):(Pd||(wy=Mf.now(),Pd=setInterval(VNe,xH)),eu=1,bH(CI))}}function EI(e,t,n){var r=new Sy;return t=t==null?0:+t,r.restart(a=>{r.stop(),e(a+t)},t,n),r}var GNe=r0("start","end","cancel","interrupt"),KNe=[],SH=0,TI=1,CC=2,zg=3,AI=4,EC=5,qg=6;function o0(e,t,n,r,a,s){var i=e.__transition;if(!i)e.__transition={};else if(n in i)return;YNe(e,n,{name:t,index:r,group:a,on:GNe,tween:KNe,time:s.time,delay:s.delay,duration:s.duration,ease:s.ease,timer:null,state:SH})}function JE(e,t){var n=ha(e,t);if(n.state>SH)throw new Error("too late; already scheduled");return n}function Va(e,t){var n=ha(e,t);if(n.state>zg)throw new Error("too late; already running");return n}function ha(e,t){var n=e.__transition;if(!n||!(n=n[t]))throw new Error("transition not found");return n}function YNe(e,t,n){var r=e.__transition,a;r[t]=n,n.timer=wH(s,0,n.time);function s(f){n.state=TI,n.timer.restart(i,n.delay,n.time),n.delay<=f&&i(f-n.delay)}function i(f){var h,p,g,y;if(n.state!==TI)return d();for(h in r)if(y=r[h],y.name===n.name){if(y.state===zg)return EI(i);y.state===AI?(y.state=qg,y.timer.stop(),y.on.call("interrupt",e,e.__data__,y.index,y.group),delete r[h]):+h<t&&(y.state=qg,y.timer.stop(),y.on.call("cancel",e,e.__data__,y.index,y.group),delete r[h])}if(EI(function(){n.state===zg&&(n.state=AI,n.timer.restart(l,n.delay,n.time),l(f))}),n.state=CC,n.on.call("start",e,e.__data__,n.index,n.group),n.state===CC){for(n.state=zg,a=new Array(g=n.tween.length),h=0,p=-1;h<g;++h)(y=n.tween[h].value.call(e,e.__data__,n.index,n.group))&&(a[++p]=y);a.length=p+1}}function l(f){for(var h=f<n.duration?n.ease.call(null,f/n.duration):(n.timer.restart(d),n.state=EC,1),p=-1,g=a.length;++p<g;)a[p].call(e,h);n.state===EC&&(n.on.call("end",e,e.__data__,n.index,n.group),d())}function d(){n.state=qg,n.timer.stop(),delete r[t];for(var f in r)return;delete e.__transition}}function Fg(e,t){var n=e.__transition,r,a,s=!0,i;if(n){t=t==null?null:t+"";for(i in n){if((r=n[i]).name!==t){s=!1;continue}a=r.state>CC&&r.state<EC,r.state=qg,r.timer.stop(),r.on.call(a?"interrupt":"cancel",e,e.__data__,r.index,r.group),delete n[i]}s&&delete e.__transition}}function XNe(e){return this.each(function(){Fg(this,e)})}function ZNe(e,t){var n,r;return function(){var a=Va(this,e),s=a.tween;if(s!==n){r=n=s;for(var i=0,l=r.length;i<l;++i)if(r[i].name===t){r=r.slice(),r.splice(i,1);break}}a.tween=r}}function QNe(e,t,n){var r,a;if(typeof n!="function")throw new Error;return function(){var s=Va(this,e),i=s.tween;if(i!==r){a=(r=i).slice();for(var l={name:t,value:n},d=0,f=a.length;d<f;++d)if(a[d].name===t){a[d]=l;break}d===f&&a.push(l)}s.tween=a}}function JNe(e,t){var n=this._id;if(e+="",arguments.length<2){for(var r=ha(this.node(),n).tween,a=0,s=r.length,i;a<s;++a)if((i=r[a]).name===e)return i.value;return null}return this.each((t==null?ZNe:QNe)(n,e,t))}function eT(e,t,n){var r=e._id;return e.each(function(){var a=Va(this,r);(a.value||(a.value={}))[t]=n.apply(this,arguments)}),function(a){return ha(a,r).value[t]}}function _H(e,t){var n;return(typeof t=="number"?Sa:t instanceof nl?xy:(n=nl(t))?(t=n,xy):gH)(e,t)}function eje(e){return function(){this.removeAttribute(e)}}function tje(e){return function(){this.removeAttributeNS(e.space,e.local)}}function nje(e,t,n){var r,a=n+"",s;return function(){var i=this.getAttribute(e);return i===a?null:i===r?s:s=t(r=i,n)}}function rje(e,t,n){var r,a=n+"",s;return function(){var i=this.getAttributeNS(e.space,e.local);return i===a?null:i===r?s:s=t(r=i,n)}}function aje(e,t,n){var r,a,s;return function(){var i,l=n(this),d;return l==null?void this.removeAttribute(e):(i=this.getAttribute(e),d=l+"",i===d?null:i===r&&d===a?s:(a=d,s=t(r=i,l)))}}function sje(e,t,n){var r,a,s;return function(){var i,l=n(this),d;return l==null?void this.removeAttributeNS(e.space,e.local):(i=this.getAttributeNS(e.space,e.local),d=l+"",i===d?null:i===r&&d===a?s:(a=d,s=t(r=i,l)))}}function oje(e,t){var n=a0(e),r=n==="transform"?zNe:_H;return this.attrTween(e,typeof t=="function"?(n.local?sje:aje)(n,r,eT(this,"attr."+e,t)):t==null?(n.local?tje:eje)(n):(n.local?rje:nje)(n,r,t))}function ije(e,t){return function(n){this.setAttribute(e,t.call(this,n))}}function lje(e,t){return function(n){this.setAttributeNS(e.space,e.local,t.call(this,n))}}function cje(e,t){var n,r;function a(){var s=t.apply(this,arguments);return s!==r&&(n=(r=s)&&lje(e,s)),n}return a._value=t,a}function uje(e,t){var n,r;function a(){var s=t.apply(this,arguments);return s!==r&&(n=(r=s)&&ije(e,s)),n}return a._value=t,a}function dje(e,t){var n="attr."+e;if(arguments.length<2)return(n=this.tween(n))&&n._value;if(t==null)return this.tween(n,null);if(typeof t!="function")throw new Error;var r=a0(e);return this.tween(n,(r.local?cje:uje)(r,t))}function fje(e,t){return function(){JE(this,e).delay=+t.apply(this,arguments)}}function hje(e,t){return t=+t,function(){JE(this,e).delay=t}}function pje(e){var t=this._id;return arguments.length?this.each((typeof e=="function"?fje:hje)(t,e)):ha(this.node(),t).delay}function mje(e,t){return function(){Va(this,e).duration=+t.apply(this,arguments)}}function gje(e,t){return t=+t,function(){Va(this,e).duration=t}}function yje(e){var t=this._id;return arguments.length?this.each((typeof e=="function"?mje:gje)(t,e)):ha(this.node(),t).duration}function vje(e,t){if(typeof t!="function")throw new Error;return function(){Va(this,e).ease=t}}function xje(e){var t=this._id;return arguments.length?this.each(vje(t,e)):ha(this.node(),t).ease}function bje(e,t){return function(){var n=t.apply(this,arguments);if(typeof n!="function")throw new Error;Va(this,e).ease=n}}function wje(e){if(typeof e!="function")throw new Error;return this.each(bje(this._id,e))}function Sje(e){typeof e!="function"&&(e=eH(e));for(var t=this._groups,n=t.length,r=new Array(n),a=0;a<n;++a)for(var s=t[a],i=s.length,l=r[a]=[],d,f=0;f<i;++f)(d=s[f])&&e.call(d,d.__data__,f,s)&&l.push(d);return new $s(r,this._parents,this._name,this._id)}function _je(e){if(e._id!==this._id)throw new Error;for(var t=this._groups,n=e._groups,r=t.length,a=n.length,s=Math.min(r,a),i=new Array(r),l=0;l<s;++l)for(var d=t[l],f=n[l],h=d.length,p=i[l]=new Array(h),g,y=0;y<h;++y)(g=d[y]||f[y])&&(p[y]=g);for(;l<r;++l)i[l]=t[l];return new $s(i,this._parents,this._name,this._id)}function Nje(e){return(e+"").trim().split(/^|\s+/).every(function(t){var n=t.indexOf(".");return n>=0&&(t=t.slice(0,n)),!t||t==="start"})}function jje(e,t,n){var r,a,s=Nje(t)?JE:Va;return function(){var i=s(this,e),l=i.on;l!==r&&(a=(r=l).copy()).on(t,n),i.on=a}}function Cje(e,t){var n=this._id;return arguments.length<2?ha(this.node(),n).on.on(e):this.each(jje(n,e,t))}function Eje(e){return function(){var t=this.parentNode;for(var n in this.__transition)if(+n!==e)return;t&&t.removeChild(this)}}function Tje(){return this.on("end.remove",Eje(this._id))}function Aje(e){var t=this._name,n=this._id;typeof e!="function"&&(e=KE(e));for(var r=this._groups,a=r.length,s=new Array(a),i=0;i<a;++i)for(var l=r[i],d=l.length,f=s[i]=new Array(d),h,p,g=0;g<d;++g)(h=l[g])&&(p=e.call(h,h.__data__,g,l))&&("__data__"in h&&(p.__data__=h.__data__),f[g]=p,o0(f[g],t,n,g,f,ha(h,n)));return new $s(s,this._parents,t,n)}function Rje(e){var t=this._name,n=this._id;typeof e!="function"&&(e=JU(e));for(var r=this._groups,a=r.length,s=[],i=[],l=0;l<a;++l)for(var d=r[l],f=d.length,h,p=0;p<f;++p)if(h=d[p]){for(var g=e.call(h,h.__data__,p,d),y,S=ha(h,n),w=0,b=g.length;w<b;++w)(y=g[w])&&o0(y,t,n,w,g,S);s.push(g),i.push(h)}return new $s(s,i,t,n)}var kje=Sh.prototype.constructor;function Oje(){return new kje(this._groups,this._parents)}function Mje(e,t){var n,r,a;return function(){var s=Jc(this,e),i=(this.style.removeProperty(e),Jc(this,e));return s===i?null:s===n&&i===r?a:a=t(n=s,r=i)}}function NH(e){return function(){this.style.removeProperty(e)}}function Dje(e,t,n){var r,a=n+"",s;return function(){var i=Jc(this,e);return i===a?null:i===r?s:s=t(r=i,n)}}function Pje(e,t,n){var r,a,s;return function(){var i=Jc(this,e),l=n(this),d=l+"";return l==null&&(d=l=(this.style.removeProperty(e),Jc(this,e))),i===d?null:i===r&&d===a?s:(a=d,s=t(r=i,l))}}function $je(e,t){var n,r,a,s="style."+t,i="end."+s,l;return function(){var d=Va(this,e),f=d.on,h=d.value[s]==null?l||(l=NH(t)):void 0;(f!==n||a!==h)&&(r=(n=f).copy()).on(i,a=h),d.on=r}}function Ije(e,t,n){var r=(e+="")=="transform"?LNe:_H;return t==null?this.styleTween(e,Mje(e,r)).on("end.style."+e,NH(e)):typeof t=="function"?this.styleTween(e,Pje(e,r,eT(this,"style."+e,t))).each($je(this._id,e)):this.styleTween(e,Dje(e,r,t),n).on("end.style."+e,null)}function Lje(e,t,n){return function(r){this.style.setProperty(e,t.call(this,r),n)}}function zje(e,t,n){var r,a;function s(){var i=t.apply(this,arguments);return i!==a&&(r=(a=i)&&Lje(e,i,n)),r}return s._value=t,s}function qje(e,t,n){var r="style."+(e+="");if(arguments.length<2)return(r=this.tween(r))&&r._value;if(t==null)return this.tween(r,null);if(typeof t!="function")throw new Error;return this.tween(r,zje(e,t,n??""))}function Fje(e){return function(){this.textContent=e}}function Uje(e){return function(){var t=e(this);this.textContent=t??""}}function Hje(e){return this.tween("text",typeof e=="function"?Uje(eT(this,"text",e)):Fje(e==null?"":e+""))}function Bje(e){return function(t){this.textContent=e.call(this,t)}}function Vje(e){var t,n;function r(){var a=e.apply(this,arguments);return a!==n&&(t=(n=a)&&Bje(a)),t}return r._value=e,r}function Wje(e){var t="text";if(arguments.length<1)return(t=this.tween(t))&&t._value;if(e==null)return this.tween(t,null);if(typeof e!="function")throw new Error;return this.tween(t,Vje(e))}function Gje(){for(var e=this._name,t=this._id,n=jH(),r=this._groups,a=r.length,s=0;s<a;++s)for(var i=r[s],l=i.length,d,f=0;f<l;++f)if(d=i[f]){var h=ha(d,t);o0(d,e,n,f,i,{time:h.time+h.delay+h.duration,delay:0,duration:h.duration,ease:h.ease})}return new $s(r,this._parents,e,n)}function Kje(){var e,t,n=this,r=n._id,a=n.size();return new Promise(function(s,i){var l={value:i},d={value:function(){--a===0&&s()}};n.each(function(){var f=Va(this,r),h=f.on;h!==e&&(t=(e=h).copy(),t._.cancel.push(l),t._.interrupt.push(l),t._.end.push(d)),f.on=t}),a===0&&s()})}var Yje=0;function $s(e,t,n,r){this._groups=e,this._parents=t,this._name=n,this._id=r}function jH(){return++Yje}var xs=Sh.prototype;$s.prototype={constructor:$s,select:Aje,selectAll:Rje,selectChild:xs.selectChild,selectChildren:xs.selectChildren,filter:Sje,merge:_je,selection:Oje,transition:Gje,call:xs.call,nodes:xs.nodes,node:xs.node,size:xs.size,empty:xs.empty,each:xs.each,on:Cje,attr:oje,attrTween:dje,style:Ije,styleTween:qje,text:Hje,textTween:Wje,remove:Tje,tween:JNe,delay:pje,duration:yje,ease:xje,easeVarying:wje,end:Kje,[Symbol.iterator]:xs[Symbol.iterator]};function Xje(e){return((e*=2)<=1?e*e*e:(e-=2)*e*e+2)/2}var Zje={time:null,delay:0,duration:250,ease:Xje};function Qje(e,t){for(var n;!(n=e.__transition)||!(n=n[t]);)if(!(e=e.parentNode))throw new Error(`transition ${t} not found`);return n}function Jje(e){var t,n;e instanceof $s?(t=e._id,e=e._name):(t=jH(),(n=Zje).time=QE(),e=e==null?null:e+"");for(var r=this._groups,a=r.length,s=0;s<a;++s)for(var i=r[s],l=i.length,d,f=0;f<l;++f)(d=i[f])&&o0(d,e,t,f,i,n||Qje(d,t));return new $s(r,this._parents,e,t)}Sh.prototype.interrupt=XNe;Sh.prototype.transition=Jje;const ug=e=>()=>e;function eCe(e,{sourceEvent:t,target:n,transform:r,dispatch:a}){Object.defineProperties(this,{type:{value:e,enumerable:!0,configurable:!0},sourceEvent:{value:t,enumerable:!0,configurable:!0},target:{value:n,enumerable:!0,configurable:!0},transform:{value:r,enumerable:!0,configurable:!0},_:{value:a}})}function Ns(e,t,n){this.k=e,this.x=t,this.y=n}Ns.prototype={constructor:Ns,scale:function(e){return e===1?this:new Ns(this.k*e,this.x,this.y)},translate:function(e,t){return e===0&t===0?this:new Ns(this.k,this.x+this.k*e,this.y+this.k*t)},apply:function(e){return[e[0]*this.k+this.x,e[1]*this.k+this.y]},applyX:function(e){return e*this.k+this.x},applyY:function(e){return e*this.k+this.y},invert:function(e){return[(e[0]-this.x)/this.k,(e[1]-this.y)/this.k]},invertX:function(e){return(e-this.x)/this.k},invertY:function(e){return(e-this.y)/this.k},rescaleX:function(e){return e.copy().domain(e.range().map(this.invertX,this).map(e.invert,e))},rescaleY:function(e){return e.copy().domain(e.range().map(this.invertY,this).map(e.invert,e))},toString:function(){return"translate("+this.x+","+this.y+") scale("+this.k+")"}};var i0=new Ns(1,0,0);CH.prototype=Ns.prototype;function CH(e){for(;!e.__zoom;)if(!(e=e.parentNode))return i0;return e.__zoom}function JN(e){e.stopImmediatePropagation()}function $d(e){e.preventDefault(),e.stopImmediatePropagation()}function tCe(e){return(!e.ctrlKey||e.type==="wheel")&&!e.button}function nCe(){var e=this;return e instanceof SVGElement?(e=e.ownerSVGElement||e,e.hasAttribute("viewBox")?(e=e.viewBox.baseVal,[[e.x,e.y],[e.x+e.width,e.y+e.height]]):[[0,0],[e.width.baseVal.value,e.height.baseVal.value]]):[[0,0],[e.clientWidth,e.clientHeight]]}function RI(){return this.__zoom||i0}function rCe(e){return-e.deltaY*(e.deltaMode===1?.05:e.deltaMode?1:.002)*(e.ctrlKey?10:1)}function aCe(){return navigator.maxTouchPoints||"ontouchstart"in this}function sCe(e,t,n){var r=e.invertX(t[0][0])-n[0][0],a=e.invertX(t[1][0])-n[1][0],s=e.invertY(t[0][1])-n[0][1],i=e.invertY(t[1][1])-n[1][1];return e.translate(a>r?(r+a)/2:Math.min(0,r)||Math.max(0,a),i>s?(s+i)/2:Math.min(0,s)||Math.max(0,i))}function EH(){var e=tCe,t=nCe,n=sCe,r=rCe,a=aCe,s=[0,1/0],i=[[-1/0,-1/0],[1/0,1/0]],l=250,d=Lg,f=r0("start","zoom","end"),h,p,g,y=500,S=150,w=0,b=10;function x(q){q.property("__zoom",RI).on("wheel.zoom",O,{passive:!1}).on("mousedown.zoom",M).on("dblclick.zoom",z).filter(a).on("touchstart.zoom",L).on("touchmove.zoom",U).on("touchend.zoom touchcancel.zoom",F).style("-webkit-tap-highlight-color","rgba(0,0,0,0)")}x.transform=function(q,V,P,K){var H=q.selection?q.selection():q;H.property("__zoom",RI),q!==H?T(q,V,P,K):H.interrupt().each(function(){A(this,arguments).event(K).start().zoom(null,typeof V=="function"?V.apply(this,arguments):V).end()})},x.scaleBy=function(q,V,P,K){x.scaleTo(q,function(){var H=this.__zoom.k,Z=typeof V=="function"?V.apply(this,arguments):V;return H*Z},P,K)},x.scaleTo=function(q,V,P,K){x.transform(q,function(){var H=t.apply(this,arguments),Z=this.__zoom,J=P==null?C(H):typeof P=="function"?P.apply(this,arguments):P,D=Z.invert(J),W=typeof V=="function"?V.apply(this,arguments):V;return n(j(_(Z,W),J,D),H,i)},P,K)},x.translateBy=function(q,V,P,K){x.transform(q,function(){return n(this.__zoom.translate(typeof V=="function"?V.apply(this,arguments):V,typeof P=="function"?P.apply(this,arguments):P),t.apply(this,arguments),i)},null,K)},x.translateTo=function(q,V,P,K,H){x.transform(q,function(){var Z=t.apply(this,arguments),J=this.__zoom,D=K==null?C(Z):typeof K=="function"?K.apply(this,arguments):K;return n(i0.translate(D[0],D[1]).scale(J.k).translate(typeof V=="function"?-V.apply(this,arguments):-V,typeof P=="function"?-P.apply(this,arguments):-P),Z,i)},K,H)};function _(q,V){return V=Math.max(s[0],Math.min(s[1],V)),V===q.k?q:new Ns(V,q.x,q.y)}function j(q,V,P){var K=V[0]-P[0]*q.k,H=V[1]-P[1]*q.k;return K===q.x&&H===q.y?q:new Ns(q.k,K,H)}function C(q){return[(+q[0][0]+ +q[1][0])/2,(+q[0][1]+ +q[1][1])/2]}function T(q,V,P,K){q.on("start.zoom",function(){A(this,arguments).event(K).start()}).on("interrupt.zoom end.zoom",function(){A(this,arguments).event(K).end()}).tween("zoom",function(){var H=this,Z=arguments,J=A(H,Z).event(K),D=t.apply(H,Z),W=P==null?C(D):typeof P=="function"?P.apply(H,Z):P,B=Math.max(D[1][0]-D[0][0],D[1][1]-D[0][1]),$=H.__zoom,G=typeof V=="function"?V.apply(H,Z):V,ee=d($.invert(W).concat(B/$.k),G.invert(W).concat(B/G.k));return function(re){if(re===1)re=G;else{var ne=ee(re),Q=B/ne[2];re=new Ns(Q,W[0]-ne[0]*Q,W[1]-ne[1]*Q)}J.zoom(null,re)}})}function A(q,V,P){return!P&&q.__zooming||new k(q,V)}function k(q,V){this.that=q,this.args=V,this.active=0,this.sourceEvent=null,this.extent=t.apply(q,V),this.taps=0}k.prototype={event:function(q){return q&&(this.sourceEvent=q),this},start:function(){return++this.active===1&&(this.that.__zooming=this,this.emit("start")),this},zoom:function(q,V){return this.mouse&&q!=="mouse"&&(this.mouse[1]=V.invert(this.mouse[0])),this.touch0&&q!=="touch"&&(this.touch0[1]=V.invert(this.touch0[0])),this.touch1&&q!=="touch"&&(this.touch1[1]=V.invert(this.touch1[0])),this.that.__zoom=V,this.emit("zoom"),this},end:function(){return--this.active===0&&(delete this.that.__zooming,this.emit("end")),this},emit:function(q){var V=yr(this.that).datum();f.call(q,this.that,new eCe(q,{sourceEvent:this.sourceEvent,target:x,transform:this.that.__zoom,dispatch:f}),V)}};function O(q,...V){if(!e.apply(this,arguments))return;var P=A(this,V).event(q),K=this.__zoom,H=Math.max(s[0],Math.min(s[1],K.k*Math.pow(2,r.apply(this,arguments)))),Z=ea(q);if(P.wheel)(P.mouse[0][0]!==Z[0]||P.mouse[0][1]!==Z[1])&&(P.mouse[1]=K.invert(P.mouse[0]=Z)),clearTimeout(P.wheel);else{if(K.k===H)return;P.mouse=[Z,K.invert(Z)],Fg(this),P.start()}$d(q),P.wheel=setTimeout(J,S),P.zoom("mouse",n(j(_(K,H),P.mouse[0],P.mouse[1]),P.extent,i));function J(){P.wheel=null,P.end()}}function M(q,...V){if(g||!e.apply(this,arguments))return;var P=q.currentTarget,K=A(this,V,!0).event(q),H=yr(q.view).on("mousemove.zoom",W,!0).on("mouseup.zoom",B,!0),Z=ea(q,P),J=q.clientX,D=q.clientY;uH(q.view),JN(q),K.mouse=[Z,this.__zoom.invert(Z)],Fg(this),K.start();function W($){if($d($),!K.moved){var G=$.clientX-J,ee=$.clientY-D;K.moved=G*G+ee*ee>w}K.event($).zoom("mouse",n(j(K.that.__zoom,K.mouse[0]=ea($,P),K.mouse[1]),K.extent,i))}function B($){H.on("mousemove.zoom mouseup.zoom",null),dH($.view,K.moved),$d($),K.event($).end()}}function z(q,...V){if(e.apply(this,arguments)){var P=this.__zoom,K=ea(q.changedTouches?q.changedTouches[0]:q,this),H=P.invert(K),Z=P.k*(q.shiftKey?.5:2),J=n(j(_(P,Z),K,H),t.apply(this,V),i);$d(q),l>0?yr(this).transition().duration(l).call(T,J,K,q):yr(this).call(x.transform,J,K,q)}}function L(q,...V){if(e.apply(this,arguments)){var P=q.touches,K=P.length,H=A(this,V,q.changedTouches.length===K).event(q),Z,J,D,W;for(JN(q),J=0;J<K;++J)D=P[J],W=ea(D,this),W=[W,this.__zoom.invert(W),D.identifier],H.touch0?!H.touch1&&H.touch0[2]!==W[2]&&(H.touch1=W,H.taps=0):(H.touch0=W,Z=!0,H.taps=1+!!h);h&&(h=clearTimeout(h)),Z&&(H.taps<2&&(p=W[0],h=setTimeout(function(){h=null},y)),Fg(this),H.start())}}function U(q,...V){if(this.__zooming){var P=A(this,V).event(q),K=q.changedTouches,H=K.length,Z,J,D,W;for($d(q),Z=0;Z<H;++Z)J=K[Z],D=ea(J,this),P.touch0&&P.touch0[2]===J.identifier?P.touch0[0]=D:P.touch1&&P.touch1[2]===J.identifier&&(P.touch1[0]=D);if(J=P.that.__zoom,P.touch1){var B=P.touch0[0],$=P.touch0[1],G=P.touch1[0],ee=P.touch1[1],re=(re=G[0]-B[0])*re+(re=G[1]-B[1])*re,ne=(ne=ee[0]-$[0])*ne+(ne=ee[1]-$[1])*ne;J=_(J,Math.sqrt(re/ne)),D=[(B[0]+G[0])/2,(B[1]+G[1])/2],W=[($[0]+ee[0])/2,($[1]+ee[1])/2]}else if(P.touch0)D=P.touch0[0],W=P.touch0[1];else return;P.zoom("touch",n(j(J,D,W),P.extent,i))}}function F(q,...V){if(this.__zooming){var P=A(this,V).event(q),K=q.changedTouches,H=K.length,Z,J;for(JN(q),g&&clearTimeout(g),g=setTimeout(function(){g=null},y),Z=0;Z<H;++Z)J=K[Z],P.touch0&&P.touch0[2]===J.identifier?delete P.touch0:P.touch1&&P.touch1[2]===J.identifier&&delete P.touch1;if(P.touch1&&!P.touch0&&(P.touch0=P.touch1,delete P.touch1),P.touch0)P.touch0[1]=this.__zoom.invert(P.touch0[0]);else if(P.end(),P.taps===2&&(J=ea(J,this),Math.hypot(p[0]-J[0],p[1]-J[1])<b)){var D=yr(this).on("dblclick.zoom");D&&D.apply(this,arguments)}}}return x.wheelDelta=function(q){return arguments.length?(r=typeof q=="function"?q:ug(+q),x):r},x.filter=function(q){return arguments.length?(e=typeof q=="function"?q:ug(!!q),x):e},x.touchable=function(q){return arguments.length?(a=typeof q=="function"?q:ug(!!q),x):a},x.extent=function(q){return arguments.length?(t=typeof q=="function"?q:ug([[+q[0][0],+q[0][1]],[+q[1][0],+q[1][1]]]),x):t},x.scaleExtent=function(q){return arguments.length?(s[0]=+q[0],s[1]=+q[1],x):[s[0],s[1]]},x.translateExtent=function(q){return arguments.length?(i[0][0]=+q[0][0],i[1][0]=+q[1][0],i[0][1]=+q[0][1],i[1][1]=+q[1][1],x):[[i[0][0],i[0][1]],[i[1][0],i[1][1]]]},x.constrain=function(q){return arguments.length?(n=q,x):n},x.duration=function(q){return arguments.length?(l=+q,x):l},x.interpolate=function(q){return arguments.length?(d=q,x):d},x.on=function(){var q=f.on.apply(f,arguments);return q===f?x:q},x.clickDistance=function(q){return arguments.length?(w=(q=+q)*q,x):Math.sqrt(w)},x.tapDistance=function(q){return arguments.length?(b=+q,x):b},x}const Pa={error001:()=>"[React Flow]: Seems like you have not used zustand provider as an ancestor. Help: https://reactflow.dev/error#001",error002:()=>"It looks like you've created a new nodeTypes or edgeTypes object. If this wasn't on purpose please define the nodeTypes/edgeTypes outside of the component or memoize them.",error003:e=>`Node type "${e}" not found. Using fallback type "default".`,error004:()=>"The React Flow parent container needs a width and a height to render the graph.",error005:()=>"Only child nodes can use a parent extent.",error006:()=>"Can't create edge. An edge needs a source and a target.",error007:e=>`The old edge with id=${e} does not exist.`,error009:e=>`Marker type "${e}" doesn't exist.`,error008:(e,{id:t,sourceHandle:n,targetHandle:r})=>`Couldn't create edge for ${e} handle id: "${e==="source"?n:r}", edge id: ${t}.`,error010:()=>"Handle: No node id found. Make sure to only use a Handle inside a custom Node.",error011:e=>`Edge type "${e}" not found. Using fallback type "default".`,error012:e=>`Node with id "${e}" does not exist, it may have been removed. This can happen when a node is deleted before the "onNodeClick" handler is called.`,error013:(e="react")=>`It seems that you haven't loaded the styles. Please import '@xyflow/${e}/dist/style.css' or base.css to make sure everything is working properly.`,error014:()=>"useNodeConnections: No node ID found. Call useNodeConnections inside a custom Node or provide a node ID.",error015:()=>"It seems that you are trying to drag a node that is not initialized. Please use onNodesChange as explained in the docs."},Df=[[Number.NEGATIVE_INFINITY,Number.NEGATIVE_INFINITY],[Number.POSITIVE_INFINITY,Number.POSITIVE_INFINITY]],TH=["Enter"," ","Escape"],AH={"node.a11yDescription.default":"Press enter or space to select a node. Press delete to remove it and escape to cancel.","node.a11yDescription.keyboardDisabled":"Press enter or space to select a node. You can then use the arrow keys to move the node around. Press delete to remove it and escape to cancel.","node.a11yDescription.ariaLiveMessage":({direction:e,x:t,y:n})=>`Moved selected node ${e}. New position, x: ${t}, y: ${n}`,"edge.a11yDescription.default":"Press enter or space to select an edge. You can then press delete to remove it or escape to cancel.","controls.ariaLabel":"Control Panel","controls.zoomIn.ariaLabel":"Zoom In","controls.zoomOut.ariaLabel":"Zoom Out","controls.fitView.ariaLabel":"Fit View","controls.interactive.ariaLabel":"Toggle Interactivity","minimap.ariaLabel":"Mini Map","handle.ariaLabel":"Handle"};var tu;(function(e){e.Strict="strict",e.Loose="loose"})(tu||(tu={}));var Ui;(function(e){e.Free="free",e.Vertical="vertical",e.Horizontal="horizontal"})(Ui||(Ui={}));var Pf;(function(e){e.Partial="partial",e.Full="full"})(Pf||(Pf={}));const RH={inProgress:!1,isValid:null,from:null,fromHandle:null,fromPosition:null,fromNode:null,to:null,toHandle:null,toPosition:null,toNode:null};var bs;(function(e){e.Bezier="default",e.Straight="straight",e.Step="step",e.SmoothStep="smoothstep",e.SimpleBezier="simplebezier"})(bs||(bs={}));var Wo;(function(e){e.Arrow="arrow",e.ArrowClosed="arrowclosed"})(Wo||(Wo={}));var Te;(function(e){e.Left="left",e.Top="top",e.Right="right",e.Bottom="bottom"})(Te||(Te={}));const kI={[Te.Left]:Te.Right,[Te.Right]:Te.Left,[Te.Top]:Te.Bottom,[Te.Bottom]:Te.Top};function kH(e){return e===null?null:e?"valid":"invalid"}const OH=e=>"id"in e&&"source"in e&&"target"in e,oCe=e=>"id"in e&&"position"in e&&!("source"in e)&&!("target"in e),tT=e=>"id"in e&&"internals"in e&&!("source"in e)&&!("target"in e),Nh=(e,t=[0,0])=>{const{width:n,height:r}=Us(e),a=e.origin??t,s=n*a[0],i=r*a[1];return{x:e.position.x-s,y:e.position.y-i}},iCe=(e,t={nodeOrigin:[0,0]})=>{if(e.length===0)return{x:0,y:0,width:0,height:0};const n=e.reduce((r,a)=>{const s=typeof a=="string";let i=!t.nodeLookup&&!s?a:void 0;t.nodeLookup&&(i=s?t.nodeLookup.get(a):tT(a)?a:t.nodeLookup.get(a.id));const l=i?_y(i,t.nodeOrigin):{x:0,y:0,x2:0,y2:0};return l0(r,l)},{x:1/0,y:1/0,x2:-1/0,y2:-1/0});return c0(n)},jh=(e,t={})=>{let n={x:1/0,y:1/0,x2:-1/0,y2:-1/0},r=!1;return e.forEach(a=>{(t.filter===void 0||t.filter(a))&&(n=l0(n,_y(a)),r=!0)}),r?c0(n):{x:0,y:0,width:0,height:0}},nT=(e,t,[n,r,a]=[0,0,1],s=!1,i=!1)=>{const l={...Eh(t,[n,r,a]),width:t.width/a,height:t.height/a},d=[];for(const f of e.values()){const{measured:h,selectable:p=!0,hidden:g=!1}=f;if(i&&!p||g)continue;const y=h.width??f.width??f.initialWidth??null,S=h.height??f.height??f.initialHeight??null,w=$f(l,ru(f)),b=(y??0)*(S??0),x=s&&w>0;(!f.internals.handleBounds||x||w>=b||f.dragging)&&d.push(f)}return d},lCe=(e,t)=>{const n=new Set;return e.forEach(r=>{n.add(r.id)}),t.filter(r=>n.has(r.source)||n.has(r.target))};function cCe(e,t){const n=new Map,r=t!=null&&t.nodes?new Set(t.nodes.map(a=>a.id)):null;return e.forEach(a=>{a.measured.width&&a.measured.height&&((t==null?void 0:t.includeHiddenNodes)||!a.hidden)&&(!r||r.has(a.id))&&n.set(a.id,a)}),n}async function uCe({nodes:e,width:t,height:n,panZoom:r,minZoom:a,maxZoom:s},i){if(e.size===0)return Promise.resolve(!0);const l=cCe(e,i),d=jh(l),f=rT(d,t,n,(i==null?void 0:i.minZoom)??a,(i==null?void 0:i.maxZoom)??s,(i==null?void 0:i.padding)??.1);return await r.setViewport(f,{duration:i==null?void 0:i.duration,ease:i==null?void 0:i.ease,interpolate:i==null?void 0:i.interpolate}),Promise.resolve(!0)}function MH({nodeId:e,nextPosition:t,nodeLookup:n,nodeOrigin:r=[0,0],nodeExtent:a,onError:s}){const i=n.get(e),l=i.parentId?n.get(i.parentId):void 0,{x:d,y:f}=l?l.internals.positionAbsolute:{x:0,y:0},h=i.origin??r;let p=i.extent||a;if(i.extent==="parent"&&!i.expandParent)if(!l)s==null||s("005",Pa.error005());else{const y=l.measured.width,S=l.measured.height;y&&S&&(p=[[d,f],[d+y,f+S]])}else l&&au(i.extent)&&(p=[[i.extent[0][0]+d,i.extent[0][1]+f],[i.extent[1][0]+d,i.extent[1][1]+f]]);const g=au(p)?al(t,p,i.measured):t;return(i.measured.width===void 0||i.measured.height===void 0)&&(s==null||s("015",Pa.error015())),{position:{x:g.x-d+(i.measured.width??0)*h[0],y:g.y-f+(i.measured.height??0)*h[1]},positionAbsolute:g}}async function dCe({nodesToRemove:e=[],edgesToRemove:t=[],nodes:n,edges:r,onBeforeDelete:a}){const s=new Set(e.map(g=>g.id)),i=[];for(const g of n){if(g.deletable===!1)continue;const y=s.has(g.id),S=!y&&g.parentId&&i.find(w=>w.id===g.parentId);(y||S)&&i.push(g)}const l=new Set(t.map(g=>g.id)),d=r.filter(g=>g.deletable!==!1),h=lCe(i,d);for(const g of d)l.has(g.id)&&!h.find(S=>S.id===g.id)&&h.push(g);if(!a)return{edges:h,nodes:i};const p=await a({nodes:i,edges:h});return typeof p=="boolean"?p?{edges:h,nodes:i}:{edges:[],nodes:[]}:p}const nu=(e,t=0,n=1)=>Math.min(Math.max(e,t),n),al=(e={x:0,y:0},t,n)=>({x:nu(e.x,t[0][0],t[1][0]-((n==null?void 0:n.width)??0)),y:nu(e.y,t[0][1],t[1][1]-((n==null?void 0:n.height)??0))});function DH(e,t,n){const{width:r,height:a}=Us(n),{x:s,y:i}=n.internals.positionAbsolute;return al(e,[[s,i],[s+r,i+a]],t)}const OI=(e,t,n)=>e<t?nu(Math.abs(e-t),1,t)/t:e>n?-nu(Math.abs(e-n),1,t)/t:0,PH=(e,t,n=15,r=40)=>{const a=OI(e.x,r,t.width-r)*n,s=OI(e.y,r,t.height-r)*n;return[a,s]},l0=(e,t)=>({x:Math.min(e.x,t.x),y:Math.min(e.y,t.y),x2:Math.max(e.x2,t.x2),y2:Math.max(e.y2,t.y2)}),TC=({x:e,y:t,width:n,height:r})=>({x:e,y:t,x2:e+n,y2:t+r}),c0=({x:e,y:t,x2:n,y2:r})=>({x:e,y:t,width:n-e,height:r-t}),ru=(e,t=[0,0])=>{var a,s;const{x:n,y:r}=tT(e)?e.internals.positionAbsolute:Nh(e,t);return{x:n,y:r,width:((a=e.measured)==null?void 0:a.width)??e.width??e.initialWidth??0,height:((s=e.measured)==null?void 0:s.height)??e.height??e.initialHeight??0}},_y=(e,t=[0,0])=>{var a,s;const{x:n,y:r}=tT(e)?e.internals.positionAbsolute:Nh(e,t);return{x:n,y:r,x2:n+(((a=e.measured)==null?void 0:a.width)??e.width??e.initialWidth??0),y2:r+(((s=e.measured)==null?void 0:s.height)??e.height??e.initialHeight??0)}},$H=(e,t)=>c0(l0(TC(e),TC(t))),$f=(e,t)=>{const n=Math.max(0,Math.min(e.x+e.width,t.x+t.width)-Math.max(e.x,t.x)),r=Math.max(0,Math.min(e.y+e.height,t.y+t.height)-Math.max(e.y,t.y));return Math.ceil(n*r)},MI=e=>ra(e.width)&&ra(e.height)&&ra(e.x)&&ra(e.y),ra=e=>!isNaN(e)&&isFinite(e),fCe=(e,t)=>{},Ch=(e,t=[1,1])=>({x:t[0]*Math.round(e.x/t[0]),y:t[1]*Math.round(e.y/t[1])}),Eh=({x:e,y:t},[n,r,a],s=!1,i=[1,1])=>{const l={x:(e-n)/a,y:(t-r)/a};return s?Ch(l,i):l},Ny=({x:e,y:t},[n,r,a])=>({x:e*a+n,y:t*a+r});function wc(e,t){if(typeof e=="number")return Math.floor((t-t/(1+e))*.5);if(typeof e=="string"&&e.endsWith("px")){const n=parseFloat(e);if(!Number.isNaN(n))return Math.floor(n)}if(typeof e=="string"&&e.endsWith("%")){const n=parseFloat(e);if(!Number.isNaN(n))return Math.floor(t*n*.01)}return console.error(`[React Flow] The padding value "${e}" is invalid. Please provide a number or a string with a valid unit (px or %).`),0}function hCe(e,t,n){if(typeof e=="string"||typeof e=="number"){const r=wc(e,n),a=wc(e,t);return{top:r,right:a,bottom:r,left:a,x:a*2,y:r*2}}if(typeof e=="object"){const r=wc(e.top??e.y??0,n),a=wc(e.bottom??e.y??0,n),s=wc(e.left??e.x??0,t),i=wc(e.right??e.x??0,t);return{top:r,right:i,bottom:a,left:s,x:s+i,y:r+a}}return{top:0,right:0,bottom:0,left:0,x:0,y:0}}function pCe(e,t,n,r,a,s){const{x:i,y:l}=Ny(e,[t,n,r]),{x:d,y:f}=Ny({x:e.x+e.width,y:e.y+e.height},[t,n,r]),h=a-d,p=s-f;return{left:Math.floor(i),top:Math.floor(l),right:Math.floor(h),bottom:Math.floor(p)}}const rT=(e,t,n,r,a,s)=>{const i=hCe(s,t,n),l=(t-i.x)/e.width,d=(n-i.y)/e.height,f=Math.min(l,d),h=nu(f,r,a),p=e.x+e.width/2,g=e.y+e.height/2,y=t/2-p*h,S=n/2-g*h,w=pCe(e,y,S,h,t,n),b={left:Math.min(w.left-i.left,0),top:Math.min(w.top-i.top,0),right:Math.min(w.right-i.right,0),bottom:Math.min(w.bottom-i.bottom,0)};return{x:y-b.left+b.right,y:S-b.top+b.bottom,zoom:h}},If=()=>{var e;return typeof navigator<"u"&&((e=navigator==null?void 0:navigator.userAgent)==null?void 0:e.indexOf("Mac"))>=0};function au(e){return e!=null&&e!=="parent"}function Us(e){var t,n;return{width:((t=e.measured)==null?void 0:t.width)??e.width??e.initialWidth??0,height:((n=e.measured)==null?void 0:n.height)??e.height??e.initialHeight??0}}function IH(e){var t,n;return(((t=e.measured)==null?void 0:t.width)??e.width??e.initialWidth)!==void 0&&(((n=e.measured)==null?void 0:n.height)??e.height??e.initialHeight)!==void 0}function LH(e,t={width:0,height:0},n,r,a){const s={...e},i=r.get(n);if(i){const l=i.origin||a;s.x+=i.internals.positionAbsolute.x-(t.width??0)*l[0],s.y+=i.internals.positionAbsolute.y-(t.height??0)*l[1]}return s}function DI(e,t){if(e.size!==t.size)return!1;for(const n of e)if(!t.has(n))return!1;return!0}function mCe(){let e,t;return{promise:new Promise((r,a)=>{e=r,t=a}),resolve:e,reject:t}}function gCe(e){return{...AH,...e||{}}}function lf(e,{snapGrid:t=[0,0],snapToGrid:n=!1,transform:r,containerBounds:a}){const{x:s,y:i}=aa(e),l=Eh({x:s-((a==null?void 0:a.left)??0),y:i-((a==null?void 0:a.top)??0)},r),{x:d,y:f}=n?Ch(l,t):l;return{xSnapped:d,ySnapped:f,...l}}const aT=e=>({width:e.offsetWidth,height:e.offsetHeight}),zH=e=>{var t;return((t=e==null?void 0:e.getRootNode)==null?void 0:t.call(e))||(window==null?void 0:window.document)},yCe=["INPUT","SELECT","TEXTAREA"];function qH(e){var r,a;const t=((a=(r=e.composedPath)==null?void 0:r.call(e))==null?void 0:a[0])||e.target;return(t==null?void 0:t.nodeType)!==1?!1:yCe.includes(t.nodeName)||t.hasAttribute("contenteditable")||!!t.closest(".nokey")}const FH=e=>"clientX"in e,aa=(e,t)=>{var s,i;const n=FH(e),r=n?e.clientX:(s=e.touches)==null?void 0:s[0].clientX,a=n?e.clientY:(i=e.touches)==null?void 0:i[0].clientY;return{x:r-((t==null?void 0:t.left)??0),y:a-((t==null?void 0:t.top)??0)}},PI=(e,t,n,r,a)=>{const s=t.querySelectorAll(`.${e}`);return!s||!s.length?null:Array.from(s).map(i=>{const l=i.getBoundingClientRect();return{id:i.getAttribute("data-handleid"),type:e,nodeId:a,position:i.getAttribute("data-handlepos"),x:(l.left-n.left)/r,y:(l.top-n.top)/r,...aT(i)}})};function UH({sourceX:e,sourceY:t,targetX:n,targetY:r,sourceControlX:a,sourceControlY:s,targetControlX:i,targetControlY:l}){const d=e*.125+a*.375+i*.375+n*.125,f=t*.125+s*.375+l*.375+r*.125,h=Math.abs(d-e),p=Math.abs(f-t);return[d,f,h,p]}function dg(e,t){return e>=0?.5*e:t*25*Math.sqrt(-e)}function $I({pos:e,x1:t,y1:n,x2:r,y2:a,c:s}){switch(e){case Te.Left:return[t-dg(t-r,s),n];case Te.Right:return[t+dg(r-t,s),n];case Te.Top:return[t,n-dg(n-a,s)];case Te.Bottom:return[t,n+dg(a-n,s)]}}function sT({sourceX:e,sourceY:t,sourcePosition:n=Te.Bottom,targetX:r,targetY:a,targetPosition:s=Te.Top,curvature:i=.25}){const[l,d]=$I({pos:n,x1:e,y1:t,x2:r,y2:a,c:i}),[f,h]=$I({pos:s,x1:r,y1:a,x2:e,y2:t,c:i}),[p,g,y,S]=UH({sourceX:e,sourceY:t,targetX:r,targetY:a,sourceControlX:l,sourceControlY:d,targetControlX:f,targetControlY:h});return[`M${e},${t} C${l},${d} ${f},${h} ${r},${a}`,p,g,y,S]}function HH({sourceX:e,sourceY:t,targetX:n,targetY:r}){const a=Math.abs(n-e)/2,s=n<e?n+a:n-a,i=Math.abs(r-t)/2,l=r<t?r+i:r-i;return[s,l,a,i]}function vCe({sourceNode:e,targetNode:t,selected:n=!1,zIndex:r,elevateOnSelect:a=!1}){if(r!==void 0)return r;const s=a&&n?1e3:0,i=Math.max(e.parentId||a&&e.selected?e.internals.z:0,t.parentId||a&&t.selected?t.internals.z:0);return s+i}function xCe({sourceNode:e,targetNode:t,width:n,height:r,transform:a}){const s=l0(_y(e),_y(t));s.x===s.x2&&(s.x2+=1),s.y===s.y2&&(s.y2+=1);const i={x:-a[0]/a[2],y:-a[1]/a[2],width:n/a[2],height:r/a[2]};return $f(i,c0(s))>0}const bCe=({source:e,sourceHandle:t,target:n,targetHandle:r})=>`xy-edge__${e}${t||""}-${n}${r||""}`,wCe=(e,t)=>t.some(n=>n.source===e.source&&n.target===e.target&&(n.sourceHandle===e.sourceHandle||!n.sourceHandle&&!e.sourceHandle)&&(n.targetHandle===e.targetHandle||!n.targetHandle&&!e.targetHandle)),BH=(e,t)=>{if(!e.source||!e.target)return t;let n;return OH(e)?n={...e}:n={...e,id:bCe(e)},wCe(n,t)?t:(n.sourceHandle===null&&delete n.sourceHandle,n.targetHandle===null&&delete n.targetHandle,t.concat(n))};function VH({sourceX:e,sourceY:t,targetX:n,targetY:r}){const[a,s,i,l]=HH({sourceX:e,sourceY:t,targetX:n,targetY:r});return[`M ${e},${t}L ${n},${r}`,a,s,i,l]}const II={[Te.Left]:{x:-1,y:0},[Te.Right]:{x:1,y:0},[Te.Top]:{x:0,y:-1},[Te.Bottom]:{x:0,y:1}},SCe=({source:e,sourcePosition:t=Te.Bottom,target:n})=>t===Te.Left||t===Te.Right?e.x<n.x?{x:1,y:0}:{x:-1,y:0}:e.y<n.y?{x:0,y:1}:{x:0,y:-1},LI=(e,t)=>Math.sqrt(Math.pow(t.x-e.x,2)+Math.pow(t.y-e.y,2));function _Ce({source:e,sourcePosition:t=Te.Bottom,target:n,targetPosition:r=Te.Top,center:a,offset:s,stepPosition:i}){const l=II[t],d=II[r],f={x:e.x+l.x*s,y:e.y+l.y*s},h={x:n.x+d.x*s,y:n.y+d.y*s},p=SCe({source:f,sourcePosition:t,target:h}),g=p.x!==0?"x":"y",y=p[g];let S=[],w,b;const x={x:0,y:0},_={x:0,y:0},[,,j,C]=HH({sourceX:e.x,sourceY:e.y,targetX:n.x,targetY:n.y});if(l[g]*d[g]===-1){g==="x"?(w=a.x??f.x+(h.x-f.x)*i,b=a.y??(f.y+h.y)/2):(w=a.x??(f.x+h.x)/2,b=a.y??f.y+(h.y-f.y)*i);const A=[{x:w,y:f.y},{x:w,y:h.y}],k=[{x:f.x,y:b},{x:h.x,y:b}];l[g]===y?S=g==="x"?A:k:S=g==="x"?k:A}else{const A=[{x:f.x,y:h.y}],k=[{x:h.x,y:f.y}];if(g==="x"?S=l.x===y?k:A:S=l.y===y?A:k,t===r){const U=Math.abs(e[g]-n[g]);if(U<=s){const F=Math.min(s-1,s-U);l[g]===y?x[g]=(f[g]>e[g]?-1:1)*F:_[g]=(h[g]>n[g]?-1:1)*F}}if(t!==r){const U=g==="x"?"y":"x",F=l[g]===d[U],q=f[U]>h[U],V=f[U]<h[U];(l[g]===1&&(!F&&q||F&&V)||l[g]!==1&&(!F&&V||F&&q))&&(S=g==="x"?A:k)}const O={x:f.x+x.x,y:f.y+x.y},M={x:h.x+_.x,y:h.y+_.y},z=Math.max(Math.abs(O.x-S[0].x),Math.abs(M.x-S[0].x)),L=Math.max(Math.abs(O.y-S[0].y),Math.abs(M.y-S[0].y));z>=L?(w=(O.x+M.x)/2,b=S[0].y):(w=S[0].x,b=(O.y+M.y)/2)}return[[e,{x:f.x+x.x,y:f.y+x.y},...S,{x:h.x+_.x,y:h.y+_.y},n],w,b,j,C]}function NCe(e,t,n,r){const a=Math.min(LI(e,t)/2,LI(t,n)/2,r),{x:s,y:i}=t;if(e.x===s&&s===n.x||e.y===i&&i===n.y)return`L${s} ${i}`;if(e.y===i){const f=e.x<n.x?-1:1,h=e.y<n.y?1:-1;return`L ${s+a*f},${i}Q ${s},${i} ${s},${i+a*h}`}const l=e.x<n.x?1:-1,d=e.y<n.y?-1:1;return`L ${s},${i+a*d}Q ${s},${i} ${s+a*l},${i}`}function AC({sourceX:e,sourceY:t,sourcePosition:n=Te.Bottom,targetX:r,targetY:a,targetPosition:s=Te.Top,borderRadius:i=5,centerX:l,centerY:d,offset:f=20,stepPosition:h=.5}){const[p,g,y,S,w]=_Ce({source:{x:e,y:t},sourcePosition:n,target:{x:r,y:a},targetPosition:s,center:{x:l,y:d},offset:f,stepPosition:h});return[p.reduce((x,_,j)=>{let C="";return j>0&&j<p.length-1?C=NCe(p[j-1],_,p[j+1],i):C=`${j===0?"M":"L"}${_.x} ${_.y}`,x+=C,x},""),g,y,S,w]}function zI(e){var t;return e&&!!(e.internals.handleBounds||(t=e.handles)!=null&&t.length)&&!!(e.measured.width||e.width||e.initialWidth)}function jCe(e){var p;const{sourceNode:t,targetNode:n}=e;if(!zI(t)||!zI(n))return null;const r=t.internals.handleBounds||qI(t.handles),a=n.internals.handleBounds||qI(n.handles),s=FI((r==null?void 0:r.source)??[],e.sourceHandle),i=FI(e.connectionMode===tu.Strict?(a==null?void 0:a.target)??[]:((a==null?void 0:a.target)??[]).concat((a==null?void 0:a.source)??[]),e.targetHandle);if(!s||!i)return(p=e.onError)==null||p.call(e,"008",Pa.error008(s?"target":"source",{id:e.id,sourceHandle:e.sourceHandle,targetHandle:e.targetHandle})),null;const l=(s==null?void 0:s.position)||Te.Bottom,d=(i==null?void 0:i.position)||Te.Top,f=Lf(t,s,l),h=Lf(n,i,d);return{sourceX:f.x,sourceY:f.y,targetX:h.x,targetY:h.y,sourcePosition:l,targetPosition:d}}function qI(e){if(!e)return null;const t=[],n=[];for(const r of e)r.width=r.width??1,r.height=r.height??1,r.type==="source"?t.push(r):r.type==="target"&&n.push(r);return{source:t,target:n}}function Lf(e,t,n=Te.Left,r=!1){const a=((t==null?void 0:t.x)??0)+e.internals.positionAbsolute.x,s=((t==null?void 0:t.y)??0)+e.internals.positionAbsolute.y,{width:i,height:l}=t??Us(e);if(r)return{x:a+i/2,y:s+l/2};switch((t==null?void 0:t.position)??n){case Te.Top:return{x:a+i/2,y:s};case Te.Right:return{x:a+i,y:s+l/2};case Te.Bottom:return{x:a+i/2,y:s+l};case Te.Left:return{x:a,y:s+l/2}}}function FI(e,t){return e&&(t?e.find(n=>n.id===t):e[0])||null}function RC(e,t){return e?typeof e=="string"?e:`${t?`${t}__`:""}${Object.keys(e).sort().map(r=>`${r}=${e[r]}`).join("&")}`:""}function CCe(e,{id:t,defaultColor:n,defaultMarkerStart:r,defaultMarkerEnd:a}){const s=new Set;return e.reduce((i,l)=>([l.markerStart||r,l.markerEnd||a].forEach(d=>{if(d&&typeof d=="object"){const f=RC(d,t);s.has(f)||(i.push({id:f,color:d.color||n,...d}),s.add(f))}}),i),[]).sort((i,l)=>i.id.localeCompare(l.id))}const WH=1e3,ECe=10,oT={nodeOrigin:[0,0],nodeExtent:Df,elevateNodesOnSelect:!0,defaults:{}},TCe={...oT,checkEquality:!0};function iT(e,t){const n={...e};for(const r in t)t[r]!==void 0&&(n[r]=t[r]);return n}function ACe(e,t,n){const r=iT(oT,n);for(const a of e.values())if(a.parentId)lT(a,e,t,r);else{const s=Nh(a,r.nodeOrigin),i=au(a.extent)?a.extent:r.nodeExtent,l=al(s,i,Us(a));a.internals.positionAbsolute=l}}function RCe(e,t){if(!e.handles)return e.measured?t==null?void 0:t.internals.handleBounds:void 0;const n=[],r=[];for(const a of e.handles){const s={id:a.id,width:a.width??1,height:a.height??1,nodeId:e.id,x:a.x,y:a.y,position:a.position,type:a.type};a.type==="source"?n.push(s):a.type==="target"&&r.push(s)}return{source:n,target:r}}function kC(e,t,n,r){var f,h;const a=iT(TCe,r);let s={i:-1},i=e.length>0;const l=new Map(t),d=a!=null&&a.elevateNodesOnSelect?WH:0;t.clear(),n.clear();for(const p of e){let g=l.get(p.id);if(a.checkEquality&&p===(g==null?void 0:g.internals.userNode))t.set(p.id,g);else{const y=Nh(p,a.nodeOrigin),S=au(p.extent)?p.extent:a.nodeExtent,w=al(y,S,Us(p));g={...a.defaults,...p,measured:{width:(f=p.measured)==null?void 0:f.width,height:(h=p.measured)==null?void 0:h.height},internals:{positionAbsolute:w,handleBounds:RCe(p,g),z:GH(p,d),userNode:p}},t.set(p.id,g)}(g.measured===void 0||g.measured.width===void 0||g.measured.height===void 0)&&!g.hidden&&(i=!1),p.parentId&&lT(g,t,n,r,s)}return i}function kCe(e,t){if(!e.parentId)return;const n=t.get(e.parentId);n?n.set(e.id,e):t.set(e.parentId,new Map([[e.id,e]]))}function lT(e,t,n,r,a){const{elevateNodesOnSelect:s,nodeOrigin:i,nodeExtent:l}=iT(oT,r),d=e.parentId,f=t.get(d);if(!f){console.warn(`Parent node ${d} not found. Please make sure that parent nodes are in front of their child nodes in the nodes array.`);return}kCe(e,n),a&&!f.parentId&&f.internals.rootParentIndex===void 0&&(f.internals.rootParentIndex=++a.i,f.internals.z=f.internals.z+a.i*ECe),a&&f.internals.rootParentIndex!==void 0&&(a.i=f.internals.rootParentIndex);const h=s?WH:0,{x:p,y:g,z:y}=OCe(e,f,i,l,h),{positionAbsolute:S}=e.internals,w=p!==S.x||g!==S.y;(w||y!==e.internals.z)&&t.set(e.id,{...e,internals:{...e.internals,positionAbsolute:w?{x:p,y:g}:S,z:y}})}function GH(e,t){return(ra(e.zIndex)?e.zIndex:0)+(e.selected?t:0)}function OCe(e,t,n,r,a){const{x:s,y:i}=t.internals.positionAbsolute,l=Us(e),d=Nh(e,n),f=au(e.extent)?al(d,e.extent,l):d;let h=al({x:s+f.x,y:i+f.y},r,l);e.extent==="parent"&&(h=DH(h,l,t));const p=GH(e,a),g=t.internals.z??0;return{x:h.x,y:h.y,z:g>=p?g+1:p}}function cT(e,t,n,r=[0,0]){var i;const a=[],s=new Map;for(const l of e){const d=t.get(l.parentId);if(!d)continue;const f=((i=s.get(l.parentId))==null?void 0:i.expandedRect)??ru(d),h=$H(f,l.rect);s.set(l.parentId,{expandedRect:h,parent:d})}return s.size>0&&s.forEach(({expandedRect:l,parent:d},f)=>{var j;const h=d.internals.positionAbsolute,p=Us(d),g=d.origin??r,y=l.x<h.x?Math.round(Math.abs(h.x-l.x)):0,S=l.y<h.y?Math.round(Math.abs(h.y-l.y)):0,w=Math.max(p.width,Math.round(l.width)),b=Math.max(p.height,Math.round(l.height)),x=(w-p.width)*g[0],_=(b-p.height)*g[1];(y>0||S>0||x||_)&&(a.push({id:f,type:"position",position:{x:d.position.x-y+x,y:d.position.y-S+_}}),(j=n.get(f))==null||j.forEach(C=>{e.some(T=>T.id===C.id)||a.push({id:C.id,type:"position",position:{x:C.position.x+y,y:C.position.y+S}})})),(p.width<l.width||p.height<l.height||y||S)&&a.push({id:f,type:"dimensions",setAttributes:!0,dimensions:{width:w+(y?g[0]*y-x:0),height:b+(S?g[1]*S-_:0)}})}),a}function MCe(e,t,n,r,a,s){const i=r==null?void 0:r.querySelector(".xyflow__viewport");let l=!1;if(!i)return{changes:[],updatedInternals:l};const d=[],f=window.getComputedStyle(i),{m22:h}=new window.DOMMatrixReadOnly(f.transform),p=[];for(const g of e.values()){const y=t.get(g.id);if(!y)continue;if(y.hidden){t.set(y.id,{...y,internals:{...y.internals,handleBounds:void 0}}),l=!0;continue}const S=aT(g.nodeElement),w=y.measured.width!==S.width||y.measured.height!==S.height;if(!!(S.width&&S.height&&(w||!y.internals.handleBounds||g.force))){const x=g.nodeElement.getBoundingClientRect(),_=au(y.extent)?y.extent:s;let{positionAbsolute:j}=y.internals;y.parentId&&y.extent==="parent"?j=DH(j,S,t.get(y.parentId)):_&&(j=al(j,_,S));const C={...y,measured:S,internals:{...y.internals,positionAbsolute:j,handleBounds:{source:PI("source",g.nodeElement,x,h,y.id),target:PI("target",g.nodeElement,x,h,y.id)}}};t.set(y.id,C),y.parentId&&lT(C,t,n,{nodeOrigin:a}),l=!0,w&&(d.push({id:y.id,type:"dimensions",dimensions:S}),y.expandParent&&y.parentId&&p.push({id:y.id,parentId:y.parentId,rect:ru(C,a)}))}}if(p.length>0){const g=cT(p,t,n,a);d.push(...g)}return{changes:d,updatedInternals:l}}async function DCe({delta:e,panZoom:t,transform:n,translateExtent:r,width:a,height:s}){if(!t||!e.x&&!e.y)return Promise.resolve(!1);const i=await t.setViewportConstrained({x:n[0]+e.x,y:n[1]+e.y,zoom:n[2]},[[0,0],[a,s]],r),l=!!i&&(i.x!==n[0]||i.y!==n[1]||i.k!==n[2]);return Promise.resolve(l)}function UI(e,t,n,r,a,s){let i=a;const l=r.get(i)||new Map;r.set(i,l.set(n,t)),i=`${a}-${e}`;const d=r.get(i)||new Map;if(r.set(i,d.set(n,t)),s){i=`${a}-${e}-${s}`;const f=r.get(i)||new Map;r.set(i,f.set(n,t))}}function KH(e,t,n){e.clear(),t.clear();for(const r of n){const{source:a,target:s,sourceHandle:i=null,targetHandle:l=null}=r,d={edgeId:r.id,source:a,target:s,sourceHandle:i,targetHandle:l},f=`${a}-${i}--${s}-${l}`,h=`${s}-${l}--${a}-${i}`;UI("source",d,h,e,a,i),UI("target",d,f,e,s,l),t.set(r.id,r)}}function YH(e,t){if(!e.parentId)return!1;const n=t.get(e.parentId);return n?n.selected?!0:YH(n,t):!1}function HI(e,t,n){var a;let r=e;do{if((a=r==null?void 0:r.matches)!=null&&a.call(r,t))return!0;if(r===n)return!1;r=r==null?void 0:r.parentElement}while(r);return!1}function PCe(e,t,n,r){const a=new Map;for(const[s,i]of e)if((i.selected||i.id===r)&&(!i.parentId||!YH(i,e))&&(i.draggable||t&&typeof i.draggable>"u")){const l=e.get(s);l&&a.set(s,{id:s,position:l.position||{x:0,y:0},distance:{x:n.x-l.internals.positionAbsolute.x,y:n.y-l.internals.positionAbsolute.y},extent:l.extent,parentId:l.parentId,origin:l.origin,expandParent:l.expandParent,internals:{positionAbsolute:l.internals.positionAbsolute||{x:0,y:0}},measured:{width:l.measured.width??0,height:l.measured.height??0}})}return a}function ej({nodeId:e,dragItems:t,nodeLookup:n,dragging:r=!0}){var i,l,d;const a=[];for(const[f,h]of t){const p=(i=n.get(f))==null?void 0:i.internals.userNode;p&&a.push({...p,position:h.position,dragging:r})}if(!e)return[a[0],a];const s=(l=n.get(e))==null?void 0:l.internals.userNode;return[s?{...s,position:((d=t.get(e))==null?void 0:d.position)||s.position,dragging:r}:a[0],a]}function $Ce({dragItems:e,snapGrid:t,x:n,y:r}){const a=e.values().next().value;if(!a)return null;const s={x:n-a.distance.x,y:r-a.distance.y},i=Ch(s,t);return{x:i.x-s.x,y:i.y-s.y}}function ICe({onNodeMouseDown:e,getStoreItems:t,onDragStart:n,onDrag:r,onDragStop:a}){let s={x:null,y:null},i=0,l=new Map,d=!1,f={x:0,y:0},h=null,p=!1,g=null,y=!1,S=!1,w=null;function b({noDragClassName:_,handleSelector:j,domNode:C,isSelectable:T,nodeId:A,nodeClickDistance:k=0}){g=yr(C);function O({x:U,y:F}){const{nodeLookup:q,nodeExtent:V,snapGrid:P,snapToGrid:K,nodeOrigin:H,onNodeDrag:Z,onSelectionDrag:J,onError:D,updateNodePositions:W}=t();s={x:U,y:F};let B=!1;const $=l.size>1,G=$&&V?TC(jh(l)):null,ee=$&&K?$Ce({dragItems:l,snapGrid:P,x:U,y:F}):null;for(const[re,ne]of l){if(!q.has(re))continue;let Q={x:U-ne.distance.x,y:F-ne.distance.y};K&&(Q=ee?{x:Math.round(Q.x+ee.x),y:Math.round(Q.y+ee.y)}:Ch(Q,P));let ae=null;if($&&V&&!ne.extent&&G){const{positionAbsolute:se}=ne.internals,le=se.x-G.x+V[0][0],fe=se.x+ne.measured.width-G.x2+V[1][0],ve=se.y-G.y+V[0][1],Se=se.y+ne.measured.height-G.y2+V[1][1];ae=[[le,ve],[fe,Se]]}const{position:Y,positionAbsolute:te}=MH({nodeId:re,nextPosition:Q,nodeLookup:q,nodeExtent:ae||V,nodeOrigin:H,onError:D});B=B||ne.position.x!==Y.x||ne.position.y!==Y.y,ne.position=Y,ne.internals.positionAbsolute=te}if(S=S||B,!!B&&(W(l,!0),w&&(r||Z||!A&&J))){const[re,ne]=ej({nodeId:A,dragItems:l,nodeLookup:q});r==null||r(w,l,re,ne),Z==null||Z(w,re,ne),A||J==null||J(w,ne)}}async function M(){if(!h)return;const{transform:U,panBy:F,autoPanSpeed:q,autoPanOnNodeDrag:V}=t();if(!V){d=!1,cancelAnimationFrame(i);return}const[P,K]=PH(f,h,q);(P!==0||K!==0)&&(s.x=(s.x??0)-P/U[2],s.y=(s.y??0)-K/U[2],await F({x:P,y:K})&&O(s)),i=requestAnimationFrame(M)}function z(U){var $;const{nodeLookup:F,multiSelectionActive:q,nodesDraggable:V,transform:P,snapGrid:K,snapToGrid:H,selectNodesOnDrag:Z,onNodeDragStart:J,onSelectionDragStart:D,unselectNodesAndEdges:W}=t();p=!0,(!Z||!T)&&!q&&A&&(($=F.get(A))!=null&&$.selected||W()),T&&Z&&A&&(e==null||e(A));const B=lf(U.sourceEvent,{transform:P,snapGrid:K,snapToGrid:H,containerBounds:h});if(s=B,l=PCe(F,V,B,A),l.size>0&&(n||J||!A&&D)){const[G,ee]=ej({nodeId:A,dragItems:l,nodeLookup:F});n==null||n(U.sourceEvent,l,G,ee),J==null||J(U.sourceEvent,G,ee),A||D==null||D(U.sourceEvent,ee)}}const L=fH().clickDistance(k).on("start",U=>{const{domNode:F,nodeDragThreshold:q,transform:V,snapGrid:P,snapToGrid:K}=t();h=(F==null?void 0:F.getBoundingClientRect())||null,y=!1,S=!1,w=U.sourceEvent,q===0&&z(U),s=lf(U.sourceEvent,{transform:V,snapGrid:P,snapToGrid:K,containerBounds:h}),f=aa(U.sourceEvent,h)}).on("drag",U=>{const{autoPanOnNodeDrag:F,transform:q,snapGrid:V,snapToGrid:P,nodeDragThreshold:K,nodeLookup:H}=t(),Z=lf(U.sourceEvent,{transform:q,snapGrid:V,snapToGrid:P,containerBounds:h});if(w=U.sourceEvent,(U.sourceEvent.type==="touchmove"&&U.sourceEvent.touches.length>1||A&&!H.has(A))&&(y=!0),!y){if(!d&&F&&p&&(d=!0,M()),!p){const J=aa(U.sourceEvent,h),D=J.x-f.x,W=J.y-f.y;Math.sqrt(D*D+W*W)>K&&z(U)}(s.x!==Z.xSnapped||s.y!==Z.ySnapped)&&l&&p&&(f=aa(U.sourceEvent,h),O(Z))}}).on("end",U=>{if(!(!p||y)&&(d=!1,p=!1,cancelAnimationFrame(i),l.size>0)){const{nodeLookup:F,updateNodePositions:q,onNodeDragStop:V,onSelectionDragStop:P}=t();if(S&&(q(l,!1),S=!1),a||V||!A&&P){const[K,H]=ej({nodeId:A,dragItems:l,nodeLookup:F,dragging:!1});a==null||a(U.sourceEvent,l,K,H),V==null||V(U.sourceEvent,K,H),A||P==null||P(U.sourceEvent,H)}}}).filter(U=>{const F=U.target;return!U.button&&(!_||!HI(F,`.${_}`,C))&&(!j||HI(F,j,C))});g.call(L)}function x(){g==null||g.on(".drag",null)}return{update:b,destroy:x}}function LCe(e,t,n){const r=[],a={x:e.x-n,y:e.y-n,width:n*2,height:n*2};for(const s of t.values())$f(a,ru(s))>0&&r.push(s);return r}const zCe=250;function qCe(e,t,n,r){var l,d;let a=[],s=1/0;const i=LCe(e,n,t+zCe);for(const f of i){const h=[...((l=f.internals.handleBounds)==null?void 0:l.source)??[],...((d=f.internals.handleBounds)==null?void 0:d.target)??[]];for(const p of h){if(r.nodeId===p.nodeId&&r.type===p.type&&r.id===p.id)continue;const{x:g,y}=Lf(f,p,p.position,!0),S=Math.sqrt(Math.pow(g-e.x,2)+Math.pow(y-e.y,2));S>t||(S<s?(a=[{...p,x:g,y}],s=S):S===s&&a.push({...p,x:g,y}))}}if(!a.length)return null;if(a.length>1){const f=r.type==="source"?"target":"source";return a.find(h=>h.type===f)??a[0]}return a[0]}function XH(e,t,n,r,a,s=!1){var f,h,p;const i=r.get(e);if(!i)return null;const l=a==="strict"?(f=i.internals.handleBounds)==null?void 0:f[t]:[...((h=i.internals.handleBounds)==null?void 0:h.source)??[],...((p=i.internals.handleBounds)==null?void 0:p.target)??[]],d=(n?l==null?void 0:l.find(g=>g.id===n):l==null?void 0:l[0])??null;return d&&s?{...d,...Lf(i,d,d.position,!0)}:d}function ZH(e,t){return e||(t!=null&&t.classList.contains("target")?"target":t!=null&&t.classList.contains("source")?"source":null)}function FCe(e,t){let n=null;return t?n=!0:e&&!t&&(n=!1),n}const QH=()=>!0;function UCe(e,{connectionMode:t,connectionRadius:n,handleId:r,nodeId:a,edgeUpdaterType:s,isTarget:i,domNode:l,nodeLookup:d,lib:f,autoPanOnConnect:h,flowId:p,panBy:g,cancelConnection:y,onConnectStart:S,onConnect:w,onConnectEnd:b,isValidConnection:x=QH,onReconnectEnd:_,updateConnection:j,getTransform:C,getFromHandle:T,autoPanSpeed:A,dragThreshold:k=1,handleDomNode:O}){const M=zH(e.target);let z=0,L;const{x:U,y:F}=aa(e),q=ZH(s,O),V=l==null?void 0:l.getBoundingClientRect();let P=!1;if(!V||!q)return;const K=XH(a,q,r,d,t);if(!K)return;let H=aa(e,V),Z=!1,J=null,D=!1,W=null;function B(){if(!h||!V)return;const[Y,te]=PH(H,V,A);g({x:Y,y:te}),z=requestAnimationFrame(B)}const $={...K,nodeId:a,type:q,position:K.position},G=d.get(a);let re={inProgress:!0,isValid:null,from:Lf(G,$,Te.Left,!0),fromHandle:$,fromPosition:$.position,fromNode:G,to:H,toHandle:null,toPosition:kI[$.position],toNode:null};function ne(){P=!0,j(re),S==null||S(e,{nodeId:a,handleId:r,handleType:q})}k===0&&ne();function Q(Y){if(!P){const{x:fe,y:ve}=aa(Y),Se=fe-U,Re=ve-F;if(!(Se*Se+Re*Re>k*k))return;ne()}if(!T()||!$){ae(Y);return}const te=C();H=aa(Y,V),L=qCe(Eh(H,te,!1,[1,1]),n,d,$),Z||(B(),Z=!0);const se=JH(Y,{handle:L,connectionMode:t,fromNodeId:a,fromHandleId:r,fromType:i?"target":"source",isValidConnection:x,doc:M,lib:f,flowId:p,nodeLookup:d});W=se.handleDomNode,J=se.connection,D=FCe(!!L,se.isValid);const le={...re,isValid:D,to:se.toHandle&&D?Ny({x:se.toHandle.x,y:se.toHandle.y},te):H,toHandle:se.toHandle,toPosition:D&&se.toHandle?se.toHandle.position:kI[$.position],toNode:se.toHandle?d.get(se.toHandle.nodeId):null};D&&L&&re.toHandle&&le.toHandle&&re.toHandle.type===le.toHandle.type&&re.toHandle.nodeId===le.toHandle.nodeId&&re.toHandle.id===le.toHandle.id&&re.to.x===le.to.x&&re.to.y===le.to.y||(j(le),re=le)}function ae(Y){if(!("touches"in Y&&Y.touches.length>0)){if(P){(L||W)&&J&&D&&(w==null||w(J));const{inProgress:te,...se}=re,le={...se,toPosition:re.toHandle?re.toPosition:null};b==null||b(Y,le),s&&(_==null||_(Y,le))}y(),cancelAnimationFrame(z),Z=!1,D=!1,J=null,W=null,M.removeEventListener("mousemove",Q),M.removeEventListener("mouseup",ae),M.removeEventListener("touchmove",Q),M.removeEventListener("touchend",ae)}}M.addEventListener("mousemove",Q),M.addEventListener("mouseup",ae),M.addEventListener("touchmove",Q),M.addEventListener("touchend",ae)}function JH(e,{handle:t,connectionMode:n,fromNodeId:r,fromHandleId:a,fromType:s,doc:i,lib:l,flowId:d,isValidConnection:f=QH,nodeLookup:h}){const p=s==="target",g=t?i.querySelector(`.${l}-flow__handle[data-id="${d}-${t==null?void 0:t.nodeId}-${t==null?void 0:t.id}-${t==null?void 0:t.type}"]`):null,{x:y,y:S}=aa(e),w=i.elementFromPoint(y,S),b=w!=null&&w.classList.contains(`${l}-flow__handle`)?w:g,x={handleDomNode:b,isValid:!1,connection:null,toHandle:null};if(b){const _=ZH(void 0,b),j=b.getAttribute("data-nodeid"),C=b.getAttribute("data-handleid"),T=b.classList.contains("connectable"),A=b.classList.contains("connectableend");if(!j||!_)return x;const k={source:p?j:r,sourceHandle:p?C:a,target:p?r:j,targetHandle:p?a:C};x.connection=k;const M=T&&A&&(n===tu.Strict?p&&_==="source"||!p&&_==="target":j!==r||C!==a);x.isValid=M&&f(k),x.toHandle=XH(j,_,C,h,n,!0)}return x}const OC={onPointerDown:UCe,isValid:JH};function HCe({domNode:e,panZoom:t,getTransform:n,getViewScale:r}){const a=yr(e);function s({translateExtent:l,width:d,height:f,zoomStep:h=1,pannable:p=!0,zoomable:g=!0,inversePan:y=!1}){const S=j=>{if(j.sourceEvent.type!=="wheel"||!t)return;const C=n(),T=j.sourceEvent.ctrlKey&&If()?10:1,A=-j.sourceEvent.deltaY*(j.sourceEvent.deltaMode===1?.05:j.sourceEvent.deltaMode?1:.002)*h,k=C[2]*Math.pow(2,A*T);t.scaleTo(k)};let w=[0,0];const b=j=>{(j.sourceEvent.type==="mousedown"||j.sourceEvent.type==="touchstart")&&(w=[j.sourceEvent.clientX??j.sourceEvent.touches[0].clientX,j.sourceEvent.clientY??j.sourceEvent.touches[0].clientY])},x=j=>{const C=n();if(j.sourceEvent.type!=="mousemove"&&j.sourceEvent.type!=="touchmove"||!t)return;const T=[j.sourceEvent.clientX??j.sourceEvent.touches[0].clientX,j.sourceEvent.clientY??j.sourceEvent.touches[0].clientY],A=[T[0]-w[0],T[1]-w[1]];w=T;const k=r()*Math.max(C[2],Math.log(C[2]))*(y?-1:1),O={x:C[0]-A[0]*k,y:C[1]-A[1]*k},M=[[0,0],[d,f]];t.setViewportConstrained({x:O.x,y:O.y,zoom:C[2]},M,l)},_=EH().on("start",b).on("zoom",p?x:null).on("zoom.wheel",g?S:null);a.call(_,{})}function i(){a.on("zoom",null)}return{update:s,destroy:i,pointer:ea}}const u0=e=>({x:e.x,y:e.y,zoom:e.k}),tj=({x:e,y:t,zoom:n})=>i0.translate(e,t).scale(n),Ec=(e,t)=>e.target.closest(`.${t}`),eB=(e,t)=>t===2&&Array.isArray(e)&&e.includes(2),BCe=e=>((e*=2)<=1?e*e*e:(e-=2)*e*e+2)/2,nj=(e,t=0,n=BCe,r=()=>{})=>{const a=typeof t=="number"&&t>0;return a||r(),a?e.transition().duration(t).ease(n).on("end",r):e},tB=e=>{const t=e.ctrlKey&&If()?10:1;return-e.deltaY*(e.deltaMode===1?.05:e.deltaMode?1:.002)*t};function VCe({zoomPanValues:e,noWheelClassName:t,d3Selection:n,d3Zoom:r,panOnScrollMode:a,panOnScrollSpeed:s,zoomOnPinch:i,onPanZoomStart:l,onPanZoom:d,onPanZoomEnd:f}){return h=>{if(Ec(h,t))return h.ctrlKey&&h.preventDefault(),!1;h.preventDefault(),h.stopImmediatePropagation();const p=n.property("__zoom").k||1;if(h.ctrlKey&&i){const b=ea(h),x=tB(h),_=p*Math.pow(2,x);r.scaleTo(n,_,b,h);return}const g=h.deltaMode===1?20:1;let y=a===Ui.Vertical?0:h.deltaX*g,S=a===Ui.Horizontal?0:h.deltaY*g;!If()&&h.shiftKey&&a!==Ui.Vertical&&(y=h.deltaY*g,S=0),r.translateBy(n,-(y/p)*s,-(S/p)*s,{internal:!0});const w=u0(n.property("__zoom"));clearTimeout(e.panScrollTimeout),e.isPanScrolling?(d==null||d(h,w),e.panScrollTimeout=setTimeout(()=>{f==null||f(h,w),e.isPanScrolling=!1},150)):(e.isPanScrolling=!0,l==null||l(h,w))}}function WCe({noWheelClassName:e,preventScrolling:t,d3ZoomHandler:n}){return function(r,a){const s=r.type==="wheel",i=!t&&s&&!r.ctrlKey,l=Ec(r,e);if(r.ctrlKey&&s&&l&&r.preventDefault(),i||l)return null;r.preventDefault(),n.call(this,r,a)}}function GCe({zoomPanValues:e,onDraggingChange:t,onPanZoomStart:n}){return r=>{var s,i,l;if((s=r.sourceEvent)!=null&&s.internal)return;const a=u0(r.transform);e.mouseButton=((i=r.sourceEvent)==null?void 0:i.button)||0,e.isZoomingOrPanning=!0,e.prevViewport=a,((l=r.sourceEvent)==null?void 0:l.type)==="mousedown"&&t(!0),n&&(n==null||n(r.sourceEvent,a))}}function KCe({zoomPanValues:e,panOnDrag:t,onPaneContextMenu:n,onTransformChange:r,onPanZoom:a}){return s=>{var i,l;e.usedRightMouseButton=!!(n&&eB(t,e.mouseButton??0)),(i=s.sourceEvent)!=null&&i.sync||r([s.transform.x,s.transform.y,s.transform.k]),a&&!((l=s.sourceEvent)!=null&&l.internal)&&(a==null||a(s.sourceEvent,u0(s.transform)))}}function YCe({zoomPanValues:e,panOnDrag:t,panOnScroll:n,onDraggingChange:r,onPanZoomEnd:a,onPaneContextMenu:s}){return i=>{var l;if(!((l=i.sourceEvent)!=null&&l.internal)&&(e.isZoomingOrPanning=!1,s&&eB(t,e.mouseButton??0)&&!e.usedRightMouseButton&&i.sourceEvent&&s(i.sourceEvent),e.usedRightMouseButton=!1,r(!1),a)){const d=u0(i.transform);e.prevViewport=d,clearTimeout(e.timerId),e.timerId=setTimeout(()=>{a==null||a(i.sourceEvent,d)},n?150:0)}}}function XCe({zoomActivationKeyPressed:e,zoomOnScroll:t,zoomOnPinch:n,panOnDrag:r,panOnScroll:a,zoomOnDoubleClick:s,userSelectionActive:i,noWheelClassName:l,noPanClassName:d,lib:f,connectionInProgress:h}){return p=>{var b;const g=e||t,y=n&&p.ctrlKey,S=p.type==="wheel";if(p.button===1&&p.type==="mousedown"&&(Ec(p,`${f}-flow__node`)||Ec(p,`${f}-flow__edge`)))return!0;if(!r&&!g&&!a&&!s&&!n||i||h&&!S||Ec(p,l)&&S||Ec(p,d)&&(!S||a&&S&&!e)||!n&&p.ctrlKey&&S)return!1;if(!n&&p.type==="touchstart"&&((b=p.touches)==null?void 0:b.length)>1)return p.preventDefault(),!1;if(!g&&!a&&!y&&S||!r&&(p.type==="mousedown"||p.type==="touchstart")||Array.isArray(r)&&!r.includes(p.button)&&p.type==="mousedown")return!1;const w=Array.isArray(r)&&r.includes(p.button)||!p.button||p.button<=1;return(!p.ctrlKey||S)&&w}}function ZCe({domNode:e,minZoom:t,maxZoom:n,translateExtent:r,viewport:a,onPanZoom:s,onPanZoomStart:i,onPanZoomEnd:l,onDraggingChange:d}){const f={isZoomingOrPanning:!1,usedRightMouseButton:!1,prevViewport:{},mouseButton:0,timerId:void 0,panScrollTimeout:void 0,isPanScrolling:!1},h=e.getBoundingClientRect(),p=EH().scaleExtent([t,n]).translateExtent(r),g=yr(e).call(p);_({x:a.x,y:a.y,zoom:nu(a.zoom,t,n)},[[0,0],[h.width,h.height]],r);const y=g.on("wheel.zoom"),S=g.on("dblclick.zoom");p.wheelDelta(tB);function w(L,U){return g?new Promise(F=>{p==null||p.interpolate((U==null?void 0:U.interpolate)==="linear"?of:Lg).transform(nj(g,U==null?void 0:U.duration,U==null?void 0:U.ease,()=>F(!0)),L)}):Promise.resolve(!1)}function b({noWheelClassName:L,noPanClassName:U,onPaneContextMenu:F,userSelectionActive:q,panOnScroll:V,panOnDrag:P,panOnScrollMode:K,panOnScrollSpeed:H,preventScrolling:Z,zoomOnPinch:J,zoomOnScroll:D,zoomOnDoubleClick:W,zoomActivationKeyPressed:B,lib:$,onTransformChange:G,connectionInProgress:ee,paneClickDistance:re,selectionOnDrag:ne}){q&&!f.isZoomingOrPanning&&x();const Q=V&&!B&&!q;p.clickDistance(ne?1/0:!ra(re)||re<0?0:re);const ae=Q?VCe({zoomPanValues:f,noWheelClassName:L,d3Selection:g,d3Zoom:p,panOnScrollMode:K,panOnScrollSpeed:H,zoomOnPinch:J,onPanZoomStart:i,onPanZoom:s,onPanZoomEnd:l}):WCe({noWheelClassName:L,preventScrolling:Z,d3ZoomHandler:y});if(g.on("wheel.zoom",ae,{passive:!1}),!q){const te=GCe({zoomPanValues:f,onDraggingChange:d,onPanZoomStart:i});p.on("start",te);const se=KCe({zoomPanValues:f,panOnDrag:P,onPaneContextMenu:!!F,onPanZoom:s,onTransformChange:G});p.on("zoom",se);const le=YCe({zoomPanValues:f,panOnDrag:P,panOnScroll:V,onPaneContextMenu:F,onPanZoomEnd:l,onDraggingChange:d});p.on("end",le)}const Y=XCe({zoomActivationKeyPressed:B,panOnDrag:P,zoomOnScroll:D,panOnScroll:V,zoomOnDoubleClick:W,zoomOnPinch:J,userSelectionActive:q,noPanClassName:U,noWheelClassName:L,lib:$,connectionInProgress:ee});p.filter(Y),W?g.on("dblclick.zoom",S):g.on("dblclick.zoom",null)}function x(){p.on("zoom",null)}async function _(L,U,F){const q=tj(L),V=p==null?void 0:p.constrain()(q,U,F);return V&&await w(V),new Promise(P=>P(V))}async function j(L,U){const F=tj(L);return await w(F,U),new Promise(q=>q(F))}function C(L){if(g){const U=tj(L),F=g.property("__zoom");(F.k!==L.zoom||F.x!==L.x||F.y!==L.y)&&(p==null||p.transform(g,U,null,{sync:!0}))}}function T(){const L=g?CH(g.node()):{x:0,y:0,k:1};return{x:L.x,y:L.y,zoom:L.k}}function A(L,U){return g?new Promise(F=>{p==null||p.interpolate((U==null?void 0:U.interpolate)==="linear"?of:Lg).scaleTo(nj(g,U==null?void 0:U.duration,U==null?void 0:U.ease,()=>F(!0)),L)}):Promise.resolve(!1)}function k(L,U){return g?new Promise(F=>{p==null||p.interpolate((U==null?void 0:U.interpolate)==="linear"?of:Lg).scaleBy(nj(g,U==null?void 0:U.duration,U==null?void 0:U.ease,()=>F(!0)),L)}):Promise.resolve(!1)}function O(L){p==null||p.scaleExtent(L)}function M(L){p==null||p.translateExtent(L)}function z(L){const U=!ra(L)||L<0?0:L;p==null||p.clickDistance(U)}return{update:b,destroy:x,setViewport:j,setViewportConstrained:_,getViewport:T,scaleTo:A,scaleBy:k,setScaleExtent:O,setTranslateExtent:M,syncViewport:C,setClickDistance:z}}var su;(function(e){e.Line="line",e.Handle="handle"})(su||(su={}));function QCe({width:e,prevWidth:t,height:n,prevHeight:r,affectsX:a,affectsY:s}){const i=e-t,l=n-r,d=[i>0?1:i<0?-1:0,l>0?1:l<0?-1:0];return i&&a&&(d[0]=d[0]*-1),l&&s&&(d[1]=d[1]*-1),d}function BI(e){const t=e.includes("right")||e.includes("left"),n=e.includes("bottom")||e.includes("top"),r=e.includes("left"),a=e.includes("top");return{isHorizontal:t,isVertical:n,affectsX:r,affectsY:a}}function So(e,t){return Math.max(0,t-e)}function _o(e,t){return Math.max(0,e-t)}function fg(e,t,n){return Math.max(0,t-e,e-n)}function VI(e,t){return e?!t:t}function JCe(e,t,n,r,a,s,i,l){let{affectsX:d,affectsY:f}=t;const{isHorizontal:h,isVertical:p}=t,g=h&&p,{xSnapped:y,ySnapped:S}=n,{minWidth:w,maxWidth:b,minHeight:x,maxHeight:_}=r,{x:j,y:C,width:T,height:A,aspectRatio:k}=e;let O=Math.floor(h?y-e.pointerX:0),M=Math.floor(p?S-e.pointerY:0);const z=T+(d?-O:O),L=A+(f?-M:M),U=-s[0]*T,F=-s[1]*A;let q=fg(z,w,b),V=fg(L,x,_);if(i){let H=0,Z=0;d&&O<0?H=So(j+O+U,i[0][0]):!d&&O>0&&(H=_o(j+z+U,i[1][0])),f&&M<0?Z=So(C+M+F,i[0][1]):!f&&M>0&&(Z=_o(C+L+F,i[1][1])),q=Math.max(q,H),V=Math.max(V,Z)}if(l){let H=0,Z=0;d&&O>0?H=_o(j+O,l[0][0]):!d&&O<0&&(H=So(j+z,l[1][0])),f&&M>0?Z=_o(C+M,l[0][1]):!f&&M<0&&(Z=So(C+L,l[1][1])),q=Math.max(q,H),V=Math.max(V,Z)}if(a){if(h){const H=fg(z/k,x,_)*k;if(q=Math.max(q,H),i){let Z=0;!d&&!f||d&&!f&&g?Z=_o(C+F+z/k,i[1][1])*k:Z=So(C+F+(d?O:-O)/k,i[0][1])*k,q=Math.max(q,Z)}if(l){let Z=0;!d&&!f||d&&!f&&g?Z=So(C+z/k,l[1][1])*k:Z=_o(C+(d?O:-O)/k,l[0][1])*k,q=Math.max(q,Z)}}if(p){const H=fg(L*k,w,b)/k;if(V=Math.max(V,H),i){let Z=0;!d&&!f||f&&!d&&g?Z=_o(j+L*k+U,i[1][0])/k:Z=So(j+(f?M:-M)*k+U,i[0][0])/k,V=Math.max(V,Z)}if(l){let Z=0;!d&&!f||f&&!d&&g?Z=So(j+L*k,l[1][0])/k:Z=_o(j+(f?M:-M)*k,l[0][0])/k,V=Math.max(V,Z)}}}M=M+(M<0?V:-V),O=O+(O<0?q:-q),a&&(g?z>L*k?M=(VI(d,f)?-O:O)/k:O=(VI(d,f)?-M:M)*k:h?(M=O/k,f=d):(O=M*k,d=f));const P=d?j+O:j,K=f?C+M:C;return{width:T+(d?-O:O),height:A+(f?-M:M),x:s[0]*O*(d?-1:1)+P,y:s[1]*M*(f?-1:1)+K}}const nB={width:0,height:0,x:0,y:0},e2e={...nB,pointerX:0,pointerY:0,aspectRatio:1};function t2e(e){return[[0,0],[e.measured.width,e.measured.height]]}function n2e(e,t,n){const r=t.position.x+e.position.x,a=t.position.y+e.position.y,s=e.measured.width??0,i=e.measured.height??0,l=n[0]*s,d=n[1]*i;return[[r-l,a-d],[r+s-l,a+i-d]]}function r2e({domNode:e,nodeId:t,getStoreItems:n,onChange:r,onEnd:a}){const s=yr(e);let i={controlDirection:BI("bottom-right"),boundaries:{minWidth:0,minHeight:0,maxWidth:Number.MAX_VALUE,maxHeight:Number.MAX_VALUE},resizeDirection:void 0,keepAspectRatio:!1};function l({controlPosition:f,boundaries:h,keepAspectRatio:p,resizeDirection:g,onResizeStart:y,onResize:S,onResizeEnd:w,shouldResize:b}){let x={...nB},_={...e2e};i={boundaries:h,resizeDirection:g,keepAspectRatio:p,controlDirection:BI(f)};let j,C=null,T=[],A,k,O,M=!1;const z=fH().on("start",L=>{const{nodeLookup:U,transform:F,snapGrid:q,snapToGrid:V,nodeOrigin:P,paneDomNode:K}=n();if(j=U.get(t),!j)return;C=(K==null?void 0:K.getBoundingClientRect())??null;const{xSnapped:H,ySnapped:Z}=lf(L.sourceEvent,{transform:F,snapGrid:q,snapToGrid:V,containerBounds:C});x={width:j.measured.width??0,height:j.measured.height??0,x:j.position.x??0,y:j.position.y??0},_={...x,pointerX:H,pointerY:Z,aspectRatio:x.width/x.height},A=void 0,j.parentId&&(j.extent==="parent"||j.expandParent)&&(A=U.get(j.parentId),k=A&&j.extent==="parent"?t2e(A):void 0),T=[],O=void 0;for(const[J,D]of U)if(D.parentId===t&&(T.push({id:J,position:{...D.position},extent:D.extent}),D.extent==="parent"||D.expandParent)){const W=n2e(D,j,D.origin??P);O?O=[[Math.min(W[0][0],O[0][0]),Math.min(W[0][1],O[0][1])],[Math.max(W[1][0],O[1][0]),Math.max(W[1][1],O[1][1])]]:O=W}y==null||y(L,{...x})}).on("drag",L=>{const{transform:U,snapGrid:F,snapToGrid:q,nodeOrigin:V}=n(),P=lf(L.sourceEvent,{transform:U,snapGrid:F,snapToGrid:q,containerBounds:C}),K=[];if(!j)return;const{x:H,y:Z,width:J,height:D}=x,W={},B=j.origin??V,{width:$,height:G,x:ee,y:re}=JCe(_,i.controlDirection,P,i.boundaries,i.keepAspectRatio,B,k,O),ne=$!==J,Q=G!==D,ae=ee!==H&&ne,Y=re!==Z&&Q;if(!ae&&!Y&&!ne&&!Q)return;if((ae||Y||B[0]===1||B[1]===1)&&(W.x=ae?ee:x.x,W.y=Y?re:x.y,x.x=W.x,x.y=W.y,T.length>0)){const fe=ee-H,ve=re-Z;for(const Se of T)Se.position={x:Se.position.x-fe+B[0]*($-J),y:Se.position.y-ve+B[1]*(G-D)},K.push(Se)}if((ne||Q)&&(W.width=ne&&(!i.resizeDirection||i.resizeDirection==="horizontal")?$:x.width,W.height=Q&&(!i.resizeDirection||i.resizeDirection==="vertical")?G:x.height,x.width=W.width,x.height=W.height),A&&j.expandParent){const fe=B[0]*(W.width??0);W.x&&W.x<fe&&(x.x=fe,_.x=_.x-(W.x-fe));const ve=B[1]*(W.height??0);W.y&&W.y<ve&&(x.y=ve,_.y=_.y-(W.y-ve))}const te=QCe({width:x.width,prevWidth:J,height:x.height,prevHeight:D,affectsX:i.controlDirection.affectsX,affectsY:i.controlDirection.affectsY}),se={...x,direction:te};(b==null?void 0:b(L,se))!==!1&&(M=!0,S==null||S(L,se),r(W,K))}).on("end",L=>{M&&(w==null||w(L,{...x}),a==null||a({...x}),M=!1)});s.call(z)}function d(){s.on(".drag",null)}return{update:l,destroy:d}}var rj={exports:{}},aj={};/**
|
|
747
|
+
* @license React
|
|
748
|
+
* use-sync-external-store-shim/with-selector.production.js
|
|
749
|
+
*
|
|
750
|
+
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
751
|
+
*
|
|
752
|
+
* This source code is licensed under the MIT license found in the
|
|
753
|
+
* LICENSE file in the root directory of this source tree.
|
|
754
|
+
*/var WI;function a2e(){if(WI)return aj;WI=1;var e=iu(),t=Eq();function n(f,h){return f===h&&(f!==0||1/f===1/h)||f!==f&&h!==h}var r=typeof Object.is=="function"?Object.is:n,a=t.useSyncExternalStore,s=e.useRef,i=e.useEffect,l=e.useMemo,d=e.useDebugValue;return aj.useSyncExternalStoreWithSelector=function(f,h,p,g,y){var S=s(null);if(S.current===null){var w={hasValue:!1,value:null};S.current=w}else w=S.current;S=l(function(){function x(A){if(!_){if(_=!0,j=A,A=g(A),y!==void 0&&w.hasValue){var k=w.value;if(y(k,A))return C=k}return C=A}if(k=C,r(j,A))return k;var O=g(A);return y!==void 0&&y(k,O)?(j=A,k):(j=A,C=O)}var _=!1,j,C,T=p===void 0?null:p;return[function(){return x(h())},T===null?void 0:function(){return x(T())}]},[h,p,g,y]);var b=a(f,S[0],S[1]);return i(function(){w.hasValue=!0,w.value=b},[b]),d(b),b},aj}var GI;function s2e(){return GI||(GI=1,rj.exports=a2e()),rj.exports}var o2e=s2e();const i2e=zr(o2e),l2e={},KI=e=>{let t;const n=new Set,r=(h,p)=>{const g=typeof h=="function"?h(t):h;if(!Object.is(g,t)){const y=t;t=p??(typeof g!="object"||g===null)?g:Object.assign({},t,g),n.forEach(S=>S(t,y))}},a=()=>t,d={setState:r,getState:a,getInitialState:()=>f,subscribe:h=>(n.add(h),()=>n.delete(h)),destroy:()=>{(l2e?"production":void 0)!=="production"&&console.warn("[DEPRECATED] The `destroy` method will be unsupported in a future version. Instead use unsubscribe function returned by subscribe. Everything will be garbage-collected if store is garbage-collected."),n.clear()}},f=t=e(r,a,d);return d},c2e=e=>e?KI(e):KI,{useDebugValue:u2e}=Me,{useSyncExternalStoreWithSelector:d2e}=i2e,f2e=e=>e;function rB(e,t=f2e,n){const r=d2e(e.subscribe,e.getState,e.getServerState||e.getInitialState,t,n);return u2e(r),r}const YI=(e,t)=>{const n=c2e(e),r=(a,s=t)=>rB(n,a,s);return Object.assign(r,n),r},h2e=(e,t)=>e?YI(e,t):YI;function Vt(e,t){if(Object.is(e,t))return!0;if(typeof e!="object"||e===null||typeof t!="object"||t===null)return!1;if(e instanceof Map&&t instanceof Map){if(e.size!==t.size)return!1;for(const[r,a]of e)if(!Object.is(a,t.get(r)))return!1;return!0}if(e instanceof Set&&t instanceof Set){if(e.size!==t.size)return!1;for(const r of e)if(!t.has(r))return!1;return!0}const n=Object.keys(e);if(n.length!==Object.keys(t).length)return!1;for(const r of n)if(!Object.prototype.hasOwnProperty.call(t,r)||!Object.is(e[r],t[r]))return!1;return!0}const d0=N.createContext(null),p2e=d0.Provider,aB=Pa.error001();function st(e,t){const n=N.useContext(d0);if(n===null)throw new Error(aB);return rB(n,e,t)}function zt(){const e=N.useContext(d0);if(e===null)throw new Error(aB);return N.useMemo(()=>({getState:e.getState,setState:e.setState,subscribe:e.subscribe}),[e])}const XI={display:"none"},m2e={position:"absolute",width:1,height:1,margin:-1,border:0,padding:0,overflow:"hidden",clip:"rect(0px, 0px, 0px, 0px)",clipPath:"inset(100%)"},sB="react-flow__node-desc",oB="react-flow__edge-desc",g2e="react-flow__aria-live",y2e=e=>e.ariaLiveMessage,v2e=e=>e.ariaLabelConfig;function x2e({rfId:e}){const t=st(y2e);return c.jsx("div",{id:`${g2e}-${e}`,"aria-live":"assertive","aria-atomic":"true",style:m2e,children:t})}function b2e({rfId:e,disableKeyboardA11y:t}){const n=st(v2e);return c.jsxs(c.Fragment,{children:[c.jsx("div",{id:`${sB}-${e}`,style:XI,children:t?n["node.a11yDescription.default"]:n["node.a11yDescription.keyboardDisabled"]}),c.jsx("div",{id:`${oB}-${e}`,style:XI,children:n["edge.a11yDescription.default"]}),!t&&c.jsx(x2e,{rfId:e})]})}const Th=N.forwardRef(({position:e="top-left",children:t,className:n,style:r,...a},s)=>{const i=`${e}`.split("-");return c.jsx("div",{className:on(["react-flow__panel",n,...i]),style:r,ref:s,...a,children:t})});Th.displayName="Panel";function w2e({proOptions:e,position:t="bottom-right"}){return e!=null&&e.hideAttribution?null:c.jsx(Th,{position:t,className:"react-flow__attribution","data-message":"Please only hide this attribution when you are subscribed to React Flow Pro: https://pro.reactflow.dev",children:c.jsx("a",{href:"https://reactflow.dev",target:"_blank",rel:"noopener noreferrer","aria-label":"React Flow attribution",children:"React Flow"})})}const S2e=e=>{const t=[],n=[];for(const[,r]of e.nodeLookup)r.selected&&t.push(r.internals.userNode);for(const[,r]of e.edgeLookup)r.selected&&n.push(r);return{selectedNodes:t,selectedEdges:n}},hg=e=>e.id;function _2e(e,t){return Vt(e.selectedNodes.map(hg),t.selectedNodes.map(hg))&&Vt(e.selectedEdges.map(hg),t.selectedEdges.map(hg))}function N2e({onSelectionChange:e}){const t=zt(),{selectedNodes:n,selectedEdges:r}=st(S2e,_2e);return N.useEffect(()=>{const a={nodes:n,edges:r};e==null||e(a),t.getState().onSelectionChangeHandlers.forEach(s=>s(a))},[n,r,e]),null}const j2e=e=>!!e.onSelectionChangeHandlers;function C2e({onSelectionChange:e}){const t=st(j2e);return e||t?c.jsx(N2e,{onSelectionChange:e}):null}const iB=[0,0],E2e={x:0,y:0,zoom:1},T2e=["nodes","edges","defaultNodes","defaultEdges","onConnect","onConnectStart","onConnectEnd","onClickConnectStart","onClickConnectEnd","nodesDraggable","autoPanOnNodeFocus","nodesConnectable","nodesFocusable","edgesFocusable","edgesReconnectable","elevateNodesOnSelect","elevateEdgesOnSelect","minZoom","maxZoom","nodeExtent","onNodesChange","onEdgesChange","elementsSelectable","connectionMode","snapGrid","snapToGrid","translateExtent","connectOnClick","defaultEdgeOptions","fitView","fitViewOptions","onNodesDelete","onEdgesDelete","onDelete","onNodeDrag","onNodeDragStart","onNodeDragStop","onSelectionDrag","onSelectionDragStart","onSelectionDragStop","onMoveStart","onMove","onMoveEnd","noPanClassName","nodeOrigin","autoPanOnConnect","autoPanOnNodeDrag","onError","connectionRadius","isValidConnection","selectNodesOnDrag","nodeDragThreshold","connectionDragThreshold","onBeforeDelete","debug","autoPanSpeed","ariaLabelConfig"],ZI=[...T2e,"rfId"],A2e=e=>({setNodes:e.setNodes,setEdges:e.setEdges,setMinZoom:e.setMinZoom,setMaxZoom:e.setMaxZoom,setTranslateExtent:e.setTranslateExtent,setNodeExtent:e.setNodeExtent,reset:e.reset,setDefaultNodesAndEdges:e.setDefaultNodesAndEdges}),QI={translateExtent:Df,nodeOrigin:iB,minZoom:.5,maxZoom:2,elementsSelectable:!0,noPanClassName:"nopan",rfId:"1"};function R2e(e){const{setNodes:t,setEdges:n,setMinZoom:r,setMaxZoom:a,setTranslateExtent:s,setNodeExtent:i,reset:l,setDefaultNodesAndEdges:d}=st(A2e,Vt),f=zt();N.useEffect(()=>(d(e.defaultNodes,e.defaultEdges),()=>{h.current=QI,l()}),[]);const h=N.useRef(QI);return N.useEffect(()=>{for(const p of ZI){const g=e[p],y=h.current[p];g!==y&&(typeof e[p]>"u"||(p==="nodes"?t(g):p==="edges"?n(g):p==="minZoom"?r(g):p==="maxZoom"?a(g):p==="translateExtent"?s(g):p==="nodeExtent"?i(g):p==="ariaLabelConfig"?f.setState({ariaLabelConfig:gCe(g)}):p==="fitView"?f.setState({fitViewQueued:g}):p==="fitViewOptions"?f.setState({fitViewOptions:g}):f.setState({[p]:g})))}h.current=e},ZI.map(p=>e[p])),null}function JI(){return typeof window>"u"||!window.matchMedia?null:window.matchMedia("(prefers-color-scheme: dark)")}function k2e(e){var r;const[t,n]=N.useState(e==="system"?null:e);return N.useEffect(()=>{if(e!=="system"){n(e);return}const a=JI(),s=()=>n(a!=null&&a.matches?"dark":"light");return s(),a==null||a.addEventListener("change",s),()=>{a==null||a.removeEventListener("change",s)}},[e]),t!==null?t:(r=JI())!=null&&r.matches?"dark":"light"}const eL=typeof document<"u"?document:null;function zf(e=null,t={target:eL,actInsideInputWithModifier:!0}){const[n,r]=N.useState(!1),a=N.useRef(!1),s=N.useRef(new Set([])),[i,l]=N.useMemo(()=>{if(e!==null){const f=(Array.isArray(e)?e:[e]).filter(p=>typeof p=="string").map(p=>p.replace("+",`
|
|
755
|
+
`).replace(`
|
|
756
|
+
|
|
757
|
+
`,`
|
|
758
|
+
+`).split(`
|
|
759
|
+
`)),h=f.reduce((p,g)=>p.concat(...g),[]);return[f,h]}return[[],[]]},[e]);return N.useEffect(()=>{const d=(t==null?void 0:t.target)??eL,f=(t==null?void 0:t.actInsideInputWithModifier)??!0;if(e!==null){const h=y=>{var b,x;if(a.current=y.ctrlKey||y.metaKey||y.shiftKey||y.altKey,(!a.current||a.current&&!f)&&qH(y))return!1;const w=nL(y.code,l);if(s.current.add(y[w]),tL(i,s.current,!1)){const _=((x=(b=y.composedPath)==null?void 0:b.call(y))==null?void 0:x[0])||y.target,j=(_==null?void 0:_.nodeName)==="BUTTON"||(_==null?void 0:_.nodeName)==="A";t.preventDefault!==!1&&(a.current||!j)&&y.preventDefault(),r(!0)}},p=y=>{const S=nL(y.code,l);tL(i,s.current,!0)?(r(!1),s.current.clear()):s.current.delete(y[S]),y.key==="Meta"&&s.current.clear(),a.current=!1},g=()=>{s.current.clear(),r(!1)};return d==null||d.addEventListener("keydown",h),d==null||d.addEventListener("keyup",p),window.addEventListener("blur",g),window.addEventListener("contextmenu",g),()=>{d==null||d.removeEventListener("keydown",h),d==null||d.removeEventListener("keyup",p),window.removeEventListener("blur",g),window.removeEventListener("contextmenu",g)}}},[e,r]),n}function tL(e,t,n){return e.filter(r=>n||r.length===t.size).some(r=>r.every(a=>t.has(a)))}function nL(e,t){return t.includes(e)?"code":"key"}const O2e=()=>{const e=zt();return N.useMemo(()=>({zoomIn:t=>{const{panZoom:n}=e.getState();return n?n.scaleBy(1.2,{duration:t==null?void 0:t.duration}):Promise.resolve(!1)},zoomOut:t=>{const{panZoom:n}=e.getState();return n?n.scaleBy(1/1.2,{duration:t==null?void 0:t.duration}):Promise.resolve(!1)},zoomTo:(t,n)=>{const{panZoom:r}=e.getState();return r?r.scaleTo(t,{duration:n==null?void 0:n.duration}):Promise.resolve(!1)},getZoom:()=>e.getState().transform[2],setViewport:async(t,n)=>{const{transform:[r,a,s],panZoom:i}=e.getState();return i?(await i.setViewport({x:t.x??r,y:t.y??a,zoom:t.zoom??s},n),Promise.resolve(!0)):Promise.resolve(!1)},getViewport:()=>{const[t,n,r]=e.getState().transform;return{x:t,y:n,zoom:r}},setCenter:async(t,n,r)=>e.getState().setCenter(t,n,r),fitBounds:async(t,n)=>{const{width:r,height:a,minZoom:s,maxZoom:i,panZoom:l}=e.getState(),d=rT(t,r,a,s,i,(n==null?void 0:n.padding)??.1);return l?(await l.setViewport(d,{duration:n==null?void 0:n.duration,ease:n==null?void 0:n.ease,interpolate:n==null?void 0:n.interpolate}),Promise.resolve(!0)):Promise.resolve(!1)},screenToFlowPosition:(t,n={})=>{const{transform:r,snapGrid:a,snapToGrid:s,domNode:i}=e.getState();if(!i)return t;const{x:l,y:d}=i.getBoundingClientRect(),f={x:t.x-l,y:t.y-d},h=n.snapGrid??a,p=n.snapToGrid??s;return Eh(f,r,p,h)},flowToScreenPosition:t=>{const{transform:n,domNode:r}=e.getState();if(!r)return t;const{x:a,y:s}=r.getBoundingClientRect(),i=Ny(t,n);return{x:i.x+a,y:i.y+s}}}),[])};function lB(e,t){const n=[],r=new Map,a=[];for(const s of e)if(s.type==="add"){a.push(s);continue}else if(s.type==="remove"||s.type==="replace")r.set(s.id,[s]);else{const i=r.get(s.id);i?i.push(s):r.set(s.id,[s])}for(const s of t){const i=r.get(s.id);if(!i){n.push(s);continue}if(i[0].type==="remove")continue;if(i[0].type==="replace"){n.push({...i[0].item});continue}const l={...s};for(const d of i)M2e(d,l);n.push(l)}return a.length&&a.forEach(s=>{s.index!==void 0?n.splice(s.index,0,{...s.item}):n.push({...s.item})}),n}function M2e(e,t){switch(e.type){case"select":{t.selected=e.selected;break}case"position":{typeof e.position<"u"&&(t.position=e.position),typeof e.dragging<"u"&&(t.dragging=e.dragging);break}case"dimensions":{typeof e.dimensions<"u"&&(t.measured??(t.measured={}),t.measured.width=e.dimensions.width,t.measured.height=e.dimensions.height,e.setAttributes&&((e.setAttributes===!0||e.setAttributes==="width")&&(t.width=e.dimensions.width),(e.setAttributes===!0||e.setAttributes==="height")&&(t.height=e.dimensions.height))),typeof e.resizing=="boolean"&&(t.resizing=e.resizing);break}}}function cB(e,t){return lB(e,t)}function uB(e,t){return lB(e,t)}function Di(e,t){return{id:e,type:"select",selected:t}}function Tc(e,t=new Set,n=!1){const r=[];for(const[a,s]of e){const i=t.has(a);!(s.selected===void 0&&!i)&&s.selected!==i&&(n&&(s.selected=i),r.push(Di(s.id,i)))}return r}function rL({items:e=[],lookup:t}){var a;const n=[],r=new Map(e.map(s=>[s.id,s]));for(const[s,i]of e.entries()){const l=t.get(i.id),d=((a=l==null?void 0:l.internals)==null?void 0:a.userNode)??l;d!==void 0&&d!==i&&n.push({id:i.id,item:i,type:"replace"}),d===void 0&&n.push({item:i,type:"add",index:s})}for(const[s]of t)r.get(s)===void 0&&n.push({id:s,type:"remove"});return n}function aL(e){return{id:e.id,type:"remove"}}const sL=e=>oCe(e),D2e=e=>OH(e);function dB(e){return N.forwardRef(e)}const P2e=typeof window<"u"?N.useLayoutEffect:N.useEffect;function oL(e){const[t,n]=N.useState(BigInt(0)),[r]=N.useState(()=>$2e(()=>n(a=>a+BigInt(1))));return P2e(()=>{const a=r.get();a.length&&(e(a),r.reset())},[t]),r}function $2e(e){let t=[];return{get:()=>t,reset:()=>{t=[]},push:n=>{t.push(n),e()}}}const fB=N.createContext(null);function I2e({children:e}){const t=zt(),n=N.useCallback(l=>{const{nodes:d=[],setNodes:f,hasDefaultNodes:h,onNodesChange:p,nodeLookup:g,fitViewQueued:y}=t.getState();let S=d;for(const b of l)S=typeof b=="function"?b(S):b;const w=rL({items:S,lookup:g});h&&f(S),w.length>0?p==null||p(w):y&&window.requestAnimationFrame(()=>{const{fitViewQueued:b,nodes:x,setNodes:_}=t.getState();b&&_(x)})},[]),r=oL(n),a=N.useCallback(l=>{const{edges:d=[],setEdges:f,hasDefaultEdges:h,onEdgesChange:p,edgeLookup:g}=t.getState();let y=d;for(const S of l)y=typeof S=="function"?S(y):S;h?f(y):p&&p(rL({items:y,lookup:g}))},[]),s=oL(a),i=N.useMemo(()=>({nodeQueue:r,edgeQueue:s}),[]);return c.jsx(fB.Provider,{value:i,children:e})}function L2e(){const e=N.useContext(fB);if(!e)throw new Error("useBatchContext must be used within a BatchProvider");return e}const z2e=e=>!!e.panZoom;function f0(){const e=O2e(),t=zt(),n=L2e(),r=st(z2e),a=N.useMemo(()=>{const s=p=>t.getState().nodeLookup.get(p),i=p=>{n.nodeQueue.push(p)},l=p=>{n.edgeQueue.push(p)},d=p=>{var x,_;const{nodeLookup:g,nodeOrigin:y}=t.getState(),S=sL(p)?p:g.get(p.id),w=S.parentId?LH(S.position,S.measured,S.parentId,g,y):S.position,b={...S,position:w,width:((x=S.measured)==null?void 0:x.width)??S.width,height:((_=S.measured)==null?void 0:_.height)??S.height};return ru(b)},f=(p,g,y={replace:!1})=>{i(S=>S.map(w=>{if(w.id===p){const b=typeof g=="function"?g(w):g;return y.replace&&sL(b)?b:{...w,...b}}return w}))},h=(p,g,y={replace:!1})=>{l(S=>S.map(w=>{if(w.id===p){const b=typeof g=="function"?g(w):g;return y.replace&&D2e(b)?b:{...w,...b}}return w}))};return{getNodes:()=>t.getState().nodes.map(p=>({...p})),getNode:p=>{var g;return(g=s(p))==null?void 0:g.internals.userNode},getInternalNode:s,getEdges:()=>{const{edges:p=[]}=t.getState();return p.map(g=>({...g}))},getEdge:p=>t.getState().edgeLookup.get(p),setNodes:i,setEdges:l,addNodes:p=>{const g=Array.isArray(p)?p:[p];n.nodeQueue.push(y=>[...y,...g])},addEdges:p=>{const g=Array.isArray(p)?p:[p];n.edgeQueue.push(y=>[...y,...g])},toObject:()=>{const{nodes:p=[],edges:g=[],transform:y}=t.getState(),[S,w,b]=y;return{nodes:p.map(x=>({...x})),edges:g.map(x=>({...x})),viewport:{x:S,y:w,zoom:b}}},deleteElements:async({nodes:p=[],edges:g=[]})=>{const{nodes:y,edges:S,onNodesDelete:w,onEdgesDelete:b,triggerNodeChanges:x,triggerEdgeChanges:_,onDelete:j,onBeforeDelete:C}=t.getState(),{nodes:T,edges:A}=await dCe({nodesToRemove:p,edgesToRemove:g,nodes:y,edges:S,onBeforeDelete:C}),k=A.length>0,O=T.length>0;if(k){const M=A.map(aL);b==null||b(A),_(M)}if(O){const M=T.map(aL);w==null||w(T),x(M)}return(O||k)&&(j==null||j({nodes:T,edges:A})),{deletedNodes:T,deletedEdges:A}},getIntersectingNodes:(p,g=!0,y)=>{const S=MI(p),w=S?p:d(p),b=y!==void 0;return w?(y||t.getState().nodes).filter(x=>{const _=t.getState().nodeLookup.get(x.id);if(_&&!S&&(x.id===p.id||!_.internals.positionAbsolute))return!1;const j=ru(b?x:_),C=$f(j,w);return g&&C>0||C>=j.width*j.height||C>=w.width*w.height}):[]},isNodeIntersecting:(p,g,y=!0)=>{const w=MI(p)?p:d(p);if(!w)return!1;const b=$f(w,g);return y&&b>0||b>=g.width*g.height||b>=w.width*w.height},updateNode:f,updateNodeData:(p,g,y={replace:!1})=>{f(p,S=>{const w=typeof g=="function"?g(S):g;return y.replace?{...S,data:w}:{...S,data:{...S.data,...w}}},y)},updateEdge:h,updateEdgeData:(p,g,y={replace:!1})=>{h(p,S=>{const w=typeof g=="function"?g(S):g;return y.replace?{...S,data:w}:{...S,data:{...S.data,...w}}},y)},getNodesBounds:p=>{const{nodeLookup:g,nodeOrigin:y}=t.getState();return iCe(p,{nodeLookup:g,nodeOrigin:y})},getHandleConnections:({type:p,id:g,nodeId:y})=>{var S;return Array.from(((S=t.getState().connectionLookup.get(`${y}-${p}${g?`-${g}`:""}`))==null?void 0:S.values())??[])},getNodeConnections:({type:p,handleId:g,nodeId:y})=>{var S;return Array.from(((S=t.getState().connectionLookup.get(`${y}${p?g?`-${p}-${g}`:`-${p}`:""}`))==null?void 0:S.values())??[])},fitView:async p=>{const g=t.getState().fitViewResolver??mCe();return t.setState({fitViewQueued:!0,fitViewOptions:p,fitViewResolver:g}),n.nodeQueue.push(y=>[...y]),g.promise}}},[]);return N.useMemo(()=>({...a,...e,viewportInitialized:r}),[r])}const iL=e=>e.selected,q2e=typeof window<"u"?window:void 0;function F2e({deleteKeyCode:e,multiSelectionKeyCode:t}){const n=zt(),{deleteElements:r}=f0(),a=zf(e,{actInsideInputWithModifier:!1}),s=zf(t,{target:q2e});N.useEffect(()=>{if(a){const{edges:i,nodes:l}=n.getState();r({nodes:l.filter(iL),edges:i.filter(iL)}),n.setState({nodesSelectionActive:!1})}},[a]),N.useEffect(()=>{n.setState({multiSelectionActive:s})},[s])}function U2e(e){const t=zt();N.useEffect(()=>{const n=()=>{var a,s,i,l;if(!e.current||!(((s=(a=e.current).checkVisibility)==null?void 0:s.call(a))??!0))return!1;const r=aT(e.current);(r.height===0||r.width===0)&&((l=(i=t.getState()).onError)==null||l.call(i,"004",Pa.error004())),t.setState({width:r.width||500,height:r.height||500})};if(e.current){n(),window.addEventListener("resize",n);const r=new ResizeObserver(()=>n());return r.observe(e.current),()=>{window.removeEventListener("resize",n),r&&e.current&&r.unobserve(e.current)}}},[])}const h0={position:"absolute",width:"100%",height:"100%",top:0,left:0},H2e=e=>({userSelectionActive:e.userSelectionActive,lib:e.lib,connectionInProgress:e.connection.inProgress});function B2e({onPaneContextMenu:e,zoomOnScroll:t=!0,zoomOnPinch:n=!0,panOnScroll:r=!1,panOnScrollSpeed:a=.5,panOnScrollMode:s=Ui.Free,zoomOnDoubleClick:i=!0,panOnDrag:l=!0,defaultViewport:d,translateExtent:f,minZoom:h,maxZoom:p,zoomActivationKeyCode:g,preventScrolling:y=!0,children:S,noWheelClassName:w,noPanClassName:b,onViewportChange:x,isControlledViewport:_,paneClickDistance:j,selectionOnDrag:C}){const T=zt(),A=N.useRef(null),{userSelectionActive:k,lib:O,connectionInProgress:M}=st(H2e,Vt),z=zf(g),L=N.useRef();U2e(A);const U=N.useCallback(F=>{x==null||x({x:F[0],y:F[1],zoom:F[2]}),_||T.setState({transform:F})},[x,_]);return N.useEffect(()=>{if(A.current){L.current=ZCe({domNode:A.current,minZoom:h,maxZoom:p,translateExtent:f,viewport:d,onDraggingChange:P=>T.setState({paneDragging:P}),onPanZoomStart:(P,K)=>{const{onViewportChangeStart:H,onMoveStart:Z}=T.getState();Z==null||Z(P,K),H==null||H(K)},onPanZoom:(P,K)=>{const{onViewportChange:H,onMove:Z}=T.getState();Z==null||Z(P,K),H==null||H(K)},onPanZoomEnd:(P,K)=>{const{onViewportChangeEnd:H,onMoveEnd:Z}=T.getState();Z==null||Z(P,K),H==null||H(K)}});const{x:F,y:q,zoom:V}=L.current.getViewport();return T.setState({panZoom:L.current,transform:[F,q,V],domNode:A.current.closest(".react-flow")}),()=>{var P;(P=L.current)==null||P.destroy()}}},[]),N.useEffect(()=>{var F;(F=L.current)==null||F.update({onPaneContextMenu:e,zoomOnScroll:t,zoomOnPinch:n,panOnScroll:r,panOnScrollSpeed:a,panOnScrollMode:s,zoomOnDoubleClick:i,panOnDrag:l,zoomActivationKeyPressed:z,preventScrolling:y,noPanClassName:b,userSelectionActive:k,noWheelClassName:w,lib:O,onTransformChange:U,connectionInProgress:M,selectionOnDrag:C,paneClickDistance:j})},[e,t,n,r,a,s,i,l,z,y,b,k,w,O,U,M,C,j]),c.jsx("div",{className:"react-flow__renderer",ref:A,style:h0,children:S})}const V2e=e=>({userSelectionActive:e.userSelectionActive,userSelectionRect:e.userSelectionRect});function W2e(){const{userSelectionActive:e,userSelectionRect:t}=st(V2e,Vt);return e&&t?c.jsx("div",{className:"react-flow__selection react-flow__container",style:{width:t.width,height:t.height,transform:`translate(${t.x}px, ${t.y}px)`}}):null}const sj=(e,t)=>n=>{n.target===t.current&&(e==null||e(n))},G2e=e=>({userSelectionActive:e.userSelectionActive,elementsSelectable:e.elementsSelectable,connectionInProgress:e.connection.inProgress,dragging:e.paneDragging});function K2e({isSelecting:e,selectionKeyPressed:t,selectionMode:n=Pf.Full,panOnDrag:r,paneClickDistance:a,selectionOnDrag:s,onSelectionStart:i,onSelectionEnd:l,onPaneClick:d,onPaneContextMenu:f,onPaneScroll:h,onPaneMouseEnter:p,onPaneMouseMove:g,onPaneMouseLeave:y,children:S}){const w=zt(),{userSelectionActive:b,elementsSelectable:x,dragging:_,connectionInProgress:j}=st(G2e,Vt),C=x&&(e||b),T=N.useRef(null),A=N.useRef(),k=N.useRef(new Set),O=N.useRef(new Set),M=N.useRef(!1),z=H=>{if(M.current||j){M.current=!1;return}d==null||d(H),w.getState().resetSelectedElements(),w.setState({nodesSelectionActive:!1})},L=H=>{if(Array.isArray(r)&&(r!=null&&r.includes(2))){H.preventDefault();return}f==null||f(H)},U=h?H=>h(H):void 0,F=H=>{M.current&&(H.stopPropagation(),M.current=!1)},q=H=>{var G,ee;const{domNode:Z}=w.getState();if(A.current=Z==null?void 0:Z.getBoundingClientRect(),!A.current)return;const J=H.target===T.current;if(!J&&!!H.target.closest(".nokey")||!e||!(s&&J||t)||H.button!==0||!H.isPrimary)return;(ee=(G=H.target)==null?void 0:G.setPointerCapture)==null||ee.call(G,H.pointerId),M.current=!1;const{x:B,y:$}=aa(H.nativeEvent,A.current);w.setState({userSelectionRect:{width:0,height:0,startX:B,startY:$,x:B,y:$}}),J||(H.stopPropagation(),H.preventDefault())},V=H=>{const{userSelectionRect:Z,transform:J,nodeLookup:D,edgeLookup:W,connectionLookup:B,triggerNodeChanges:$,triggerEdgeChanges:G,defaultEdgeOptions:ee,resetSelectedElements:re}=w.getState();if(!A.current||!Z)return;const{x:ne,y:Q}=aa(H.nativeEvent,A.current),{startX:ae,startY:Y}=Z;if(!M.current){const ve=t?0:a;if(Math.hypot(ne-ae,Q-Y)<=ve)return;re(),i==null||i(H)}M.current=!0;const te={startX:ae,startY:Y,x:ne<ae?ne:ae,y:Q<Y?Q:Y,width:Math.abs(ne-ae),height:Math.abs(Q-Y)},se=k.current,le=O.current;k.current=new Set(nT(D,te,J,n===Pf.Partial,!0).map(ve=>ve.id)),O.current=new Set;const fe=(ee==null?void 0:ee.selectable)??!0;for(const ve of k.current){const Se=B.get(ve);if(Se)for(const{edgeId:Re}of Se.values()){const De=W.get(Re);De&&(De.selectable??fe)&&O.current.add(Re)}}if(!DI(se,k.current)){const ve=Tc(D,k.current,!0);$(ve)}if(!DI(le,O.current)){const ve=Tc(W,O.current);G(ve)}w.setState({userSelectionRect:te,userSelectionActive:!0,nodesSelectionActive:!1})},P=H=>{var Z,J;H.button===0&&((J=(Z=H.target)==null?void 0:Z.releasePointerCapture)==null||J.call(Z,H.pointerId),!b&&H.target===T.current&&w.getState().userSelectionRect&&(z==null||z(H)),w.setState({userSelectionActive:!1,userSelectionRect:null}),M.current&&(l==null||l(H),w.setState({nodesSelectionActive:k.current.size>0})))},K=r===!0||Array.isArray(r)&&r.includes(0);return c.jsxs("div",{className:on(["react-flow__pane",{draggable:K,dragging:_,selection:e}]),onClick:C?void 0:sj(z,T),onContextMenu:sj(L,T),onWheel:sj(U,T),onPointerEnter:C?void 0:p,onPointerMove:C?V:g,onPointerUp:C?P:void 0,onPointerDownCapture:C?q:void 0,onClickCapture:C?F:void 0,onPointerLeave:y,ref:T,style:h0,children:[S,c.jsx(W2e,{})]})}function MC({id:e,store:t,unselect:n=!1,nodeRef:r}){const{addSelectedNodes:a,unselectNodesAndEdges:s,multiSelectionActive:i,nodeLookup:l,onError:d}=t.getState(),f=l.get(e);if(!f){d==null||d("012",Pa.error012(e));return}t.setState({nodesSelectionActive:!1}),f.selected?(n||f.selected&&i)&&(s({nodes:[f],edges:[]}),requestAnimationFrame(()=>{var h;return(h=r==null?void 0:r.current)==null?void 0:h.blur()})):a([e])}function hB({nodeRef:e,disabled:t=!1,noDragClassName:n,handleSelector:r,nodeId:a,isSelectable:s,nodeClickDistance:i}){const l=zt(),[d,f]=N.useState(!1),h=N.useRef();return N.useEffect(()=>{h.current=ICe({getStoreItems:()=>l.getState(),onNodeMouseDown:p=>{MC({id:p,store:l,nodeRef:e})},onDragStart:()=>{f(!0)},onDragStop:()=>{f(!1)}})},[]),N.useEffect(()=>{var p,g;if(t)(p=h.current)==null||p.destroy();else if(e.current)return(g=h.current)==null||g.update({noDragClassName:n,handleSelector:r,domNode:e.current,isSelectable:s,nodeId:a,nodeClickDistance:i}),()=>{var y;(y=h.current)==null||y.destroy()}},[n,r,t,s,e,a]),d}const Y2e=e=>t=>t.selected&&(t.draggable||e&&typeof t.draggable>"u");function pB(){const e=zt();return N.useCallback(n=>{const{nodeExtent:r,snapToGrid:a,snapGrid:s,nodesDraggable:i,onError:l,updateNodePositions:d,nodeLookup:f,nodeOrigin:h}=e.getState(),p=new Map,g=Y2e(i),y=a?s[0]:5,S=a?s[1]:5,w=n.direction.x*y*n.factor,b=n.direction.y*S*n.factor;for(const[,x]of f){if(!g(x))continue;let _={x:x.internals.positionAbsolute.x+w,y:x.internals.positionAbsolute.y+b};a&&(_=Ch(_,s));const{position:j,positionAbsolute:C}=MH({nodeId:x.id,nextPosition:_,nodeLookup:f,nodeExtent:r,nodeOrigin:h,onError:l});x.position=j,x.internals.positionAbsolute=C,p.set(x.id,x)}d(p)},[])}const uT=N.createContext(null),X2e=uT.Provider;uT.Consumer;const mB=()=>N.useContext(uT),Z2e=e=>({connectOnClick:e.connectOnClick,noPanClassName:e.noPanClassName,rfId:e.rfId}),Q2e=(e,t,n)=>r=>{const{connectionClickStartHandle:a,connectionMode:s,connection:i}=r,{fromHandle:l,toHandle:d,isValid:f}=i,h=(d==null?void 0:d.nodeId)===e&&(d==null?void 0:d.id)===t&&(d==null?void 0:d.type)===n;return{connectingFrom:(l==null?void 0:l.nodeId)===e&&(l==null?void 0:l.id)===t&&(l==null?void 0:l.type)===n,connectingTo:h,clickConnecting:(a==null?void 0:a.nodeId)===e&&(a==null?void 0:a.id)===t&&(a==null?void 0:a.type)===n,isPossibleEndHandle:s===tu.Strict?(l==null?void 0:l.type)!==n:e!==(l==null?void 0:l.nodeId)||t!==(l==null?void 0:l.id),connectionInProcess:!!l,clickConnectionInProcess:!!a,valid:h&&f}};function J2e({type:e="source",position:t=Te.Top,isValidConnection:n,isConnectable:r=!0,isConnectableStart:a=!0,isConnectableEnd:s=!0,id:i,onConnect:l,children:d,className:f,onMouseDown:h,onTouchStart:p,...g},y){var V,P;const S=i||null,w=e==="target",b=zt(),x=mB(),{connectOnClick:_,noPanClassName:j,rfId:C}=st(Z2e,Vt),{connectingFrom:T,connectingTo:A,clickConnecting:k,isPossibleEndHandle:O,connectionInProcess:M,clickConnectionInProcess:z,valid:L}=st(Q2e(x,S,e),Vt);x||(P=(V=b.getState()).onError)==null||P.call(V,"010",Pa.error010());const U=K=>{const{defaultEdgeOptions:H,onConnect:Z,hasDefaultEdges:J}=b.getState(),D={...H,...K};if(J){const{edges:W,setEdges:B}=b.getState();B(BH(D,W))}Z==null||Z(D),l==null||l(D)},F=K=>{if(!x)return;const H=FH(K.nativeEvent);if(a&&(H&&K.button===0||!H)){const Z=b.getState();OC.onPointerDown(K.nativeEvent,{handleDomNode:K.currentTarget,autoPanOnConnect:Z.autoPanOnConnect,connectionMode:Z.connectionMode,connectionRadius:Z.connectionRadius,domNode:Z.domNode,nodeLookup:Z.nodeLookup,lib:Z.lib,isTarget:w,handleId:S,nodeId:x,flowId:Z.rfId,panBy:Z.panBy,cancelConnection:Z.cancelConnection,onConnectStart:Z.onConnectStart,onConnectEnd:Z.onConnectEnd,updateConnection:Z.updateConnection,onConnect:U,isValidConnection:n||Z.isValidConnection,getTransform:()=>b.getState().transform,getFromHandle:()=>b.getState().connection.fromHandle,autoPanSpeed:Z.autoPanSpeed,dragThreshold:Z.connectionDragThreshold})}H?h==null||h(K):p==null||p(K)},q=K=>{const{onClickConnectStart:H,onClickConnectEnd:Z,connectionClickStartHandle:J,connectionMode:D,isValidConnection:W,lib:B,rfId:$,nodeLookup:G,connection:ee}=b.getState();if(!x||!J&&!a)return;if(!J){H==null||H(K.nativeEvent,{nodeId:x,handleId:S,handleType:e}),b.setState({connectionClickStartHandle:{nodeId:x,type:e,id:S}});return}const re=zH(K.target),ne=n||W,{connection:Q,isValid:ae}=OC.isValid(K.nativeEvent,{handle:{nodeId:x,id:S,type:e},connectionMode:D,fromNodeId:J.nodeId,fromHandleId:J.id||null,fromType:J.type,isValidConnection:ne,flowId:$,doc:re,lib:B,nodeLookup:G});ae&&Q&&U(Q);const Y=structuredClone(ee);delete Y.inProgress,Y.toPosition=Y.toHandle?Y.toHandle.position:null,Z==null||Z(K,Y),b.setState({connectionClickStartHandle:null})};return c.jsx("div",{"data-handleid":S,"data-nodeid":x,"data-handlepos":t,"data-id":`${C}-${x}-${S}-${e}`,className:on(["react-flow__handle",`react-flow__handle-${t}`,"nodrag",j,f,{source:!w,target:w,connectable:r,connectablestart:a,connectableend:s,clickconnecting:k,connectingfrom:T,connectingto:A,valid:L,connectionindicator:r&&(!M||O)&&(M||z?s:a)}]),onMouseDown:F,onTouchStart:F,onClick:_?q:void 0,ref:y,...g,children:d})}const Go=N.memo(dB(J2e));function eEe({data:e,isConnectable:t,sourcePosition:n=Te.Bottom}){return c.jsxs(c.Fragment,{children:[e==null?void 0:e.label,c.jsx(Go,{type:"source",position:n,isConnectable:t})]})}function tEe({data:e,isConnectable:t,targetPosition:n=Te.Top,sourcePosition:r=Te.Bottom}){return c.jsxs(c.Fragment,{children:[c.jsx(Go,{type:"target",position:n,isConnectable:t}),e==null?void 0:e.label,c.jsx(Go,{type:"source",position:r,isConnectable:t})]})}function nEe(){return null}function rEe({data:e,isConnectable:t,targetPosition:n=Te.Top}){return c.jsxs(c.Fragment,{children:[c.jsx(Go,{type:"target",position:n,isConnectable:t}),e==null?void 0:e.label]})}const jy={ArrowUp:{x:0,y:-1},ArrowDown:{x:0,y:1},ArrowLeft:{x:-1,y:0},ArrowRight:{x:1,y:0}},lL={input:eEe,default:tEe,output:rEe,group:nEe};function aEe(e){var t,n,r,a;return e.internals.handleBounds===void 0?{width:e.width??e.initialWidth??((t=e.style)==null?void 0:t.width),height:e.height??e.initialHeight??((n=e.style)==null?void 0:n.height)}:{width:e.width??((r=e.style)==null?void 0:r.width),height:e.height??((a=e.style)==null?void 0:a.height)}}const sEe=e=>{const{width:t,height:n,x:r,y:a}=jh(e.nodeLookup,{filter:s=>!!s.selected});return{width:ra(t)?t:null,height:ra(n)?n:null,userSelectionActive:e.userSelectionActive,transformString:`translate(${e.transform[0]}px,${e.transform[1]}px) scale(${e.transform[2]}) translate(${r}px,${a}px)`}};function oEe({onSelectionContextMenu:e,noPanClassName:t,disableKeyboardA11y:n}){const r=zt(),{width:a,height:s,transformString:i,userSelectionActive:l}=st(sEe,Vt),d=pB(),f=N.useRef(null);if(N.useEffect(()=>{var g;n||(g=f.current)==null||g.focus({preventScroll:!0})},[n]),hB({nodeRef:f}),l||!a||!s)return null;const h=e?g=>{const y=r.getState().nodes.filter(S=>S.selected);e(g,y)}:void 0,p=g=>{Object.prototype.hasOwnProperty.call(jy,g.key)&&(g.preventDefault(),d({direction:jy[g.key],factor:g.shiftKey?4:1}))};return c.jsx("div",{className:on(["react-flow__nodesselection","react-flow__container",t]),style:{transform:i},children:c.jsx("div",{ref:f,className:"react-flow__nodesselection-rect",onContextMenu:h,tabIndex:n?void 0:-1,onKeyDown:n?void 0:p,style:{width:a,height:s}})})}const cL=typeof window<"u"?window:void 0,iEe=e=>({nodesSelectionActive:e.nodesSelectionActive,userSelectionActive:e.userSelectionActive});function gB({children:e,onPaneClick:t,onPaneMouseEnter:n,onPaneMouseMove:r,onPaneMouseLeave:a,onPaneContextMenu:s,onPaneScroll:i,paneClickDistance:l,deleteKeyCode:d,selectionKeyCode:f,selectionOnDrag:h,selectionMode:p,onSelectionStart:g,onSelectionEnd:y,multiSelectionKeyCode:S,panActivationKeyCode:w,zoomActivationKeyCode:b,elementsSelectable:x,zoomOnScroll:_,zoomOnPinch:j,panOnScroll:C,panOnScrollSpeed:T,panOnScrollMode:A,zoomOnDoubleClick:k,panOnDrag:O,defaultViewport:M,translateExtent:z,minZoom:L,maxZoom:U,preventScrolling:F,onSelectionContextMenu:q,noWheelClassName:V,noPanClassName:P,disableKeyboardA11y:K,onViewportChange:H,isControlledViewport:Z}){const{nodesSelectionActive:J,userSelectionActive:D}=st(iEe),W=zf(f,{target:cL}),B=zf(w,{target:cL}),$=B||O,G=B||C,ee=h&&$!==!0,re=W||D||ee;return F2e({deleteKeyCode:d,multiSelectionKeyCode:S}),c.jsx(B2e,{onPaneContextMenu:s,elementsSelectable:x,zoomOnScroll:_,zoomOnPinch:j,panOnScroll:G,panOnScrollSpeed:T,panOnScrollMode:A,zoomOnDoubleClick:k,panOnDrag:!W&&$,defaultViewport:M,translateExtent:z,minZoom:L,maxZoom:U,zoomActivationKeyCode:b,preventScrolling:F,noWheelClassName:V,noPanClassName:P,onViewportChange:H,isControlledViewport:Z,paneClickDistance:l,selectionOnDrag:ee,children:c.jsxs(K2e,{onSelectionStart:g,onSelectionEnd:y,onPaneClick:t,onPaneMouseEnter:n,onPaneMouseMove:r,onPaneMouseLeave:a,onPaneContextMenu:s,onPaneScroll:i,panOnDrag:$,isSelecting:!!re,selectionMode:p,selectionKeyPressed:W,paneClickDistance:l,selectionOnDrag:ee,children:[e,J&&c.jsx(oEe,{onSelectionContextMenu:q,noPanClassName:P,disableKeyboardA11y:K})]})})}gB.displayName="FlowRenderer";const lEe=N.memo(gB),cEe=e=>t=>e?nT(t.nodeLookup,{x:0,y:0,width:t.width,height:t.height},t.transform,!0).map(n=>n.id):Array.from(t.nodeLookup.keys());function uEe(e){return st(N.useCallback(cEe(e),[e]),Vt)}const dEe=e=>e.updateNodeInternals;function fEe(){const e=st(dEe),[t]=N.useState(()=>typeof ResizeObserver>"u"?null:new ResizeObserver(n=>{const r=new Map;n.forEach(a=>{const s=a.target.getAttribute("data-id");r.set(s,{id:s,nodeElement:a.target,force:!0})}),e(r)}));return N.useEffect(()=>()=>{t==null||t.disconnect()},[t]),t}function hEe({node:e,nodeType:t,hasDimensions:n,resizeObserver:r}){const a=zt(),s=N.useRef(null),i=N.useRef(null),l=N.useRef(e.sourcePosition),d=N.useRef(e.targetPosition),f=N.useRef(t),h=n&&!!e.internals.handleBounds;return N.useEffect(()=>{s.current&&!e.hidden&&(!h||i.current!==s.current)&&(i.current&&(r==null||r.unobserve(i.current)),r==null||r.observe(s.current),i.current=s.current)},[h,e.hidden]),N.useEffect(()=>()=>{i.current&&(r==null||r.unobserve(i.current),i.current=null)},[]),N.useEffect(()=>{if(s.current){const p=f.current!==t,g=l.current!==e.sourcePosition,y=d.current!==e.targetPosition;(p||g||y)&&(f.current=t,l.current=e.sourcePosition,d.current=e.targetPosition,a.getState().updateNodeInternals(new Map([[e.id,{id:e.id,nodeElement:s.current,force:!0}]])))}},[e.id,t,e.sourcePosition,e.targetPosition]),s}function pEe({id:e,onClick:t,onMouseEnter:n,onMouseMove:r,onMouseLeave:a,onContextMenu:s,onDoubleClick:i,nodesDraggable:l,elementsSelectable:d,nodesConnectable:f,nodesFocusable:h,resizeObserver:p,noDragClassName:g,noPanClassName:y,disableKeyboardA11y:S,rfId:w,nodeTypes:b,nodeClickDistance:x,onError:_}){const{node:j,internals:C,isParent:T}=st(ne=>{const Q=ne.nodeLookup.get(e),ae=ne.parentLookup.has(e);return{node:Q,internals:Q.internals,isParent:ae}},Vt);let A=j.type||"default",k=(b==null?void 0:b[A])||lL[A];k===void 0&&(_==null||_("003",Pa.error003(A)),A="default",k=(b==null?void 0:b.default)||lL.default);const O=!!(j.draggable||l&&typeof j.draggable>"u"),M=!!(j.selectable||d&&typeof j.selectable>"u"),z=!!(j.connectable||f&&typeof j.connectable>"u"),L=!!(j.focusable||h&&typeof j.focusable>"u"),U=zt(),F=IH(j),q=hEe({node:j,nodeType:A,hasDimensions:F,resizeObserver:p}),V=hB({nodeRef:q,disabled:j.hidden||!O,noDragClassName:g,handleSelector:j.dragHandle,nodeId:e,isSelectable:M,nodeClickDistance:x}),P=pB();if(j.hidden)return null;const K=Us(j),H=aEe(j),Z=M||O||t||n||r||a,J=n?ne=>n(ne,{...C.userNode}):void 0,D=r?ne=>r(ne,{...C.userNode}):void 0,W=a?ne=>a(ne,{...C.userNode}):void 0,B=s?ne=>s(ne,{...C.userNode}):void 0,$=i?ne=>i(ne,{...C.userNode}):void 0,G=ne=>{const{selectNodesOnDrag:Q,nodeDragThreshold:ae}=U.getState();M&&(!Q||!O||ae>0)&&MC({id:e,store:U,nodeRef:q}),t&&t(ne,{...C.userNode})},ee=ne=>{if(!(qH(ne.nativeEvent)||S)){if(TH.includes(ne.key)&&M){const Q=ne.key==="Escape";MC({id:e,store:U,unselect:Q,nodeRef:q})}else if(O&&j.selected&&Object.prototype.hasOwnProperty.call(jy,ne.key)){ne.preventDefault();const{ariaLabelConfig:Q}=U.getState();U.setState({ariaLiveMessage:Q["node.a11yDescription.ariaLiveMessage"]({direction:ne.key.replace("Arrow","").toLowerCase(),x:~~C.positionAbsolute.x,y:~~C.positionAbsolute.y})}),P({direction:jy[ne.key],factor:ne.shiftKey?4:1})}}},re=()=>{var le;if(S||!((le=q.current)!=null&&le.matches(":focus-visible")))return;const{transform:ne,width:Q,height:ae,autoPanOnNodeFocus:Y,setCenter:te}=U.getState();if(!Y)return;nT(new Map([[e,j]]),{x:0,y:0,width:Q,height:ae},ne,!0).length>0||te(j.position.x+K.width/2,j.position.y+K.height/2,{zoom:ne[2]})};return c.jsx("div",{className:on(["react-flow__node",`react-flow__node-${A}`,{[y]:O},j.className,{selected:j.selected,selectable:M,parent:T,draggable:O,dragging:V}]),ref:q,style:{zIndex:C.z,transform:`translate(${C.positionAbsolute.x}px,${C.positionAbsolute.y}px)`,pointerEvents:Z?"all":"none",visibility:F?"visible":"hidden",...j.style,...H},"data-id":e,"data-testid":`rf__node-${e}`,onMouseEnter:J,onMouseMove:D,onMouseLeave:W,onContextMenu:B,onClick:G,onDoubleClick:$,onKeyDown:L?ee:void 0,tabIndex:L?0:void 0,onFocus:L?re:void 0,role:j.ariaRole??(L?"group":void 0),"aria-roledescription":"node","aria-describedby":S?void 0:`${sB}-${w}`,"aria-label":j.ariaLabel,...j.domAttributes,children:c.jsx(X2e,{value:e,children:c.jsx(k,{id:e,data:j.data,type:A,positionAbsoluteX:C.positionAbsolute.x,positionAbsoluteY:C.positionAbsolute.y,selected:j.selected??!1,selectable:M,draggable:O,deletable:j.deletable??!0,isConnectable:z,sourcePosition:j.sourcePosition,targetPosition:j.targetPosition,dragging:V,dragHandle:j.dragHandle,zIndex:C.z,parentId:j.parentId,...K})})})}var mEe=N.memo(pEe);const gEe=e=>({nodesDraggable:e.nodesDraggable,nodesConnectable:e.nodesConnectable,nodesFocusable:e.nodesFocusable,elementsSelectable:e.elementsSelectable,onError:e.onError});function yB(e){const{nodesDraggable:t,nodesConnectable:n,nodesFocusable:r,elementsSelectable:a,onError:s}=st(gEe,Vt),i=uEe(e.onlyRenderVisibleElements),l=fEe();return c.jsx("div",{className:"react-flow__nodes",style:h0,children:i.map(d=>c.jsx(mEe,{id:d,nodeTypes:e.nodeTypes,nodeExtent:e.nodeExtent,onClick:e.onNodeClick,onMouseEnter:e.onNodeMouseEnter,onMouseMove:e.onNodeMouseMove,onMouseLeave:e.onNodeMouseLeave,onContextMenu:e.onNodeContextMenu,onDoubleClick:e.onNodeDoubleClick,noDragClassName:e.noDragClassName,noPanClassName:e.noPanClassName,rfId:e.rfId,disableKeyboardA11y:e.disableKeyboardA11y,resizeObserver:l,nodesDraggable:t,nodesConnectable:n,nodesFocusable:r,elementsSelectable:a,nodeClickDistance:e.nodeClickDistance,onError:s},d))})}yB.displayName="NodeRenderer";const yEe=N.memo(yB);function vEe(e){return st(N.useCallback(n=>{if(!e)return n.edges.map(a=>a.id);const r=[];if(n.width&&n.height)for(const a of n.edges){const s=n.nodeLookup.get(a.source),i=n.nodeLookup.get(a.target);s&&i&&xCe({sourceNode:s,targetNode:i,width:n.width,height:n.height,transform:n.transform})&&r.push(a.id)}return r},[e]),Vt)}const xEe=({color:e="none",strokeWidth:t=1})=>{const n={strokeWidth:t,...e&&{stroke:e}};return c.jsx("polyline",{className:"arrow",style:n,strokeLinecap:"round",fill:"none",strokeLinejoin:"round",points:"-5,-4 0,0 -5,4"})},bEe=({color:e="none",strokeWidth:t=1})=>{const n={strokeWidth:t,...e&&{stroke:e,fill:e}};return c.jsx("polyline",{className:"arrowclosed",style:n,strokeLinecap:"round",strokeLinejoin:"round",points:"-5,-4 0,0 -5,4 -5,-4"})},uL={[Wo.Arrow]:xEe,[Wo.ArrowClosed]:bEe};function wEe(e){const t=zt();return N.useMemo(()=>{var a,s;return Object.prototype.hasOwnProperty.call(uL,e)?uL[e]:((s=(a=t.getState()).onError)==null||s.call(a,"009",Pa.error009(e)),null)},[e])}const SEe=({id:e,type:t,color:n,width:r=12.5,height:a=12.5,markerUnits:s="strokeWidth",strokeWidth:i,orient:l="auto-start-reverse"})=>{const d=wEe(t);return d?c.jsx("marker",{className:"react-flow__arrowhead",id:e,markerWidth:`${r}`,markerHeight:`${a}`,viewBox:"-10 -10 20 20",markerUnits:s,orient:l,refX:"0",refY:"0",children:c.jsx(d,{color:n,strokeWidth:i})}):null},vB=({defaultColor:e,rfId:t})=>{const n=st(s=>s.edges),r=st(s=>s.defaultEdgeOptions),a=N.useMemo(()=>CCe(n,{id:t,defaultColor:e,defaultMarkerStart:r==null?void 0:r.markerStart,defaultMarkerEnd:r==null?void 0:r.markerEnd}),[n,r,t,e]);return a.length?c.jsx("svg",{className:"react-flow__marker","aria-hidden":"true",children:c.jsx("defs",{children:a.map(s=>c.jsx(SEe,{id:s.id,type:s.type,color:s.color,width:s.width,height:s.height,markerUnits:s.markerUnits,strokeWidth:s.strokeWidth,orient:s.orient},s.id))})}):null};vB.displayName="MarkerDefinitions";var _Ee=N.memo(vB);function xB({x:e,y:t,label:n,labelStyle:r,labelShowBg:a=!0,labelBgStyle:s,labelBgPadding:i=[2,4],labelBgBorderRadius:l=2,children:d,className:f,...h}){const[p,g]=N.useState({x:1,y:0,width:0,height:0}),y=on(["react-flow__edge-textwrapper",f]),S=N.useRef(null);return N.useEffect(()=>{if(S.current){const w=S.current.getBBox();g({x:w.x,y:w.y,width:w.width,height:w.height})}},[n]),n?c.jsxs("g",{transform:`translate(${e-p.width/2} ${t-p.height/2})`,className:y,visibility:p.width?"visible":"hidden",...h,children:[a&&c.jsx("rect",{width:p.width+2*i[0],x:-i[0],y:-i[1],height:p.height+2*i[1],className:"react-flow__edge-textbg",style:s,rx:l,ry:l}),c.jsx("text",{className:"react-flow__edge-text",y:p.height/2,dy:"0.3em",ref:S,style:r,children:n}),d]}):null}xB.displayName="EdgeText";const NEe=N.memo(xB);function Ah({path:e,labelX:t,labelY:n,label:r,labelStyle:a,labelShowBg:s,labelBgStyle:i,labelBgPadding:l,labelBgBorderRadius:d,interactionWidth:f=20,...h}){return c.jsxs(c.Fragment,{children:[c.jsx("path",{...h,d:e,fill:"none",className:on(["react-flow__edge-path",h.className])}),f?c.jsx("path",{d:e,fill:"none",strokeOpacity:0,strokeWidth:f,className:"react-flow__edge-interaction"}):null,r&&ra(t)&&ra(n)?c.jsx(NEe,{x:t,y:n,label:r,labelStyle:a,labelShowBg:s,labelBgStyle:i,labelBgPadding:l,labelBgBorderRadius:d}):null]})}function dL({pos:e,x1:t,y1:n,x2:r,y2:a}){return e===Te.Left||e===Te.Right?[.5*(t+r),n]:[t,.5*(n+a)]}function bB({sourceX:e,sourceY:t,sourcePosition:n=Te.Bottom,targetX:r,targetY:a,targetPosition:s=Te.Top}){const[i,l]=dL({pos:n,x1:e,y1:t,x2:r,y2:a}),[d,f]=dL({pos:s,x1:r,y1:a,x2:e,y2:t}),[h,p,g,y]=UH({sourceX:e,sourceY:t,targetX:r,targetY:a,sourceControlX:i,sourceControlY:l,targetControlX:d,targetControlY:f});return[`M${e},${t} C${i},${l} ${d},${f} ${r},${a}`,h,p,g,y]}function wB(e){return N.memo(({id:t,sourceX:n,sourceY:r,targetX:a,targetY:s,sourcePosition:i,targetPosition:l,label:d,labelStyle:f,labelShowBg:h,labelBgStyle:p,labelBgPadding:g,labelBgBorderRadius:y,style:S,markerEnd:w,markerStart:b,interactionWidth:x})=>{const[_,j,C]=bB({sourceX:n,sourceY:r,sourcePosition:i,targetX:a,targetY:s,targetPosition:l}),T=e.isInternal?void 0:t;return c.jsx(Ah,{id:T,path:_,labelX:j,labelY:C,label:d,labelStyle:f,labelShowBg:h,labelBgStyle:p,labelBgPadding:g,labelBgBorderRadius:y,style:S,markerEnd:w,markerStart:b,interactionWidth:x})})}const jEe=wB({isInternal:!1}),SB=wB({isInternal:!0});jEe.displayName="SimpleBezierEdge";SB.displayName="SimpleBezierEdgeInternal";function _B(e){return N.memo(({id:t,sourceX:n,sourceY:r,targetX:a,targetY:s,label:i,labelStyle:l,labelShowBg:d,labelBgStyle:f,labelBgPadding:h,labelBgBorderRadius:p,style:g,sourcePosition:y=Te.Bottom,targetPosition:S=Te.Top,markerEnd:w,markerStart:b,pathOptions:x,interactionWidth:_})=>{const[j,C,T]=AC({sourceX:n,sourceY:r,sourcePosition:y,targetX:a,targetY:s,targetPosition:S,borderRadius:x==null?void 0:x.borderRadius,offset:x==null?void 0:x.offset,stepPosition:x==null?void 0:x.stepPosition}),A=e.isInternal?void 0:t;return c.jsx(Ah,{id:A,path:j,labelX:C,labelY:T,label:i,labelStyle:l,labelShowBg:d,labelBgStyle:f,labelBgPadding:h,labelBgBorderRadius:p,style:g,markerEnd:w,markerStart:b,interactionWidth:_})})}const NB=_B({isInternal:!1}),jB=_B({isInternal:!0});NB.displayName="SmoothStepEdge";jB.displayName="SmoothStepEdgeInternal";function CB(e){return N.memo(({id:t,...n})=>{var a;const r=e.isInternal?void 0:t;return c.jsx(NB,{...n,id:r,pathOptions:N.useMemo(()=>{var s;return{borderRadius:0,offset:(s=n.pathOptions)==null?void 0:s.offset}},[(a=n.pathOptions)==null?void 0:a.offset])})})}const CEe=CB({isInternal:!1}),EB=CB({isInternal:!0});CEe.displayName="StepEdge";EB.displayName="StepEdgeInternal";function TB(e){return N.memo(({id:t,sourceX:n,sourceY:r,targetX:a,targetY:s,label:i,labelStyle:l,labelShowBg:d,labelBgStyle:f,labelBgPadding:h,labelBgBorderRadius:p,style:g,markerEnd:y,markerStart:S,interactionWidth:w})=>{const[b,x,_]=VH({sourceX:n,sourceY:r,targetX:a,targetY:s}),j=e.isInternal?void 0:t;return c.jsx(Ah,{id:j,path:b,labelX:x,labelY:_,label:i,labelStyle:l,labelShowBg:d,labelBgStyle:f,labelBgPadding:h,labelBgBorderRadius:p,style:g,markerEnd:y,markerStart:S,interactionWidth:w})})}const EEe=TB({isInternal:!1}),AB=TB({isInternal:!0});EEe.displayName="StraightEdge";AB.displayName="StraightEdgeInternal";function RB(e){return N.memo(({id:t,sourceX:n,sourceY:r,targetX:a,targetY:s,sourcePosition:i=Te.Bottom,targetPosition:l=Te.Top,label:d,labelStyle:f,labelShowBg:h,labelBgStyle:p,labelBgPadding:g,labelBgBorderRadius:y,style:S,markerEnd:w,markerStart:b,pathOptions:x,interactionWidth:_})=>{const[j,C,T]=sT({sourceX:n,sourceY:r,sourcePosition:i,targetX:a,targetY:s,targetPosition:l,curvature:x==null?void 0:x.curvature}),A=e.isInternal?void 0:t;return c.jsx(Ah,{id:A,path:j,labelX:C,labelY:T,label:d,labelStyle:f,labelShowBg:h,labelBgStyle:p,labelBgPadding:g,labelBgBorderRadius:y,style:S,markerEnd:w,markerStart:b,interactionWidth:_})})}const TEe=RB({isInternal:!1}),kB=RB({isInternal:!0});TEe.displayName="BezierEdge";kB.displayName="BezierEdgeInternal";const fL={default:kB,straight:AB,step:EB,smoothstep:jB,simplebezier:SB},hL={sourceX:null,sourceY:null,targetX:null,targetY:null,sourcePosition:null,targetPosition:null},AEe=(e,t,n)=>n===Te.Left?e-t:n===Te.Right?e+t:e,REe=(e,t,n)=>n===Te.Top?e-t:n===Te.Bottom?e+t:e,pL="react-flow__edgeupdater";function mL({position:e,centerX:t,centerY:n,radius:r=10,onMouseDown:a,onMouseEnter:s,onMouseOut:i,type:l}){return c.jsx("circle",{onMouseDown:a,onMouseEnter:s,onMouseOut:i,className:on([pL,`${pL}-${l}`]),cx:AEe(t,r,e),cy:REe(n,r,e),r,stroke:"transparent",fill:"transparent"})}function kEe({isReconnectable:e,reconnectRadius:t,edge:n,sourceX:r,sourceY:a,targetX:s,targetY:i,sourcePosition:l,targetPosition:d,onReconnect:f,onReconnectStart:h,onReconnectEnd:p,setReconnecting:g,setUpdateHover:y}){const S=zt(),w=(C,T)=>{if(C.button!==0)return;const{autoPanOnConnect:A,domNode:k,isValidConnection:O,connectionMode:M,connectionRadius:z,lib:L,onConnectStart:U,onConnectEnd:F,cancelConnection:q,nodeLookup:V,rfId:P,panBy:K,updateConnection:H}=S.getState(),Z=T.type==="target",J=(B,$)=>{g(!1),p==null||p(B,n,T.type,$)},D=B=>f==null?void 0:f(n,B),W=(B,$)=>{g(!0),h==null||h(C,n,T.type),U==null||U(B,$)};OC.onPointerDown(C.nativeEvent,{autoPanOnConnect:A,connectionMode:M,connectionRadius:z,domNode:k,handleId:T.id,nodeId:T.nodeId,nodeLookup:V,isTarget:Z,edgeUpdaterType:T.type,lib:L,flowId:P,cancelConnection:q,panBy:K,isValidConnection:O,onConnect:D,onConnectStart:W,onConnectEnd:F,onReconnectEnd:J,updateConnection:H,getTransform:()=>S.getState().transform,getFromHandle:()=>S.getState().connection.fromHandle,dragThreshold:S.getState().connectionDragThreshold,handleDomNode:C.currentTarget})},b=C=>w(C,{nodeId:n.target,id:n.targetHandle??null,type:"target"}),x=C=>w(C,{nodeId:n.source,id:n.sourceHandle??null,type:"source"}),_=()=>y(!0),j=()=>y(!1);return c.jsxs(c.Fragment,{children:[(e===!0||e==="source")&&c.jsx(mL,{position:l,centerX:r,centerY:a,radius:t,onMouseDown:b,onMouseEnter:_,onMouseOut:j,type:"source"}),(e===!0||e==="target")&&c.jsx(mL,{position:d,centerX:s,centerY:i,radius:t,onMouseDown:x,onMouseEnter:_,onMouseOut:j,type:"target"})]})}function OEe({id:e,edgesFocusable:t,edgesReconnectable:n,elementsSelectable:r,onClick:a,onDoubleClick:s,onContextMenu:i,onMouseEnter:l,onMouseMove:d,onMouseLeave:f,reconnectRadius:h,onReconnect:p,onReconnectStart:g,onReconnectEnd:y,rfId:S,edgeTypes:w,noPanClassName:b,onError:x,disableKeyboardA11y:_}){let j=st(te=>te.edgeLookup.get(e));const C=st(te=>te.defaultEdgeOptions);j=C?{...C,...j}:j;let T=j.type||"default",A=(w==null?void 0:w[T])||fL[T];A===void 0&&(x==null||x("011",Pa.error011(T)),T="default",A=(w==null?void 0:w.default)||fL.default);const k=!!(j.focusable||t&&typeof j.focusable>"u"),O=typeof p<"u"&&(j.reconnectable||n&&typeof j.reconnectable>"u"),M=!!(j.selectable||r&&typeof j.selectable>"u"),z=N.useRef(null),[L,U]=N.useState(!1),[F,q]=N.useState(!1),V=zt(),{zIndex:P,sourceX:K,sourceY:H,targetX:Z,targetY:J,sourcePosition:D,targetPosition:W}=st(N.useCallback(te=>{const se=te.nodeLookup.get(j.source),le=te.nodeLookup.get(j.target);if(!se||!le)return{zIndex:j.zIndex,...hL};const fe=jCe({id:e,sourceNode:se,targetNode:le,sourceHandle:j.sourceHandle||null,targetHandle:j.targetHandle||null,connectionMode:te.connectionMode,onError:x});return{zIndex:vCe({selected:j.selected,zIndex:j.zIndex,sourceNode:se,targetNode:le,elevateOnSelect:te.elevateEdgesOnSelect}),...fe||hL}},[j.source,j.target,j.sourceHandle,j.targetHandle,j.selected,j.zIndex]),Vt),B=N.useMemo(()=>j.markerStart?`url('#${RC(j.markerStart,S)}')`:void 0,[j.markerStart,S]),$=N.useMemo(()=>j.markerEnd?`url('#${RC(j.markerEnd,S)}')`:void 0,[j.markerEnd,S]);if(j.hidden||K===null||H===null||Z===null||J===null)return null;const G=te=>{var ve;const{addSelectedEdges:se,unselectNodesAndEdges:le,multiSelectionActive:fe}=V.getState();M&&(V.setState({nodesSelectionActive:!1}),j.selected&&fe?(le({nodes:[],edges:[j]}),(ve=z.current)==null||ve.blur()):se([e])),a&&a(te,j)},ee=s?te=>{s(te,{...j})}:void 0,re=i?te=>{i(te,{...j})}:void 0,ne=l?te=>{l(te,{...j})}:void 0,Q=d?te=>{d(te,{...j})}:void 0,ae=f?te=>{f(te,{...j})}:void 0,Y=te=>{var se;if(!_&&TH.includes(te.key)&&M){const{unselectNodesAndEdges:le,addSelectedEdges:fe}=V.getState();te.key==="Escape"?((se=z.current)==null||se.blur(),le({edges:[j]})):fe([e])}};return c.jsx("svg",{style:{zIndex:P},children:c.jsxs("g",{className:on(["react-flow__edge",`react-flow__edge-${T}`,j.className,b,{selected:j.selected,animated:j.animated,inactive:!M&&!a,updating:L,selectable:M}]),onClick:G,onDoubleClick:ee,onContextMenu:re,onMouseEnter:ne,onMouseMove:Q,onMouseLeave:ae,onKeyDown:k?Y:void 0,tabIndex:k?0:void 0,role:j.ariaRole??(k?"group":"img"),"aria-roledescription":"edge","data-id":e,"data-testid":`rf__edge-${e}`,"aria-label":j.ariaLabel===null?void 0:j.ariaLabel||`Edge from ${j.source} to ${j.target}`,"aria-describedby":k?`${oB}-${S}`:void 0,ref:z,...j.domAttributes,children:[!F&&c.jsx(A,{id:e,source:j.source,target:j.target,type:j.type,selected:j.selected,animated:j.animated,selectable:M,deletable:j.deletable??!0,label:j.label,labelStyle:j.labelStyle,labelShowBg:j.labelShowBg,labelBgStyle:j.labelBgStyle,labelBgPadding:j.labelBgPadding,labelBgBorderRadius:j.labelBgBorderRadius,sourceX:K,sourceY:H,targetX:Z,targetY:J,sourcePosition:D,targetPosition:W,data:j.data,style:j.style,sourceHandleId:j.sourceHandle,targetHandleId:j.targetHandle,markerStart:B,markerEnd:$,pathOptions:"pathOptions"in j?j.pathOptions:void 0,interactionWidth:j.interactionWidth}),O&&c.jsx(kEe,{edge:j,isReconnectable:O,reconnectRadius:h,onReconnect:p,onReconnectStart:g,onReconnectEnd:y,sourceX:K,sourceY:H,targetX:Z,targetY:J,sourcePosition:D,targetPosition:W,setUpdateHover:U,setReconnecting:q})]})})}var MEe=N.memo(OEe);const DEe=e=>({edgesFocusable:e.edgesFocusable,edgesReconnectable:e.edgesReconnectable,elementsSelectable:e.elementsSelectable,connectionMode:e.connectionMode,onError:e.onError});function OB({defaultMarkerColor:e,onlyRenderVisibleElements:t,rfId:n,edgeTypes:r,noPanClassName:a,onReconnect:s,onEdgeContextMenu:i,onEdgeMouseEnter:l,onEdgeMouseMove:d,onEdgeMouseLeave:f,onEdgeClick:h,reconnectRadius:p,onEdgeDoubleClick:g,onReconnectStart:y,onReconnectEnd:S,disableKeyboardA11y:w}){const{edgesFocusable:b,edgesReconnectable:x,elementsSelectable:_,onError:j}=st(DEe,Vt),C=vEe(t);return c.jsxs("div",{className:"react-flow__edges",children:[c.jsx(_Ee,{defaultColor:e,rfId:n}),C.map(T=>c.jsx(MEe,{id:T,edgesFocusable:b,edgesReconnectable:x,elementsSelectable:_,noPanClassName:a,onReconnect:s,onContextMenu:i,onMouseEnter:l,onMouseMove:d,onMouseLeave:f,onClick:h,reconnectRadius:p,onDoubleClick:g,onReconnectStart:y,onReconnectEnd:S,rfId:n,onError:j,edgeTypes:r,disableKeyboardA11y:w},T))]})}OB.displayName="EdgeRenderer";const PEe=N.memo(OB),$Ee=e=>`translate(${e.transform[0]}px,${e.transform[1]}px) scale(${e.transform[2]})`;function IEe({children:e}){const t=st($Ee);return c.jsx("div",{className:"react-flow__viewport xyflow__viewport react-flow__container",style:{transform:t},children:e})}function LEe(e){const t=f0(),n=N.useRef(!1);N.useEffect(()=>{!n.current&&t.viewportInitialized&&e&&(setTimeout(()=>e(t),1),n.current=!0)},[e,t.viewportInitialized])}const zEe=e=>{var t;return(t=e.panZoom)==null?void 0:t.syncViewport};function qEe(e){const t=st(zEe),n=zt();return N.useEffect(()=>{e&&(t==null||t(e),n.setState({transform:[e.x,e.y,e.zoom]}))},[e,t]),null}function FEe(e){return e.connection.inProgress?{...e.connection,to:Eh(e.connection.to,e.transform)}:{...e.connection}}function UEe(e){return FEe}function HEe(e){const t=UEe();return st(t,Vt)}const BEe=e=>({nodesConnectable:e.nodesConnectable,isValid:e.connection.isValid,inProgress:e.connection.inProgress,width:e.width,height:e.height});function VEe({containerStyle:e,style:t,type:n,component:r}){const{nodesConnectable:a,width:s,height:i,isValid:l,inProgress:d}=st(BEe,Vt);return!(s&&a&&d)?null:c.jsx("svg",{style:e,width:s,height:i,className:"react-flow__connectionline react-flow__container",children:c.jsx("g",{className:on(["react-flow__connection",kH(l)]),children:c.jsx(MB,{style:t,type:n,CustomComponent:r,isValid:l})})})}const MB=({style:e,type:t=bs.Bezier,CustomComponent:n,isValid:r})=>{const{inProgress:a,from:s,fromNode:i,fromHandle:l,fromPosition:d,to:f,toNode:h,toHandle:p,toPosition:g}=HEe();if(!a)return;if(n)return c.jsx(n,{connectionLineType:t,connectionLineStyle:e,fromNode:i,fromHandle:l,fromX:s.x,fromY:s.y,toX:f.x,toY:f.y,fromPosition:d,toPosition:g,connectionStatus:kH(r),toNode:h,toHandle:p});let y="";const S={sourceX:s.x,sourceY:s.y,sourcePosition:d,targetX:f.x,targetY:f.y,targetPosition:g};switch(t){case bs.Bezier:[y]=sT(S);break;case bs.SimpleBezier:[y]=bB(S);break;case bs.Step:[y]=AC({...S,borderRadius:0});break;case bs.SmoothStep:[y]=AC(S);break;default:[y]=VH(S)}return c.jsx("path",{d:y,fill:"none",className:"react-flow__connection-path",style:e})};MB.displayName="ConnectionLine";const WEe={};function gL(e=WEe){N.useRef(e),zt(),N.useEffect(()=>{},[e])}function GEe(){zt(),N.useRef(!1),N.useEffect(()=>{},[])}function DB({nodeTypes:e,edgeTypes:t,onInit:n,onNodeClick:r,onEdgeClick:a,onNodeDoubleClick:s,onEdgeDoubleClick:i,onNodeMouseEnter:l,onNodeMouseMove:d,onNodeMouseLeave:f,onNodeContextMenu:h,onSelectionContextMenu:p,onSelectionStart:g,onSelectionEnd:y,connectionLineType:S,connectionLineStyle:w,connectionLineComponent:b,connectionLineContainerStyle:x,selectionKeyCode:_,selectionOnDrag:j,selectionMode:C,multiSelectionKeyCode:T,panActivationKeyCode:A,zoomActivationKeyCode:k,deleteKeyCode:O,onlyRenderVisibleElements:M,elementsSelectable:z,defaultViewport:L,translateExtent:U,minZoom:F,maxZoom:q,preventScrolling:V,defaultMarkerColor:P,zoomOnScroll:K,zoomOnPinch:H,panOnScroll:Z,panOnScrollSpeed:J,panOnScrollMode:D,zoomOnDoubleClick:W,panOnDrag:B,onPaneClick:$,onPaneMouseEnter:G,onPaneMouseMove:ee,onPaneMouseLeave:re,onPaneScroll:ne,onPaneContextMenu:Q,paneClickDistance:ae,nodeClickDistance:Y,onEdgeContextMenu:te,onEdgeMouseEnter:se,onEdgeMouseMove:le,onEdgeMouseLeave:fe,reconnectRadius:ve,onReconnect:Se,onReconnectStart:Re,onReconnectEnd:De,noDragClassName:Ve,noWheelClassName:Le,noPanClassName:$e,disableKeyboardA11y:qe,nodeExtent:Je,rfId:qt,viewport:ln,onViewportChange:Sn}){return gL(e),gL(t),GEe(),LEe(n),qEe(ln),c.jsx(lEe,{onPaneClick:$,onPaneMouseEnter:G,onPaneMouseMove:ee,onPaneMouseLeave:re,onPaneContextMenu:Q,onPaneScroll:ne,paneClickDistance:ae,deleteKeyCode:O,selectionKeyCode:_,selectionOnDrag:j,selectionMode:C,onSelectionStart:g,onSelectionEnd:y,multiSelectionKeyCode:T,panActivationKeyCode:A,zoomActivationKeyCode:k,elementsSelectable:z,zoomOnScroll:K,zoomOnPinch:H,zoomOnDoubleClick:W,panOnScroll:Z,panOnScrollSpeed:J,panOnScrollMode:D,panOnDrag:B,defaultViewport:L,translateExtent:U,minZoom:F,maxZoom:q,onSelectionContextMenu:p,preventScrolling:V,noDragClassName:Ve,noWheelClassName:Le,noPanClassName:$e,disableKeyboardA11y:qe,onViewportChange:Sn,isControlledViewport:!!ln,children:c.jsxs(IEe,{children:[c.jsx(PEe,{edgeTypes:t,onEdgeClick:a,onEdgeDoubleClick:i,onReconnect:Se,onReconnectStart:Re,onReconnectEnd:De,onlyRenderVisibleElements:M,onEdgeContextMenu:te,onEdgeMouseEnter:se,onEdgeMouseMove:le,onEdgeMouseLeave:fe,reconnectRadius:ve,defaultMarkerColor:P,noPanClassName:$e,disableKeyboardA11y:qe,rfId:qt}),c.jsx(VEe,{style:w,type:S,component:b,containerStyle:x}),c.jsx("div",{className:"react-flow__edgelabel-renderer"}),c.jsx(yEe,{nodeTypes:e,onNodeClick:r,onNodeDoubleClick:s,onNodeMouseEnter:l,onNodeMouseMove:d,onNodeMouseLeave:f,onNodeContextMenu:h,nodeClickDistance:Y,onlyRenderVisibleElements:M,noPanClassName:$e,noDragClassName:Ve,disableKeyboardA11y:qe,nodeExtent:Je,rfId:qt}),c.jsx("div",{className:"react-flow__viewport-portal"})]})})}DB.displayName="GraphView";const KEe=N.memo(DB),yL=({nodes:e,edges:t,defaultNodes:n,defaultEdges:r,width:a,height:s,fitView:i,fitViewOptions:l,minZoom:d=.5,maxZoom:f=2,nodeOrigin:h,nodeExtent:p}={})=>{const g=new Map,y=new Map,S=new Map,w=new Map,b=r??t??[],x=n??e??[],_=h??[0,0],j=p??Df;KH(S,w,b);const C=kC(x,g,y,{nodeOrigin:_,nodeExtent:j,elevateNodesOnSelect:!1});let T=[0,0,1];if(i&&a&&s){const A=jh(g,{filter:z=>!!((z.width||z.initialWidth)&&(z.height||z.initialHeight))}),{x:k,y:O,zoom:M}=rT(A,a,s,d,f,(l==null?void 0:l.padding)??.1);T=[k,O,M]}return{rfId:"1",width:a??0,height:s??0,transform:T,nodes:x,nodesInitialized:C,nodeLookup:g,parentLookup:y,edges:b,edgeLookup:w,connectionLookup:S,onNodesChange:null,onEdgesChange:null,hasDefaultNodes:n!==void 0,hasDefaultEdges:r!==void 0,panZoom:null,minZoom:d,maxZoom:f,translateExtent:Df,nodeExtent:j,nodesSelectionActive:!1,userSelectionActive:!1,userSelectionRect:null,connectionMode:tu.Strict,domNode:null,paneDragging:!1,noPanClassName:"nopan",nodeOrigin:_,nodeDragThreshold:1,connectionDragThreshold:1,snapGrid:[15,15],snapToGrid:!1,nodesDraggable:!0,nodesConnectable:!0,nodesFocusable:!0,edgesFocusable:!0,edgesReconnectable:!0,elementsSelectable:!0,elevateNodesOnSelect:!0,elevateEdgesOnSelect:!1,selectNodesOnDrag:!0,multiSelectionActive:!1,fitViewQueued:i??!1,fitViewOptions:l,fitViewResolver:null,connection:{...RH},connectionClickStartHandle:null,connectOnClick:!0,ariaLiveMessage:"",autoPanOnConnect:!0,autoPanOnNodeDrag:!0,autoPanOnNodeFocus:!0,autoPanSpeed:15,connectionRadius:20,onError:fCe,isValidConnection:void 0,onSelectionChangeHandlers:[],lib:"react",debug:!1,ariaLabelConfig:AH}},YEe=({nodes:e,edges:t,defaultNodes:n,defaultEdges:r,width:a,height:s,fitView:i,fitViewOptions:l,minZoom:d,maxZoom:f,nodeOrigin:h,nodeExtent:p})=>h2e((g,y)=>{async function S(){const{nodeLookup:w,panZoom:b,fitViewOptions:x,fitViewResolver:_,width:j,height:C,minZoom:T,maxZoom:A}=y();b&&(await uCe({nodes:w,width:j,height:C,panZoom:b,minZoom:T,maxZoom:A},x),_==null||_.resolve(!0),g({fitViewResolver:null}))}return{...yL({nodes:e,edges:t,width:a,height:s,fitView:i,fitViewOptions:l,minZoom:d,maxZoom:f,nodeOrigin:h,nodeExtent:p,defaultNodes:n,defaultEdges:r}),setNodes:w=>{const{nodeLookup:b,parentLookup:x,nodeOrigin:_,elevateNodesOnSelect:j,fitViewQueued:C}=y(),T=kC(w,b,x,{nodeOrigin:_,nodeExtent:p,elevateNodesOnSelect:j,checkEquality:!0});C&&T?(S(),g({nodes:w,nodesInitialized:T,fitViewQueued:!1,fitViewOptions:void 0})):g({nodes:w,nodesInitialized:T})},setEdges:w=>{const{connectionLookup:b,edgeLookup:x}=y();KH(b,x,w),g({edges:w})},setDefaultNodesAndEdges:(w,b)=>{if(w){const{setNodes:x}=y();x(w),g({hasDefaultNodes:!0})}if(b){const{setEdges:x}=y();x(b),g({hasDefaultEdges:!0})}},updateNodeInternals:w=>{const{triggerNodeChanges:b,nodeLookup:x,parentLookup:_,domNode:j,nodeOrigin:C,nodeExtent:T,debug:A,fitViewQueued:k}=y(),{changes:O,updatedInternals:M}=MCe(w,x,_,j,C,T);M&&(ACe(x,_,{nodeOrigin:C,nodeExtent:T}),k?(S(),g({fitViewQueued:!1,fitViewOptions:void 0})):g({}),(O==null?void 0:O.length)>0&&(A&&console.log("React Flow: trigger node changes",O),b==null||b(O)))},updateNodePositions:(w,b=!1)=>{const x=[],_=[],{nodeLookup:j,triggerNodeChanges:C}=y();for(const[T,A]of w){const k=j.get(T),O=!!(k!=null&&k.expandParent&&(k!=null&&k.parentId)&&(A!=null&&A.position)),M={id:T,type:"position",position:O?{x:Math.max(0,A.position.x),y:Math.max(0,A.position.y)}:A.position,dragging:b};O&&k.parentId&&x.push({id:T,parentId:k.parentId,rect:{...A.internals.positionAbsolute,width:A.measured.width??0,height:A.measured.height??0}}),_.push(M)}if(x.length>0){const{parentLookup:T,nodeOrigin:A}=y(),k=cT(x,j,T,A);_.push(...k)}C(_)},triggerNodeChanges:w=>{const{onNodesChange:b,setNodes:x,nodes:_,hasDefaultNodes:j,debug:C}=y();if(w!=null&&w.length){if(j){const T=cB(w,_);x(T)}C&&console.log("React Flow: trigger node changes",w),b==null||b(w)}},triggerEdgeChanges:w=>{const{onEdgesChange:b,setEdges:x,edges:_,hasDefaultEdges:j,debug:C}=y();if(w!=null&&w.length){if(j){const T=uB(w,_);x(T)}C&&console.log("React Flow: trigger edge changes",w),b==null||b(w)}},addSelectedNodes:w=>{const{multiSelectionActive:b,edgeLookup:x,nodeLookup:_,triggerNodeChanges:j,triggerEdgeChanges:C}=y();if(b){const T=w.map(A=>Di(A,!0));j(T);return}j(Tc(_,new Set([...w]),!0)),C(Tc(x))},addSelectedEdges:w=>{const{multiSelectionActive:b,edgeLookup:x,nodeLookup:_,triggerNodeChanges:j,triggerEdgeChanges:C}=y();if(b){const T=w.map(A=>Di(A,!0));C(T);return}C(Tc(x,new Set([...w]))),j(Tc(_,new Set,!0))},unselectNodesAndEdges:({nodes:w,edges:b}={})=>{const{edges:x,nodes:_,nodeLookup:j,triggerNodeChanges:C,triggerEdgeChanges:T}=y(),A=w||_,k=b||x,O=A.map(z=>{const L=j.get(z.id);return L&&(L.selected=!1),Di(z.id,!1)}),M=k.map(z=>Di(z.id,!1));C(O),T(M)},setMinZoom:w=>{const{panZoom:b,maxZoom:x}=y();b==null||b.setScaleExtent([w,x]),g({minZoom:w})},setMaxZoom:w=>{const{panZoom:b,minZoom:x}=y();b==null||b.setScaleExtent([x,w]),g({maxZoom:w})},setTranslateExtent:w=>{var b;(b=y().panZoom)==null||b.setTranslateExtent(w),g({translateExtent:w})},resetSelectedElements:()=>{const{edges:w,nodes:b,triggerNodeChanges:x,triggerEdgeChanges:_,elementsSelectable:j}=y();if(!j)return;const C=b.reduce((A,k)=>k.selected?[...A,Di(k.id,!1)]:A,[]),T=w.reduce((A,k)=>k.selected?[...A,Di(k.id,!1)]:A,[]);x(C),_(T)},setNodeExtent:w=>{const{nodes:b,nodeLookup:x,parentLookup:_,nodeOrigin:j,elevateNodesOnSelect:C,nodeExtent:T}=y();w[0][0]===T[0][0]&&w[0][1]===T[0][1]&&w[1][0]===T[1][0]&&w[1][1]===T[1][1]||(kC(b,x,_,{nodeOrigin:j,nodeExtent:w,elevateNodesOnSelect:C,checkEquality:!1}),g({nodeExtent:w}))},panBy:w=>{const{transform:b,width:x,height:_,panZoom:j,translateExtent:C}=y();return DCe({delta:w,panZoom:j,transform:b,translateExtent:C,width:x,height:_})},setCenter:async(w,b,x)=>{const{width:_,height:j,maxZoom:C,panZoom:T}=y();if(!T)return Promise.resolve(!1);const A=typeof(x==null?void 0:x.zoom)<"u"?x.zoom:C;return await T.setViewport({x:_/2-w*A,y:j/2-b*A,zoom:A},{duration:x==null?void 0:x.duration,ease:x==null?void 0:x.ease,interpolate:x==null?void 0:x.interpolate}),Promise.resolve(!0)},cancelConnection:()=>{g({connection:{...RH}})},updateConnection:w=>{g({connection:w})},reset:()=>g({...yL()})}},Object.is);function XEe({initialNodes:e,initialEdges:t,defaultNodes:n,defaultEdges:r,initialWidth:a,initialHeight:s,initialMinZoom:i,initialMaxZoom:l,initialFitViewOptions:d,fitView:f,nodeOrigin:h,nodeExtent:p,children:g}){const[y]=N.useState(()=>YEe({nodes:e,edges:t,defaultNodes:n,defaultEdges:r,width:a,height:s,fitView:f,minZoom:i,maxZoom:l,fitViewOptions:d,nodeOrigin:h,nodeExtent:p}));return c.jsx(p2e,{value:y,children:c.jsx(I2e,{children:g})})}function ZEe({children:e,nodes:t,edges:n,defaultNodes:r,defaultEdges:a,width:s,height:i,fitView:l,fitViewOptions:d,minZoom:f,maxZoom:h,nodeOrigin:p,nodeExtent:g}){return N.useContext(d0)?c.jsx(c.Fragment,{children:e}):c.jsx(XEe,{initialNodes:t,initialEdges:n,defaultNodes:r,defaultEdges:a,initialWidth:s,initialHeight:i,fitView:l,initialFitViewOptions:d,initialMinZoom:f,initialMaxZoom:h,nodeOrigin:p,nodeExtent:g,children:e})}const QEe={width:"100%",height:"100%",overflow:"hidden",position:"relative",zIndex:0};function JEe({nodes:e,edges:t,defaultNodes:n,defaultEdges:r,className:a,nodeTypes:s,edgeTypes:i,onNodeClick:l,onEdgeClick:d,onInit:f,onMove:h,onMoveStart:p,onMoveEnd:g,onConnect:y,onConnectStart:S,onConnectEnd:w,onClickConnectStart:b,onClickConnectEnd:x,onNodeMouseEnter:_,onNodeMouseMove:j,onNodeMouseLeave:C,onNodeContextMenu:T,onNodeDoubleClick:A,onNodeDragStart:k,onNodeDrag:O,onNodeDragStop:M,onNodesDelete:z,onEdgesDelete:L,onDelete:U,onSelectionChange:F,onSelectionDragStart:q,onSelectionDrag:V,onSelectionDragStop:P,onSelectionContextMenu:K,onSelectionStart:H,onSelectionEnd:Z,onBeforeDelete:J,connectionMode:D,connectionLineType:W=bs.Bezier,connectionLineStyle:B,connectionLineComponent:$,connectionLineContainerStyle:G,deleteKeyCode:ee="Backspace",selectionKeyCode:re="Shift",selectionOnDrag:ne=!1,selectionMode:Q=Pf.Full,panActivationKeyCode:ae="Space",multiSelectionKeyCode:Y=If()?"Meta":"Control",zoomActivationKeyCode:te=If()?"Meta":"Control",snapToGrid:se,snapGrid:le,onlyRenderVisibleElements:fe=!1,selectNodesOnDrag:ve,nodesDraggable:Se,autoPanOnNodeFocus:Re,nodesConnectable:De,nodesFocusable:Ve,nodeOrigin:Le=iB,edgesFocusable:$e,edgesReconnectable:qe,elementsSelectable:Je=!0,defaultViewport:qt=E2e,minZoom:ln=.5,maxZoom:Sn=2,translateExtent:cn=Df,preventScrolling:Wa=!0,nodeExtent:Fr,defaultMarkerColor:Tu="#b1b1b7",zoomOnScroll:jl=!0,zoomOnPinch:Rn=!0,panOnScroll:Ft=!1,panOnScrollSpeed:ma=.5,panOnScrollMode:Fn=Ui.Free,zoomOnDoubleClick:j0=!0,panOnDrag:C0=!0,onPaneClick:E0,onPaneMouseEnter:Cl,onPaneMouseMove:El,onPaneMouseLeave:Tl,onPaneScroll:Ga,onPaneContextMenu:Al,paneClickDistance:ii=0,nodeClickDistance:T0=0,children:Dh,onReconnect:Au,onReconnectStart:li,onReconnectEnd:A0,onEdgeContextMenu:Ph,onEdgeDoubleClick:$h,onEdgeMouseEnter:Ih,onEdgeMouseMove:Ru,onEdgeMouseLeave:ku,reconnectRadius:Lh=10,onNodesChange:zh,onEdgesChange:ga,noDragClassName:un="nodrag",noWheelClassName:kn="nowheel",noPanClassName:Ka="nopan",fitView:Rl,fitViewOptions:qh,connectOnClick:R0,attributionPosition:Fh,proOptions:ci,defaultEdgeOptions:Ou,elevateNodesOnSelect:Hs,elevateEdgesOnSelect:Bs,disableKeyboardA11y:Vs=!1,autoPanOnConnect:Ws,autoPanOnNodeDrag:en,autoPanSpeed:Uh,connectionRadius:Hh,isValidConnection:Ya,onError:Gs,style:k0,id:Mu,nodeDragThreshold:Bh,connectionDragThreshold:O0,viewport:kl,onViewportChange:Ol,width:Ur,height:Kn,colorMode:Vh="light",debug:M0,onScroll:Ks,ariaLabelConfig:Wh,...Ml},D0){const On=Mu||"1",Du=k2e(Vh),Gh=N.useCallback(Dl=>{Dl.currentTarget.scrollTo({top:0,left:0,behavior:"instant"}),Ks==null||Ks(Dl)},[Ks]);return c.jsx("div",{"data-testid":"rf__wrapper",...Ml,onScroll:Gh,style:{...k0,...QEe},ref:D0,className:on(["react-flow",a,Du]),id:Mu,role:"application",children:c.jsxs(ZEe,{nodes:e,edges:t,width:Ur,height:Kn,fitView:Rl,fitViewOptions:qh,minZoom:ln,maxZoom:Sn,nodeOrigin:Le,nodeExtent:Fr,children:[c.jsx(KEe,{onInit:f,onNodeClick:l,onEdgeClick:d,onNodeMouseEnter:_,onNodeMouseMove:j,onNodeMouseLeave:C,onNodeContextMenu:T,onNodeDoubleClick:A,nodeTypes:s,edgeTypes:i,connectionLineType:W,connectionLineStyle:B,connectionLineComponent:$,connectionLineContainerStyle:G,selectionKeyCode:re,selectionOnDrag:ne,selectionMode:Q,deleteKeyCode:ee,multiSelectionKeyCode:Y,panActivationKeyCode:ae,zoomActivationKeyCode:te,onlyRenderVisibleElements:fe,defaultViewport:qt,translateExtent:cn,minZoom:ln,maxZoom:Sn,preventScrolling:Wa,zoomOnScroll:jl,zoomOnPinch:Rn,zoomOnDoubleClick:j0,panOnScroll:Ft,panOnScrollSpeed:ma,panOnScrollMode:Fn,panOnDrag:C0,onPaneClick:E0,onPaneMouseEnter:Cl,onPaneMouseMove:El,onPaneMouseLeave:Tl,onPaneScroll:Ga,onPaneContextMenu:Al,paneClickDistance:ii,nodeClickDistance:T0,onSelectionContextMenu:K,onSelectionStart:H,onSelectionEnd:Z,onReconnect:Au,onReconnectStart:li,onReconnectEnd:A0,onEdgeContextMenu:Ph,onEdgeDoubleClick:$h,onEdgeMouseEnter:Ih,onEdgeMouseMove:Ru,onEdgeMouseLeave:ku,reconnectRadius:Lh,defaultMarkerColor:Tu,noDragClassName:un,noWheelClassName:kn,noPanClassName:Ka,rfId:On,disableKeyboardA11y:Vs,nodeExtent:Fr,viewport:kl,onViewportChange:Ol}),c.jsx(R2e,{nodes:e,edges:t,defaultNodes:n,defaultEdges:r,onConnect:y,onConnectStart:S,onConnectEnd:w,onClickConnectStart:b,onClickConnectEnd:x,nodesDraggable:Se,autoPanOnNodeFocus:Re,nodesConnectable:De,nodesFocusable:Ve,edgesFocusable:$e,edgesReconnectable:qe,elementsSelectable:Je,elevateNodesOnSelect:Hs,elevateEdgesOnSelect:Bs,minZoom:ln,maxZoom:Sn,nodeExtent:Fr,onNodesChange:zh,onEdgesChange:ga,snapToGrid:se,snapGrid:le,connectionMode:D,translateExtent:cn,connectOnClick:R0,defaultEdgeOptions:Ou,fitView:Rl,fitViewOptions:qh,onNodesDelete:z,onEdgesDelete:L,onDelete:U,onNodeDragStart:k,onNodeDrag:O,onNodeDragStop:M,onSelectionDrag:V,onSelectionDragStart:q,onSelectionDragStop:P,onMove:h,onMoveStart:p,onMoveEnd:g,noPanClassName:Ka,nodeOrigin:Le,rfId:On,autoPanOnConnect:Ws,autoPanOnNodeDrag:en,autoPanSpeed:Uh,onError:Gs,connectionRadius:Hh,isValidConnection:Ya,selectNodesOnDrag:ve,nodeDragThreshold:Bh,connectionDragThreshold:O0,onBeforeDelete:J,debug:M0,ariaLabelConfig:Wh}),c.jsx(C2e,{onSelectionChange:F}),Dh,c.jsx(w2e,{proOptions:ci,position:Fh}),c.jsx(b2e,{rfId:On,disableKeyboardA11y:Vs})]})})}var eTe=dB(JEe);const tTe=e=>{var t;return(t=e.domNode)==null?void 0:t.querySelector(".react-flow__edgelabel-renderer")};function nTe({children:e}){const t=st(tTe);return t?ol.createPortal(e,t):null}function rTe(e){const[t,n]=N.useState(e),r=N.useCallback(a=>n(s=>cB(a,s)),[]);return[t,n,r]}function aTe(e){const[t,n]=N.useState(e),r=N.useCallback(a=>n(s=>uB(a,s)),[]);return[t,n,r]}function sTe({dimensions:e,lineWidth:t,variant:n,className:r}){return c.jsx("path",{strokeWidth:t,d:`M${e[0]/2} 0 V${e[1]} M0 ${e[1]/2} H${e[0]}`,className:on(["react-flow__background-pattern",n,r])})}function oTe({radius:e,className:t}){return c.jsx("circle",{cx:e,cy:e,r:e,className:on(["react-flow__background-pattern","dots",t])})}var Ts;(function(e){e.Lines="lines",e.Dots="dots",e.Cross="cross"})(Ts||(Ts={}));const iTe={[Ts.Dots]:1,[Ts.Lines]:1,[Ts.Cross]:6},lTe=e=>({transform:e.transform,patternId:`pattern-${e.rfId}`});function PB({id:e,variant:t=Ts.Dots,gap:n=20,size:r,lineWidth:a=1,offset:s=0,color:i,bgColor:l,style:d,className:f,patternClassName:h}){const p=N.useRef(null),{transform:g,patternId:y}=st(lTe,Vt),S=r||iTe[t],w=t===Ts.Dots,b=t===Ts.Cross,x=Array.isArray(n)?n:[n,n],_=[x[0]*g[2]||1,x[1]*g[2]||1],j=S*g[2],C=Array.isArray(s)?s:[s,s],T=b?[j,j]:_,A=[C[0]*g[2]||1+T[0]/2,C[1]*g[2]||1+T[1]/2],k=`${y}${e||""}`;return c.jsxs("svg",{className:on(["react-flow__background",f]),style:{...d,...h0,"--xy-background-color-props":l,"--xy-background-pattern-color-props":i},ref:p,"data-testid":"rf__background",children:[c.jsx("pattern",{id:k,x:g[0]%_[0],y:g[1]%_[1],width:_[0],height:_[1],patternUnits:"userSpaceOnUse",patternTransform:`translate(-${A[0]},-${A[1]})`,children:w?c.jsx(oTe,{radius:j/2,className:h}):c.jsx(sTe,{dimensions:T,lineWidth:a,variant:t,className:h})}),c.jsx("rect",{x:"0",y:"0",width:"100%",height:"100%",fill:`url(#${k})`})]})}PB.displayName="Background";const cTe=N.memo(PB);function uTe(){return c.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 32",children:c.jsx("path",{d:"M32 18.133H18.133V32h-4.266V18.133H0v-4.266h13.867V0h4.266v13.867H32z"})})}function dTe(){return c.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 5",children:c.jsx("path",{d:"M0 0h32v4.2H0z"})})}function fTe(){return c.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 30",children:c.jsx("path",{d:"M3.692 4.63c0-.53.4-.938.939-.938h5.215V0H4.708C2.13 0 0 2.054 0 4.63v5.216h3.692V4.631zM27.354 0h-5.2v3.692h5.17c.53 0 .984.4.984.939v5.215H32V4.631A4.624 4.624 0 0027.354 0zm.954 24.83c0 .532-.4.94-.939.94h-5.215v3.768h5.215c2.577 0 4.631-2.13 4.631-4.707v-5.139h-3.692v5.139zm-23.677.94c-.531 0-.939-.4-.939-.94v-5.138H0v5.139c0 2.577 2.13 4.707 4.708 4.707h5.138V25.77H4.631z"})})}function hTe(){return c.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 25 32",children:c.jsx("path",{d:"M21.333 10.667H19.81V7.619C19.81 3.429 16.38 0 12.19 0 8 0 4.571 3.429 4.571 7.619v3.048H3.048A3.056 3.056 0 000 13.714v15.238A3.056 3.056 0 003.048 32h18.285a3.056 3.056 0 003.048-3.048V13.714a3.056 3.056 0 00-3.048-3.047zM12.19 24.533a3.056 3.056 0 01-3.047-3.047 3.056 3.056 0 013.047-3.048 3.056 3.056 0 013.048 3.048 3.056 3.056 0 01-3.048 3.047zm4.724-13.866H7.467V7.619c0-2.59 2.133-4.724 4.723-4.724 2.591 0 4.724 2.133 4.724 4.724v3.048z"})})}function pTe(){return c.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 25 32",children:c.jsx("path",{d:"M21.333 10.667H19.81V7.619C19.81 3.429 16.38 0 12.19 0c-4.114 1.828-1.37 2.133.305 2.438 1.676.305 4.42 2.59 4.42 5.181v3.048H3.047A3.056 3.056 0 000 13.714v15.238A3.056 3.056 0 003.048 32h18.285a3.056 3.056 0 003.048-3.048V13.714a3.056 3.056 0 00-3.048-3.047zM12.19 24.533a3.056 3.056 0 01-3.047-3.047 3.056 3.056 0 013.047-3.048 3.056 3.056 0 013.048 3.048 3.056 3.056 0 01-3.048 3.047z"})})}function pg({children:e,className:t,...n}){return c.jsx("button",{type:"button",className:on(["react-flow__controls-button",t]),...n,children:e})}const mTe=e=>({isInteractive:e.nodesDraggable||e.nodesConnectable||e.elementsSelectable,minZoomReached:e.transform[2]<=e.minZoom,maxZoomReached:e.transform[2]>=e.maxZoom,ariaLabelConfig:e.ariaLabelConfig});function $B({style:e,showZoom:t=!0,showFitView:n=!0,showInteractive:r=!0,fitViewOptions:a,onZoomIn:s,onZoomOut:i,onFitView:l,onInteractiveChange:d,className:f,children:h,position:p="bottom-left",orientation:g="vertical","aria-label":y}){const S=zt(),{isInteractive:w,minZoomReached:b,maxZoomReached:x,ariaLabelConfig:_}=st(mTe,Vt),{zoomIn:j,zoomOut:C,fitView:T}=f0(),A=()=>{j(),s==null||s()},k=()=>{C(),i==null||i()},O=()=>{T(a),l==null||l()},M=()=>{S.setState({nodesDraggable:!w,nodesConnectable:!w,elementsSelectable:!w}),d==null||d(!w)},z=g==="horizontal"?"horizontal":"vertical";return c.jsxs(Th,{className:on(["react-flow__controls",z,f]),position:p,style:e,"data-testid":"rf__controls","aria-label":y??_["controls.ariaLabel"],children:[t&&c.jsxs(c.Fragment,{children:[c.jsx(pg,{onClick:A,className:"react-flow__controls-zoomin",title:_["controls.zoomIn.ariaLabel"],"aria-label":_["controls.zoomIn.ariaLabel"],disabled:x,children:c.jsx(uTe,{})}),c.jsx(pg,{onClick:k,className:"react-flow__controls-zoomout",title:_["controls.zoomOut.ariaLabel"],"aria-label":_["controls.zoomOut.ariaLabel"],disabled:b,children:c.jsx(dTe,{})})]}),n&&c.jsx(pg,{className:"react-flow__controls-fitview",onClick:O,title:_["controls.fitView.ariaLabel"],"aria-label":_["controls.fitView.ariaLabel"],children:c.jsx(fTe,{})}),r&&c.jsx(pg,{className:"react-flow__controls-interactive",onClick:M,title:_["controls.interactive.ariaLabel"],"aria-label":_["controls.interactive.ariaLabel"],children:w?c.jsx(pTe,{}):c.jsx(hTe,{})}),h]})}$B.displayName="Controls";const gTe=N.memo($B);function yTe({id:e,x:t,y:n,width:r,height:a,style:s,color:i,strokeColor:l,strokeWidth:d,className:f,borderRadius:h,shapeRendering:p,selected:g,onClick:y}){const{background:S,backgroundColor:w}=s||{},b=i||S||w;return c.jsx("rect",{className:on(["react-flow__minimap-node",{selected:g},f]),x:t,y:n,rx:h,ry:h,width:r,height:a,style:{fill:b,stroke:l,strokeWidth:d},shapeRendering:p,onClick:y?x=>y(x,e):void 0})}const vTe=N.memo(yTe),xTe=e=>e.nodes.map(t=>t.id),oj=e=>e instanceof Function?e:()=>e;function bTe({nodeStrokeColor:e,nodeColor:t,nodeClassName:n="",nodeBorderRadius:r=5,nodeStrokeWidth:a,nodeComponent:s=vTe,onClick:i}){const l=st(xTe,Vt),d=oj(t),f=oj(e),h=oj(n),p=typeof window>"u"||window.chrome?"crispEdges":"geometricPrecision";return c.jsx(c.Fragment,{children:l.map(g=>c.jsx(STe,{id:g,nodeColorFunc:d,nodeStrokeColorFunc:f,nodeClassNameFunc:h,nodeBorderRadius:r,nodeStrokeWidth:a,NodeComponent:s,onClick:i,shapeRendering:p},g))})}function wTe({id:e,nodeColorFunc:t,nodeStrokeColorFunc:n,nodeClassNameFunc:r,nodeBorderRadius:a,nodeStrokeWidth:s,shapeRendering:i,NodeComponent:l,onClick:d}){const{node:f,x:h,y:p,width:g,height:y}=st(S=>{const{internals:w}=S.nodeLookup.get(e),b=w.userNode,{x,y:_}=w.positionAbsolute,{width:j,height:C}=Us(b);return{node:b,x,y:_,width:j,height:C}},Vt);return!f||f.hidden||!IH(f)?null:c.jsx(l,{x:h,y:p,width:g,height:y,style:f.style,selected:!!f.selected,className:r(f),color:t(f),borderRadius:a,strokeColor:n(f),strokeWidth:s,shapeRendering:i,onClick:d,id:f.id})}const STe=N.memo(wTe);var _Te=N.memo(bTe);const NTe=200,jTe=150,CTe=e=>!e.hidden,ETe=e=>{const t={x:-e.transform[0]/e.transform[2],y:-e.transform[1]/e.transform[2],width:e.width/e.transform[2],height:e.height/e.transform[2]};return{viewBB:t,boundingRect:e.nodeLookup.size>0?$H(jh(e.nodeLookup,{filter:CTe}),t):t,rfId:e.rfId,panZoom:e.panZoom,translateExtent:e.translateExtent,flowWidth:e.width,flowHeight:e.height,ariaLabelConfig:e.ariaLabelConfig}},TTe="react-flow__minimap-desc";function IB({style:e,className:t,nodeStrokeColor:n,nodeColor:r,nodeClassName:a="",nodeBorderRadius:s=5,nodeStrokeWidth:i,nodeComponent:l,bgColor:d,maskColor:f,maskStrokeColor:h,maskStrokeWidth:p,position:g="bottom-right",onClick:y,onNodeClick:S,pannable:w=!1,zoomable:b=!1,ariaLabel:x,inversePan:_,zoomStep:j=1,offsetScale:C=5}){const T=zt(),A=N.useRef(null),{boundingRect:k,viewBB:O,rfId:M,panZoom:z,translateExtent:L,flowWidth:U,flowHeight:F,ariaLabelConfig:q}=st(ETe,Vt),V=(e==null?void 0:e.width)??NTe,P=(e==null?void 0:e.height)??jTe,K=k.width/V,H=k.height/P,Z=Math.max(K,H),J=Z*V,D=Z*P,W=C*Z,B=k.x-(J-k.width)/2-W,$=k.y-(D-k.height)/2-W,G=J+W*2,ee=D+W*2,re=`${TTe}-${M}`,ne=N.useRef(0),Q=N.useRef();ne.current=Z,N.useEffect(()=>{if(A.current&&z)return Q.current=HCe({domNode:A.current,panZoom:z,getTransform:()=>T.getState().transform,getViewScale:()=>ne.current}),()=>{var se;(se=Q.current)==null||se.destroy()}},[z]),N.useEffect(()=>{var se;(se=Q.current)==null||se.update({translateExtent:L,width:U,height:F,inversePan:_,pannable:w,zoomStep:j,zoomable:b})},[w,b,_,j,L,U,F]);const ae=y?se=>{var ve;const[le,fe]=((ve=Q.current)==null?void 0:ve.pointer(se))||[0,0];y(se,{x:le,y:fe})}:void 0,Y=S?N.useCallback((se,le)=>{const fe=T.getState().nodeLookup.get(le).internals.userNode;S(se,fe)},[]):void 0,te=x??q["minimap.ariaLabel"];return c.jsx(Th,{position:g,style:{...e,"--xy-minimap-background-color-props":typeof d=="string"?d:void 0,"--xy-minimap-mask-background-color-props":typeof f=="string"?f:void 0,"--xy-minimap-mask-stroke-color-props":typeof h=="string"?h:void 0,"--xy-minimap-mask-stroke-width-props":typeof p=="number"?p*Z:void 0,"--xy-minimap-node-background-color-props":typeof r=="string"?r:void 0,"--xy-minimap-node-stroke-color-props":typeof n=="string"?n:void 0,"--xy-minimap-node-stroke-width-props":typeof i=="number"?i:void 0},className:on(["react-flow__minimap",t]),"data-testid":"rf__minimap",children:c.jsxs("svg",{width:V,height:P,viewBox:`${B} ${$} ${G} ${ee}`,className:"react-flow__minimap-svg",role:"img","aria-labelledby":re,ref:A,onClick:ae,children:[te&&c.jsx("title",{id:re,children:te}),c.jsx(_Te,{onClick:Y,nodeColor:r,nodeStrokeColor:n,nodeBorderRadius:s,nodeClassName:a,nodeStrokeWidth:i,nodeComponent:l}),c.jsx("path",{className:"react-flow__minimap-mask",d:`M${B-W},${$-W}h${G+W*2}v${ee+W*2}h${-G-W*2}z
|
|
760
|
+
M${O.x},${O.y}h${O.width}v${O.height}h${-O.width}z`,fillRule:"evenodd",pointerEvents:"none"})]})})}IB.displayName="MiniMap";const ATe=N.memo(IB),RTe=e=>t=>e?`${Math.max(1/t.transform[2],1)}`:void 0,kTe={[su.Line]:"right",[su.Handle]:"bottom-right"};function OTe({nodeId:e,position:t,variant:n=su.Handle,className:r,style:a=void 0,children:s,color:i,minWidth:l=10,minHeight:d=10,maxWidth:f=Number.MAX_VALUE,maxHeight:h=Number.MAX_VALUE,keepAspectRatio:p=!1,resizeDirection:g,autoScale:y=!0,shouldResize:S,onResizeStart:w,onResize:b,onResizeEnd:x}){const _=mB(),j=typeof e=="string"?e:_,C=zt(),T=N.useRef(null),A=n===su.Handle,k=st(N.useCallback(RTe(A&&y),[A,y]),Vt),O=N.useRef(null),M=t??kTe[n];N.useEffect(()=>{if(!(!T.current||!j))return O.current||(O.current=r2e({domNode:T.current,nodeId:j,getStoreItems:()=>{const{nodeLookup:L,transform:U,snapGrid:F,snapToGrid:q,nodeOrigin:V,domNode:P}=C.getState();return{nodeLookup:L,transform:U,snapGrid:F,snapToGrid:q,nodeOrigin:V,paneDomNode:P}},onChange:(L,U)=>{const{triggerNodeChanges:F,nodeLookup:q,parentLookup:V,nodeOrigin:P}=C.getState(),K=[],H={x:L.x,y:L.y},Z=q.get(j);if(Z&&Z.expandParent&&Z.parentId){const J=Z.origin??P,D=L.width??Z.measured.width??0,W=L.height??Z.measured.height??0,B={id:Z.id,parentId:Z.parentId,rect:{width:D,height:W,...LH({x:L.x??Z.position.x,y:L.y??Z.position.y},{width:D,height:W},Z.parentId,q,J)}},$=cT([B],q,V,P);K.push(...$),H.x=L.x?Math.max(J[0]*D,L.x):void 0,H.y=L.y?Math.max(J[1]*W,L.y):void 0}if(H.x!==void 0&&H.y!==void 0){const J={id:j,type:"position",position:{...H}};K.push(J)}if(L.width!==void 0&&L.height!==void 0){const D={id:j,type:"dimensions",resizing:!0,setAttributes:g?g==="horizontal"?"width":"height":!0,dimensions:{width:L.width,height:L.height}};K.push(D)}for(const J of U){const D={...J,type:"position"};K.push(D)}F(K)},onEnd:({width:L,height:U})=>{const F={id:j,type:"dimensions",resizing:!1,dimensions:{width:L,height:U}};C.getState().triggerNodeChanges([F])}})),O.current.update({controlPosition:M,boundaries:{minWidth:l,minHeight:d,maxWidth:f,maxHeight:h},keepAspectRatio:p,resizeDirection:g,onResizeStart:w,onResize:b,onResizeEnd:x,shouldResize:S}),()=>{var L;(L=O.current)==null||L.destroy()}},[M,l,d,f,h,p,w,b,x,S]);const z=M.split("-");return c.jsx("div",{className:on(["react-flow__resize-control","nodrag",...z,n,r]),ref:T,style:{...a,scale:k,...i&&{[A?"backgroundColor":"borderColor"]:i}},children:s})}N.memo(OTe);var p0="Collapsible",[MTe,LB]=wn(p0),[DTe,dT]=MTe(p0),zB=N.forwardRef((e,t)=>{const{__scopeCollapsible:n,open:r,defaultOpen:a,disabled:s,onOpenChange:i,...l}=e,[d,f]=bn({prop:r,defaultProp:a??!1,onChange:i,caller:p0});return c.jsx(DTe,{scope:n,disabled:s,contentId:zn(),open:d,onOpenToggle:N.useCallback(()=>f(h=>!h),[f]),children:c.jsx(Ae.div,{"data-state":hT(d),"data-disabled":s?"":void 0,...l,ref:t})})});zB.displayName=p0;var qB="CollapsibleTrigger",FB=N.forwardRef((e,t)=>{const{__scopeCollapsible:n,...r}=e,a=dT(qB,n);return c.jsx(Ae.button,{type:"button","aria-controls":a.contentId,"aria-expanded":a.open||!1,"data-state":hT(a.open),"data-disabled":a.disabled?"":void 0,disabled:a.disabled,...r,ref:t,onClick:_e(e.onClick,a.onOpenToggle)})});FB.displayName=qB;var fT="CollapsibleContent",UB=N.forwardRef((e,t)=>{const{forceMount:n,...r}=e,a=dT(fT,e.__scopeCollapsible);return c.jsx(sn,{present:n||a.open,children:({present:s})=>c.jsx(PTe,{...r,ref:t,present:s})})});UB.displayName=fT;var PTe=N.forwardRef((e,t)=>{const{__scopeCollapsible:n,present:r,children:a,...s}=e,i=dT(fT,n),[l,d]=N.useState(r),f=N.useRef(null),h=ze(t,f),p=N.useRef(0),g=p.current,y=N.useRef(0),S=y.current,w=i.open||l,b=N.useRef(w),x=N.useRef(void 0);return N.useEffect(()=>{const _=requestAnimationFrame(()=>b.current=!1);return()=>cancelAnimationFrame(_)},[]),Jt(()=>{const _=f.current;if(_){x.current=x.current||{transitionDuration:_.style.transitionDuration,animationName:_.style.animationName},_.style.transitionDuration="0s",_.style.animationName="none";const j=_.getBoundingClientRect();p.current=j.height,y.current=j.width,b.current||(_.style.transitionDuration=x.current.transitionDuration,_.style.animationName=x.current.animationName),d(r)}},[i.open,r]),c.jsx(Ae.div,{"data-state":hT(i.open),"data-disabled":i.disabled?"":void 0,id:i.contentId,hidden:!w,...s,ref:h,style:{"--radix-collapsible-content-height":g?`${g}px`:void 0,"--radix-collapsible-content-width":S?`${S}px`:void 0,...e.style},children:w&&a})});function hT(e){return e?"open":"closed"}var pT=zB,mT=FB,gT=UB,pa="Accordion",$Te=["Home","End","ArrowDown","ArrowUp","ArrowLeft","ArrowRight"],[yT,ITe,LTe]=qy(pa),[m0]=wn(pa,[LTe,LB]),vT=LB(),HB=Me.forwardRef((e,t)=>{const{type:n,...r}=e,a=r,s=r;return c.jsx(yT.Provider,{scope:e.__scopeAccordion,children:n==="multiple"?c.jsx(UTe,{...s,ref:t}):c.jsx(FTe,{...a,ref:t})})});HB.displayName=pa;var[BB,zTe]=m0(pa),[VB,qTe]=m0(pa,{collapsible:!1}),FTe=Me.forwardRef((e,t)=>{const{value:n,defaultValue:r,onValueChange:a=()=>{},collapsible:s=!1,...i}=e,[l,d]=bn({prop:n,defaultProp:r??"",onChange:a,caller:pa});return c.jsx(BB,{scope:e.__scopeAccordion,value:Me.useMemo(()=>l?[l]:[],[l]),onItemOpen:d,onItemClose:Me.useCallback(()=>s&&d(""),[s,d]),children:c.jsx(VB,{scope:e.__scopeAccordion,collapsible:s,children:c.jsx(WB,{...i,ref:t})})})}),UTe=Me.forwardRef((e,t)=>{const{value:n,defaultValue:r,onValueChange:a=()=>{},...s}=e,[i,l]=bn({prop:n,defaultProp:r??[],onChange:a,caller:pa}),d=Me.useCallback(h=>l((p=[])=>[...p,h]),[l]),f=Me.useCallback(h=>l((p=[])=>p.filter(g=>g!==h)),[l]);return c.jsx(BB,{scope:e.__scopeAccordion,value:i,onItemOpen:d,onItemClose:f,children:c.jsx(VB,{scope:e.__scopeAccordion,collapsible:!0,children:c.jsx(WB,{...s,ref:t})})})}),[HTe,g0]=m0(pa),WB=Me.forwardRef((e,t)=>{const{__scopeAccordion:n,disabled:r,dir:a,orientation:s="vertical",...i}=e,l=Me.useRef(null),d=ze(l,t),f=ITe(n),p=Ko(a)==="ltr",g=_e(e.onKeyDown,y=>{var O;if(!$Te.includes(y.key))return;const S=y.target,w=f().filter(M=>{var z;return!((z=M.ref.current)!=null&&z.disabled)}),b=w.findIndex(M=>M.ref.current===S),x=w.length;if(b===-1)return;y.preventDefault();let _=b;const j=0,C=x-1,T=()=>{_=b+1,_>C&&(_=j)},A=()=>{_=b-1,_<j&&(_=C)};switch(y.key){case"Home":_=j;break;case"End":_=C;break;case"ArrowRight":s==="horizontal"&&(p?T():A());break;case"ArrowDown":s==="vertical"&&T();break;case"ArrowLeft":s==="horizontal"&&(p?A():T());break;case"ArrowUp":s==="vertical"&&A();break}const k=_%x;(O=w[k].ref.current)==null||O.focus()});return c.jsx(HTe,{scope:n,disabled:r,direction:a,orientation:s,children:c.jsx(yT.Slot,{scope:n,children:c.jsx(Ae.div,{...i,"data-orientation":s,ref:d,onKeyDown:r?void 0:g})})})}),Cy="AccordionItem",[BTe,xT]=m0(Cy),GB=Me.forwardRef((e,t)=>{const{__scopeAccordion:n,value:r,...a}=e,s=g0(Cy,n),i=zTe(Cy,n),l=vT(n),d=zn(),f=r&&i.value.includes(r)||!1,h=s.disabled||e.disabled;return c.jsx(BTe,{scope:n,open:f,disabled:h,triggerId:d,children:c.jsx(pT,{"data-orientation":s.orientation,"data-state":JB(f),...l,...a,ref:t,disabled:h,open:f,onOpenChange:p=>{p?i.onItemOpen(r):i.onItemClose(r)}})})});GB.displayName=Cy;var KB="AccordionHeader",YB=Me.forwardRef((e,t)=>{const{__scopeAccordion:n,...r}=e,a=g0(pa,n),s=xT(KB,n);return c.jsx(Ae.h3,{"data-orientation":a.orientation,"data-state":JB(s.open),"data-disabled":s.disabled?"":void 0,...r,ref:t})});YB.displayName=KB;var DC="AccordionTrigger",XB=Me.forwardRef((e,t)=>{const{__scopeAccordion:n,...r}=e,a=g0(pa,n),s=xT(DC,n),i=qTe(DC,n),l=vT(n);return c.jsx(yT.ItemSlot,{scope:n,children:c.jsx(mT,{"aria-disabled":s.open&&!i.collapsible||void 0,"data-orientation":a.orientation,id:s.triggerId,...l,...r,ref:t})})});XB.displayName=DC;var ZB="AccordionContent",QB=Me.forwardRef((e,t)=>{const{__scopeAccordion:n,...r}=e,a=g0(pa,n),s=xT(ZB,n),i=vT(n);return c.jsx(gT,{role:"region","aria-labelledby":s.triggerId,"data-orientation":a.orientation,...i,...r,ref:t,style:{"--radix-accordion-content-height":"var(--radix-collapsible-content-height)","--radix-accordion-content-width":"var(--radix-collapsible-content-width)",...e.style}})});QB.displayName=ZB;function JB(e){return e?"open":"closed"}var VTe=HB,WTe=GB,GTe=YB,eV=XB,tV=QB;const nV=VTe,bT=N.forwardRef(({className:e,...t},n)=>c.jsx(WTe,{ref:n,className:ye("border-b",e),...t}));bT.displayName="AccordionItem";const wT=N.forwardRef(({className:e,children:t,...n},r)=>c.jsx(GTe,{className:"flex",children:c.jsxs(eV,{ref:r,className:ye("flex flex-1 items-center justify-between py-4 text-sm font-medium transition-all hover:underline text-left [&[data-state=open]>svg]:rotate-180",e),...n,children:[t,c.jsx(uu,{className:"h-4 w-4 shrink-0 text-muted-foreground transition-transform duration-200"})]})}));wT.displayName=eV.displayName;const ST=N.forwardRef(({className:e,children:t,...n},r)=>c.jsx(tV,{ref:r,className:"overflow-hidden text-sm data-[state=closed]:animate-accordion-up data-[state=open]:animate-accordion-down",...n,children:c.jsx("div",{className:ye("pb-4 pt-0",e),children:t})}));ST.displayName=tV.displayName;const nt="h-4 w-4",rV={webhook:()=>c.jsx(_g,{className:`${nt} text-amber-500`}),schedule:()=>c.jsx(Bi,{className:`${nt} text-amber-500`}),calendar:()=>c.jsx(rZ,{className:`${nt} text-amber-500`}),chatTrigger:()=>c.jsx(Ea,{className:`${nt} text-amber-500`}),manualTrigger:()=>c.jsx(sQ,{className:`${nt} text-amber-500`}),httpPolling:()=>c.jsx(qz,{className:`${nt} text-amber-500`}),http:()=>c.jsx(_g,{className:`${nt} text-blue-500`}),email:()=>c.jsx(SQ,{className:`${nt} text-blue-500`}),slack:()=>c.jsx(Ea,{className:`${nt} text-blue-500`}),condition:()=>c.jsx(hf,{className:`${nt} text-purple-500`}),loop:()=>c.jsx(ZC,{className:`${nt} text-purple-500`}),switch:()=>c.jsx(Kg,{className:`${nt} text-purple-500`}),delay:()=>c.jsx(Bi,{className:`${nt} text-purple-500`}),errorHandler:()=>c.jsx($y,{className:`${nt} text-purple-500`}),setVariable:()=>c.jsx(RJ,{className:`${nt} text-purple-500`}),stickyNote:()=>c.jsx(hJ,{className:`${nt} text-amber-500`}),database:()=>c.jsx(Oj,{className:`${nt} text-green-500`}),transform:()=>c.jsx(Jd,{className:`${nt} text-green-500`}),filterData:()=>c.jsx(Kg,{className:`${nt} text-green-500`}),aggregate:()=>c.jsx(Sg,{className:`${nt} text-green-500`}),python:()=>c.jsx(Jd,{className:`${nt} text-orange-500`}),code:()=>c.jsx(Jd,{className:`${nt} text-purple-500`}),textGeneration:()=>c.jsx(KZ,{className:`${nt} text-indigo-500`}),chatCompletion:()=>c.jsx(Ea,{className:`${nt} text-indigo-500`}),classification:()=>c.jsx(Ng,{className:`${nt} text-indigo-500`}),imageGeneration:()=>c.jsx(Ng,{className:`${nt} text-indigo-500`}),barChart:()=>c.jsx(Sg,{className:`${nt} text-orange-500`}),lineChart:()=>c.jsx(sZ,{className:`${nt} text-orange-500`}),pieChart:()=>c.jsx(uZ,{className:`${nt} text-orange-500`}),defaultTrigger:()=>c.jsx(Gf,{className:`${nt} text-amber-500`}),defaultApi:()=>c.jsx(_g,{className:`${nt} text-blue-500`}),defaultFunction:()=>c.jsx(Iy,{className:`${nt} text-purple-500`}),defaultData:()=>c.jsx(Oj,{className:`${nt} text-green-500`}),defaultAi:()=>c.jsx(Ng,{className:`${nt} text-indigo-500`}),defaultVisualization:()=>c.jsx(Sg,{className:`${nt} text-orange-500`}),group:()=>c.jsx(ZX,{className:`${nt} text-blue-500`}),start:()=>c.jsx(Wf,{className:"h-4 w-4 text-emerald-600"}),end:()=>c.jsx(Hz,{className:"h-4 w-4 text-rose-600"})},KTe={trigger:"defaultTrigger",api:"defaultApi",function:"defaultFunction",data:"defaultData",ai:"defaultAi",visualization:"defaultVisualization",python:"python",chatTrigger:"chatTrigger",group:"group",start:"start",end:"end"},YTe=[[/webhook/i,"webhook"],[/(schedule|cron)/i,"schedule"],[/calendar/i,"calendar"],[/manual/i,"manualTrigger"],[/poll/i,"httpPolling"],[/(chat trigger|chat)/i,"chatTrigger"],[/http|api/i,"http"],[/email/i,"email"],[/slack/i,"slack"],[/condition/i,"condition"],[/(loop|iterate)/i,"loop"],[/switch/i,"switch"],[/(delay|wait)/i,"delay"],[/(set variable|assign)/i,"setVariable"],[/(sticky note|note)/i,"stickyNote"],[/error/i,"errorHandler"],[/database|sql/i,"database"],[/transform/i,"transform"],[/python/i,"python"],[/filter/i,"filterData"],[/(aggregate|group)/i,"aggregate"],[/(code|script)/i,"code"],[/(text generation|text)/i,"textGeneration"],[/(chat completion|chat response)/i,"chatCompletion"],[/classification/i,"classification"],[/image/i,"imageGeneration"],[/bar chart/i,"barChart"],[/line chart/i,"lineChart"],[/pie chart/i,"pieChart"]],PC=e=>e in rV,Rh=e=>{if(!e)return;const t=PC(e)?e:void 0,n=t?rV[t]:void 0;return n?n():void 0},_T=e=>{const{iconKey:t,label:n,type:r}=e;if(t&&PC(t))return t;if(n){const a=YTe.find(([s])=>s.test(n));if(a)return a[1]}if(r){const a=KTe[r];if(a&&PC(a))return a}},ij=({node:e,onSelect:t})=>{const n=e.icon??Rh(e.iconKey),r=()=>{t==null||t(e)},a=s=>{const i={...e,icon:void 0};s.dataTransfer.setData("application/reactflow",JSON.stringify(i)),s.dataTransfer.effectAllowed="move"};return c.jsxs("div",{className:"flex items-start gap-3 p-2 rounded-md hover:bg-accent cursor-pointer",onClick:r,draggable:!0,onDragStart:a,children:[c.jsx("div",{className:"mt-0.5",children:n}),c.jsxs("div",{children:[c.jsx("div",{className:"font-medium text-sm",children:e.name}),c.jsx("div",{className:"text-xs text-muted-foreground",children:e.description})]})]})},Qe=({id:e,name:t,description:n,iconKey:r,type:a,backendType:s,data:i})=>{const l={label:t,type:a,description:n,...i??{},iconKey:r,...s?{backendType:s}:{}};return{id:e,name:t,description:n,iconKey:r,icon:Rh(r),type:a,backendType:s,data:l}},XTe={id:"actions",name:"Actions",icon:c.jsx(_g,{className:"h-4 w-4 text-blue-500"}),nodes:[Qe({id:"http-request",name:"HTTP Request",description:"Make HTTP requests to external APIs",iconKey:"http",type:"api"}),Qe({id:"email-send",name:"Send Email",description:"Send and receive emails",iconKey:"email",type:"api"}),Qe({id:"slack",name:"Slack",description:"Interact with Slack channels",iconKey:"slack",type:"api",backendType:"SlackNode"})]},ZTe={id:"ai",name:"AI & ML",icon:c.jsx(Ng,{className:"h-4 w-4 text-indigo-500"}),nodes:[Qe({id:"text-generation",name:"Text Generation",description:"Generate text with AI models",iconKey:"textGeneration",type:"ai"}),Qe({id:"chat-completion",name:"Chat Completion",description:"Generate chat responses",iconKey:"chatCompletion",type:"ai"}),Qe({id:"classification",name:"Classification",description:"Classify content with ML models",iconKey:"classification",type:"ai"}),Qe({id:"image-generation",name:"Image Generation",description:"Generate images with AI",iconKey:"imageGeneration",type:"ai"})]},QTe={id:"data",name:"Data Processing",icon:c.jsx(Oj,{className:"h-4 w-4 text-green-500"}),nodes:[Qe({id:"database",name:"Database",description:"Query databases with SQL",iconKey:"database",type:"data"}),Qe({id:"transform",name:"Transform",description:"Transform data between steps",iconKey:"transform",type:"data"}),Qe({id:"python-code",name:"Python Code",description:"Execute custom Python scripts",iconKey:"python",type:"python",data:{code:Uo,backendType:"PythonCode"}}),Qe({id:"filter",name:"Filter Data",description:"Filter data based on conditions",iconKey:"filterData",type:"data"}),Qe({id:"aggregate",name:"Aggregate",description:"Group and aggregate data",iconKey:"aggregate",type:"data"})]},JTe={id:"logic",name:"Logic & Flow",icon:c.jsx(hf,{className:"h-4 w-4 text-purple-500"}),nodes:[Qe({id:"condition",name:"If / Else",description:"Branch based on a comparison",iconKey:"condition",type:"function",backendType:"IfElseNode",data:{conditionLogic:"and",conditions:[{id:"condition-1",left:"{{previous.result}}",operator:"equals",right:"expected",caseSensitive:!1}],outputs:[{id:"true",label:"True"},{id:"false",label:"False"}]}}),Qe({id:"loop",name:"While Loop",description:"Iterate while a condition remains true",iconKey:"loop",type:"function",backendType:"WhileNode",data:{conditionLogic:"and",conditions:[{id:"condition-1",operator:"less_than",right:3}],maxIterations:10,outputs:[{id:"continue",label:"Continue"},{id:"exit",label:"Exit"}]}}),Qe({id:"switch",name:"Switch",description:"Multiple conditional branches",iconKey:"switch",type:"function",backendType:"SwitchNode",data:{value:"{{previous.status}}",caseSensitive:!1,defaultBranchKey:"default",cases:[{id:"case-1",match:"approved",label:"Approved",branchKey:"approved"},{id:"case-2",match:"rejected",label:"Rejected",branchKey:"rejected"}],outputs:[{id:"approved",label:"Approved"},{id:"rejected",label:"Rejected"},{id:"default",label:"Default"}]}}),Qe({id:"delay",name:"Delay",description:"Pause workflow execution",iconKey:"delay",type:"function",backendType:"DelayNode",data:{durationSeconds:5}}),Qe({id:"error-handler",name:"Error Handler",description:"Handle errors in workflow",iconKey:"errorHandler",type:"function"}),Qe({id:"set-variable",name:"Set Variable",description:"Store a value for downstream steps",iconKey:"setVariable",type:"function",backendType:"SetVariableNode",data:{variables:[{name:"my_variable",valueType:"string",value:"sample"}],outputs:[{id:"default"}]}})]},eAe={id:"special",name:"Special Nodes",icon:c.jsx(Iy,{className:"h-4 w-4 text-gray-500"}),nodes:[Qe({id:"start-node",name:"Workflow Start",description:"Beginning of the workflow",iconKey:"start",type:"start"}),Qe({id:"end-node",name:"Workflow End",description:"End of the workflow",iconKey:"end",type:"end"}),Qe({id:"group-node",name:"Node Group",description:"Group related nodes together",iconKey:"group",type:"group"}),Qe({id:"sticky-note",name:"Sticky Note",description:"Add workflow annotations",iconKey:"stickyNote",type:"annotation",data:{color:"yellow",content:"Document why this branch exists."}})]},tAe={id:"triggers",name:"Triggers",icon:c.jsx(Gf,{className:"h-4 w-4 text-amber-500"}),nodes:[Qe({id:"webhook-trigger",name:"Webhook",description:"Trigger workflow via HTTP request",iconKey:"webhook",type:"trigger",backendType:"WebhookTriggerNode"}),Qe({id:"manual-trigger",name:"Manual",description:"Dispatch runs from the dashboard",iconKey:"manualTrigger",type:"trigger",backendType:"ManualTriggerNode"}),Qe({id:"http-polling-trigger",name:"HTTP Polling",description:"Poll an API on a schedule",iconKey:"httpPolling",type:"trigger",backendType:"HttpPollingTriggerNode"}),Qe({id:"schedule-trigger",name:"Schedule",description:"Run workflow on a schedule",iconKey:"schedule",type:"trigger",backendType:"CronTriggerNode"})]},nAe={id:"visualization",name:"Visualization",icon:c.jsx(Sg,{className:"h-4 w-4 text-orange-500"}),nodes:[Qe({id:"bar-chart",name:"Bar Chart",description:"Create bar charts from data",iconKey:"barChart",type:"visualization"}),Qe({id:"line-chart",name:"Line Chart",description:"Create line charts from data",iconKey:"lineChart",type:"visualization"}),Qe({id:"pie-chart",name:"Pie Chart",description:"Create pie charts from data",iconKey:"pieChart",type:"visualization"})]},lj=[eAe,tAe,XTe,JTe,QTe,ZTe,nAe],rAe=[Qe({id:"http-recent",name:"HTTP Request",description:"Make HTTP requests to external APIs",iconKey:"http",type:"api"}),Qe({id:"python-recent",name:"Python Code",description:"Execute custom Python scripts",iconKey:"python",type:"python",data:{code:Uo}}),Qe({id:"text-generation-recent",name:"Text Generation",description:"Generate text with AI models",iconKey:"textGeneration",type:"ai"}),Qe({id:"start-node-recent",name:"Workflow Start",description:"Beginning of the workflow",iconKey:"start",type:"start"}),Qe({id:"end-node-recent",name:"Workflow End",description:"End of the workflow",iconKey:"end",type:"end"})],vL=[Qe({id:"http-favorite",name:"HTTP Request",description:"Make HTTP requests to external APIs",iconKey:"http",type:"api"}),Qe({id:"transform-favorite",name:"Transform",description:"Transform data between steps",iconKey:"transform",type:"data"}),Qe({id:"python-favorite",name:"Python Code",description:"Execute custom Python scripts",iconKey:"python",type:"python",data:{code:Uo}})];function aAe({isCollapsed:e=!1,onToggleCollapse:t,onAddNode:n,className:r,position:a="left"}){const[s,i]=N.useState(""),l=N.useMemo(()=>sAe(lj,s),[s]),d=g=>{n==null||n(g)},f=()=>{e&&(t==null||t())},h=ye(a==="canvas"?"bg-card border border-border rounded-md shadow-md transition-all duration-300":"h-full border-r border-border bg-card transition-all duration-300 flex flex-col",e?"w-[50px]":"w-[300px]",r),p=a==="canvas"?"h-[calc(100vh-280px)]":"h-[calc(100vh-180px)]";return c.jsxs("div",{className:h,children:[c.jsxs("div",{className:"flex items-center justify-between p-3 border-b border-border",children:[!e&&c.jsx("div",{className:"text-lg font-semibold",children:"Nodes"}),c.jsx(me,{variant:"ghost",size:"icon",onClick:t,className:ye(e&&"mx-auto"),children:c.jsx(ff,{className:ye("h-5 w-5 transition-transform",e&&"rotate-180")})})]}),!e&&c.jsxs(c.Fragment,{children:[c.jsx("div",{className:"p-3",children:c.jsxs("div",{className:"relative",children:[c.jsx(ia,{className:"absolute left-2 top-2.5 h-4 w-4 text-muted-foreground"}),c.jsx(Ct,{placeholder:"Search nodes...",className:"pl-8",value:s,onChange:g=>i(g.target.value)})]})}),c.jsxs(Da,{defaultValue:"all",className:"flex-1 flex flex-col",children:[c.jsx("div",{className:"px-3",children:c.jsxs(Ls,{className:"w-full",children:[c.jsx(St,{value:"all",className:"flex-1",children:"All"}),c.jsx(St,{value:"recent",className:"flex-1",children:"Recent"}),c.jsx(St,{value:"favorites",className:"flex-1",children:"Favorites"})]})}),c.jsx($t,{value:"all",className:"flex-1 mt-0",children:c.jsx(Mo,{className:p,children:c.jsx("div",{className:"p-3",children:s&&l.length===0?c.jsxs("div",{className:"text-center py-8 text-muted-foreground",children:['No nodes found matching "',s,'"']}):c.jsx(nV,{type:"multiple",defaultValue:lj.map(g=>g.id),className:"space-y-2",children:l.map(g=>c.jsxs(bT,{value:g.id,className:"border-border",children:[c.jsx(wT,{className:"py-2 hover:no-underline",children:c.jsxs("div",{className:"flex items-center gap-2",children:[g.icon,c.jsx("span",{children:g.name})]})}),c.jsx(ST,{children:c.jsx("div",{className:"space-y-1 pl-6",children:g.nodes.map(y=>c.jsx(ij,{node:y,onSelect:d},y.id))})})]},g.id))})})})}),c.jsx($t,{value:"recent",className:"flex-1 mt-0",children:c.jsx(Mo,{className:p,children:c.jsx("div",{className:"p-3 space-y-2",children:rAe.map(g=>c.jsx(ij,{node:g,onSelect:d},g.id))})})}),c.jsx($t,{value:"favorites",className:"flex-1 mt-0",children:c.jsx(Mo,{className:p,children:vL.length>0?c.jsx("div",{className:"p-3 space-y-2",children:vL.map(g=>c.jsx(ij,{node:g,onSelect:d},g.id))}):c.jsx("div",{className:"flex items-center justify-center h-full text-muted-foreground p-4",children:"No favorite nodes yet"})})})]})]}),e&&c.jsx("div",{className:"flex flex-col items-center gap-4 py-4",children:lj.map(g=>c.jsx(me,{variant:"ghost",size:"icon",className:"h-8 w-8",title:g.name,onClick:f,children:g.icon},g.id))})]})}const sAe=(e,t)=>{const n=t.toLowerCase();return n?e.map(r=>({...r,nodes:r.nodes.filter(a=>a.name.toLowerCase().includes(n)||a.description.toLowerCase().includes(n))})).filter(r=>r.nodes.length>0):e},aV=Me.forwardRef(({visible:e,isDisabled:t,nodeId:n,onDelete:r},a)=>c.jsxs("div",{ref:a,className:ye("absolute -top-4 left-1/2 transform -translate-x-1/2 flex items-center gap-0.5 bg-background border border-border rounded-md shadow-md p-0.5 transition-opacity duration-200 z-20 pointer-events-auto",e?"opacity-100":"opacity-0 pointer-events-none"),children:[c.jsx(Vn,{children:c.jsxs(Wn,{children:[c.jsx(Gn,{asChild:!0,children:c.jsx("button",{className:"p-0.5 rounded-sm hover:bg-accent focus:outline-none focus:ring-1 focus:ring-primary focus:ring-offset-0.5",children:c.jsx(Wf,{className:"h-2 w-2"})})}),c.jsx(In,{children:c.jsx("p",{children:"Run from this node"})})]})}),c.jsx(Vn,{children:c.jsxs(Wn,{children:[c.jsx(Gn,{asChild:!0,children:c.jsx("button",{className:"p-0.5 rounded-sm hover:bg-accent focus:outline-none focus:ring-1 focus:ring-primary focus:ring-offset-0.5",children:c.jsx(Iy,{className:"h-2 w-2"})})}),c.jsx(In,{children:c.jsx("p",{children:"Configure node"})})]})}),c.jsx(Vn,{children:c.jsxs(Wn,{children:[c.jsx(Gn,{asChild:!0,children:c.jsx("button",{className:"p-0.5 rounded-sm hover:bg-accent focus:outline-none focus:ring-1 focus:ring-primary focus:ring-offset-0.5",children:c.jsx(xJ,{className:"h-2 w-2"})})}),c.jsx(In,{children:c.jsxs("p",{children:[t?"Enable":"Disable"," node"]})})]})}),c.jsx(Vn,{children:c.jsxs(Wn,{children:[c.jsx(Gn,{asChild:!0,children:c.jsx("button",{className:"p-0.5 rounded-sm hover:bg-accent hover:text-destructive focus:outline-none focus:ring-1 focus:ring-destructive focus:ring-offset-0.5",onClick:s=>{s.preventDefault(),s.stopPropagation(),r==null||r(n)},children:c.jsx(Ly,{className:"h-2 w-2"})})}),c.jsx(In,{children:c.jsx("p",{children:"Delete node"})})]})})]}));aV.displayName="WorkflowNodeControls";const oAe=e=>e.hideInputHandle?[]:e.inputs&&e.inputs.length>0?e.inputs:[{id:void 0}],iAe=e=>e.outputs&&e.outputs.length>0?e.outputs:[{id:void 0}],lAe=(e,t)=>{switch(e){case"left":return Te.Left;case"right":return Te.Right;case"top":return Te.Top;case"bottom":return Te.Bottom;default:return t}},cAe=(e,t,n,r)=>{const a=r==="target"?Te.Left:Te.Right,s=lAe(e.position,a),i=(t+1)/(n+1)*100,l={};n>1&&(s===Te.Left||s===Te.Right?l.top=`${i}%`:l.left=`${i}%`);const d=n>1?{top:`${i}%`,transform:"translateY(-50%)"}:{top:"50%",transform:"translateY(-50%)"};return c.jsxs(Me.Fragment,{children:[c.jsx(Go,{type:r,id:e.id,position:s,className:"!h-2 !w-2 !bg-primary !border-2 !border-background !z-10 !pointer-events-auto",style:l,isConnectable:!0}),r==="source"&&e.label&&c.jsx("span",{className:"absolute left-[calc(100%+8px)] text-[6px] uppercase tracking-wide text-muted-foreground pointer-events-none whitespace-nowrap",style:d,children:e.label})]},`${r}-${e.id??t}`)},xL=({handles:e,type:t})=>e.map((n,r)=>cAe(n,r,e.length,t)),uAe={idle:c.jsx(Bi,{className:"h-4 w-4 text-muted-foreground"}),running:c.jsx(Bi,{className:"h-4 w-4 text-blue-500 animate-pulse"}),success:c.jsx(Tz,{className:"h-4 w-4 text-green-500"}),error:c.jsx($y,{className:"h-4 w-4 text-red-500"})},mg={default:"bg-card border-border",api:"bg-blue-50 border-blue-200 dark:bg-blue-950/30 dark:border-blue-800/50",function:"bg-purple-50 border-purple-200 dark:bg-purple-950/30 dark:border-purple-800/50",trigger:"bg-amber-50 border-amber-200 dark:bg-amber-950/30 dark:border-amber-800/50",data:"bg-green-50 border-green-200 dark:bg-green-950/30 dark:border-green-800/50",ai:"bg-indigo-50 border-indigo-200 dark:bg-indigo-950/30 dark:border-indigo-800/50",python:"bg-orange-50 border-orange-200 dark:bg-orange-950/30 dark:border-orange-800/50"},dAe=e=>uAe[e],fAe=e=>e&&Object.prototype.hasOwnProperty.call(mg,e)?mg[e]:mg.default,hAe=({id:e,data:t,selected:n})=>{const r=t,[a,s]=N.useState(!1),i=N.useRef(null),l=N.useRef(null),{label:d,icon:f,status:h="idle",type:p,isDisabled:g,isSearchMatch:y=!1,isSearchActive:S=!1}=r;N.useEffect(()=>{const T=typeof document<"u"?document:void 0;if(!T)return;const A=k=>{const O=k.target;i.current&&!i.current.contains(O)&&l.current&&!l.current.contains(O)&&s(!1)};return T.addEventListener("mousedown",A),()=>{T.removeEventListener("mousedown",A)}},[]);const w=fAe(p),b=dAe(h),x=()=>{s(!0)},_=()=>{s(!1)},j=oAe(r),C=iAe(r);return c.jsxs("div",{ref:l,"data-search-match":y?"true":void 0,"data-search-active":S?"true":void 0,className:ye("group relative border shadow-sm transition-all duration-200",w,n&&"ring-2 ring-primary ring-offset-2",y&&!S&&"ring-2 ring-sky-400/70 ring-offset-2",S&&"ring-4 ring-sky-500 ring-offset-2",g&&"opacity-60","h-16 w-16 rounded-xl cursor-pointer"),onMouseEnter:x,onMouseLeave:_,tabIndex:0,role:"button","aria-selected":!!n,children:[c.jsx("div",{className:"absolute -bottom-6 left-1/2 -translate-x-1/2 text-xs text-center whitespace-nowrap pointer-events-none",children:c.jsx("span",{className:ye("px-2 py-0.5 rounded-full transition-colors",S?"bg-sky-500/10 text-sky-700 dark:text-sky-300":y?"bg-sky-500/5 text-sky-600 dark:text-sky-200":void 0),children:d})}),c.jsx(xL,{handles:j,type:"target"}),c.jsx(xL,{handles:C,type:"source"}),c.jsxs("div",{className:"h-full w-full flex items-center justify-center relative pointer-events-none",children:[c.jsx("div",{className:"absolute top-1 right-1 pointer-events-auto",children:b}),c.jsx("div",{className:"flex items-center justify-center pointer-events-auto",children:f?c.jsx("div",{className:"scale-125",children:f}):c.jsx("div",{className:"text-xs font-medium text-center",children:d.substring(0,2)})})]}),c.jsx(aV,{ref:i,visible:a,isDisabled:g,nodeId:e,onDelete:T=>{var A;(A=r.onDelete)==null||A.call(r,T)}})]})};function pAe({id:e,label:t,onLabelChange:n,editable:r=!0,className:a}){const[s,i]=N.useState(!1),[l,d]=N.useState(""),f=N.useRef(null);N.useEffect(()=>{s&&f.current&&f.current.focus()},[s]);const h=S=>{r&&(S.stopPropagation(),i(!0),d(t))},p=()=>{i(!1)},g=()=>{n&&l.trim()!==""&&n(e,l),i(!1)},y=S=>{S.key==="Enter"?g():S.key==="Escape"&&p()};return c.jsx("div",{className:ye("mb-2 w-full text-center",a),children:s?c.jsxs("div",{className:"flex items-center justify-center",children:[c.jsx(Ct,{ref:f,value:l,onChange:S=>d(S.target.value),onKeyDown:y,className:"h-6 py-0 px-1 text-xs w-[100px] text-center",autoFocus:!0}),c.jsxs("div",{className:"absolute right-[-40px] flex space-x-1",children:[c.jsx("button",{onClick:g,className:"p-1 rounded-full bg-green-100 hover:bg-green-200 dark:bg-green-900/30 dark:hover:bg-green-800/50",children:c.jsx(Is,{className:"h-3 w-3 text-green-600 dark:text-green-400"})}),c.jsx("button",{onClick:p,className:"p-1 rounded-full bg-red-100 hover:bg-red-200 dark:bg-red-900/30 dark:hover:bg-red-800/50",children:c.jsx(la,{className:"h-3 w-3 text-red-600 dark:text-red-400"})})]})]}):c.jsxs("div",{className:"flex items-center justify-center text-xs",onDoubleClick:h,children:[c.jsx("span",{className:"whitespace-nowrap overflow-hidden text-ellipsis px-1",children:t}),r&&c.jsx("button",{onClick:h,className:"ml-1 opacity-0 group-hover:opacity-100 hover:text-primary transition-opacity",children:c.jsx(Dj,{className:"h-3 w-3"})})]})})}const mAe=({data:e,selected:t,id:n})=>{const r=e,{label:a,description:s,status:i="idle",onOpenChat:l,onLabelChange:d}=r,f={idle:"bg-muted",running:"bg-blue-500",success:"bg-green-500",error:"bg-red-500"};return c.jsxs("div",{className:"flex flex-col items-center",children:[c.jsxs("div",{className:ye("relative group rounded-lg border p-3 shadow-sm bg-background w-[180px]",t?"border-primary ring-2 ring-primary ring-opacity-20":"border-border"),children:[c.jsx("div",{className:ye("absolute top-1 right-1 w-2 h-2 rounded-full",f[i])}),c.jsx(Go,{type:"source",position:Te.Right,id:"out",className:"!h-3 !w-3 !bg-primary !border-2 !border-background"}),c.jsxs("div",{className:"flex flex-col items-center gap-2",children:[c.jsx("div",{className:"rounded-full bg-primary/10 p-2",children:c.jsx(Ea,{className:"h-5 w-5 text-primary"})}),c.jsx("div",{className:"text-center",children:s&&c.jsx("p",{className:"text-xs text-muted-foreground truncate max-w-[150px]",children:s})}),c.jsx(Vn,{children:c.jsxs(Wn,{children:[c.jsx(Gn,{asChild:!0,children:c.jsxs(me,{variant:"secondary",size:"sm",className:"mt-1 w-full",onClick:l,children:[c.jsx(Ea,{className:"h-3.5 w-3.5 mr-1"}),"Test Chat"]})}),c.jsx(In,{children:c.jsx("p",{children:"Open chat interface to test this trigger"})})]})})]})]}),c.jsx(pAe,{id:n,label:a,onLabelChange:d})]})},gAe=({data:e,selected:t})=>{const n=e,{label:r,type:a}=n,s={start:"bg-emerald-50 border-emerald-300 dark:bg-emerald-950/30 dark:border-emerald-800/50",end:"bg-rose-50 border-rose-300 dark:bg-rose-950/30 dark:border-rose-800/50"};return c.jsxs("div",{className:ye("group relative rounded-xl border-2 shadow-sm transition-all duration-200 h-16 w-16 aspect-square flex items-center justify-center",s[a],t&&"ring-2 ring-primary ring-offset-2"),children:[c.jsx("div",{className:"absolute -bottom-6 left-1/2 -translate-x-1/2 text-xs text-center whitespace-nowrap",children:c.jsx("span",{className:"px-2 py-0.5 rounded-full transition-colors",children:r})}),a==="end"&&c.jsx(Go,{type:"target",position:Te.Left,className:"!h-2 !w-2 !bg-primary !border-2 !border-background"}),a==="start"&&c.jsx(Go,{type:"source",position:Te.Right,className:"!h-2 !w-2 !bg-primary !border-2 !border-background"}),c.jsx("div",{className:"flex items-center justify-center",children:a==="start"?c.jsx(Wf,{className:"h-6 w-6 text-emerald-600 dark:text-emerald-400"}):c.jsx(Hz,{className:"h-5 w-5 text-rose-600 dark:text-rose-400"})})]})},cj={yellow:"bg-amber-100 border-amber-200 text-amber-950 dark:bg-amber-500/20 dark:border-amber-400/30 dark:text-amber-100",pink:"bg-rose-100 border-rose-200 text-rose-950 dark:bg-rose-500/20 dark:border-rose-400/30 dark:text-rose-100",blue:"bg-sky-100 border-sky-200 text-sky-950 dark:bg-sky-500/20 dark:border-sky-400/30 dark:text-sky-100",green:"bg-emerald-100 border-emerald-200 text-emerald-950 dark:bg-emerald-500/20 dark:border-emerald-400/30 dark:text-emerald-100",purple:"bg-violet-100 border-violet-200 text-violet-950 dark:bg-violet-500/20 dark:border-violet-400/30 dark:text-violet-100"},sV=["yellow","pink","blue","green","purple"],uj=180,dj=150,yAe=e=>typeof e=="string"&&sV.includes(e),gg=(e,t)=>Number.isNaN(e)||!Number.isFinite(e)?t:Math.max(t,Math.round(e)),vAe=({id:e,data:t,selected:n})=>{var x;const r=N.useRef(null),a=N.useMemo(()=>yAe(t.color)?t.color:"yellow",[t.color]),s=gg(typeof t.width=="number"?t.width:uj,uj),i=gg(typeof t.height=="number"?t.height:dj,dj),l=(x=t.label)!=null&&x.length?t.label:"Sticky Note",d=N.useCallback(_=>{t.onUpdateStickyNote&&t.onUpdateStickyNote(e,{color:_})},[t,e]),f=N.useCallback(_=>{t.onUpdateStickyNote&&t.onUpdateStickyNote(e,{content:_.target.value})},[t,e]),h=_=>{_.stopPropagation()},p=N.useCallback(_=>{var j;_.stopPropagation(),(j=t.onDelete)==null||j.call(t,e)},[t,e]),g=N.useCallback(_=>{_.stopPropagation(),_.preventDefault(),r.current={pointerId:_.pointerId,startX:_.clientX,startY:_.clientY,startWidth:s,startHeight:i},_.currentTarget.setPointerCapture(_.pointerId)},[i,s]),y=N.useCallback(_=>{const j=r.current;if(!j||j.pointerId!==_.pointerId||!t.onUpdateStickyNote)return;const C=_.clientX-j.startX,T=_.clientY-j.startY,A=gg(j.startWidth+C,uj),k=gg(j.startHeight+T,dj);t.onUpdateStickyNote(e,{width:A,height:k})},[t,e]),S=N.useCallback(_=>{const j=r.current;!j||j.pointerId!==_.pointerId||(_.currentTarget.hasPointerCapture(_.pointerId)&&_.currentTarget.releasePointerCapture(_.pointerId),r.current=null)},[]),w=cj[a]??cj.yellow,b=typeof t.content=="string"?t.content:"";return c.jsxs("div",{className:ye("group relative flex h-full w-full min-h-[150px] min-w-[180px] flex-col rounded-xl border shadow-md transition",w,n&&"ring-2 ring-primary ring-offset-2"),style:{width:s,height:i},onClick:h,children:[c.jsxs("div",{className:"flex items-center justify-between px-3 py-2 text-xs font-medium",children:[c.jsxs("div",{className:"flex items-center gap-1 text-muted-foreground",children:[c.jsx(zz,{className:"h-3 w-3"}),l]}),c.jsx(me,{variant:"ghost",size:"icon",className:"h-6 w-6 text-muted-foreground hover:text-destructive",onClick:p,children:c.jsx(QC,{className:"h-3 w-3"})})]}),c.jsx(ih,{value:b,onChange:f,placeholder:"Leave a note for collaborators",className:"flex-1 resize-none border-none bg-transparent px-3 text-sm focus-visible:ring-0 focus-visible:ring-offset-0",onPointerDown:_=>_.stopPropagation()}),c.jsxs("div",{className:"flex items-center justify-between gap-2 px-3 py-2",children:[c.jsx("div",{className:"flex items-center gap-1",children:sV.map(_=>c.jsx("button",{type:"button",className:ye("h-4 w-4 rounded-full border transition hover:scale-110",cj[_],_===a&&"ring-2 ring-offset-1 ring-primary"),onClick:j=>{j.stopPropagation(),d(_)},"aria-label":`Set sticky note color to ${_}`},_))}),c.jsx("span",{className:"text-[10px] uppercase tracking-wide text-muted-foreground",children:"Drag to move • Resize corner"})]}),c.jsx("div",{role:"presentation",className:"absolute bottom-1 right-1 h-3 w-3 cursor-se-resize rounded-sm border border-dashed border-border/60 bg-transparent",onPointerDown:g,onPointerMove:y,onPointerUp:S,onPointerCancel:S})]})},oV=Me.createContext(null),xAe=()=>Me.useContext(oV);function bAe({id:e,sourceX:t,sourceY:n,targetX:r,targetY:a,sourcePosition:s,targetPosition:i,style:l={},markerEnd:d}){const f=xAe(),[h,p]=Me.useState(!1),{setEdges:g}=f0(),[y,S,w]=sT({sourceX:t,sourceY:n,sourcePosition:s,targetX:r,targetY:a,targetPosition:i}),b=(f==null?void 0:f.hoveredEdgeId)??null,x=f==null?void 0:f.setHoveredEdgeId,_=Me.useCallback(T=>{if(x){const A=T?e:null;if(b===A)return;x(A)}else p(T)},[b,e,x]),j=x!==void 0?b===e:h,C=T=>{T.stopPropagation();try{let A=!1;g(k=>{let O=!1;const M=k.filter(z=>{const L=z.id!==e;return L||(O=!0),L});return A=O,M}),A||Ne({title:"Edge not found",description:"The selected connection could not be located.",variant:"destructive"}),_(!1)}catch(A){console.error("Failed to delete edge",A);const k=A instanceof Error?A.message:"An unexpected error occurred while removing the connection.";Ne({title:"Failed to delete edge",description:k,variant:"destructive"})}};return c.jsxs(c.Fragment,{children:[c.jsx("path",{d:y,fill:"none",stroke:"currentColor",strokeOpacity:0,strokeWidth:20,style:{pointerEvents:"stroke"},onMouseEnter:()=>{x||p(!0)},onMouseLeave:()=>{x||p(!1)},className:"react-flow__edge-interaction"}),c.jsx(Ah,{path:y,markerEnd:d,interactionWidth:20,style:{...l,strokeWidth:j?3:2}}),c.jsx(nTe,{children:j&&c.jsx("div",{"data-edge-id":e,style:{position:"absolute",transform:`translate(-50%, -50%) translate(${S}px,${w}px)`,pointerEvents:"all"},className:"nodrag nopan",onMouseEnter:()=>_(!0),onMouseLeave:()=>_(!1),children:c.jsx(QC,{className:"h-3 w-3 text-red-500 cursor-pointer",onClick:C,"aria-label":"Delete edge"})})})]})}const wAe={default:hAe,chatTrigger:mAe,startEnd:gAe,stickyNote:vAe},SAe={default:bAe},_Ae={style:{stroke:"#99a1b3",strokeWidth:2},type:"default",markerEnd:{type:Wo.ArrowClosed,width:12,height:12}},NAe=e=>{var t;switch((t=e.data)==null?void 0:t.type){case"api":return"#93c5fd";case"function":return"#d8b4fe";case"trigger":return"#fcd34d";case"data":return"#86efac";case"ai":return"#a5b4fc";case"chatTrigger":return"#fdba74";case"python":return"#fb923c";case"start":return"#86efac";case"end":return"#fca5a5";case"annotation":case"stickyNote":return"#facc15";default:return"#e2e8f0"}};function iV({nodes:e,edges:t,onNodesChange:n,onEdgesChange:r,onConnect:a,onNodeClick:s,onNodeDoubleClick:i,onEdgeMouseEnter:l,onEdgeMouseMove:d,onEdgeMouseLeave:f,onInit:h,fitView:p=!0,snapToGrid:g=!1,snapGrid:y=[15,15],className:S,children:w,showMiniMap:b=!0,showControls:x=!0,showBackground:_=!0,backgroundVariant:j=Ts.Dots,editable:C=!0,nodesDraggable:T,nodesConnectable:A,nodesFocusable:k,edgesFocusable:O,elementsSelectable:M,zoomOnDoubleClick:z=!0}){const L=T??C,U=A??C,F=k??!0,q=O??C,V=M??C;return c.jsxs(eTe,{nodes:e,edges:t,onNodesChange:n,onEdgesChange:r,onConnect:a,onNodeClick:s,onNodeDoubleClick:i,onEdgeMouseEnter:l,onEdgeMouseMove:d,onEdgeMouseLeave:f,onInit:h,nodeTypes:wAe,edgeTypes:SAe,fitView:p,snapToGrid:g,snapGrid:y,defaultEdgeOptions:_Ae,connectionLineType:bs.Bezier,connectionLineStyle:{stroke:"#99a1b3",strokeWidth:2},proOptions:{hideAttribution:!0},nodesDraggable:L,nodesConnectable:U,nodesFocusable:F,edgesFocusable:q,elementsSelectable:V,zoomOnDoubleClick:z,className:ye("h-full",S),children:[_&&c.jsx(cTe,{variant:j}),x&&c.jsx(gTe,{}),b&&c.jsx(ATe,{nodeStrokeWidth:3,zoomable:!0,pannable:!0,nodeColor:NAe,style:{backgroundColor:"hsl(var(--background))",border:"1px solid hsl(var(--border))"},maskColor:"hsl(var(--muted) / 0.6)"}),w]})}function jAe({isRunning:e=!1,onPause:t,onRun:n,onSave:r,onDuplicate:a,onExport:s,onImport:i,onShare:l,onVersionHistory:d,onToggleSearch:f,isSearchOpen:h=!1}){return c.jsxs("div",{className:"flex items-center gap-1 border border-border rounded-md bg-background p-1",children:[c.jsx(Vn,{children:c.jsxs(Wn,{children:[c.jsx(Gn,{asChild:!0,children:c.jsx(me,{variant:"ghost",size:"icon",className:"h-8 w-8",onClick:e?t:n,"aria-label":e?"Pause workflow":"Run workflow",children:e?c.jsx(IQ,{className:"h-4 w-4"}):c.jsx(Wf,{className:"h-4 w-4"})})}),c.jsx(In,{children:c.jsx("p",{children:e?"Pause Execution":"Run Workflow"})})]})}),c.jsx(Vn,{children:c.jsxs(Wn,{children:[c.jsx(Gn,{asChild:!0,children:c.jsx(me,{variant:"ghost",size:"icon",className:"h-8 w-8",onClick:r,"aria-label":"Save workflow",children:c.jsx(Uz,{className:"h-4 w-4"})})}),c.jsx(In,{children:c.jsx("p",{children:"Save Workflow"})})]})}),c.jsx(Vn,{children:c.jsxs(Wn,{children:[c.jsx(Gn,{asChild:!0,children:c.jsx(me,{variant:"ghost",size:"icon",className:"h-8 w-8","aria-label":"Debug workflow",children:c.jsx(JX,{className:"h-4 w-4"})})}),c.jsx(In,{children:c.jsx("p",{children:"Debug Mode"})})]})}),c.jsx(Vn,{children:c.jsxs(Wn,{children:[c.jsx(Gn,{asChild:!0,children:c.jsx(me,{variant:h?"secondary":"ghost",size:"icon",className:"h-8 w-8",onClick:f,"aria-label":h?"Hide search":"Search nodes","aria-pressed":h,children:c.jsx(ia,{className:"h-4 w-4"})})}),c.jsx(In,{children:c.jsx("p",{children:"Search Nodes (Ctrl+F)"})})]})}),c.jsxs(ul,{children:[c.jsx(Vn,{children:c.jsxs(Wn,{children:[c.jsx(Gn,{asChild:!0,children:c.jsx(dl,{asChild:!0,children:c.jsx(me,{variant:"ghost",size:"icon",className:"h-8 w-8","aria-label":"More actions",children:c.jsx(Vf,{className:"h-4 w-4"})})})}),c.jsx(In,{children:c.jsx("p",{children:"More Actions"})})]})}),c.jsxs(Qo,{align:"end",children:[c.jsxs(Lt,{onSelect:p=>{p.preventDefault(),a==null||a()},disabled:!a,"data-testid":"duplicate-workflow-menu-item",children:[c.jsx(Lo,{className:"mr-2 h-4 w-4"}),c.jsx("span",{children:"Duplicate"})]}),c.jsxs(Lt,{onSelect:p=>{p.preventDefault(),l==null||l()},disabled:!l,children:[c.jsx(ZQ,{className:"mr-2 h-4 w-4"}),c.jsx("span",{children:"Share"})]}),c.jsx(Os,{}),c.jsxs(Lt,{onSelect:p=>{p.preventDefault(),s==null||s()},disabled:!s,children:[c.jsx(Mj,{className:"mr-2 h-4 w-4"}),c.jsx("span",{children:"Export"})]}),c.jsxs(Lt,{onSelect:p=>{p.preventDefault(),i==null||i()},disabled:!i,children:[c.jsx(CJ,{className:"mr-2 h-4 w-4"}),c.jsx("span",{children:"Import"})]}),c.jsx(Os,{}),c.jsxs(Lt,{onSelect:p=>{p.preventDefault(),d==null||d()},disabled:!d,children:[c.jsx(hf,{className:"mr-2 h-4 w-4"}),c.jsx("span",{children:"Version History"})]})]})]})]})}function CAe({onUndo:e,onRedo:t,canUndo:n=!1,canRedo:r=!1}){return c.jsxs("div",{className:"flex items-center gap-1 border border-border rounded-md bg-background p-1",children:[c.jsx(Vn,{children:c.jsxs(Wn,{children:[c.jsx(Gn,{asChild:!0,children:c.jsx(me,{variant:"ghost",size:"icon",className:"h-8 w-8",onClick:e,disabled:!n,"aria-label":"Undo",children:c.jsx(Fz,{className:"h-4 w-4"})})}),c.jsx(In,{children:c.jsx("p",{children:"Undo (Ctrl+Z)"})})]})}),c.jsx(Vn,{children:c.jsxs(Wn,{children:[c.jsx(Gn,{asChild:!0,children:c.jsx(me,{variant:"ghost",size:"icon",className:"h-8 w-8",onClick:t,disabled:!r,"aria-label":"Redo",children:c.jsx(ZC,{className:"h-4 w-4"})})}),c.jsx(In,{children:c.jsx("p",{children:"Redo (Ctrl+Y)"})})]})}),c.jsx(Vn,{children:c.jsxs(Wn,{children:[c.jsx(Gn,{asChild:!0,children:c.jsx(me,{variant:"ghost",size:"icon",className:"h-8 w-8","aria-label":"History",children:c.jsx(Dz,{className:"h-4 w-4"})})}),c.jsx(In,{children:c.jsx("p",{children:"History"})})]})})]})}function EAe({isRunning:e=!1,onRun:t,onPause:n,onSave:r,onUndo:a,onRedo:s,canUndo:i=!1,canRedo:l=!1,onDuplicate:d,onExport:f,onImport:h,onShare:p,onVersionHistory:g,onToggleSearch:y,isSearchOpen:S=!1,className:w}){return c.jsxs("div",{className:ye("flex items-center gap-2",w),children:[c.jsx(jAe,{isRunning:e,onPause:n,onRun:t,onSave:r,onDuplicate:d,onExport:f,onImport:h,onShare:p,onVersionHistory:g,onToggleSearch:y,isSearchOpen:S}),c.jsx(CAe,{onUndo:a,onRedo:s,canUndo:i,canRedo:l})]})}function TAe({onSearch:e,onHighlightNext:t,onHighlightPrevious:n,onClose:r,matchCount:a,currentMatchIndex:s,isOpen:i,className:l}){const[d,f]=N.useState(""),h=N.useRef(null);N.useEffect(()=>{i&&h.current&&h.current.focus()},[i]),N.useEffect(()=>{const g=typeof window<"u"?window:void 0;if(!g)return;const y=S=>{if(i){if(S.key==="Escape"){S.preventDefault(),r();return}S.key==="Enter"&&(S.shiftKey?n():t())}};return g.addEventListener("keydown",y),()=>g.removeEventListener("keydown",y)},[i,r,t,n]);const p=g=>{const y=g.target.value;f(y),e(y)};return i?c.jsxs("div",{className:ye("absolute top-4 left-1/2 transform -translate-x-1/2 z-10 flex items-center bg-background border border-border rounded-md shadow-md",l),"data-testid":"workflow-search",children:[c.jsxs("div",{className:"relative flex items-center w-80",children:[c.jsx(ia,{className:"absolute left-2 h-4 w-4 text-muted-foreground"}),c.jsx(Ct,{ref:h,value:d,onChange:p,placeholder:"Search nodes...",className:"pl-8 pr-16 h-9 focus-visible:ring-1"}),d&&c.jsx(me,{variant:"ghost",size:"icon",className:"absolute right-0 h-9 w-9",onClick:()=>{f(""),e("")},children:c.jsx(la,{className:"h-4 w-4"})})]}),c.jsxs("div",{className:"flex items-center px-2 border-l border-border h-9",children:[a>0?c.jsxs(Ue,{variant:"secondary",className:"mr-2",children:[s+1," of ",a]}):d&&c.jsx(Ue,{variant:"outline",className:"mr-2 text-muted-foreground",children:"No matches"}),c.jsx(me,{variant:"ghost",size:"icon",className:"h-7 w-7",onClick:n,disabled:a===0,children:c.jsx(HX,{className:"h-4 w-4"})}),c.jsx(me,{variant:"ghost",size:"icon",className:"h-7 w-7",onClick:t,disabled:a===0,children:c.jsx(IX,{className:"h-4 w-4"})}),c.jsx(me,{variant:"ghost",size:"icon",className:"h-7 w-7 ml-1",onClick:r,children:c.jsx(la,{className:"h-4 w-4"})})]})]}):null}function AAe({errors:e,onDismiss:t,onFix:n,className:r}){const[a,s]=N.useState([]);N.useEffect(()=>{s(e)},[e]);const i=l=>{s(d=>d.filter(f=>f.id!==l)),t(l)};return a.length===0?null:c.jsx("div",{className:ye("absolute bottom-4 right-4 z-10 w-96 max-h-[calc(100vh-8rem)] overflow-y-auto space-y-2",r),children:a.map(l=>c.jsxs(Ho,{variant:"destructive",className:"flex items-start pr-12 relative",children:[c.jsx($y,{className:"h-4 w-4 mt-0.5"}),c.jsxs("div",{className:"ml-2 flex-1",children:[c.jsx(Bo,{children:l.type==="connection"?"Invalid Connection":l.type==="credential"?"Missing Credentials":"Node Configuration Error"}),c.jsxs(Vo,{className:"text-sm mt-1",children:[l.message,l.type==="connection"&&l.sourceId&&l.targetId&&c.jsxs("div",{className:"mt-1 text-xs",children:[c.jsx("span",{className:"font-medium",children:"From:"})," ",l.sourceId,c.jsx("br",{}),c.jsx("span",{className:"font-medium",children:"To:"})," ",l.targetId]}),l.type==="node"&&l.nodeName&&c.jsxs("div",{className:"mt-1 text-xs",children:[c.jsx("span",{className:"font-medium",children:"Node:"})," ",l.nodeName]}),n&&c.jsx(me,{variant:"outline",size:"sm",className:"mt-2 bg-destructive/10 border-destructive/20 hover:bg-destructive/20",onClick:()=>n(l),children:"Fix Issue"})]})]}),c.jsx(me,{variant:"ghost",size:"icon",className:"h-6 w-6 absolute top-2 right-2 text-destructive-foreground/70 hover:text-destructive-foreground",onClick:()=>i(l.id),children:c.jsx(la,{className:"h-3 w-3"})})]},l.id))})}function RAe(e,t,n){const r=t.find(l=>l.id===e.source),a=t.find(l=>l.id===e.target);return!r||!a?{id:`conn-${Date.now()}`,type:"connection",message:"Source or target node not found",sourceId:e.source,targetId:e.target}:n.some(l=>l.source===e.source&&l.target===e.target)?{id:`conn-${Date.now()}`,type:"connection",message:"Connection already exists between these nodes",sourceId:e.source,targetId:e.target}:r.data.type==="trigger"&&a.data.type==="trigger"?{id:`conn-${Date.now()}`,type:"connection",message:"Cannot connect a trigger node to another trigger node",sourceId:e.source,targetId:e.target}:lV(e.source,e.target,n)?{id:`conn-${Date.now()}`,type:"connection",message:"This connection would create a circular reference",sourceId:e.source,targetId:e.target}:null}function kAe(e){return(e.data.type==="api"||e.data.type==="database")&&(!e.data.credentials||!e.data.credentials.id)?{id:`cred-${e.id}-${Date.now()}`,type:"credential",message:`${e.data.label} requires credentials to be configured`,nodeName:e.data.label,nodeId:e.id}:null}function lV(e,t,n,r=new Set){if(e===t)return!0;if(r.has(t))return!1;r.add(t);const a=n.filter(s=>s.source===t);for(const s of a)if(lV(e,s.target,n,r))return!0;return!1}function OAe({sidebarCollapsed:e,onToggleSidebar:t,onAddNode:n,reactFlowWrapperRef:r,onDragOver:a,onDrop:s,edgeHoverContextValue:i,flowHandlers:l,searchHandlers:d,controlsHandlers:f,fileInputRef:h,validation:p,onFileSelected:g}){return c.jsxs("div",{className:"flex h-full min-h-0",children:[c.jsx(aAe,{isCollapsed:e,onToggleCollapse:t,onAddNode:n}),c.jsxs("div",{ref:r,className:"relative flex-1 h-full min-h-0",onDragOver:a,onDrop:s,children:[c.jsx(oV.Provider,{value:i,children:c.jsxs(iV,{nodes:l.nodes,edges:l.edges,onNodesChange:l.onNodesChange,onEdgesChange:l.onEdgesChange,onConnect:l.onConnect,onNodeClick:l.onNodeClick,onNodeDoubleClick:l.onNodeDoubleClick,onEdgeMouseEnter:l.onEdgeMouseEnter,onEdgeMouseLeave:l.onEdgeMouseLeave,onInit:l.onInit,fitView:!0,snapToGrid:!0,snapGrid:[15,15],editable:!0,children:[c.jsx(TAe,{...d}),c.jsx(Th,{position:"top-left",className:"m-4",children:c.jsx(EAe,{...f})}),c.jsx("input",{ref:h,type:"file",accept:"application/json",className:"hidden",onChange:g})]})}),c.jsx(AAe,{errors:p.errors,onDismiss:p.onDismiss,onFix:p.onFix})]})]})}const MAe=({resizable:e,isCollapsed:t,sidebarWidth:n,minWidth:r,maxWidth:a,position:s,onWidthChange:i})=>{const l=N.useRef(!1),d=N.useRef(0),f=N.useRef(n);N.useEffect(()=>{f.current=n},[n]);const h=N.useCallback(y=>{!e||t||(l.current=!0,d.current=y.clientX,f.current=n,y.preventDefault())},[e,t,n]),p=N.useCallback(y=>{if(!l.current)return;const S=s==="left"?y.clientX-d.current:d.current-y.clientX;let w=f.current+S;w=Math.max(r,Math.min(a,w)),i==null||i(w)},[s,r,a,i]),g=N.useCallback(()=>{l.current=!1},[]);return N.useEffect(()=>{if(!e)return;const y=typeof document<"u"?document:void 0;if(y)return y.addEventListener("mousemove",p),y.addEventListener("mouseup",g),()=>{y.removeEventListener("mousemove",p),y.removeEventListener("mouseup",g)}},[e,p,g]),{handleMouseDown:h}};function DAe({sidebar:e,children:t,isCollapsed:n=!1,onToggleCollapse:r,sidebarWidth:a=300,collapsedWidth:s=50,resizable:i=!1,minWidth:l=200,maxWidth:d=500,onWidthChange:f,showCollapseButton:h=!0,position:p="left",className:g,sidebarClassName:y,mainClassName:S}){const w=n?s:a,{handleMouseDown:b}=MAe({resizable:i,isCollapsed:n,sidebarWidth:a,minWidth:l,maxWidth:d,position:p,onWidthChange:f});return c.jsxs("div",{className:ye("flex h-full min-h-0",g),children:[p==="left"&&c.jsxs(c.Fragment,{children:[c.jsxs("aside",{className:ye("relative h-full border-r border-border bg-card transition-all duration-300 flex flex-col",y),style:{width:`${w}px`},children:[e,h&&r&&c.jsx(me,{variant:"ghost",size:"icon",onClick:r,className:"absolute top-3 right-3 z-10",title:n?"Expand sidebar":"Collapse sidebar",children:n?c.jsx(Io,{className:"h-5 w-5"}):c.jsx(ff,{className:"h-5 w-5"})}),i&&!n&&c.jsx("div",{className:"absolute top-0 right-0 bottom-0 w-1 cursor-col-resize hover:bg-primary/20 transition-colors",onMouseDown:b})]}),c.jsx("main",{className:ye("flex-1 h-full min-h-0",S),children:t})]}),p==="right"&&c.jsxs(c.Fragment,{children:[c.jsx("main",{className:ye("flex-1 h-full min-h-0",S),children:t}),c.jsxs("aside",{className:ye("relative h-full border-l border-border bg-card transition-all duration-300 flex flex-col",y),style:{width:`${w}px`},children:[e,h&&r&&c.jsx(me,{variant:"ghost",size:"icon",onClick:r,className:"absolute top-3 left-3 z-10",title:n?"Expand sidebar":"Collapse sidebar",children:n?c.jsx(ff,{className:"h-5 w-5"}):c.jsx(Io,{className:"h-5 w-5"})}),i&&!n&&c.jsx("div",{className:"absolute top-0 left-0 bottom-0 w-1 cursor-col-resize hover:bg-primary/20 transition-colors",onMouseDown:b})]})]})]})}const cV=({className:e,...t})=>c.jsx("nav",{role:"navigation","aria-label":"pagination",className:ye("mx-auto flex w-full justify-center",e),...t});cV.displayName="Pagination";const uV=N.forwardRef(({className:e,...t},n)=>c.jsx("ul",{ref:n,className:ye("flex flex-row items-center gap-1",e),...t}));uV.displayName="PaginationContent";const Ug=N.forwardRef(({className:e,...t},n)=>c.jsx("li",{ref:n,className:ye("",e),...t}));Ug.displayName="PaginationItem";const y0=({className:e,isActive:t,size:n="icon",...r})=>c.jsx("a",{"aria-current":t?"page":void 0,className:ye(o6({variant:t?"outline":"ghost",size:n}),e),...r});y0.displayName="PaginationLink";const dV=({className:e,...t})=>c.jsxs(y0,{"aria-label":"Go to previous page",size:"default",className:ye("gap-1 pl-2.5",e),...t,children:[c.jsx(ff,{className:"h-4 w-4"}),c.jsx("span",{children:"Previous"})]});dV.displayName="PaginationPrevious";const fV=({className:e,...t})=>c.jsxs(y0,{"aria-label":"Go to next page",size:"default",className:ye("gap-1 pr-2.5",e),...t,children:[c.jsx("span",{children:"Next"}),c.jsx(Io,{className:"h-4 w-4"})]});fV.displayName="PaginationNext";const fj={background:"none",border:"none",padding:0,borderRadius:0,width:"auto",boxShadow:"none"},PAe=e=>e==="chatTrigger"?"chatTrigger":e==="start"||e==="end"?"startEnd":"default",hV=e=>{switch(e){case"running":return"running";case"success":return"success";case"error":return"error";case"warning":return"running";default:return"idle"}},$Ae=e=>{if(e){if(typeof e.message=="string"&&e.message.trim())return e.message;if(typeof e.description=="string"&&e.description.trim())return e.description}},IAe=e=>{const t=new Date(e),n=new Date;if(t.toDateString()===n.toDateString())return`Today, ${t.toLocaleTimeString([],{hour:"2-digit",minute:"2-digit"})}`;const r=new Date;return r.setDate(n.getDate()-1),t.toDateString()===r.toDateString()?`Yesterday, ${t.toLocaleTimeString([],{hour:"2-digit",minute:"2-digit"})}`:t.toLocaleDateString([],{month:"short",day:"numeric",year:"numeric"})+`, ${t.toLocaleTimeString([],{hour:"2-digit",minute:"2-digit"})}`},LAe=e=>e<1e3?`${e}ms`:`${(e/1e3).toFixed(1)}s`,pV=e=>{switch(e.toLowerCase()){case"success":return"bg-green-100 text-green-800 dark:bg-green-900/30 dark:text-green-400";case"failed":return"bg-red-100 text-red-800 dark:bg-red-900/30 dark:text-red-400";case"partial":return"bg-amber-100 text-amber-800 dark:bg-amber-900/30 dark:text-amber-400";case"running":return"bg-blue-100 text-blue-800 dark:bg-blue-900/30 dark:text-blue-400";default:return"bg-gray-100 text-gray-800 dark:bg-gray-900/30 dark:text-gray-400"}},zAe=e=>e?e.nodes.map(t=>{const n=typeof t.type=="string"?t.type:"default",r=PAe(n),a=hV(t.status);if(r==="startEnd")return{id:t.id,type:r,position:t.position,style:fj,width:64,height:64,data:{label:t.name,type:n==="end"?"end":"start"}};if(r==="chatTrigger")return{id:t.id,type:r,position:t.position,style:fj,width:180,height:120,data:{label:t.name,type:"chatTrigger",description:$Ae(t.details),status:a}};const s=t.iconKey??_T({iconKey:t.iconKey,label:t.name,type:n});return{id:t.id,type:r,position:t.position,style:fj,width:64,height:64,data:{label:t.name,status:a,type:n,iconKey:s,icon:s?Rh(s):void 0}}}):[],qAe=e=>e?e.edges.map(t=>({id:t.id,source:t.source,target:t.target,type:"default",animated:e.status==="running",style:{stroke:"#99a1b3",strokeWidth:2},markerEnd:{type:Wo.ArrowClosed,width:12,height:12}})):[],FAe=({totalExecutions:e,currentPageExecutions:t,selectedExecutionId:n,page:r,pageCount:a,pageSize:s,pageSizeOptions:i,isFirstPage:l,isLastPage:d,startOffset:f,endOffset:h,onSelectExecution:p,onPreviousPage:g,onNextPage:y,onPageSizeChange:S,onRefresh:w,onViewDetails:b})=>c.jsxs("div",{className:"flex h-full flex-col",children:[c.jsxs("div",{className:"space-y-2 border-b border-border p-2",children:[c.jsxs("div",{className:"flex items-center justify-between",children:[c.jsx("h2",{className:"text-xl font-bold",children:"Executions"}),c.jsxs("div",{className:"flex items-center gap-2",children:[c.jsx(me,{variant:"outline",size:"icon",onClick:w,title:"Refresh",children:c.jsx(XC,{className:"h-4 w-4"})}),c.jsx(me,{variant:"outline",size:"icon",title:"Filter",children:c.jsx(Kg,{className:"h-4 w-4"})})]})]}),c.jsxs("div",{className:"flex items-center justify-between text-xs text-muted-foreground",children:[c.jsx("span",{children:e===1?"1 execution":`${e} executions`}),c.jsxs("div",{className:"flex items-center gap-2",children:[c.jsx("span",{children:"Rows"}),c.jsxs(Fc,{value:String(s),onValueChange:x=>S(Number(x)),children:[c.jsx(Yi,{className:"h-8 w-[80px]",children:c.jsx(Uc,{"aria-label":"Rows per page"})}),c.jsx(Xi,{children:i.map(x=>c.jsx(Pn,{value:String(x),children:x},x))})]})]})]})]}),c.jsx(Mo,{className:"flex-1",children:c.jsx("div",{className:"p-2",children:e===0?c.jsx("div",{className:"py-8 text-center text-muted-foreground",children:"No executions found"}):t.map(x=>c.jsxs("div",{className:ye("mb-2 cursor-pointer rounded-lg border p-4 transition-colors",n===x.id?"border-primary bg-primary/5":"border-border hover:border-primary/50"),onClick:()=>p(x),children:[c.jsxs("div",{className:"mb-2 flex items-center justify-between",children:[c.jsxs("div",{className:"flex items-center gap-2",children:[c.jsx(Ue,{className:ye(pV(x.status)),children:x.status.charAt(0).toUpperCase()+x.status.slice(1)}),c.jsxs("span",{className:"font-medium",children:["Run #",x.runId]})]}),c.jsx("span",{className:"text-sm text-muted-foreground",children:IAe(x.startTime)})]}),c.jsxs("div",{className:"flex items-center justify-between text-sm",children:[c.jsxs("div",{className:"flex items-center gap-4",children:[c.jsxs("div",{className:"flex items-center gap-1",children:[c.jsx(Bi,{className:"h-4 w-4 text-muted-foreground"}),c.jsx("span",{children:LAe(x.duration)})]}),c.jsxs("div",{className:"flex items-center gap-1",children:[c.jsx(Ea,{className:"h-4 w-4 text-muted-foreground"}),c.jsxs("span",{children:[x.issues," ",x.issues===1?"issue":"issues"]})]})]}),c.jsx("div",{className:"flex gap-2",children:c.jsx(me,{variant:"ghost",size:"sm",className:"h-7 px-2",onClick:_=>{_.stopPropagation(),b==null||b(x)},children:"View Details"})})]})]},x.id))})}),c.jsxs("div",{className:"flex flex-col gap-2 border-t border-border p-2 text-sm md:flex-row md:items-center md:justify-between",children:[c.jsx("span",{className:"text-xs text-muted-foreground md:text-sm",children:e===0?"No executions to display":`Showing ${f+1}-${h} of ${e}`}),c.jsx(cV,{className:"mx-0 justify-center md:justify-end",children:c.jsxs(uV,{children:[c.jsx(Ug,{children:c.jsx(dV,{href:"#",onClick:x=>{x.preventDefault(),g()},className:ye(l&&"pointer-events-none opacity-50")})}),c.jsx(Ug,{children:c.jsx(y0,{href:"#",isActive:!0,onClick:x=>x.preventDefault(),className:"px-3",children:`Page ${a===0?0:r+1} of ${Math.max(a,1)}`})}),c.jsx(Ug,{children:c.jsx(fV,{href:"#",onClick:x=>{x.preventDefault(),y()},className:ye(d&&"pointer-events-none opacity-50")})})]})})]})]}),UAe=({execution:e,isFullscreen:t,onToggleFullscreen:n,onNodeSelect:r,onCopyToEditor:a,onDelete:s})=>e?c.jsxs(c.Fragment,{children:[c.jsxs("div",{className:"flex items-center justify-between border-b border-border p-2",children:[c.jsx("div",{children:c.jsxs("h2",{className:"flex items-center gap-2 text-xl font-bold",children:[c.jsx(Ue,{className:ye(pV(e.status)),children:e.status.charAt(0).toUpperCase()+e.status.slice(1)}),"Run #",e.runId]})}),c.jsxs("div",{className:"flex items-center gap-2",children:[c.jsxs(me,{variant:"outline",size:"sm",onClick:()=>a==null?void 0:a(e),title:"Copy to editor",children:[c.jsx(Lo,{className:"mr-2 h-4 w-4"}),"Copy to editor"]}),c.jsx(me,{variant:"outline",size:"icon",onClick:()=>s==null?void 0:s(e),title:"Delete execution",children:c.jsx(Ly,{className:"h-4 w-4"})})]})]}),c.jsx("div",{className:"flex flex-1 flex-col overflow-hidden p-2",children:c.jsx("div",{className:ye("relative flex-1 rounded-lg border border-border bg-muted/20",t&&"fixed inset-0 z-50 bg-background p-4"),children:c.jsx(iV,{nodes:zAe(e),edges:qAe(e),fitView:!0,editable:!1,nodesDraggable:!1,nodesConnectable:!1,elementsSelectable:!0,zoomOnDoubleClick:!1,showMiniMap:!0,onNodeDoubleClick:(i,l)=>{l.type!=="startEnd"&&r(l.id)},children:c.jsx("div",{className:"absolute right-4 top-4 z-10",children:c.jsx(me,{variant:"outline",size:"icon",onClick:n,title:t?"Exit fullscreen":"Fullscreen",children:t?c.jsx(AQ,{className:"h-4 w-4"}):c.jsx(NQ,{className:"h-4 w-4"})})})})})})]}):c.jsx("div",{className:"flex h-full items-center justify-center text-muted-foreground",children:"Select an execution to view details"}),HAe=(e,t)=>{const[n,r]=N.useState(t||(e.length>0?e[0]:null));return N.useEffect(()=>{r(a=>{if(e.length===0)return null;if(a){const s=e.find(i=>i.id===a.id);if(s)return s}if(t){const s=e.find(i=>i.id===t.id);if(s)return s}return e[0]})},[e,t]),{selectedExecution:n,setSelectedExecution:r}},BAe=(e,t=20)=>{const[n,r]=N.useState(0),[a,s]=N.useState(t),i=e.length,l=i===0?0:Math.ceil(i/a),d=N.useMemo(()=>{const b=n*a;return e.slice(b,b+a)},[e,n,a]),f=n*a,h=Math.min(i,f+a),p=n===0||l===0,g=l===0||n===l-1;return N.useEffect(()=>{if(l===0){n!==0&&r(0);return}n>l-1&&r(l-1)},[n,l]),{page:n,setPage:r,pageSize:a,pageCount:l,totalExecutions:i,currentPageExecutions:d,startOffset:f,endOffset:h,isFirstPage:p,isLastPage:g,changePageSize:b=>{r(0),b!==a&&s(b)},goToPreviousPage:()=>{p||r(b=>Math.max(b-1,0))},goToNextPage:()=>{g||r(b=>b+1)}}},VAe=[10,20,50];function mV({executions:e=[],onViewDetails:t,onRefresh:n,onCopyToEditor:r,onDelete:a,className:s,showList:i=!0,defaultSelectedExecution:l}){const{selectedExecution:d,setSelectedExecution:f}=HAe(e,l),{page:h,pageSize:p,pageCount:g,totalExecutions:y,currentPageExecutions:S,startOffset:w,endOffset:b,isFirstPage:x,isLastPage:_,changePageSize:j,goToPreviousPage:C,goToNextPage:T}=BAe(e),[A,k]=N.useState(!1),[O,M]=N.useState(300),[z,L]=N.useState(null),U=K=>{f(K),L(null)},F=N.useMemo(()=>{if(!z||!d)return null;const K=d.nodes.find(H=>H.id===z);return K?{id:K.id,type:K.type||"default",data:{type:K.type||"default",label:K.name,status:hV(K.status),iconKey:K.iconKey,details:K.details,...K.details||{}}}:null},[z,d]),q=c.jsx(UAe,{execution:d,isFullscreen:A,onToggleFullscreen:()=>k(K=>!K),onNodeSelect:K=>L(K),onCopyToEditor:r,onDelete:a}),V=c.jsx(FAe,{totalExecutions:y,currentPageExecutions:S,selectedExecutionId:d==null?void 0:d.id,page:h,pageCount:g,pageSize:p,pageSizeOptions:VAe,isFirstPage:x,isLastPage:_,startOffset:w,endOffset:b,onSelectExecution:U,onPreviousPage:C,onNextPage:T,onPageSizeChange:j,onRefresh:n,onViewDetails:t}),P=c.jsxs(c.Fragment,{children:[i?c.jsx(DAe,{sidebar:V,sidebarWidth:O,onWidthChange:M,resizable:!0,minWidth:200,maxWidth:500,showCollapseButton:!1,children:c.jsx("div",{className:"flex h-full flex-col",children:q})}):q,F&&c.jsx(KU,{node:F,onClose:()=>L(null),className:"absolute left-1/2 top-1/2 z-50 -translate-x-1/2 -translate-y-1/2 transform"})]});return i?c.jsx("div",{className:ye("h-full w-full",s),children:P}):c.jsx("div",{className:ye("flex h-full w-full flex-col",s),children:P})}function WAe({executions:e,onViewDetails:t,onRefresh:n,onCopyToEditor:r,onDelete:a,onRunWorkflow:s,onPauseWorkflow:i,isRunning:l,activeExecutionId:d,setActiveExecutionId:f}){return c.jsx(mV,{executions:e,onViewDetails:t,onRefresh:n,onCopyToEditor:r,onDelete:a,onRunWorkflow:s,onPauseWorkflow:i,isRunning:l,activeExecutionId:d,onActiveExecutionChange:f})}function An(e){const t=Object.prototype.toString.call(e);return e instanceof Date||typeof e=="object"&&t==="[object Date]"?new e.constructor(+e):typeof e=="number"||t==="[object Number]"||typeof e=="string"||t==="[object String]"?new Date(e):new Date(NaN)}function GAe(e,t){return e instanceof Date?new e.constructor(t):new Date(t)}const yg=43200,bL=1440;let KAe={};function YAe(){return KAe}function wL(e){const t=An(e),n=new Date(Date.UTC(t.getFullYear(),t.getMonth(),t.getDate(),t.getHours(),t.getMinutes(),t.getSeconds(),t.getMilliseconds()));return n.setUTCFullYear(t.getFullYear()),+e-+n}function Hg(e,t){const n=An(e),r=An(t),a=n.getTime()-r.getTime();return a<0?-1:a>0?1:a}function XAe(e){return GAe(e,Date.now())}function ZAe(e,t){const n=An(e),r=An(t),a=n.getFullYear()-r.getFullYear(),s=n.getMonth()-r.getMonth();return a*12+s}function QAe(e){return t=>{const r=(e?Math[e]:Math.trunc)(t);return r===0?0:r}}function JAe(e,t){return+An(e)-+An(t)}function eRe(e){const t=An(e);return t.setHours(23,59,59,999),t}function tRe(e){const t=An(e),n=t.getMonth();return t.setFullYear(t.getFullYear(),n+1,0),t.setHours(23,59,59,999),t}function nRe(e){const t=An(e);return+eRe(t)==+tRe(t)}function rRe(e,t){const n=An(e),r=An(t),a=Hg(n,r),s=Math.abs(ZAe(n,r));let i;if(s<1)i=0;else{n.getMonth()===1&&n.getDate()>27&&n.setDate(30),n.setMonth(n.getMonth()-a*s);let l=Hg(n,r)===-a;nRe(An(e))&&s===1&&Hg(e,r)===1&&(l=!1),i=a*(s-Number(l))}return i===0?0:i}function aRe(e,t,n){const r=JAe(e,t)/1e3;return QAe(n==null?void 0:n.roundingMethod)(r)}const sRe={lessThanXSeconds:{one:"less than a second",other:"less than {{count}} seconds"},xSeconds:{one:"1 second",other:"{{count}} seconds"},halfAMinute:"half a minute",lessThanXMinutes:{one:"less than a minute",other:"less than {{count}} minutes"},xMinutes:{one:"1 minute",other:"{{count}} minutes"},aboutXHours:{one:"about 1 hour",other:"about {{count}} hours"},xHours:{one:"1 hour",other:"{{count}} hours"},xDays:{one:"1 day",other:"{{count}} days"},aboutXWeeks:{one:"about 1 week",other:"about {{count}} weeks"},xWeeks:{one:"1 week",other:"{{count}} weeks"},aboutXMonths:{one:"about 1 month",other:"about {{count}} months"},xMonths:{one:"1 month",other:"{{count}} months"},aboutXYears:{one:"about 1 year",other:"about {{count}} years"},xYears:{one:"1 year",other:"{{count}} years"},overXYears:{one:"over 1 year",other:"over {{count}} years"},almostXYears:{one:"almost 1 year",other:"almost {{count}} years"}},oRe=(e,t,n)=>{let r;const a=sRe[e];return typeof a=="string"?r=a:t===1?r=a.one:r=a.other.replace("{{count}}",t.toString()),n!=null&&n.addSuffix?n.comparison&&n.comparison>0?"in "+r:r+" ago":r};function hj(e){return(t={})=>{const n=t.width?String(t.width):e.defaultWidth;return e.formats[n]||e.formats[e.defaultWidth]}}const iRe={full:"EEEE, MMMM do, y",long:"MMMM do, y",medium:"MMM d, y",short:"MM/dd/yyyy"},lRe={full:"h:mm:ss a zzzz",long:"h:mm:ss a z",medium:"h:mm:ss a",short:"h:mm a"},cRe={full:"{{date}} 'at' {{time}}",long:"{{date}} 'at' {{time}}",medium:"{{date}}, {{time}}",short:"{{date}}, {{time}}"},uRe={date:hj({formats:iRe,defaultWidth:"full"}),time:hj({formats:lRe,defaultWidth:"full"}),dateTime:hj({formats:cRe,defaultWidth:"full"})},dRe={lastWeek:"'last' eeee 'at' p",yesterday:"'yesterday at' p",today:"'today at' p",tomorrow:"'tomorrow at' p",nextWeek:"eeee 'at' p",other:"P"},fRe=(e,t,n,r)=>dRe[e];function Id(e){return(t,n)=>{const r=n!=null&&n.context?String(n.context):"standalone";let a;if(r==="formatting"&&e.formattingValues){const i=e.defaultFormattingWidth||e.defaultWidth,l=n!=null&&n.width?String(n.width):i;a=e.formattingValues[l]||e.formattingValues[i]}else{const i=e.defaultWidth,l=n!=null&&n.width?String(n.width):e.defaultWidth;a=e.values[l]||e.values[i]}const s=e.argumentCallback?e.argumentCallback(t):t;return a[s]}}const hRe={narrow:["B","A"],abbreviated:["BC","AD"],wide:["Before Christ","Anno Domini"]},pRe={narrow:["1","2","3","4"],abbreviated:["Q1","Q2","Q3","Q4"],wide:["1st quarter","2nd quarter","3rd quarter","4th quarter"]},mRe={narrow:["J","F","M","A","M","J","J","A","S","O","N","D"],abbreviated:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],wide:["January","February","March","April","May","June","July","August","September","October","November","December"]},gRe={narrow:["S","M","T","W","T","F","S"],short:["Su","Mo","Tu","We","Th","Fr","Sa"],abbreviated:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],wide:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"]},yRe={narrow:{am:"a",pm:"p",midnight:"mi",noon:"n",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},abbreviated:{am:"AM",pm:"PM",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},wide:{am:"a.m.",pm:"p.m.",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"}},vRe={narrow:{am:"a",pm:"p",midnight:"mi",noon:"n",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"},abbreviated:{am:"AM",pm:"PM",midnight:"midnight",noon:"noon",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"},wide:{am:"a.m.",pm:"p.m.",midnight:"midnight",noon:"noon",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"}},xRe=(e,t)=>{const n=Number(e),r=n%100;if(r>20||r<10)switch(r%10){case 1:return n+"st";case 2:return n+"nd";case 3:return n+"rd"}return n+"th"},bRe={ordinalNumber:xRe,era:Id({values:hRe,defaultWidth:"wide"}),quarter:Id({values:pRe,defaultWidth:"wide",argumentCallback:e=>e-1}),month:Id({values:mRe,defaultWidth:"wide"}),day:Id({values:gRe,defaultWidth:"wide"}),dayPeriod:Id({values:yRe,defaultWidth:"wide",formattingValues:vRe,defaultFormattingWidth:"wide"})};function Ld(e){return(t,n={})=>{const r=n.width,a=r&&e.matchPatterns[r]||e.matchPatterns[e.defaultMatchWidth],s=t.match(a);if(!s)return null;const i=s[0],l=r&&e.parsePatterns[r]||e.parsePatterns[e.defaultParseWidth],d=Array.isArray(l)?SRe(l,p=>p.test(i)):wRe(l,p=>p.test(i));let f;f=e.valueCallback?e.valueCallback(d):d,f=n.valueCallback?n.valueCallback(f):f;const h=t.slice(i.length);return{value:f,rest:h}}}function wRe(e,t){for(const n in e)if(Object.prototype.hasOwnProperty.call(e,n)&&t(e[n]))return n}function SRe(e,t){for(let n=0;n<e.length;n++)if(t(e[n]))return n}function _Re(e){return(t,n={})=>{const r=t.match(e.matchPattern);if(!r)return null;const a=r[0],s=t.match(e.parsePattern);if(!s)return null;let i=e.valueCallback?e.valueCallback(s[0]):s[0];i=n.valueCallback?n.valueCallback(i):i;const l=t.slice(a.length);return{value:i,rest:l}}}const NRe=/^(\d+)(th|st|nd|rd)?/i,jRe=/\d+/i,CRe={narrow:/^(b|a)/i,abbreviated:/^(b\.?\s?c\.?|b\.?\s?c\.?\s?e\.?|a\.?\s?d\.?|c\.?\s?e\.?)/i,wide:/^(before christ|before common era|anno domini|common era)/i},ERe={any:[/^b/i,/^(a|c)/i]},TRe={narrow:/^[1234]/i,abbreviated:/^q[1234]/i,wide:/^[1234](th|st|nd|rd)? quarter/i},ARe={any:[/1/i,/2/i,/3/i,/4/i]},RRe={narrow:/^[jfmasond]/i,abbreviated:/^(jan|feb|mar|apr|may|jun|jul|aug|sep|oct|nov|dec)/i,wide:/^(january|february|march|april|may|june|july|august|september|october|november|december)/i},kRe={narrow:[/^j/i,/^f/i,/^m/i,/^a/i,/^m/i,/^j/i,/^j/i,/^a/i,/^s/i,/^o/i,/^n/i,/^d/i],any:[/^ja/i,/^f/i,/^mar/i,/^ap/i,/^may/i,/^jun/i,/^jul/i,/^au/i,/^s/i,/^o/i,/^n/i,/^d/i]},ORe={narrow:/^[smtwf]/i,short:/^(su|mo|tu|we|th|fr|sa)/i,abbreviated:/^(sun|mon|tue|wed|thu|fri|sat)/i,wide:/^(sunday|monday|tuesday|wednesday|thursday|friday|saturday)/i},MRe={narrow:[/^s/i,/^m/i,/^t/i,/^w/i,/^t/i,/^f/i,/^s/i],any:[/^su/i,/^m/i,/^tu/i,/^w/i,/^th/i,/^f/i,/^sa/i]},DRe={narrow:/^(a|p|mi|n|(in the|at) (morning|afternoon|evening|night))/i,any:/^([ap]\.?\s?m\.?|midnight|noon|(in the|at) (morning|afternoon|evening|night))/i},PRe={any:{am:/^a/i,pm:/^p/i,midnight:/^mi/i,noon:/^no/i,morning:/morning/i,afternoon:/afternoon/i,evening:/evening/i,night:/night/i}},$Re={ordinalNumber:_Re({matchPattern:NRe,parsePattern:jRe,valueCallback:e=>parseInt(e,10)}),era:Ld({matchPatterns:CRe,defaultMatchWidth:"wide",parsePatterns:ERe,defaultParseWidth:"any"}),quarter:Ld({matchPatterns:TRe,defaultMatchWidth:"wide",parsePatterns:ARe,defaultParseWidth:"any",valueCallback:e=>e+1}),month:Ld({matchPatterns:RRe,defaultMatchWidth:"wide",parsePatterns:kRe,defaultParseWidth:"any"}),day:Ld({matchPatterns:ORe,defaultMatchWidth:"wide",parsePatterns:MRe,defaultParseWidth:"any"}),dayPeriod:Ld({matchPatterns:DRe,defaultMatchWidth:"any",parsePatterns:PRe,defaultParseWidth:"any"})},IRe={code:"en-US",formatDistance:oRe,formatLong:uRe,formatRelative:fRe,localize:bRe,match:$Re,options:{weekStartsOn:0,firstWeekContainsDate:1}};function LRe(e,t,n){const r=YAe(),a=(n==null?void 0:n.locale)??r.locale??IRe,s=2520,i=Hg(e,t);if(isNaN(i))throw new RangeError("Invalid time value");const l=Object.assign({},n,{addSuffix:n==null?void 0:n.addSuffix,comparison:i});let d,f;i>0?(d=An(t),f=An(e)):(d=An(e),f=An(t));const h=aRe(f,d),p=(wL(f)-wL(d))/1e3,g=Math.round((h-p)/60);let y;if(g<2)return n!=null&&n.includeSeconds?h<5?a.formatDistance("lessThanXSeconds",5,l):h<10?a.formatDistance("lessThanXSeconds",10,l):h<20?a.formatDistance("lessThanXSeconds",20,l):h<40?a.formatDistance("halfAMinute",0,l):h<60?a.formatDistance("lessThanXMinutes",1,l):a.formatDistance("xMinutes",1,l):g===0?a.formatDistance("lessThanXMinutes",1,l):a.formatDistance("xMinutes",g,l);if(g<45)return a.formatDistance("xMinutes",g,l);if(g<90)return a.formatDistance("aboutXHours",1,l);if(g<bL){const S=Math.round(g/60);return a.formatDistance("aboutXHours",S,l)}else{if(g<s)return a.formatDistance("xDays",1,l);if(g<yg){const S=Math.round(g/bL);return a.formatDistance("xDays",S,l)}else if(g<yg*2)return y=Math.round(g/yg),a.formatDistance("aboutXMonths",y,l)}if(y=rRe(f,d),y<12){const S=Math.round(g/yg);return a.formatDistance("xMonths",S,l)}else{const S=y%12,w=Math.trunc(y/12);return S<3?a.formatDistance("aboutXYears",w,l):S<9?a.formatDistance("overXYears",w,l):a.formatDistance("almostXYears",w+1,l)}}function zRe(e,t){return LRe(e,XAe(e),t)}const gV=e=>{const t=+e.startTime;return+e.endTime-t},yV=e=>{if(e<1e3)return`${Math.round(e)}ms`;if(e<6e4)return`${Math.round(e/1e3)}s`;if(e<36e5){const r=Math.floor(e/6e4),a=Math.floor(e%6e4/1e3);return a>0?`${r}m ${a}s`:`${r}m`}const t=Math.floor(e/36e5),n=Math.floor(e%36e5/6e4);return n>0?`${t}h ${n}m`:`${t}h`},vV=({spanCard:e,minStart:t,maxEnd:n})=>{const r=+e.startTime,a=n-t,s=gV(e),i=(r-t)/a*100,l=s/a*100;return{durationMs:s,startPercent:i,widthPercent:l}},NT=e=>{const t=[],n=r=>{r.forEach(a=>{var s;t.push(a),(s=a.children)!=null&&s.length&&n(a.children)})};return n(e),t};function qRe(e){return e.reduce((t,n)=>{const r=+new Date(n.startTime),a=+new Date(n.endTime);return{minStart:Math.min(t.minStart,r),maxEnd:Math.max(t.maxEnd,a)}},{minStart:e.length>0?+new Date(e[0].startTime):1/0,maxEnd:e.length>0?+new Date(e[0].endTime):-1/0})}const xV=(e,t)=>t.trim()?e.map(n=>{const r=n.title.toLowerCase().includes(t.toLowerCase()),a=n.children?xV(n.children,t):void 0,s=a&&a.length>0;return r||s?{...n,children:a}:null}).filter(n=>n!==null):e,ws={OPERATION_NAME:"gen_ai.operation.name",SYSTEM:"gen_ai.system",MODEL:"gen_ai.request.model",USAGE_INPUT_TOKENS:"gen_ai.usage.input_tokens",USAGE_OUTPUT_TOKENS:"gen_ai.usage.output_tokens",USAGE_TOTAL_TOKENS:"gen_ai.usage.total_tokens",USAGE_INPUT_COST:"gen_ai.usage.input_cost",USAGE_OUTPUT_COST:"gen_ai.usage.output_cost"},$C={SPAN_KIND:"openinference.span.kind",LLM_MODEL:"llm.model_name"},zi={HTTP_METHOD:"http.method",HTTP_URL:"http.url",DB_SYSTEM:"db.system",DB_OPERATION:"db.operation.name",DB_COLLECTION:"db.collection.name",FUNCTION_NAME:"function.name"},FRe={chat:"llm_call",generate_content:"llm_call",text_completion:"llm_call",execute_tool:"tool_execution",invoke_agent:"agent_invocation",create_agent:"create_agent",embeddings:"embedding"},URe={LLM:"llm_call",TOOL:"tool_execution",CHAIN:"chain_operation",AGENT:"agent_invocation",RETRIEVER:"retrieval",EMBEDDING:"embedding"},zd={FUNCTION_KEYWORDS:["tool","function"],LLM_KEYWORDS:["openai","anthropic","gpt","claude"],CHAIN_KEYWORDS:["chain","workflow","langchain"],AGENT_KEYWORDS:["agent"],RETRIEVAL_KEYWORDS:["pinecone","chroma","retrieval","vector","search"]},SL={INPUT_VALUE:"input.value",OUTPUT_VALUE:"output.value"};function Kt(e,t){const n=e.attributes.find(a=>a.key===t);if(!n)return;const{value:r}=n;if(r.stringValue!==void 0)return r.stringValue;if(r.intValue!==void 0)return parseFloat(r.intValue);if(r.boolValue!==void 0)return r.boolValue}function HRe(e){const t=Kt(e,$C.SPAN_KIND);if(typeof t=="string"){const n=URe[t];if(n)return n}return"unknown"}function BRe(e){const t=Kt(e,ws.OPERATION_NAME);if(typeof t=="string"){const n=FRe[t];if(n)return n}return"unknown"}const ki={isHttpCall:e=>Kt(e,zi.HTTP_METHOD)!==void 0,isDatabaseCall:e=>Kt(e,zi.DB_SYSTEM)!==void 0,isFunctionCall:e=>{const t=e.name.toLowerCase();return zd.FUNCTION_KEYWORDS.some(n=>t.includes(n))||Kt(e,zi.FUNCTION_NAME)!==void 0},isLLMCall:e=>{const t=e.name.toLowerCase();return zd.LLM_KEYWORDS.some(n=>t.includes(n))},isChainOperation:e=>{const t=e.name.toLowerCase();return zd.CHAIN_KEYWORDS.some(n=>t.includes(n))},isAgentOperation:e=>{const t=e.name.toLowerCase();return zd.AGENT_KEYWORDS.some(n=>t.includes(n))},isRetrievalOperation:e=>{const t=e.name.toLowerCase();return zd.RETRIEVAL_KEYWORDS.some(n=>t.includes(n))}};function pj(e){return ki.isLLMCall(e)?"llm_call":ki.isAgentOperation(e)?"agent_invocation":ki.isChainOperation(e)?"chain_operation":ki.isRetrievalOperation(e)?"retrieval":ki.isFunctionCall(e)||ki.isHttpCall(e)||ki.isDatabaseCall(e)?"tool_execution":"unknown"}function _L(e){const t=BigInt(e),n=Number(t/BigInt(1e6));return new Date(n)}function VRe(e){const{name:t}=e,n=Kt(e,ws.MODEL);if(n)return`${n} - ${t}`;const r=Kt(e,zi.DB_COLLECTION),a=Kt(e,zi.DB_OPERATION);if(r&&a)return`${r} - ${a}`;const s=Kt(e,zi.HTTP_METHOD),i=Kt(e,zi.HTTP_URL);return s&&i?`${s} ${i}`:t}function WRe(e){return Kt(e,ws.OPERATION_NAME)||Kt(e,ws.SYSTEM)?"opentelemetry_genai":Kt(e,$C.SPAN_KIND)||Kt(e,$C.LLM_MODEL)?"openinference":"standard"}const GRe={convertRawDocumentsToSpans(e){const t=Array.isArray(e)?e:[e],n=[];return t.forEach(r=>{r.resourceSpans.forEach(a=>{a.scopeSpans.forEach(s=>{n.push(...s.spans)})})}),this.convertRawSpansToSpanTree(n)},convertRawSpansToSpanTree(e){const t=new Map,n=[];return e.forEach(r=>{const a=this.convertRawSpanToTraceSpan(r);t.set(a.id,a)}),e.forEach(r=>{const a=t.get(r.spanId),s=r.parentSpanId;if(s){const i=t.get(s);i&&(i.children||(i.children=[]),i.children.push(a))}else n.push(a)}),n},convertRawSpanToTraceSpan(e,t=[]){const n=this.getSpanDuration(e),r=this.getSpanStatus(e),a=this.getSpanCategory(e),s=this.getSpanTokensCount(e),i=this.getSpanCost(e),l=this.getSpanInputOutput(e),d=VRe(e);return{id:e.spanId,title:d,type:a,status:r,attributes:e.attributes,duration:n,tokensCount:s,raw:JSON.stringify(e,null,2),cost:i,startTime:_L(e.startTimeUnixNano),endTime:_L(e.endTimeUnixNano),children:t,input:l.input,output:l.output}},getSpanDuration(e){const t=BigInt(e.startTimeUnixNano),r=BigInt(e.endTimeUnixNano)-t;return Number(r/BigInt(1e6))},getSpanCost(e){const t=Kt(e,ws.USAGE_INPUT_COST),n=Kt(e,ws.USAGE_OUTPUT_COST);let r=0;if(typeof t=="number"&&(r+=t),typeof n=="number"&&(r+=n),r===0){const a=Kt(e,"gen_ai.usage.cost");typeof a=="number"&&(r=a)}return r},getSpanTokensCount(e){const t=Kt(e,ws.USAGE_TOTAL_TOKENS),n=Kt(e,ws.USAGE_INPUT_TOKENS),r=Kt(e,ws.USAGE_OUTPUT_TOKENS);return typeof t=="number"?t:(typeof n=="number"?n:0)+(typeof r=="number"?r:0)},getSpanInputOutput(e){const t=Kt(e,SL.INPUT_VALUE),n=Kt(e,SL.OUTPUT_VALUE);return{input:typeof t=="string"?t:void 0,output:typeof n=="string"?n:void 0}},getSpanStatus(e){switch(e.status.code){case"STATUS_CODE_OK":return"success";case"STATUS_CODE_ERROR":return"error";default:return"warning"}},getSpanCategory(e){switch(WRe(e)){case"opentelemetry_genai":{const n=BRe(e);return n!=="unknown"?n:pj(e)}case"openinference":{const n=HRe(e);return n!=="unknown"?n:pj(e)}case"standard":default:return pj(e)}}},bV={none:"rounded-none",sm:"rounded-sm",md:"rounded-md",lg:"rounded-lg",full:"rounded-full"},wV={llm_call:{label:"LLM",theme:"purple",icon:Gf},tool_execution:{label:"TOOL",theme:"orange",icon:DJ},agent_invocation:{label:"AGENT INVOCATION",theme:"indigo",icon:YX},chain_operation:{label:"CHAIN",theme:"teal",icon:hQ},retrieval:{label:"RETRIEVAL",theme:"cyan",icon:ia},embedding:{label:"EMBEDDING",theme:"emerald",icon:lZ},create_agent:{label:"CREATE AGENT",theme:"sky",icon:ll},span:{label:"SPAN",theme:"cyan",icon:DQ},event:{label:"EVENT",theme:"emerald",icon:jZ},guardrail:{label:"GUARDRAIL",theme:"red",icon:JQ},unknown:{label:"UNKNOWN",theme:"gray",icon:KC}};function KRe(e){return wV[e].label}function YRe(e){return wV[e].icon}const XRe=()=>{const[e,t]=N.useState(!1),[n,r]=N.useState(!1);return N.useEffect(()=>{if(r(!0),typeof window>"u"||typeof window.matchMedia!="function"){t(!1);return}const a=window.matchMedia("(max-width: 1023px)"),s=i=>{t(i.matches)};return s(a),a.addEventListener("change",s),()=>a.removeEventListener("change",s)},[]),n?e:!1},v0=N.createContext(null);v0.displayName="PanelGroupContext";const Yt={group:"data-panel-group",groupDirection:"data-panel-group-direction",groupId:"data-panel-group-id",panel:"data-panel",panelCollapsible:"data-panel-collapsible",panelId:"data-panel-id",panelSize:"data-panel-size",resizeHandle:"data-resize-handle",resizeHandleActive:"data-resize-handle-active",resizeHandleEnabled:"data-panel-resize-handle-enabled",resizeHandleId:"data-panel-resize-handle-id",resizeHandleState:"data-resize-handle-state"},jT=10,Hi=N.useLayoutEffect,NL=ky.useId,ZRe=typeof NL=="function"?NL:()=>null;let QRe=0;function CT(e=null){const t=ZRe(),n=N.useRef(e||t||null);return n.current===null&&(n.current=""+QRe++),e??n.current}function SV({children:e,className:t="",collapsedSize:n,collapsible:r,defaultSize:a,forwardedRef:s,id:i,maxSize:l,minSize:d,onCollapse:f,onExpand:h,onResize:p,order:g,style:y,tagName:S="div",...w}){const b=N.useContext(v0);if(b===null)throw Error("Panel components must be rendered within a PanelGroup container");const{collapsePanel:x,expandPanel:_,getPanelSize:j,getPanelStyle:C,groupId:T,isPanelCollapsed:A,reevaluatePanelConstraints:k,registerPanel:O,resizePanel:M,unregisterPanel:z}=b,L=CT(i),U=N.useRef({callbacks:{onCollapse:f,onExpand:h,onResize:p},constraints:{collapsedSize:n,collapsible:r,defaultSize:a,maxSize:l,minSize:d},id:L,idIsFromProps:i!==void 0,order:g});N.useRef({didLogMissingDefaultSizeWarning:!1}),Hi(()=>{const{callbacks:q,constraints:V}=U.current,P={...V};U.current.id=L,U.current.idIsFromProps=i!==void 0,U.current.order=g,q.onCollapse=f,q.onExpand=h,q.onResize=p,V.collapsedSize=n,V.collapsible=r,V.defaultSize=a,V.maxSize=l,V.minSize=d,(P.collapsedSize!==V.collapsedSize||P.collapsible!==V.collapsible||P.maxSize!==V.maxSize||P.minSize!==V.minSize)&&k(U.current,P)}),Hi(()=>{const q=U.current;return O(q),()=>{z(q)}},[g,L,O,z]),N.useImperativeHandle(s,()=>({collapse:()=>{x(U.current)},expand:q=>{_(U.current,q)},getId(){return L},getSize(){return j(U.current)},isCollapsed(){return A(U.current)},isExpanded(){return!A(U.current)},resize:q=>{M(U.current,q)}}),[x,_,j,A,L,M]);const F=C(U.current,a);return N.createElement(S,{...w,children:e,className:t,id:L,style:{...F,...y},[Yt.groupId]:T,[Yt.panel]:"",[Yt.panelCollapsible]:r||void 0,[Yt.panelId]:L,[Yt.panelSize]:parseFloat(""+F.flexGrow).toFixed(1)})}const Yd=N.forwardRef((e,t)=>N.createElement(SV,{...e,forwardedRef:t}));SV.displayName="Panel";Yd.displayName="forwardRef(Panel)";let IC=null,Bg=-1,Co=null;function JRe(e,t,n){const r=(t&EV)!==0,a=(t&TV)!==0,s=(t&AV)!==0,i=(t&RV)!==0;if(t){if(r)return s?"se-resize":i?"ne-resize":"e-resize";if(a)return s?"sw-resize":i?"nw-resize":"w-resize";if(s)return"s-resize";if(i)return"n-resize"}switch(e){case"horizontal":return"ew-resize";case"intersection":return"move";case"vertical":return"ns-resize"}}function eke(){Co!==null&&(document.head.removeChild(Co),IC=null,Co=null,Bg=-1)}function mj(e,t,n){var r,a;const s=JRe(e,t);if(IC!==s){if(IC=s,Co===null&&(Co=document.createElement("style"),document.head.appendChild(Co)),Bg>=0){var i;(i=Co.sheet)===null||i===void 0||i.removeRule(Bg)}Bg=(r=(a=Co.sheet)===null||a===void 0?void 0:a.insertRule(`*{cursor: ${s} !important;}`))!==null&&r!==void 0?r:-1}}function _V(e){return e.type==="keydown"}function NV(e){return e.type.startsWith("pointer")}function jV(e){return e.type.startsWith("mouse")}function x0(e){if(NV(e)){if(e.isPrimary)return{x:e.clientX,y:e.clientY}}else if(jV(e))return{x:e.clientX,y:e.clientY};return{x:1/0,y:1/0}}function tke(){if(typeof matchMedia=="function")return matchMedia("(pointer:coarse)").matches?"coarse":"fine"}function nke(e,t,n){return e.x<t.x+t.width&&e.x+e.width>t.x&&e.y<t.y+t.height&&e.y+e.height>t.y}function rke(e,t){if(e===t)throw new Error("Cannot compare node with itself");const n={a:EL(e),b:EL(t)};let r;for(;n.a.at(-1)===n.b.at(-1);)e=n.a.pop(),t=n.b.pop(),r=e;We(r,"Stacking order can only be calculated for elements with a common ancestor");const a={a:CL(jL(n.a)),b:CL(jL(n.b))};if(a.a===a.b){const s=r.childNodes,i={a:n.a.at(-1),b:n.b.at(-1)};let l=s.length;for(;l--;){const d=s[l];if(d===i.a)return 1;if(d===i.b)return-1}}return Math.sign(a.a-a.b)}const ake=/\b(?:position|zIndex|opacity|transform|webkitTransform|mixBlendMode|filter|webkitFilter|isolation)\b/;function ske(e){var t;const n=getComputedStyle((t=CV(e))!==null&&t!==void 0?t:e).display;return n==="flex"||n==="inline-flex"}function oke(e){const t=getComputedStyle(e);return!!(t.position==="fixed"||t.zIndex!=="auto"&&(t.position!=="static"||ske(e))||+t.opacity<1||"transform"in t&&t.transform!=="none"||"webkitTransform"in t&&t.webkitTransform!=="none"||"mixBlendMode"in t&&t.mixBlendMode!=="normal"||"filter"in t&&t.filter!=="none"||"webkitFilter"in t&&t.webkitFilter!=="none"||"isolation"in t&&t.isolation==="isolate"||ake.test(t.willChange)||t.webkitOverflowScrolling==="touch")}function jL(e){let t=e.length;for(;t--;){const n=e[t];if(We(n,"Missing node"),oke(n))return n}return null}function CL(e){return e&&Number(getComputedStyle(e).zIndex)||0}function EL(e){const t=[];for(;e;)t.push(e),e=CV(e);return t}function CV(e){const{parentNode:t}=e;return t&&t instanceof ShadowRoot?t.host:t}const EV=1,TV=2,AV=4,RV=8,ike=tke()==="coarse";let oa=[],Lc=!1,Eo=new Map,b0=new Map;const qf=new Set;function lke(e,t,n,r,a){var s;const{ownerDocument:i}=t,l={direction:n,element:t,hitAreaMargins:r,setResizeHandlerState:a},d=(s=Eo.get(i))!==null&&s!==void 0?s:0;return Eo.set(i,d+1),qf.add(l),Ey(),function(){var h;b0.delete(e),qf.delete(l);const p=(h=Eo.get(i))!==null&&h!==void 0?h:1;if(Eo.set(i,p-1),Ey(),p===1&&Eo.delete(i),oa.includes(l)){const g=oa.indexOf(l);g>=0&&oa.splice(g,1),w0(),a("up",!0,null)}}}function cke(e){const{target:t}=e,{x:n,y:r}=x0(e);Lc=!0,ET({target:t,x:n,y:r}),Ey(),oa.length>0&&(Ty("down",e),w0(),e.preventDefault(),kV(t)||e.stopImmediatePropagation())}function gj(e){const{x:t,y:n}=x0(e);if(Lc&&e.type!=="pointerleave"&&e.buttons===0&&(Lc=!1,Ty("up",e)),!Lc){const{target:r}=e;ET({target:r,x:t,y:n})}Ty("move",e),w0(),oa.length>0&&e.preventDefault()}function yj(e){const{target:t}=e,{x:n,y:r}=x0(e);b0.clear(),Lc=!1,oa.length>0&&(e.preventDefault(),kV(t)||e.stopImmediatePropagation()),Ty("up",e),ET({target:t,x:n,y:r}),w0(),Ey()}function kV(e){let t=e;for(;t;){if(t.hasAttribute(Yt.resizeHandle))return!0;t=t.parentElement}return!1}function ET({target:e,x:t,y:n}){oa.splice(0);let r=null;(e instanceof HTMLElement||e instanceof SVGElement)&&(r=e),qf.forEach(a=>{const{element:s,hitAreaMargins:i}=a,l=s.getBoundingClientRect(),{bottom:d,left:f,right:h,top:p}=l,g=ike?i.coarse:i.fine;if(t>=f-g&&t<=h+g&&n>=p-g&&n<=d+g){if(r!==null&&document.contains(r)&&s!==r&&!s.contains(r)&&!r.contains(s)&&rke(r,s)>0){let S=r,w=!1;for(;S&&!S.contains(s);){if(nke(S.getBoundingClientRect(),l)){w=!0;break}S=S.parentElement}if(w)return}oa.push(a)}})}function vj(e,t){b0.set(e,t)}function w0(){let e=!1,t=!1;oa.forEach(r=>{const{direction:a}=r;a==="horizontal"?e=!0:t=!0});let n=0;b0.forEach(r=>{n|=r}),e&&t?mj("intersection",n):e?mj("horizontal",n):t?mj("vertical",n):eke()}let xj;function Ey(){var e;(e=xj)===null||e===void 0||e.abort(),xj=new AbortController;const t={capture:!0,signal:xj.signal};qf.size&&(Lc?(oa.length>0&&Eo.forEach((n,r)=>{const{body:a}=r;n>0&&(a.addEventListener("contextmenu",yj,t),a.addEventListener("pointerleave",gj,t),a.addEventListener("pointermove",gj,t))}),Eo.forEach((n,r)=>{const{body:a}=r;a.addEventListener("pointerup",yj,t),a.addEventListener("pointercancel",yj,t)})):Eo.forEach((n,r)=>{const{body:a}=r;n>0&&(a.addEventListener("pointerdown",cke,t),a.addEventListener("pointermove",gj,t))}))}function Ty(e,t){qf.forEach(n=>{const{setResizeHandlerState:r}=n,a=oa.includes(n);r(e,a,t)})}function uke(){const[e,t]=N.useState(0);return N.useCallback(()=>t(n=>n+1),[])}function We(e,t){if(!e)throw console.error(t),Error(t)}function sl(e,t,n=jT){return e.toFixed(n)===t.toFixed(n)?0:e>t?1:-1}function Ss(e,t,n=jT){return sl(e,t,n)===0}function fr(e,t,n){return sl(e,t,n)===0}function dke(e,t,n){if(e.length!==t.length)return!1;for(let r=0;r<e.length;r++){const a=e[r],s=t[r];if(!fr(a,s,n))return!1}return!0}function Ac({panelConstraints:e,panelIndex:t,size:n}){const r=e[t];We(r!=null,`Panel constraints not found for index ${t}`);let{collapsedSize:a=0,collapsible:s,maxSize:i=100,minSize:l=0}=r;if(sl(n,l)<0)if(s){const d=(a+l)/2;sl(n,d)<0?n=a:n=l}else n=l;return n=Math.min(i,n),n=parseFloat(n.toFixed(jT)),n}function Xd({delta:e,initialLayout:t,panelConstraints:n,pivotIndices:r,prevLayout:a,trigger:s}){if(fr(e,0))return t;const i=[...t],[l,d]=r;We(l!=null,"Invalid first pivot index"),We(d!=null,"Invalid second pivot index");let f=0;if(s==="keyboard"){{const p=e<0?d:l,g=n[p];We(g,`Panel constraints not found for index ${p}`);const{collapsedSize:y=0,collapsible:S,minSize:w=0}=g;if(S){const b=t[p];if(We(b!=null,`Previous layout not found for panel index ${p}`),fr(b,y)){const x=w-b;sl(x,Math.abs(e))>0&&(e=e<0?0-x:x)}}}{const p=e<0?l:d,g=n[p];We(g,`No panel constraints found for index ${p}`);const{collapsedSize:y=0,collapsible:S,minSize:w=0}=g;if(S){const b=t[p];if(We(b!=null,`Previous layout not found for panel index ${p}`),fr(b,w)){const x=b-y;sl(x,Math.abs(e))>0&&(e=e<0?0-x:x)}}}}{const p=e<0?1:-1;let g=e<0?d:l,y=0;for(;;){const w=t[g];We(w!=null,`Previous layout not found for panel index ${g}`);const x=Ac({panelConstraints:n,panelIndex:g,size:100})-w;if(y+=x,g+=p,g<0||g>=n.length)break}const S=Math.min(Math.abs(e),Math.abs(y));e=e<0?0-S:S}{let g=e<0?l:d;for(;g>=0&&g<n.length;){const y=Math.abs(e)-Math.abs(f),S=t[g];We(S!=null,`Previous layout not found for panel index ${g}`);const w=S-y,b=Ac({panelConstraints:n,panelIndex:g,size:w});if(!fr(S,b)&&(f+=S-b,i[g]=b,f.toFixed(3).localeCompare(Math.abs(e).toFixed(3),void 0,{numeric:!0})>=0))break;e<0?g--:g++}}if(dke(a,i))return a;{const p=e<0?d:l,g=t[p];We(g!=null,`Previous layout not found for panel index ${p}`);const y=g+f,S=Ac({panelConstraints:n,panelIndex:p,size:y});if(i[p]=S,!fr(S,y)){let w=y-S,x=e<0?d:l;for(;x>=0&&x<n.length;){const _=i[x];We(_!=null,`Previous layout not found for panel index ${x}`);const j=_+w,C=Ac({panelConstraints:n,panelIndex:x,size:j});if(fr(_,C)||(w-=C-_,i[x]=C),fr(w,0))break;e>0?x--:x++}}}const h=i.reduce((p,g)=>g+p,0);return fr(h,100)?i:a}function fke({layout:e,panelsArray:t,pivotIndices:n}){let r=0,a=100,s=0,i=0;const l=n[0];We(l!=null,"No pivot index found"),t.forEach((p,g)=>{const{constraints:y}=p,{maxSize:S=100,minSize:w=0}=y;g===l?(r=w,a=S):(s+=w,i+=S)});const d=Math.min(a,100-s),f=Math.max(r,100-i),h=e[l];return{valueMax:d,valueMin:f,valueNow:h}}function Ff(e,t=document){return Array.from(t.querySelectorAll(`[${Yt.resizeHandleId}][data-panel-group-id="${e}"]`))}function OV(e,t,n=document){const a=Ff(e,n).findIndex(s=>s.getAttribute(Yt.resizeHandleId)===t);return a??null}function MV(e,t,n){const r=OV(e,t,n);return r!=null?[r,r+1]:[-1,-1]}function hke(e){return e instanceof HTMLElement?!0:typeof e=="object"&&e!==null&&"tagName"in e&&"getAttribute"in e}function DV(e,t=document){if(hke(t)&&t.dataset.panelGroupId==e)return t;const n=t.querySelector(`[data-panel-group][data-panel-group-id="${e}"]`);return n||null}function S0(e,t=document){const n=t.querySelector(`[${Yt.resizeHandleId}="${e}"]`);return n||null}function pke(e,t,n,r=document){var a,s,i,l;const d=S0(t,r),f=Ff(e,r),h=d?f.indexOf(d):-1,p=(a=(s=n[h])===null||s===void 0?void 0:s.id)!==null&&a!==void 0?a:null,g=(i=(l=n[h+1])===null||l===void 0?void 0:l.id)!==null&&i!==void 0?i:null;return[p,g]}function mke({committedValuesRef:e,eagerValuesRef:t,groupId:n,layout:r,panelDataArray:a,panelGroupElement:s,setLayout:i}){N.useRef({didWarnAboutMissingResizeHandle:!1}),Hi(()=>{if(!s)return;const l=Ff(n,s);for(let d=0;d<a.length-1;d++){const{valueMax:f,valueMin:h,valueNow:p}=fke({layout:r,panelsArray:a,pivotIndices:[d,d+1]}),g=l[d];if(g!=null){const y=a[d];We(y,`No panel data found for index "${d}"`),g.setAttribute("aria-controls",y.id),g.setAttribute("aria-valuemax",""+Math.round(f)),g.setAttribute("aria-valuemin",""+Math.round(h)),g.setAttribute("aria-valuenow",p!=null?""+Math.round(p):"")}}return()=>{l.forEach((d,f)=>{d.removeAttribute("aria-controls"),d.removeAttribute("aria-valuemax"),d.removeAttribute("aria-valuemin"),d.removeAttribute("aria-valuenow")})}},[n,r,a,s]),N.useEffect(()=>{if(!s)return;const l=t.current;We(l,"Eager values not found");const{panelDataArray:d}=l,f=DV(n,s);We(f!=null,`No group found for id "${n}"`);const h=Ff(n,s);We(h,`No resize handles found for group id "${n}"`);const p=h.map(g=>{const y=g.getAttribute(Yt.resizeHandleId);We(y,"Resize handle element has no handle id attribute");const[S,w]=pke(n,y,d,s);if(S==null||w==null)return()=>{};const b=x=>{if(!x.defaultPrevented)switch(x.key){case"Enter":{x.preventDefault();const _=d.findIndex(j=>j.id===S);if(_>=0){const j=d[_];We(j,`No panel data found for index ${_}`);const C=r[_],{collapsedSize:T=0,collapsible:A,minSize:k=0}=j.constraints;if(C!=null&&A){const O=Xd({delta:fr(C,T)?k-T:T-C,initialLayout:r,panelConstraints:d.map(M=>M.constraints),pivotIndices:MV(n,y,s),prevLayout:r,trigger:"keyboard"});r!==O&&i(O)}}break}}};return g.addEventListener("keydown",b),()=>{g.removeEventListener("keydown",b)}});return()=>{p.forEach(g=>g())}},[s,e,t,n,r,a,i])}function TL(e,t){if(e.length!==t.length)return!1;for(let n=0;n<e.length;n++)if(e[n]!==t[n])return!1;return!0}function PV(e,t){const n=e==="horizontal",{x:r,y:a}=x0(t);return n?r:a}function gke(e,t,n,r,a){const s=n==="horizontal",i=S0(t,a);We(i,`No resize handle element found for id "${t}"`);const l=i.getAttribute(Yt.groupId);We(l,"Resize handle element has no group id attribute");let{initialCursorPosition:d}=r;const f=PV(n,e),h=DV(l,a);We(h,`No group element found for id "${l}"`);const p=h.getBoundingClientRect(),g=s?p.width:p.height;return(f-d)/g*100}function yke(e,t,n,r,a,s){if(_V(e)){const i=n==="horizontal";let l=0;e.shiftKey?l=100:a!=null?l=a:l=10;let d=0;switch(e.key){case"ArrowDown":d=i?0:l;break;case"ArrowLeft":d=i?-l:0;break;case"ArrowRight":d=i?l:0;break;case"ArrowUp":d=i?0:-l;break;case"End":d=100;break;case"Home":d=-100;break}return d}else return r==null?0:gke(e,t,n,r,s)}function vke({panelDataArray:e}){const t=Array(e.length),n=e.map(s=>s.constraints);let r=0,a=100;for(let s=0;s<e.length;s++){const i=n[s];We(i,`Panel constraints not found for index ${s}`);const{defaultSize:l}=i;l!=null&&(r++,t[s]=l,a-=l)}for(let s=0;s<e.length;s++){const i=n[s];We(i,`Panel constraints not found for index ${s}`);const{defaultSize:l}=i;if(l!=null)continue;const d=e.length-r,f=a/d;r++,t[s]=f,a-=f}return t}function Sc(e,t,n){t.forEach((r,a)=>{const s=e[a];We(s,`Panel data not found for index ${a}`);const{callbacks:i,constraints:l,id:d}=s,{collapsedSize:f=0,collapsible:h}=l,p=n[d];if(p==null||r!==p){n[d]=r;const{onCollapse:g,onExpand:y,onResize:S}=i;S&&S(r,p),h&&(g||y)&&(y&&(p==null||Ss(p,f))&&!Ss(r,f)&&y(),g&&(p==null||!Ss(p,f))&&Ss(r,f)&&g())}})}function vg(e,t){if(e.length!==t.length)return!1;for(let n=0;n<e.length;n++)if(e[n]!=t[n])return!1;return!0}function xke({defaultSize:e,dragState:t,layout:n,panelData:r,panelIndex:a,precision:s=3}){const i=n[a];let l;return i==null?l=e!=null?e.toFixed(s):"1":r.length===1?l="1":l=i.toFixed(s),{flexBasis:0,flexGrow:l,flexShrink:1,overflow:"hidden",pointerEvents:t!==null?"none":void 0}}function bke(e,t=10){let n=null;return(...a)=>{n!==null&&clearTimeout(n),n=setTimeout(()=>{e(...a)},t)}}function AL(e){try{if(typeof localStorage<"u")e.getItem=t=>localStorage.getItem(t),e.setItem=(t,n)=>{localStorage.setItem(t,n)};else throw new Error("localStorage not supported in this environment")}catch(t){console.error(t),e.getItem=()=>null,e.setItem=()=>{}}}function $V(e){return`react-resizable-panels:${e}`}function IV(e){return e.map(t=>{const{constraints:n,id:r,idIsFromProps:a,order:s}=t;return a?r:s?`${s}:${JSON.stringify(n)}`:JSON.stringify(n)}).sort((t,n)=>t.localeCompare(n)).join(",")}function LV(e,t){try{const n=$V(e),r=t.getItem(n);if(r){const a=JSON.parse(r);if(typeof a=="object"&&a!=null)return a}}catch{}return null}function wke(e,t,n){var r,a;const s=(r=LV(e,n))!==null&&r!==void 0?r:{},i=IV(t);return(a=s[i])!==null&&a!==void 0?a:null}function Ske(e,t,n,r,a){var s;const i=$V(e),l=IV(t),d=(s=LV(e,a))!==null&&s!==void 0?s:{};d[l]={expandToSizes:Object.fromEntries(n.entries()),layout:r};try{a.setItem(i,JSON.stringify(d))}catch(f){console.error(f)}}function RL({layout:e,panelConstraints:t}){const n=[...e],r=n.reduce((s,i)=>s+i,0);if(n.length!==t.length)throw Error(`Invalid ${t.length} panel layout: ${n.map(s=>`${s}%`).join(", ")}`);if(!fr(r,100)&&n.length>0)for(let s=0;s<t.length;s++){const i=n[s];We(i!=null,`No layout data found for index ${s}`);const l=100/r*i;n[s]=l}let a=0;for(let s=0;s<t.length;s++){const i=n[s];We(i!=null,`No layout data found for index ${s}`);const l=Ac({panelConstraints:t,panelIndex:s,size:i});i!=l&&(a+=i-l,n[s]=l)}if(!fr(a,0))for(let s=0;s<t.length;s++){const i=n[s];We(i!=null,`No layout data found for index ${s}`);const l=i+a,d=Ac({panelConstraints:t,panelIndex:s,size:l});if(i!==d&&(a-=d-i,n[s]=d,fr(a,0)))break}return n}const _ke=100,Zd={getItem:e=>(AL(Zd),Zd.getItem(e)),setItem:(e,t)=>{AL(Zd),Zd.setItem(e,t)}},kL={};function zV({autoSaveId:e=null,children:t,className:n="",direction:r,forwardedRef:a,id:s=null,onLayout:i=null,keyboardResizeBy:l=null,storage:d=Zd,style:f,tagName:h="div",...p}){const g=CT(s),y=N.useRef(null),[S,w]=N.useState(null),[b,x]=N.useState([]),_=uke(),j=N.useRef({}),C=N.useRef(new Map),T=N.useRef(0),A=N.useRef({autoSaveId:e,direction:r,dragState:S,id:g,keyboardResizeBy:l,onLayout:i,storage:d}),k=N.useRef({layout:b,panelDataArray:[],panelDataArrayChanged:!1});N.useRef({didLogIdAndOrderWarning:!1,didLogPanelConstraintsWarning:!1,prevPanelIds:[]}),N.useImperativeHandle(a,()=>({getId:()=>A.current.id,getLayout:()=>{const{layout:B}=k.current;return B},setLayout:B=>{const{onLayout:$}=A.current,{layout:G,panelDataArray:ee}=k.current,re=RL({layout:B,panelConstraints:ee.map(ne=>ne.constraints)});TL(G,re)||(x(re),k.current.layout=re,$&&$(re),Sc(ee,re,j.current))}}),[]),Hi(()=>{A.current.autoSaveId=e,A.current.direction=r,A.current.dragState=S,A.current.id=g,A.current.onLayout=i,A.current.storage=d}),mke({committedValuesRef:A,eagerValuesRef:k,groupId:g,layout:b,panelDataArray:k.current.panelDataArray,setLayout:x,panelGroupElement:y.current}),N.useEffect(()=>{const{panelDataArray:B}=k.current;if(e){if(b.length===0||b.length!==B.length)return;let $=kL[e];$==null&&($=bke(Ske,_ke),kL[e]=$);const G=[...B],ee=new Map(C.current);$(e,G,ee,b,d)}},[e,b,d]),N.useEffect(()=>{});const O=N.useCallback(B=>{const{onLayout:$}=A.current,{layout:G,panelDataArray:ee}=k.current;if(B.constraints.collapsible){const re=ee.map(Y=>Y.constraints),{collapsedSize:ne=0,panelSize:Q,pivotIndices:ae}=Oi(ee,B,G);if(We(Q!=null,`Panel size not found for panel "${B.id}"`),!Ss(Q,ne)){C.current.set(B.id,Q);const te=_c(ee,B)===ee.length-1?Q-ne:ne-Q,se=Xd({delta:te,initialLayout:G,panelConstraints:re,pivotIndices:ae,prevLayout:G,trigger:"imperative-api"});vg(G,se)||(x(se),k.current.layout=se,$&&$(se),Sc(ee,se,j.current))}}},[]),M=N.useCallback((B,$)=>{const{onLayout:G}=A.current,{layout:ee,panelDataArray:re}=k.current;if(B.constraints.collapsible){const ne=re.map(le=>le.constraints),{collapsedSize:Q=0,panelSize:ae=0,minSize:Y=0,pivotIndices:te}=Oi(re,B,ee),se=$??Y;if(Ss(ae,Q)){const le=C.current.get(B.id),fe=le!=null&&le>=se?le:se,Se=_c(re,B)===re.length-1?ae-fe:fe-ae,Re=Xd({delta:Se,initialLayout:ee,panelConstraints:ne,pivotIndices:te,prevLayout:ee,trigger:"imperative-api"});vg(ee,Re)||(x(Re),k.current.layout=Re,G&&G(Re),Sc(re,Re,j.current))}}},[]),z=N.useCallback(B=>{const{layout:$,panelDataArray:G}=k.current,{panelSize:ee}=Oi(G,B,$);return We(ee!=null,`Panel size not found for panel "${B.id}"`),ee},[]),L=N.useCallback((B,$)=>{const{panelDataArray:G}=k.current,ee=_c(G,B);return xke({defaultSize:$,dragState:S,layout:b,panelData:G,panelIndex:ee})},[S,b]),U=N.useCallback(B=>{const{layout:$,panelDataArray:G}=k.current,{collapsedSize:ee=0,collapsible:re,panelSize:ne}=Oi(G,B,$);return We(ne!=null,`Panel size not found for panel "${B.id}"`),re===!0&&Ss(ne,ee)},[]),F=N.useCallback(B=>{const{layout:$,panelDataArray:G}=k.current,{collapsedSize:ee=0,collapsible:re,panelSize:ne}=Oi(G,B,$);return We(ne!=null,`Panel size not found for panel "${B.id}"`),!re||sl(ne,ee)>0},[]),q=N.useCallback(B=>{const{panelDataArray:$}=k.current;$.push(B),$.sort((G,ee)=>{const re=G.order,ne=ee.order;return re==null&&ne==null?0:re==null?-1:ne==null?1:re-ne}),k.current.panelDataArrayChanged=!0,_()},[_]);Hi(()=>{if(k.current.panelDataArrayChanged){k.current.panelDataArrayChanged=!1;const{autoSaveId:B,onLayout:$,storage:G}=A.current,{layout:ee,panelDataArray:re}=k.current;let ne=null;if(B){const ae=wke(B,re,G);ae&&(C.current=new Map(Object.entries(ae.expandToSizes)),ne=ae.layout)}ne==null&&(ne=vke({panelDataArray:re}));const Q=RL({layout:ne,panelConstraints:re.map(ae=>ae.constraints)});TL(ee,Q)||(x(Q),k.current.layout=Q,$&&$(Q),Sc(re,Q,j.current))}}),Hi(()=>{const B=k.current;return()=>{B.layout=[]}},[]);const V=N.useCallback(B=>{let $=!1;const G=y.current;return G&&window.getComputedStyle(G,null).getPropertyValue("direction")==="rtl"&&($=!0),function(re){re.preventDefault();const ne=y.current;if(!ne)return()=>null;const{direction:Q,dragState:ae,id:Y,keyboardResizeBy:te,onLayout:se}=A.current,{layout:le,panelDataArray:fe}=k.current,{initialLayout:ve}=ae??{},Se=MV(Y,B,ne);let Re=yke(re,B,Q,ae,te,ne);const De=Q==="horizontal";De&&$&&(Re=-Re);const Ve=fe.map(qe=>qe.constraints),Le=Xd({delta:Re,initialLayout:ve??le,panelConstraints:Ve,pivotIndices:Se,prevLayout:le,trigger:_V(re)?"keyboard":"mouse-or-touch"}),$e=!vg(le,Le);(NV(re)||jV(re))&&T.current!=Re&&(T.current=Re,!$e&&Re!==0?De?vj(B,Re<0?EV:TV):vj(B,Re<0?AV:RV):vj(B,0)),$e&&(x(Le),k.current.layout=Le,se&&se(Le),Sc(fe,Le,j.current))}},[]),P=N.useCallback((B,$)=>{const{onLayout:G}=A.current,{layout:ee,panelDataArray:re}=k.current,ne=re.map(le=>le.constraints),{panelSize:Q,pivotIndices:ae}=Oi(re,B,ee);We(Q!=null,`Panel size not found for panel "${B.id}"`);const te=_c(re,B)===re.length-1?Q-$:$-Q,se=Xd({delta:te,initialLayout:ee,panelConstraints:ne,pivotIndices:ae,prevLayout:ee,trigger:"imperative-api"});vg(ee,se)||(x(se),k.current.layout=se,G&&G(se),Sc(re,se,j.current))},[]),K=N.useCallback((B,$)=>{const{layout:G,panelDataArray:ee}=k.current,{collapsedSize:re=0,collapsible:ne}=$,{collapsedSize:Q=0,collapsible:ae,maxSize:Y=100,minSize:te=0}=B.constraints,{panelSize:se}=Oi(ee,B,G);se!=null&&(ne&&ae&&Ss(se,re)?Ss(re,Q)||P(B,Q):se<te?P(B,te):se>Y&&P(B,Y))},[P]),H=N.useCallback((B,$)=>{const{direction:G}=A.current,{layout:ee}=k.current;if(!y.current)return;const re=S0(B,y.current);We(re,`Drag handle element not found for id "${B}"`);const ne=PV(G,$);w({dragHandleId:B,dragHandleRect:re.getBoundingClientRect(),initialCursorPosition:ne,initialLayout:ee})},[]),Z=N.useCallback(()=>{w(null)},[]),J=N.useCallback(B=>{const{panelDataArray:$}=k.current,G=_c($,B);G>=0&&($.splice(G,1),delete j.current[B.id],k.current.panelDataArrayChanged=!0,_())},[_]),D=N.useMemo(()=>({collapsePanel:O,direction:r,dragState:S,expandPanel:M,getPanelSize:z,getPanelStyle:L,groupId:g,isPanelCollapsed:U,isPanelExpanded:F,reevaluatePanelConstraints:K,registerPanel:q,registerResizeHandle:V,resizePanel:P,startDragging:H,stopDragging:Z,unregisterPanel:J,panelGroupElement:y.current}),[O,S,r,M,z,L,g,U,F,K,q,V,P,H,Z,J]),W={display:"flex",flexDirection:r==="horizontal"?"row":"column",height:"100%",overflow:"hidden",width:"100%"};return N.createElement(v0.Provider,{value:D},N.createElement(h,{...p,children:t,className:n,id:s,ref:y,style:{...W,...f},[Yt.group]:"",[Yt.groupDirection]:r,[Yt.groupId]:g}))}const qV=N.forwardRef((e,t)=>N.createElement(zV,{...e,forwardedRef:t}));zV.displayName="PanelGroup";qV.displayName="forwardRef(PanelGroup)";function _c(e,t){return e.findIndex(n=>n===t||n.id===t.id)}function Oi(e,t,n){const r=_c(e,t),s=r===e.length-1?[r-1,r]:[r,r+1],i=n[r];return{...t.constraints,panelSize:i,pivotIndices:s}}function Nke({disabled:e,handleId:t,resizeHandler:n,panelGroupElement:r}){N.useEffect(()=>{if(e||n==null||r==null)return;const a=S0(t,r);if(a==null)return;const s=i=>{if(!i.defaultPrevented)switch(i.key){case"ArrowDown":case"ArrowLeft":case"ArrowRight":case"ArrowUp":case"End":case"Home":{i.preventDefault(),n(i);break}case"F6":{i.preventDefault();const l=a.getAttribute(Yt.groupId);We(l,`No group element found for id "${l}"`);const d=Ff(l,r),f=OV(l,t,r);We(f!==null,`No resize element found for id "${t}"`);const h=i.shiftKey?f>0?f-1:d.length-1:f+1<d.length?f+1:0;d[h].focus();break}}};return a.addEventListener("keydown",s),()=>{a.removeEventListener("keydown",s)}},[r,e,t,n])}function LC({children:e=null,className:t="",disabled:n=!1,hitAreaMargins:r,id:a,onBlur:s,onClick:i,onDragging:l,onFocus:d,onPointerDown:f,onPointerUp:h,style:p={},tabIndex:g=0,tagName:y="div",...S}){var w,b;const x=N.useRef(null),_=N.useRef({onClick:i,onDragging:l,onPointerDown:f,onPointerUp:h});N.useEffect(()=>{_.current.onClick=i,_.current.onDragging=l,_.current.onPointerDown=f,_.current.onPointerUp=h});const j=N.useContext(v0);if(j===null)throw Error("PanelResizeHandle components must be rendered within a PanelGroup container");const{direction:C,groupId:T,registerResizeHandle:A,startDragging:k,stopDragging:O,panelGroupElement:M}=j,z=CT(a),[L,U]=N.useState("inactive"),[F,q]=N.useState(!1),[V,P]=N.useState(null),K=N.useRef({state:L});Hi(()=>{K.current.state=L}),N.useEffect(()=>{if(n)P(null);else{const D=A(z);P(()=>D)}},[n,z,A]);const H=(w=r==null?void 0:r.coarse)!==null&&w!==void 0?w:15,Z=(b=r==null?void 0:r.fine)!==null&&b!==void 0?b:5;N.useEffect(()=>{if(n||V==null)return;const D=x.current;We(D,"Element ref not attached");let W=!1;return lke(z,D,C,{coarse:H,fine:Z},($,G,ee)=>{if(!G){U("inactive");return}switch($){case"down":{U("drag"),W=!1,We(ee,'Expected event to be defined for "down" action'),k(z,ee);const{onDragging:re,onPointerDown:ne}=_.current;re==null||re(!0),ne==null||ne();break}case"move":{const{state:re}=K.current;W=!0,re!=="drag"&&U("hover"),We(ee,'Expected event to be defined for "move" action'),V(ee);break}case"up":{U("hover"),O();const{onClick:re,onDragging:ne,onPointerUp:Q}=_.current;ne==null||ne(!1),Q==null||Q(),W||re==null||re();break}}})},[H,C,n,Z,A,z,V,k,O]),Nke({disabled:n,handleId:z,resizeHandler:V,panelGroupElement:M});const J={touchAction:"none",userSelect:"none"};return N.createElement(y,{...S,children:e,className:t,id:a,onBlur:()=>{q(!1),s==null||s()},onFocus:()=>{q(!0),d==null||d()},ref:x,role:"separator",style:{...J,...p},tabIndex:g,[Yt.groupDirection]:C,[Yt.groupId]:T,[Yt.resizeHandle]:"",[Yt.resizeHandleActive]:L==="drag"?"pointer":F?"keyboard":void 0,[Yt.resizeHandleEnabled]:!n,[Yt.resizeHandleId]:z,[Yt.resizeHandleState]:L})}LC.displayName="PanelResizeHandle";var bj={exports:{}};/*!
|
|
761
|
+
Copyright (c) 2018 Jed Watson.
|
|
762
|
+
Licensed under the MIT License (MIT), see
|
|
763
|
+
http://jedwatson.github.io/classnames
|
|
764
|
+
*/var OL;function jke(){return OL||(OL=1,(function(e){(function(){var t={}.hasOwnProperty;function n(){for(var s="",i=0;i<arguments.length;i++){var l=arguments[i];l&&(s=a(s,r(l)))}return s}function r(s){if(typeof s=="string"||typeof s=="number")return s;if(typeof s!="object")return"";if(Array.isArray(s))return n.apply(null,s);if(s.toString!==Object.prototype.toString&&!s.toString.toString().includes("[native code]"))return s.toString();var i="";for(var l in s)t.call(s,l)&&s[l]&&(i=a(i,l));return i}function a(s,i){return i?s?s+" "+i:s+i:s}e.exports?(n.default=n,e.exports=n):window.classNames=n})()})(bj)),bj.exports}var Cke=jke();const dt=zr(Cke),ML="text-sm font-medium transition-colors duration-200 disabled:opacity-50 disabled:cursor-not-allowed",Eke={underline:{list:"h-9 flex border-b border-agentprism-border",trigger:`w-full justify-center px-3 ${ML}
|
|
765
|
+
text-agentprism-secondary-foreground data-[state=active]:text-agentprism-foreground
|
|
766
|
+
border-b-2 border-transparent data-[state=active]:border-agentprism-border-inverse
|
|
767
|
+
-mb-[2px]
|
|
768
|
+
data-[state=inactive]:[&:not(:disabled)]:hover:border-agentprism-border-inverse/20
|
|
769
|
+
data-[state=inactive]:[&:not(:disabled)]:hover:text-agentprism-muted-foreground`},pill:{list:"h-9 inline-flex gap-1 p-1 bg-agentprism-secondary rounded-lg",trigger:`px-3 ${ML} rounded-md
|
|
770
|
+
text-agentprism-muted-foreground data-[state=active]:text-agentprism-foreground
|
|
771
|
+
data-[state=inactive]:[&:not(:disabled)]:hover:bg-agentprism-background/50 data-[state=active]:bg-agentprism-background data-[state=active]:shadow-sm
|
|
772
|
+
dark:data-[state=active]:shadow-none`}},Tke=({items:e,defaultValue:t,value:n,onValueChange:r,theme:a="underline",className:s="",tabsListClassName:i="",triggerClassName:l="",dir:d,...f})=>{var g;const h=t||((g=e[0])==null?void 0:g.value),p=Eke[a];return c.jsx(jq,{className:s,defaultValue:n?void 0:h,value:n,onValueChange:r,dir:d,...f,children:c.jsx(T2,{className:dt(p.list,i),"aria-label":"Navigation tabs",children:e.map(y=>c.jsxs(A2,{value:y.value,disabled:y.disabled,className:dt("group flex items-center overflow-hidden",p.trigger,l),children:[y.icon&&c.jsx("span",{className:"text-agentprism-secondary-foreground mr-2 group-data-[state=active]:text-current",children:y.icon}),c.jsx("span",{className:"truncate text-sm font-medium",children:y.label})]},y.value))})})},TT=({items:e,value:t,onValueChange:n,defaultValue:r,theme:a="underline",className:s,onClick:i})=>c.jsx(Tke,{items:e,value:t,onValueChange:n,defaultValue:r,theme:a,className:s,onClick:i}),FV=({title:e,rightContent:t,children:n,defaultOpen:r=!1,className:a="",triggerClassName:s="",contentClassName:i="",onOpenChange:l})=>{const[d,f]=N.useState(r),h=N.useCallback(g=>{f(g),l==null||l(g)},[l]),p=N.useCallback(g=>{(g.key==="Enter"||g.key===" ")&&(g.preventDefault(),h(!d))},[h,d]);return c.jsxs(pT,{open:d,onOpenChange:h,className:dt("rounded-lg",a),children:[c.jsx(mT,{asChild:!0,children:c.jsxs("div",{tabIndex:0,role:"button",className:dt("text-agentprism-muted-foreground mb-2.5 flex w-full items-center justify-between gap-2 rounded-lg px-1 text-left text-sm font-medium",s),onKeyDown:p,"aria-expanded":d,"aria-label":`${d?"Collapse":"Expand"} content of "${e}" section`,children:[c.jsxs("div",{className:"text-agentprism-muted-foreground flex min-w-0 flex-1 items-center gap-2",children:[c.jsx(uu,{className:dt("h-3 w-3 shrink-0 -rotate-90",d&&"rotate-0")}),c.jsx("span",{className:"min-w-0 truncate text-sm font-medium",title:e,children:e})]}),c.jsx("div",{className:"shrink-0",children:t})]})}),c.jsx(gT,{className:dt("data-[state=closed]:animate-slideUp data-[state=open]:animate-slideDown","text-agentprism-muted-foreground",i),children:n})]})},Ake={6:"h-6 min-h-6",7:"h-7 min-h-7",8:"h-8 min-h-8",9:"h-9 min-h-9",10:"h-10 min-h-10",11:"h-11 min-h-11",12:"h-12 min-h-12",16:"h-16 min-h-16"},Rke={default:"border border-agentprism-border bg-transparent",ghost:"bg-transparent"},kh=({children:e,className:t,size:n="6",variant:r="default",type:a="button","aria-label":s,...i})=>c.jsx("button",{type:a,"aria-label":s,className:dt(t,Ake[n],"inline-flex aspect-square shrink-0 items-center justify-center","rounded-md",Rke[r],"text-agentprism-secondary-foreground","hover:bg-agentprism-secondary"),...i,children:e}),UV=({label:e,content:t})=>{const[n,r]=N.useState("idle"),a=async()=>{try{if(!navigator.clipboard)throw new Error("Clipboard API not supported");await navigator.clipboard.writeText(t),r("success"),setTimeout(()=>r("idle"),2e3)}catch{r("error"),setTimeout(()=>r("idle"),2e3)}},s=()=>{switch(n){case"success":return c.jsx(Is,{className:"size-3"});case"error":return c.jsx(la,{className:"size-3"});default:return c.jsx(Lo,{className:"size-3"})}},i=()=>{switch(n){case"success":return`${e} Copied`;case"error":return`Failed to copy ${e}`;default:return`Copy ${e}`}};return c.jsx(kh,{onClick:a,"aria-label":i(),variant:"ghost",disabled:n!=="idle",children:s()})};var Zr,DL;function kke(){if(DL)return Zr;DL=1;var e=Zr&&Zr.__extends||(function(){var p=function(g,y){return p=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(S,w){S.__proto__=w}||function(S,w){for(var b in w)w.hasOwnProperty(b)&&(S[b]=w[b])},p(g,y)};return function(g,y){p(g,y);function S(){this.constructor=g}g.prototype=y===null?Object.create(y):(S.prototype=y.prototype,new S)}})(),t=Zr&&Zr.__assign||function(){return t=Object.assign||function(p){for(var g,y=1,S=arguments.length;y<S;y++){g=arguments[y];for(var w in g)Object.prototype.hasOwnProperty.call(g,w)&&(p[w]=g[w])}return p},t.apply(this,arguments)},n=Zr&&Zr.__rest||function(p,g){var y={};for(var S in p)Object.prototype.hasOwnProperty.call(p,S)&&g.indexOf(S)<0&&(y[S]=p[S]);if(p!=null&&typeof Object.getOwnPropertySymbols=="function")for(var w=0,S=Object.getOwnPropertySymbols(p);w<S.length;w++)g.indexOf(S[w])<0&&(y[S[w]]=p[S[w]]);return y},r=Zr&&Zr.__importStar||function(p){if(p&&p.__esModule)return p;var g={};if(p!=null)for(var y in p)Object.hasOwnProperty.call(p,y)&&(g[y]=p[y]);return g.default=p,g},a=r(Wq()),s=r(iu());function i(p,g,y){var S=y[p+"Style"]||"",w=g&&g[p]||"";return S?S+";"+w:w}function l(p,g,y){var S=i(p,g,y);return S?' style="'+S+'"':""}var d={'"':""","'":"'","&":"&",">":">","<":"<"};function f(p){return p&&p.replace(/<|>|&|"|'/g,function(g){return d[g]})}var h=(function(p){e(g,p);function g(){return p!==null&&p.apply(this,arguments)||this}return g.prototype.render=function(){var y=this.props,S=y.json,w=y.data,b=y.replacer,x=y.space,_=y.themeClassName,j=y.theme,C=y.onJSONPrettyError,T=y.onError,A=y.silent,k=y.mainStyle,O=y.keyStyle,M=y.valueStyle,z=y.stringStyle,L=y.booleanStyle,U=y.errorStyle,F=n(y,["json","data","replacer","space","themeClassName","theme","onJSONPrettyError","onError","silent","mainStyle","keyStyle","valueStyle","stringStyle","booleanStyle","errorStyle"]),q={mainStyle:k,keyStyle:O,valueStyle:M,stringStyle:z,booleanStyle:L,errorStyle:U},V=w||S;if(typeof V=="string")try{V=JSON.parse(V)}catch(P){return A||console.warn("[react-json-pretty]: "+P.message),C&&C(P),!C&&T&&(T(P),console.warn("JSONPretty#onError is deprecated, please use JSONPretty#onJSONPrettyError instead")),s.createElement("div",t({},F,{dangerouslySetInnerHTML:{__html:'<pre class="__json-pretty-error__"'+l("error",j,q)+">"+f(V)+"</pre>"}}))}return s.createElement("div",t({},F,{dangerouslySetInnerHTML:{__html:'<pre class="'+_+'"'+l("main",j,q)+">"+this._pretty(j,V,b,+x,q)+"</pre>"}}))},g.prototype._pretty=function(y,S,w,b,x){var _=/^( *)("[^"]+": )?("[^"]*"|[\w.+-]*)?([,[{]|\[\s*\],?|\{\s*\},?)?$/mg,j=JSON.stringify(S,typeof w=="function"?w:null,isNaN(b)?2:b);return j&&j.replace(/&/g,"&").replace(/\\"([^,])/g,"\\"$1").replace(/</g,"<").replace(/>/g,">").replace(_,this._replace.bind(null,y,x))},g.prototype._replace=function(y,S,w,b,x,_,j){var C="</span>",T='<span class="__json-key__"'+l("key",y,S)+">",A='<span class="__json-value__"'+l("value",y,S)+">",k='<span class="__json-string__"'+l("string",y,S)+">",O='<span class="__json-boolean__"'+l("boolean",y,S)+">",M=b||"";return x&&(M=M+'"'+T+x.replace(/^"|":\s$/g,"")+C+'": '),_&&(_==="true"||_==="false"?M=M+O+_+C:M=M+(_[0]==='"'?k:A)+_+C),M+(j||"")},g.propTypes={data:a.any,json:a.any,replacer:a.func,silent:a.bool,space:a.oneOfType([a.number,a.string]),theme:a.object,themeClassName:a.string,onJSONPrettyError:a.func},g.defaultProps={data:"",json:"",silent:!0,space:2,themeClassName:"__json-pretty__"},g})(s.Component);return Zr=h,Zr}var Oke=kke();const Mke=zr(Oke);var wj={},Sj={},xg={exports:{}},PL;function Dke(){if(PL)return xg.exports;PL=1;var e=String,t=function(){return{isColorSupported:!1,reset:e,bold:e,dim:e,italic:e,underline:e,inverse:e,hidden:e,strikethrough:e,black:e,red:e,green:e,yellow:e,blue:e,magenta:e,cyan:e,white:e,gray:e,bgBlack:e,bgRed:e,bgGreen:e,bgYellow:e,bgBlue:e,bgMagenta:e,bgCyan:e,bgWhite:e,blackBright:e,redBright:e,greenBright:e,yellowBright:e,blueBright:e,magentaBright:e,cyanBright:e,whiteBright:e,bgBlackBright:e,bgRedBright:e,bgGreenBright:e,bgYellowBright:e,bgBlueBright:e,bgMagentaBright:e,bgCyanBright:e,bgWhiteBright:e}};return xg.exports=t(),xg.exports.createColors=t,xg.exports}var $L;function Pke(){return $L||($L=1,(function(e){var t={};Object.defineProperty(e,"__esModule",{value:!0});function n(f,h){for(var p in h)Object.defineProperty(f,p,{enumerable:!0,get:h[p]})}n(e,{dim:function(){return l},default:function(){return d}});const r=a(Dke());function a(f){return f&&f.__esModule?f:{default:f}}let s=new Set;function i(f,h,p){typeof process<"u"&&t.JEST_WORKER_ID||p&&s.has(p)||(p&&s.add(p),console.warn(""),h.forEach(g=>console.warn(f,"-",g)))}function l(f){return r.default.dim(f)}const d={info(f,h){i(r.default.bold(r.default.cyan("info")),...Array.isArray(f)?[f]:[h,f])},warn(f,h){i(r.default.bold(r.default.yellow("warn")),...Array.isArray(f)?[f]:[h,f])},risk(f,h){i(r.default.bold(r.default.magenta("risk")),...Array.isArray(f)?[f]:[h,f])}}})(Sj)),Sj}var IL;function $ke(){return IL||(IL=1,(function(e){Object.defineProperty(e,"__esModule",{value:!0}),Object.defineProperty(e,"default",{enumerable:!0,get:function(){return a}});const t=n(Pke());function n(s){return s&&s.__esModule?s:{default:s}}function r({version:s,from:i,to:l}){t.default.warn(`${i}-color-renamed`,[`As of Tailwind CSS ${s}, \`${i}\` has been renamed to \`${l}\`.`,"Update your configuration file to silence this warning."])}const a={inherit:"inherit",current:"currentColor",transparent:"transparent",black:"#000",white:"#fff",slate:{50:"#f8fafc",100:"#f1f5f9",200:"#e2e8f0",300:"#cbd5e1",400:"#94a3b8",500:"#64748b",600:"#475569",700:"#334155",800:"#1e293b",900:"#0f172a",950:"#020617"},gray:{50:"#f9fafb",100:"#f3f4f6",200:"#e5e7eb",300:"#d1d5db",400:"#9ca3af",500:"#6b7280",600:"#4b5563",700:"#374151",800:"#1f2937",900:"#111827",950:"#030712"},zinc:{50:"#fafafa",100:"#f4f4f5",200:"#e4e4e7",300:"#d4d4d8",400:"#a1a1aa",500:"#71717a",600:"#52525b",700:"#3f3f46",800:"#27272a",900:"#18181b",950:"#09090b"},neutral:{50:"#fafafa",100:"#f5f5f5",200:"#e5e5e5",300:"#d4d4d4",400:"#a3a3a3",500:"#737373",600:"#525252",700:"#404040",800:"#262626",900:"#171717",950:"#0a0a0a"},stone:{50:"#fafaf9",100:"#f5f5f4",200:"#e7e5e4",300:"#d6d3d1",400:"#a8a29e",500:"#78716c",600:"#57534e",700:"#44403c",800:"#292524",900:"#1c1917",950:"#0c0a09"},red:{50:"#fef2f2",100:"#fee2e2",200:"#fecaca",300:"#fca5a5",400:"#f87171",500:"#ef4444",600:"#dc2626",700:"#b91c1c",800:"#991b1b",900:"#7f1d1d",950:"#450a0a"},orange:{50:"#fff7ed",100:"#ffedd5",200:"#fed7aa",300:"#fdba74",400:"#fb923c",500:"#f97316",600:"#ea580c",700:"#c2410c",800:"#9a3412",900:"#7c2d12",950:"#431407"},amber:{50:"#fffbeb",100:"#fef3c7",200:"#fde68a",300:"#fcd34d",400:"#fbbf24",500:"#f59e0b",600:"#d97706",700:"#b45309",800:"#92400e",900:"#78350f",950:"#451a03"},yellow:{50:"#fefce8",100:"#fef9c3",200:"#fef08a",300:"#fde047",400:"#facc15",500:"#eab308",600:"#ca8a04",700:"#a16207",800:"#854d0e",900:"#713f12",950:"#422006"},lime:{50:"#f7fee7",100:"#ecfccb",200:"#d9f99d",300:"#bef264",400:"#a3e635",500:"#84cc16",600:"#65a30d",700:"#4d7c0f",800:"#3f6212",900:"#365314",950:"#1a2e05"},green:{50:"#f0fdf4",100:"#dcfce7",200:"#bbf7d0",300:"#86efac",400:"#4ade80",500:"#22c55e",600:"#16a34a",700:"#15803d",800:"#166534",900:"#14532d",950:"#052e16"},emerald:{50:"#ecfdf5",100:"#d1fae5",200:"#a7f3d0",300:"#6ee7b7",400:"#34d399",500:"#10b981",600:"#059669",700:"#047857",800:"#065f46",900:"#064e3b",950:"#022c22"},teal:{50:"#f0fdfa",100:"#ccfbf1",200:"#99f6e4",300:"#5eead4",400:"#2dd4bf",500:"#14b8a6",600:"#0d9488",700:"#0f766e",800:"#115e59",900:"#134e4a",950:"#042f2e"},cyan:{50:"#ecfeff",100:"#cffafe",200:"#a5f3fc",300:"#67e8f9",400:"#22d3ee",500:"#06b6d4",600:"#0891b2",700:"#0e7490",800:"#155e75",900:"#164e63",950:"#083344"},sky:{50:"#f0f9ff",100:"#e0f2fe",200:"#bae6fd",300:"#7dd3fc",400:"#38bdf8",500:"#0ea5e9",600:"#0284c7",700:"#0369a1",800:"#075985",900:"#0c4a6e",950:"#082f49"},blue:{50:"#eff6ff",100:"#dbeafe",200:"#bfdbfe",300:"#93c5fd",400:"#60a5fa",500:"#3b82f6",600:"#2563eb",700:"#1d4ed8",800:"#1e40af",900:"#1e3a8a",950:"#172554"},indigo:{50:"#eef2ff",100:"#e0e7ff",200:"#c7d2fe",300:"#a5b4fc",400:"#818cf8",500:"#6366f1",600:"#4f46e5",700:"#4338ca",800:"#3730a3",900:"#312e81",950:"#1e1b4b"},violet:{50:"#f5f3ff",100:"#ede9fe",200:"#ddd6fe",300:"#c4b5fd",400:"#a78bfa",500:"#8b5cf6",600:"#7c3aed",700:"#6d28d9",800:"#5b21b6",900:"#4c1d95",950:"#2e1065"},purple:{50:"#faf5ff",100:"#f3e8ff",200:"#e9d5ff",300:"#d8b4fe",400:"#c084fc",500:"#a855f7",600:"#9333ea",700:"#7e22ce",800:"#6b21a8",900:"#581c87",950:"#3b0764"},fuchsia:{50:"#fdf4ff",100:"#fae8ff",200:"#f5d0fe",300:"#f0abfc",400:"#e879f9",500:"#d946ef",600:"#c026d3",700:"#a21caf",800:"#86198f",900:"#701a75",950:"#4a044e"},pink:{50:"#fdf2f8",100:"#fce7f3",200:"#fbcfe8",300:"#f9a8d4",400:"#f472b6",500:"#ec4899",600:"#db2777",700:"#be185d",800:"#9d174d",900:"#831843",950:"#500724"},rose:{50:"#fff1f2",100:"#ffe4e6",200:"#fecdd3",300:"#fda4af",400:"#fb7185",500:"#f43f5e",600:"#e11d48",700:"#be123c",800:"#9f1239",900:"#881337",950:"#4c0519"},get lightBlue(){return r({version:"v2.2",from:"lightBlue",to:"sky"}),this.sky},get warmGray(){return r({version:"v3.0",from:"warmGray",to:"stone"}),this.stone},get trueGray(){return r({version:"v3.0",from:"trueGray",to:"neutral"}),this.neutral},get coolGray(){return r({version:"v3.0",from:"coolGray",to:"gray"}),this.gray},get blueGray(){return r({version:"v3.0",from:"blueGray",to:"slate"}),this.slate}}})(wj)),wj}var _j,LL;function Ike(){if(LL)return _j;LL=1;let e=$ke();return _j=(e.__esModule?e:{default:e}).default,_j}var Lke=Ike();const zke=zr(Lke),Qd="agentprism",qke=["background","foreground","primary","primary-foreground","primary","primary-foreground","secondary","secondary-foreground","muted","muted-foreground","accent","accent-foreground","brand","brand-foreground","brand-secondary","brand-secondary-foreground","border","border-subtle","border-strong","border-inverse","success","success-muted","success-muted-foreground","error","error-muted","error-muted-foreground","warning","warning-muted","warning-muted-foreground","pending","pending-muted","pending-muted-foreground","code-string","code-number","code-key","code-base","badge-default","badge-default-foreground","avatar-llm","badge-llm","badge-llm-foreground","timeline-llm","avatar-agent","badge-agent","badge-agent-foreground","timeline-agent","avatar-tool","badge-tool","badge-tool-foreground","timeline-tool","avatar-chain","badge-chain","badge-chain-foreground","timeline-chain","avatar-retrieval","badge-retrieval","badge-retrieval-foreground","timeline-retrieval","avatar-embedding","badge-embedding","badge-embedding-foreground","timeline-embedding","avatar-guardrail","badge-guardrail","badge-guardrail-foreground","timeline-guardrail","avatar-create-agent","badge-create-agent","badge-create-agent-foreground","timeline-create-agent","avatar-span","badge-span","badge-span-foreground","timeline-span","avatar-event","badge-event","badge-event-foreground","timeline-event","avatar-unknown","badge-unknown","badge-unknown-foreground","timeline-unknown"];Object.fromEntries(qke.map(e=>[`agentprism-${e}`,Fke(e)]));function Fke(e){return`oklch(var(--${Qd}-${e}) / <alpha-value>)`}const HV=({content:e,id:t,className:n=""})=>c.jsx(Mke,{booleanStyle:`color: ${zke.blue[800]};`,className:`overflow-x-hidden rounded-xl p-4 text-left ${n}`,data:e,id:`json-pretty-${t}`,keyStyle:`color: oklch(var(--${Qd}-code-key));`,mainStyle:`color: oklch(var(--${Qd}-code-base)); font-size: 12px; white-space: pre-wrap; word-wrap: break-word; overflow-wrap: break-word;`,stringStyle:`color: oklch(var(--${Qd}-code-string));`,valueStyle:`color: oklch(var(--${Qd}-code-number));`}),BV=({content:e,parsedContent:t,mode:n,label:r,id:a,className:s=""})=>e?c.jsxs("div",{className:`border-agentprism-border relative rounded-lg border ${s}`,children:[c.jsx("div",{className:"absolute right-1.5 top-1.5 z-10",children:c.jsx(UV,{label:r,content:e})}),n==="json"&&t?c.jsx(HV,{content:t,id:a}):c.jsx("div",{className:"bg-agentprism-background rounded-lg p-4",children:c.jsx("pre",{className:"text-agentprism-foreground overflow-x-auto whitespace-pre-wrap text-left font-mono text-sm",children:e})})]}):c.jsx("p",{className:"text-agentprism-muted-foreground p-3 text-sm italic",children:"No data available"}),Uke=[{value:"json",label:"JSON"},{value:"plain",label:"Plain"}],Hke=({data:e})=>!e.attributes||e.attributes.length===0?c.jsx("div",{className:"p-6 text-center",children:c.jsx("p",{className:"text-agentprism-muted-foreground",children:"No attributes available for this span."})}):c.jsx("div",{className:"space-y-4",children:e.attributes.map((t,n)=>{var l,d;const r=t.value.stringValue,a=r||((l=t.value.intValue)==null?void 0:l.toString())||((d=t.value.boolValue)==null?void 0:d.toString())||"N/A";let s=null;if(typeof r=="string")try{s=JSON.parse(r)}catch{s=null}return s!==null&&s&&r?c.jsx(Bke,{attributeKey:t.key,content:r,parsedContent:s,id:`${e.id}-${t.key}-${n}`},`${t.key}-${n}`):c.jsxs("div",{className:"border-agentprism-border rounded-md border p-4",children:[c.jsx("dt",{className:"text-agentprism-muted-foreground mb-1 text-sm",children:t.key}),c.jsx("dd",{className:"text-agentprism-foreground break-words text-sm",children:a})]},`${t.key}-${n}`)})}),Bke=({attributeKey:e,content:t,parsedContent:n,id:r})=>{const[a,s]=N.useState("json");return c.jsx(FV,{title:e,defaultOpen:!0,rightContent:c.jsx(TT,{items:Uke,defaultValue:"json",value:a,onValueChange:s,theme:"pill",onClick:i=>i.stopPropagation()}),children:c.jsx(BV,{content:t,parsedContent:n,mode:a,label:e,id:r})})},Vke={4:"size-4 text-xs",6:"size-6 text-xs",8:"size-8 text-xs",9:"size-9 text-sm",10:"size-10 text-base",11:"size-11 text-lg",12:"size-12 text-xl",16:"size-16 text-2xl"},Wke={4:"size-3",6:"size-4",8:"size-6",9:"size-7",10:"size-8",11:"size-9",12:"size-10",16:"size-12"},Gke={llm_call:"bg-agentprism-avatar-llm",tool_execution:"bg-agentprism-avatar-tool",agent_invocation:"bg-agentprism-avatar-agent",chain_operation:"bg-agentprism-avatar-chain",retrieval:"bg-agentprism-avatar-retrieval",embedding:"bg-agentprism-avatar-embedding",create_agent:"bg-agentprism-avatar-create-agent",span:"bg-agentprism-avatar-span",event:"bg-agentprism-avatar-event",guardrail:"bg-agentprism-avatar-guardrail",unknown:"bg-agentprism-avatar-unknown"},AT=({category:e,src:t,alt:n="Avatar",size:r="10",rounded:a="full",letter:s,children:i,className:l="",...d})=>{const[f,h]=N.useState(!1),p=s?s.charAt(0):n.charAt(0).toUpperCase();return c.jsx("div",{className:dt("flex items-center justify-center overflow-hidden",!i&&"bg-agentprism-muted",f&&"border-agentprism-secondary border",Vke[r],bV[a],l),...d,children:i||(f?c.jsx(Pj,{className:dt(Wke[r],"text-agentprism-muted-foreground")}):c.jsx(c.Fragment,{children:t?c.jsx("img",{src:t,alt:n,className:"size-full object-cover",onError:()=>h(!0)}):c.jsx("div",{className:dt("flex h-full w-full items-center justify-center","text-agentprism-accent font-medium",Gke[e]),children:p})}))})},Kke={4:"px-1 gap-1 h-4",5:"px-1.5 gap-1 h-5",6:"px-2 gap-1.5 h-6",7:"px-2.5 gap-2 h-7"},Yke={4:"text-xs leading-3",5:"text-xs",6:"text-sm",7:"text-sm"},si=({label:e,size:t="4",iconStart:n,iconEnd:r,className:a="",unstyled:s=!1,...i})=>c.jsxs("span",{className:dt("inline-flex min-w-0 items-center overflow-hidden rounded-md font-medium",Kke[t],a,s?"":"bg-agentprism-badge-default text-agentprism-badge-default-foreground"),...i,children:[n&&c.jsx("span",{className:"shrink-0",children:n}),c.jsx("span",{className:dt(Yke[t],"min-w-0 max-w-full flex-shrink-0 truncate font-medium tracking-normal"),children:e}),r&&c.jsx("span",{className:"shrink-0",children:r})]}),RT=({cost:e,size:t,...n})=>c.jsx(si,{size:t,...n,label:`$ ${e}`}),Xke={llm_call:"bg-agentprism-badge-llm text-agentprism-badge-llm-foreground",tool_execution:"bg-agentprism-badge-tool text-agentprism-badge-tool-foreground",chain_operation:"bg-agentprism-badge-chain text-agentprism-badge-chain-foreground",retrieval:"bg-agentprism-badge-retrieval text-agentprism-badge-retrieval-foreground",embedding:"bg-agentprism-badge-embedding text-agentprism-badge-embedding-foreground",guardrail:"bg-agentprism-badge-guardrail text-agentprism-badge-guardrail-foreground",agent_invocation:"bg-agentprism-badge-agent text-agentprism-badge-agent-foreground",create_agent:"bg-agentprism-badge-create-agent text-agentprism-badge-create-agent-foreground",span:"bg-agentprism-badge-span text-agentprism-badge-span-foreground",event:"bg-agentprism-badge-event text-agentprism-badge-event-foreground",unknown:"bg-agentprism-badge-unknown text-agentprism-badge-unknown-foreground"},VV=({category:e,className:t,...n})=>{const r=YRe(e),a=KRe(e);return c.jsx(si,{className:dt(Xke[e],t),iconStart:c.jsx(r,{className:"size-2.5"}),...n,label:a,unstyled:!0})},Zke={success:"bg-agentprism-success",error:"bg-agentprism-error",pending:"bg-agentprism-pending",warning:"bg-agentprism-warning"},Qke={success:"bg-agentprism-success-muted text-agentprism-success-muted-foreground",error:"bg-agentprism-error-muted text-agentprism-error-muted-foreground",pending:"bg-agentprism-pending-muted text-agentprism-pending-muted-foreground",warning:"bg-agentprism-warning-muted text-agentprism-warning-muted-foreground"},zC=({status:e,variant:t="dot",...n})=>{const r=`Status: ${e}`;return c.jsx("div",{className:"flex size-4 items-center justify-center",...n,children:t==="dot"?c.jsx(Jke,{status:e,title:r}):c.jsx(eOe,{status:e,title:r})})},Jke=({status:e,title:t})=>c.jsx("span",{className:dt("block size-1.5 rounded-full",Zke[e]),"aria-label":t,title:t}),eOe=({status:e,title:t})=>c.jsxs("span",{className:dt("inline-flex items-center justify-center","h-3.5 w-4 rounded",Qke[e]),"aria-label":t,title:t,children:[e==="success"&&c.jsx(Is,{className:"size-2.5","aria-hidden":!0}),e==="error"&&c.jsx(JC,{className:"size-2.5","aria-hidden":!0}),e==="warning"&&c.jsx(lQ,{className:"size-2.5","aria-hidden":!0}),e==="pending"&&c.jsx(Vf,{className:"size-2.5","aria-hidden":!0})]}),WV=({timestamp:e,size:t,...n})=>c.jsx(si,{size:t,...n,label:tOe(e)});function tOe(e){return new Date(e).toLocaleString()}const kT=({tokensCount:e,size:t,...n})=>c.jsx(si,{iconStart:c.jsx(DZ,{className:"size-2.5"}),size:t,...n,label:e}),nOe=({data:e,avatar:t,copyButton:n,actions:r,className:a})=>{const[s,i]=N.useState(!1),l=gV(e),d=()=>{n!=null&&n.onCopy&&(n.onCopy(e),i(!0),setTimeout(()=>i(!1),2e3))};return c.jsxs("div",{className:a||"flex flex-wrap items-center gap-2",children:[t&&c.jsx(AT,{size:"4",...t}),c.jsx("span",{className:"text-agentprism-foreground tracking-wide",children:e.title}),c.jsx("div",{className:"flex size-5 items-center justify-center",children:c.jsx(zC,{status:e.status})}),n&&c.jsx(kh,{"aria-label":n.isEnabled?"Copy span details":"Copy disabled",variant:"ghost",onClick:d,children:s?c.jsx(Is,{className:"text-agentprism-muted-foreground size-3"}):c.jsx(Lo,{className:"text-agentprism-muted-foreground size-3"})}),c.jsx(VV,{category:e.type}),typeof e.tokensCount=="number"&&c.jsx(kT,{tokensCount:e.tokensCount}),typeof e.cost=="number"&&c.jsx(RT,{cost:e.cost}),c.jsxs("span",{className:"text-agentprism-muted-foreground text-xs",children:["LATENCY: ",yV(l)]}),typeof e.startTime=="number"&&c.jsx(WV,{timestamp:e.startTime}),r]})},rOe=({data:e})=>{const t=!!e.input,n=!!e.output;if(!t&&!n)return c.jsx("div",{className:"border-agentprism-border rounded-md border p-4",children:c.jsx("p",{className:"text-agentprism-muted-foreground text-sm",children:"No input or output data available for this span"})});let r=null,a=null;if(typeof e.input=="string")try{r=JSON.parse(e.input)}catch{r=null}if(typeof e.output=="string")try{a=JSON.parse(e.output)}catch{a=null}return c.jsxs("div",{className:"space-y-4",children:[typeof e.input=="string"&&c.jsx(zL,{section:"Input",content:e.input,parsedContent:r}),typeof e.output=="string"&&c.jsx(zL,{section:"Output",content:e.output,parsedContent:a})]})},zL=({section:e,content:t,parsedContent:n})=>{const[r,a]=N.useState(n?"json":"plain");N.useEffect(()=>{r==="json"&&!n&&a("plain")},[r,n]);const s=[{value:"json",label:"JSON",disabled:!n},{value:"plain",label:"Plain"}];return c.jsx(FV,{title:e,defaultOpen:!0,rightContent:c.jsx(TT,{items:s,defaultValue:n?"json":"plain",value:r,onValueChange:a,theme:"pill",onClick:i=>i.stopPropagation()}),children:c.jsx(BV,{content:t,parsedContent:n,mode:r,label:e,id:e})})},aOe=({data:e})=>c.jsx("div",{className:"border-agentprism-border rounded-md border bg-transparent",children:c.jsxs("div",{className:"relative",children:[c.jsx("div",{className:"pointer-events-none sticky top-0 z-10 flex justify-end p-1.5",children:c.jsx("div",{className:"pointer-events-auto",children:c.jsx(UV,{label:"Raw",content:e.raw})})}),c.jsx("div",{className:"-mt-12",children:c.jsx(HV,{content:e.raw,id:e.id||"span-details"})})]})}),sOe=[{value:"input-output",label:"In/Out",icon:c.jsx(qX,{className:"size-4"})},{value:"attributes",label:"Attributes",icon:c.jsx(yJ,{className:"size-4"})},{value:"raw",label:"RAW",icon:c.jsx(lJ,{className:"size-4"})}],GV=({data:e,avatar:t,defaultTab:n="input-output",className:r,copyButton:a,headerActions:s,customHeader:i,onTabChange:l})=>{const[d,f]=N.useState(n),h=y=>{f(y),l==null||l(y)},p=typeof s=="function"?s(e):s,g=i?typeof i=="function"?i({data:e}):i:c.jsx(nOe,{data:e,avatar:t,copyButton:a,actions:p});return c.jsxs("div",{className:dt("border-agentprism-border bg-agentprism-background flex h-full min-h-0 flex-col rounded-md border p-4",r),children:[c.jsx("div",{className:"mb-4 shrink-0",children:g}),c.jsx("div",{className:"shrink-0",children:c.jsx(TT,{items:sOe,value:d,onValueChange:h,theme:"underline",defaultValue:n})}),c.jsxs("div",{className:"min-h-0 flex-1 overflow-y-auto py-4",children:[d==="input-output"&&c.jsx(rOe,{data:e}),d==="attributes"&&c.jsx(Hke,{data:e}),d==="raw"&&c.jsx(aOe,{data:e})]},d)]})},KV=({trace:e,avatar:t})=>c.jsxs("header",{className:"flex w-full min-w-0 flex-wrap items-center justify-between gap-2",children:[c.jsxs("div",{className:"flex min-w-0 items-center gap-1.5 overflow-hidden",children:[t&&c.jsx(AT,{size:"4",...t}),c.jsx("h3",{className:"text-agentprism-muted-foreground max-w-full truncate text-sm",children:e.name})]}),c.jsx("div",{className:"flex items-center gap-2",children:c.jsx(si,{size:"4",label:e.spansCount===1?"1 span":`${e.spansCount} spans`})})]}),oOe=({trace:e,avatar:t,onClick:n,badges:r,isSelected:a,showDescription:s=!0})=>{const i=N.useCallback(g=>{(g.key==="Enter"||g.key===" ")&&(g.preventDefault(),n==null||n())},[n]),{name:l,agentDescription:d,totalCost:f,totalTokens:h,startTime:p}=e;return c.jsxs("div",{className:dt("group w-full","flex flex-col gap-2 p-4","cursor-pointer",a?"bg-agentprism-secondary/75 dark:bg-agentprism-muted/80":"bg-agentprism-background hover:bg-agentprism-secondary/45 dark:hover:bg-agentprism-muted/70"),role:"button",tabIndex:0,onClick:n,onKeyDown:i,"aria-label":`Select trace ${l}`,children:[c.jsx(KV,{trace:e,avatar:t}),c.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[s&&c.jsx("span",{className:"text-agentprism-muted-foreground mr-4 max-w-full truncate text-sm",children:d}),typeof f=="number"&&c.jsx(RT,{cost:f}),typeof h=="number"&&c.jsx(kT,{tokensCount:h}),r==null?void 0:r.map((g,y)=>c.jsx(si,{size:"4",label:g.label},y)),typeof p=="number"&&c.jsx(WV,{timestamp:p})]})]})},YV=({traces:e,expanded:t,onExpandStateChange:n,className:r,onTraceSelect:a,selectedTrace:s})=>c.jsxs("div",{className:dt("flex min-w-0 flex-col",t?"h-full w-full gap-3":"h-auto w-fit gap-1",r),children:[c.jsxs("header",{className:"flex min-h-6 shrink-0 items-center justify-between gap-2",children:[c.jsxs("div",{className:dt("flex items-center gap-2",t?"opacity-100":"hidden opacity-0"),children:[c.jsx("h2",{className:"text-agentprism-muted-foreground",children:"Traces"}),c.jsx(si,{size:"5","aria-label":`Total number of traces: ${e.length}`,label:e.length})]}),c.jsx(kh,{"aria-label":t?"Collapse Trace List":"Expand Trace List",onClick:()=>n(!t),children:c.jsx(Gg,{className:dt("size-3",t?"":"rotate-180")})})]}),t&&c.jsx("ul",{className:"border-agentprism-border flex min-h-0 flex-1 flex-col overflow-hidden rounded-md border",children:c.jsx("div",{className:"flex-1 overflow-y-auto",children:e.map(i=>c.jsx("li",{className:"border-agentprism-border w-full list-none border-b [&:not(:last-child)]:border-b",children:c.jsx(oOe,{showDescription:!1,trace:i,onClick:()=>a==null?void 0:a(i),isSelected:(s==null?void 0:s.id)===i.id,badges:i.badges})},i.id))})})]}),qL=({title:e})=>c.jsx("p",{className:"text-agentprism-muted-foreground bg-agentprism-background flex h-full items-center justify-center rounded-lg p-4 text-center",children:e}),iOe=({className:e})=>c.jsx("svg",{className:e,viewBox:"0 0 24 24",fill:"currentColor",children:c.jsx("path",{d:"M22.282 9.821a5.985 5.985 0 0 0-.516-4.91 6.046 6.046 0 0 0-6.51-2.9A6.065 6.065 0 0 0 4.981 4.18a5.985 5.985 0 0 0-3.998 2.9 6.046 6.046 0 0 0 .743 7.097 5.98 5.98 0 0 0 .51 4.911 6.051 6.051 0 0 0 6.515 2.9A5.985 5.985 0 0 0 13.26 24a6.056 6.056 0 0 0 5.772-4.206 5.99 5.99 0 0 0 3.997-2.9 6.056 6.056 0 0 0-.747-7.073zM13.26 22.43a4.476 4.476 0 0 1-2.876-1.04l.141-.081 4.779-2.758a.795.795 0 0 0 .392-.681v-6.737l2.02 1.168a.071.071 0 0 1 .038.052v5.583a4.504 4.504 0 0 1-4.494 4.494zM3.6 18.304a4.47 4.47 0 0 1-.535-3.014l.142.085 4.783 2.759a.771.771 0 0 0 .78 0l5.843-3.369v2.332a.08.08 0 0 1-.033.062L9.74 19.95a4.5 4.5 0 0 1-6.14-1.646zM2.34 7.896a4.485 4.485 0 0 1 2.366-1.973V11.6a.766.766 0 0 0 .388.676l5.815 3.355-2.02 1.168a.076.076 0 0 1-.071 0l-4.83-2.786A4.504 4.504 0 0 1 2.34 7.872zm16.597 3.855l-5.833-3.387L15.119 7.2a.076.076 0 0 1 .071 0l4.83 2.791a4.494 4.494 0 0 1-.676 8.105v-5.678a.79.79 0 0 0-.407-.667zm2.01-3.023l-.141-.085-4.774-2.782a.776.776 0 0 0-.785 0L9.409 9.23V6.897a.066.066 0 0 1 .028-.061l4.83-2.787a4.5 4.5 0 0 1 6.68 4.66zm-12.64 4.135l-2.02-1.164a.08.08 0 0 1-.038-.057V6.075a4.5 4.5 0 0 1 7.375-3.453l-.142.08L8.704 5.46a.795.795 0 0 0-.393.681zm1.097-2.365l2.602-1.5 2.607 1.5v2.999l-2.597 1.5-2.607-1.5z"})}),lOe=({className:e})=>c.jsx("svg",{className:e,viewBox:"0 0 24 24",fill:"currentColor",children:c.jsx("path",{d:"M15.5 2.694h5.97l-9.204 18.612h-5.97L15.5 2.694zm-7.112 0h5.515l-9.177 18.612H0L8.388 2.694z"})}),cOe=({className:e})=>c.jsxs("svg",{className:e,viewBox:"0 0 24 24",fill:"none",children:[c.jsx("path",{d:"M22.56 12.25c0-.78-.07-1.53-.2-2.25H12v4.26h5.92c-.26 1.37-1.04 2.53-2.21 3.31v2.77h3.57c2.08-1.92 3.28-4.74 3.28-8.09z",fill:"#4285F4"}),c.jsx("path",{d:"M12 23c2.97 0 5.46-.98 7.28-2.66l-3.57-2.77c-.98.66-2.23 1.06-3.71 1.06-2.86 0-5.29-1.93-6.16-4.53H2.18v2.84C3.99 20.53 7.7 23 12 23z",fill:"#34A853"}),c.jsx("path",{d:"M5.84 14.09c-.22-.66-.35-1.36-.35-2.09s.13-1.43.35-2.09V7.07H2.18C1.43 8.55 1 10.22 1 12s.43 3.45 1.18 4.93l2.85-2.22.81-.62z",fill:"#FBBC05"}),c.jsx("path",{d:"M12 5.38c1.62 0 3.06.56 4.21 1.64l3.15-3.15C17.45 2.09 14.97 1 12 1 7.7 1 3.99 3.47 2.18 7.07l3.66 2.84c.87-2.6 3.3-4.53 6.16-4.53z",fill:"#EA4335"})]}),uOe=({className:e})=>c.jsx("svg",{className:e,viewBox:"0 0 24 24",fill:"currentColor",children:c.jsx("path",{d:"M24 12.073c0-6.627-5.373-12-12-12s-12 5.373-12 12c0 5.99 4.388 10.954 10.125 11.854v-8.385H7.078v-3.47h3.047V9.43c0-3.007 1.792-4.669 4.533-4.669 1.312 0 2.686.235 2.686.235v2.953H15.83c-1.491 0-1.956.925-1.956 1.874v2.25h3.328l-.532 3.47h-2.796v8.385C19.612 23.027 24 18.062 24 12.073z"})}),dOe=({className:e})=>c.jsxs("svg",{className:e,viewBox:"0 0 24 24",fill:"currentColor",children:[c.jsx("rect",{width:"4",height:"4",x:"0",y:"0"}),c.jsx("rect",{width:"4",height:"4",x:"5",y:"0"}),c.jsx("rect",{width:"4",height:"4",x:"10",y:"0"}),c.jsx("rect",{width:"4",height:"4",x:"15",y:"0"}),c.jsx("rect",{width:"4",height:"4",x:"20",y:"0"}),c.jsx("rect",{width:"4",height:"4",x:"0",y:"5"}),c.jsx("rect",{width:"4",height:"4",x:"15",y:"5"}),c.jsx("rect",{width:"4",height:"4",x:"20",y:"5"}),c.jsx("rect",{width:"4",height:"4",x:"0",y:"10"}),c.jsx("rect",{width:"4",height:"4",x:"10",y:"10"}),c.jsx("rect",{width:"4",height:"4",x:"15",y:"10"}),c.jsx("rect",{width:"4",height:"4",x:"20",y:"10"}),c.jsx("rect",{width:"4",height:"4",x:"0",y:"15"}),c.jsx("rect",{width:"4",height:"4",x:"5",y:"15"}),c.jsx("rect",{width:"4",height:"4",x:"15",y:"15"}),c.jsx("rect",{width:"4",height:"4",x:"20",y:"15"}),c.jsx("rect",{width:"4",height:"4",x:"0",y:"20"}),c.jsx("rect",{width:"4",height:"4",x:"5",y:"20"}),c.jsx("rect",{width:"4",height:"4",x:"10",y:"20"}),c.jsx("rect",{width:"4",height:"4",x:"15",y:"20"}),c.jsx("rect",{width:"4",height:"4",x:"20",y:"20"})]}),fOe=({className:e})=>c.jsx("svg",{className:e,viewBox:"0 0 24 24",fill:"currentColor",children:c.jsx("path",{d:"M13.913.5v10.203L23.413 5.5zm-3.826 0L.587 5.5l9.5 5.203zm0 23L.587 18.5l9.5-5.203zm3.826 0v-10.203L23.413 18.5z"})}),hOe={openai:iOe,anthropic:lOe,google:cOe,meta:uOe,mistral:dOe,perplexity:fOe},XV=({brand:e,className:t="size-4",fallback:n=null})=>{const r=hOe[e];return r?c.jsx(r,{className:t}):c.jsx(c.Fragment,{children:n})},pOe=({data:e})=>c.jsxs("div",{className:"flex flex-wrap items-center justify-start gap-1",children:[c.jsx(VV,{category:e.type}),typeof e.tokensCount=="number"&&c.jsx(kT,{tokensCount:e.tokensCount}),typeof e.cost=="number"&&c.jsx(RT,{cost:e.cost})]}),FL=({type:e})=>e==="empty"?c.jsx("div",{className:"w-5 shrink-0 grow"}):c.jsxs("div",{className:"relative w-5 shrink-0 grow",children:[(e==="vertical"||e==="t-right")&&c.jsx("div",{className:"bg-agentprism-secondary absolute inset-y-0 left-1/2 z-10 w-0.5 -translate-x-1/2"}),e==="t-right"&&c.jsx("div",{className:"bg-agentprism-secondary absolute left-2.5 top-2.5 h-0.5 w-2.5 translate-y-[-3px]"}),e==="corner-top-right"&&c.jsxs(c.Fragment,{children:[c.jsx("div",{className:"bg-agentprism-secondary absolute left-1/2 top-2 size-0.5 -translate-x-1/2 -translate-y-px"}),c.jsx("div",{className:"bg-agentprism-secondary absolute left-1/2 top-2.5 h-0.5 w-2.5 translate-y-[-3px]"}),c.jsx("div",{className:"bg-agentprism-secondary absolute left-1/2 top-0 h-[7px] w-0.5 -translate-x-px"})]})]}),mOe={llm_call:"bg-agentprism-timeline-llm",agent_invocation:"bg-agentprism-timeline-agent",tool_execution:"bg-agentprism-timeline-tool",chain_operation:"bg-agentprism-timeline-chain",retrieval:"bg-agentprism-timeline-retrieval",embedding:"bg-agentprism-timeline-embedding",guardrail:"bg-agentprism-timeline-guardrail",create_agent:"bg-agentprism-timeline-create-agent",span:"bg-agentprism-timeline-span",event:"bg-agentprism-timeline-event",unknown:"bg-agentprism-timeline-unknown"},gOe=({spanCard:e,minStart:t,maxEnd:n,className:r})=>{const{startPercent:a,widthPercent:s}=vV({spanCard:e,minStart:t,maxEnd:n});return c.jsx("span",{className:dt("bg-agentprism-secondary relative flex h-4 min-w-20 flex-1 rounded-md",r),children:c.jsx("span",{className:"pointer-events-none absolute inset-x-1 top-1/2 h-1.5 -translate-y-1/2",children:c.jsx("span",{className:`absolute h-full rounded-sm ${mOe[e.type]}`,style:{left:`${a}%`,width:`${s}%`}})})})},UL=({isExpanded:e,title:t,onToggleClick:n})=>c.jsx(mT,{asChild:!0,children:c.jsx("button",{className:"flex h-4 w-5 shrink-0 items-center justify-center",onClick:n,onKeyDown:n,"aria-label":`${e?"Collapse":"Expand"} ${t} children`,"aria-expanded":e,type:"button",children:e?c.jsx(uu,{"aria-hidden":"true",className:"text-agentprism-muted-foreground size-3"}):c.jsx(Io,{"aria-hidden":"true",className:"text-agentprism-muted-foreground size-3"})})}),qi={CONNECTOR_WIDTH:20,CONTENT_BASE_WIDTH:320},Vg={withStatus:!0,expandButton:"inside"},yOe=({level:e,hasExpandButton:t,contentPadding:n,expandButton:r})=>{let a=qi.CONTENT_BASE_WIDTH-e*qi.CONNECTOR_WIDTH;return t&&r==="inside"&&(a-=qi.CONNECTOR_WIDTH),r==="outside"&&e===0&&(a-=qi.CONNECTOR_WIDTH),a-n},vOe=({connectorsColumnWidth:e,expandButton:t})=>t==="inside"?`${e}px 1fr`:`${e}px 1fr ${qi.CONNECTOR_WIDTH}px`,xOe=({level:e,hasExpandButton:t})=>e===0?0:t?4:8,bOe=({level:e,hasExpandButton:t,isLastChild:n,prevConnectors:r,expandButton:a})=>{const s=[];if(e===0)return{connectors:a==="inside"?[]:["vertical"],connectorsColumnWidth:20};for(let l=0;l<e-1;l++)s.push("vertical");n||s.push("t-right"),n&&s.push("corner-top-right");let i=s.length*qi.CONNECTOR_WIDTH;t&&(i+=qi.CONNECTOR_WIDTH);for(let l=0;l<r.length;l++)(r[l]==="empty"||r[l]==="corner-top-right")&&(s[l]="empty");return{connectors:s,connectorsColumnWidth:i}},wOe=(e,t)=>{const n=N.useCallback(()=>{t==null||t(e)},[e,t]),r=N.useCallback(s=>{(s.key==="Enter"||s.key===" ")&&(s.preventDefault(),n())},[n]),a=N.useCallback(s=>{s.stopPropagation()},[]);return{handleCardClick:n,handleKeyDown:r,handleToggleClick:a}},SOe=({data:e,level:t,selectedSpan:n,onSpanSelect:r,minStart:a,maxEnd:s,prevLevelConnectors:i,expandedSpansIds:l,onExpandSpansIdsChange:d,viewOptions:f=Vg})=>{var h;return(h=e.children)!=null&&h.length?c.jsx("div",{className:"relative",children:c.jsx(gT,{children:c.jsx("ul",{role:"group",children:e.children.map((p,g)=>{var S;const y=(S=p.metadata)==null?void 0:S.brand;return c.jsx(ZV,{viewOptions:f,data:p,minStart:a,maxEnd:s,level:t+1,selectedSpan:n,onSpanSelect:r,isLastChild:g===(e.children||[]).length-1,prevLevelConnectors:i,expandedSpansIds:l,onExpandSpansIdsChange:d,avatar:y?{children:c.jsx(XV,{brand:y.type}),size:"4",rounded:"sm",category:p.type}:void 0},p.id)})})})}):null},ZV=({data:e,level:t=0,selectedSpan:n,onSpanSelect:r,viewOptions:a=Vg,avatar:s,minStart:i,maxEnd:l,isLastChild:d,prevLevelConnectors:f=[],expandedSpansIds:h,onExpandSpansIdsChange:p})=>{var M;const g=h.includes(e.id),y=a.withStatus??Vg.withStatus,S=a.expandButton||Vg.expandButton,w=N.useCallback(z=>{const L=h.includes(e.id);L&&!z&&p(h.filter(U=>U!==e.id)),!L&&z&&p([...h,e.id])},[h,e.id,p]),b={isExpanded:g,hasChildren:!!((M=e.children)!=null&&M.length),isSelected:(n==null?void 0:n.id)===e.id},x=wOe(e,r),{durationMs:_}=vV({spanCard:e,minStart:i,maxEnd:l}),j=S==="inside"&&b.hasChildren,C=xOe({level:t,hasExpandButton:j}),T=yOe({level:t,hasExpandButton:j,contentPadding:C,expandButton:S}),{connectors:A,connectorsColumnWidth:k}=bOe({level:t,hasExpandButton:j,isLastChild:d,prevConnectors:f,expandButton:S}),O=vOe({connectorsColumnWidth:k,expandButton:S});return c.jsx("li",{role:"treeitem","aria-selected":b.isSelected?!0:n?!1:void 0,"aria-expanded":b.hasChildren?b.isExpanded:void 0,className:"list-none",children:c.jsxs(pT,{open:b.isExpanded,onOpenChange:w,children:[c.jsxs("div",{className:dt("relative grid w-full",b.isSelected&&"before:bg-agentprism-muted/75 before:absolute before:-top-2 before:h-2 before:w-full",b.isSelected&&"from-agentprism-muted/75 to-agentprism-muted/75 bg-gradient-to-b"),style:{gridTemplateColumns:O,backgroundSize:"auto calc(100% - 8px)",backgroundPosition:"top",backgroundRepeat:"no-repeat"},onClick:x.handleCardClick,onKeyDown:x.handleKeyDown,tabIndex:0,role:"button","aria-pressed":b.isSelected,"aria-describedby":`span-card-desc-${e.id}`,"aria-expanded":b.hasChildren?b.isExpanded:void 0,"aria-label":`${b.isSelected?"Selected":"Not selected"} span card for ${e.title} at level ${t}`,children:[c.jsxs("div",{className:"flex flex-nowrap",children:[A.map((z,L)=>c.jsx(FL,{type:z},`${z}-${L}`)),j&&c.jsxs("div",{className:"flex w-5 flex-col items-center",children:[c.jsx(UL,{isExpanded:b.isExpanded,title:e.title,onToggleClick:x.handleToggleClick}),b.isExpanded&&c.jsx(FL,{type:"vertical"})]})]}),c.jsxs("div",{className:dt("flex flex-wrap items-start gap-x-2 gap-y-1","mb-3 min-h-5 w-full cursor-pointer",t!==0&&!j&&"pl-2",t!==0&&j&&"pl-1"),children:[c.jsxs("div",{className:"relative flex min-h-4 shrink-0 flex-wrap items-center gap-1.5",style:{width:`min(${T}px, 100%)`,minWidth:140},children:[s&&c.jsx(AT,{size:"4",...s}),c.jsx("h3",{className:"text-agentprism-foreground max-w-32 truncate text-sm leading-[14px]",title:e.title,children:e.title}),c.jsx(pOe,{data:e})]}),c.jsxs("div",{className:"flex grow flex-wrap items-center justify-end gap-1",children:[S==="outside"&&y&&c.jsx("div",{children:c.jsx(zC,{status:e.status})}),c.jsx(gOe,{minStart:i,maxEnd:l,spanCard:e}),c.jsxs("div",{className:"flex items-center gap-2",children:[c.jsx("span",{className:"text-agentprism-foreground inline-block w-14 flex-1 shrink-0 whitespace-nowrap px-1 text-right text-xs",children:yV(_)}),S==="inside"&&y&&c.jsx("div",{children:c.jsx(zC,{status:e.status})})]})]})]}),S==="outside"&&(b.hasChildren?c.jsx(UL,{isExpanded:b.isExpanded,title:e.title,onToggleClick:x.handleToggleClick}):c.jsx("div",{}))]}),c.jsx(SOe,{minStart:i,maxEnd:l,viewOptions:a,data:e,level:t,selectedSpan:n,onSpanSelect:r,prevLevelConnectors:A,expandedSpansIds:h,onExpandSpansIdsChange:p})]})})},_Oe=({spans:e,onSpanSelect:t,className:n="",selectedSpan:r,expandedSpansIds:a,onExpandSpansIdsChange:s,spanCardViewOptions:i})=>{const l=NT(e),{minStart:d,maxEnd:f}=qRe(l);return c.jsx("div",{className:"w-full min-w-0 px-4",children:c.jsx("ul",{className:dt(n,"overflow-x-auto pt-2"),role:"tree","aria-label":"Hierarchical card list",children:e.map((h,p)=>{var y;const g=(y=h.metadata)==null?void 0:y.brand;return c.jsx(ZV,{data:h,level:0,selectedSpan:r,onSpanSelect:t,minStart:d,maxEnd:f,isLastChild:p===e.length-1,expandedSpansIds:a,onExpandSpansIdsChange:s,viewOptions:i,avatar:g?{children:c.jsx(XV,{brand:g.type}),size:"4",rounded:"sm",category:h.type}:void 0},h.id)})})})},NOe=({onExpandAll:e,...t})=>c.jsx(kh,{size:"6",onClick:e,"aria-label":"Expand all",...t,children:c.jsx(bZ,{className:"size-3.5"})}),jOe=({onCollapseAll:e,...t})=>c.jsx(kh,{size:"6",onClick:e,"aria-label":"Collapse all",...t,children:c.jsx(vZ,{className:"size-3.5"})}),HL="absolute top-1/2 -translate-y-1/2 flex items-center justify-center text-agentprism-muted-foreground",COe=({className:e,onChange:t,onValueChange:n,startIcon:r,onClear:a,ref:s,inputClassName:i,label:l,hideLabel:d=!1,id:f,...h})=>{const p=N.useRef(null),g=S=>{t==null||t(S),n==null||n(S.target.value)},y=()=>{var S,w;if(a==null||a(),s){(S=s.current)==null||S.focus();return}(w=p.current)==null||w.focus()};return c.jsxs("div",{className:dt("w-full",e),children:[l&&c.jsx("label",{htmlFor:f,className:dt("text-agentprism-foreground block text-sm font-medium",d&&"sr-only"),children:l}),c.jsxs("div",{className:dt("relative flex w-full items-center justify-center",l&&!d&&"mt-1"),children:[c.jsx("input",{id:f,ref:s||p,onChange:g,className:dt(i,"flex h-7 items-center truncate","w-full px-2",!!r&&"pl-8",!!a&&"pr-8","border-agentprism-border rounded border bg-transparent","text-agentprism-foreground placeholder:text-agentprism-foreground/50","hover:border-agentprism-border-strong","disabled:cursor-not-allowed disabled:opacity-50"),...h}),r&&c.jsx("div",{className:dt(HL,"left-2"),"aria-hidden":!0,children:r}),a&&h.value&&c.jsx("button",{className:dt(HL,"right-2"),"aria-label":"Clear input value",onClick:y,type:"button",children:c.jsx(la,{className:"size-4"})})]})]})},EOe=({...e})=>c.jsx(COe,{startIcon:c.jsx(ia,{className:"size-4"}),placeholder:"Filter...",...e}),TOe=({searchValue:e,setSearchValue:t,handleExpandAll:n,handleCollapseAll:r})=>c.jsxs("div",{className:"flex shrink-0 items-center justify-between gap-3 px-4 pb-2 pt-1",children:[c.jsx(EOe,{id:"trace-span-search",value:e,onChange:a=>t(a.target.value),placeholder:"Search spans"}),c.jsxs("div",{className:"flex items-center gap-2",children:[c.jsx(NOe,{onExpandAll:n}),c.jsx(jOe,{onCollapseAll:r})]})]}),QV=({searchValue:e,setSearchValue:t,handleExpandAll:n,handleCollapseAll:r,filteredSpans:a,selectedSpan:s,setSelectedSpan:i,expandedSpansIds:l,setExpandedSpansIds:d,spanCardViewOptions:f,selectedTrace:h,showHeader:p=!0})=>{var g;return c.jsxs(c.Fragment,{children:[p&&h&&c.jsxs("div",{className:"flex shrink-0 gap-2 px-4",children:[c.jsx(KV,{trace:h}),c.jsx("div",{className:"flex flex-wrap items-center gap-2",children:(g=h.badges)==null?void 0:g.map((y,S)=>c.jsx(si,{size:"4",label:y.label},S))})]}),c.jsxs("div",{className:"bg-agentprism-background flex min-h-0 flex-1 flex-col overflow-hidden rounded-md",children:[c.jsx(TOe,{searchValue:e,setSearchValue:t,handleExpandAll:n,handleCollapseAll:r}),c.jsx("div",{className:"min-h-0 flex-1 overflow-y-auto",children:a.length===0?c.jsx("div",{className:"text-agentprism-muted-foreground p-3 text-center",children:"No spans found"}):c.jsx(_Oe,{spans:a,onSpanSelect:i,selectedSpan:s,expandedSpansIds:l,onExpandSpansIdsChange:d,spanCardViewOptions:f})})]})]})},AOe=({traceRecords:e,traceListExpanded:t,setTraceListExpanded:n,selectedTrace:r,selectedTraceId:a,selectedSpan:s,setSelectedSpan:i,searchValue:l,setSearchValue:d,filteredSpans:f,expandedSpansIds:h,setExpandedSpansIds:p,handleExpandAll:g,handleCollapseAll:y,handleTraceSelect:S,spanCardViewOptions:w,detailsViewProps:b})=>{const x=e.find(_=>_.id===a)||r;return c.jsxs(qV,{direction:"horizontal",className:"h-full",children:[c.jsx(Yd,{id:"trace-list",defaultSize:t?20:2,minSize:t?15:2,maxSize:t?40:2,collapsible:!1,className:"flex h-full min-h-0 flex-col overflow-hidden",children:c.jsx(YV,{traces:e,expanded:t,onExpandStateChange:n,onTraceSelect:S,selectedTrace:x})}),c.jsx(LC,{}),r?c.jsx(Yd,{id:"tree-view",minSize:30,className:"flex h-full flex-col gap-y-2 overflow-hidden",children:c.jsx(QV,{searchValue:l,setSearchValue:d,handleExpandAll:g,handleCollapseAll:y,filteredSpans:f,selectedSpan:s,setSelectedSpan:i,expandedSpansIds:h,setExpandedSpansIds:p,spanCardViewOptions:w,selectedTrace:r})}):c.jsx(Yd,{id:"tree-view",minSize:30,className:"flex h-full items-center justify-center",children:c.jsx(qL,{title:"Select a trace to see the details"})}),c.jsx(LC,{}),c.jsx(Yd,{id:"details-view",defaultSize:30,minSize:20,maxSize:50,className:"h-full overflow-hidden",children:s?c.jsx(GV,{data:s,...b}):c.jsx(qL,{title:"Select a span to see the details"})})]})},ROe="inline-flex items-center justify-center font-medium transition-all duration-200",kOe={6:"h-6 px-2 gap-1 text-xs",7:"h-7 px-2 gap-1 text-xs",8:"h-8 px-2 gap-1 text-xs",9:"h-9 px-2.5 gap-2 text-sm",10:"h-10 px-4 gap-2 text-sm",11:"h-11 px-5 gap-3 text-base",12:"h-12 px-5 gap-2.5 text-base",16:"h-16 px-7 gap-3 text-lg"},OOe={brand:"text-agentprism-brand-foreground bg-agentprism-brand",primary:"text-agentprism-primary-foreground bg-agentprism-primary",outlined:"border border bg-transparent text-agentprism-foreground border-agentprism-foreground",secondary:"bg-agentprism-secondary text-agentprism-secondary-foreground",ghost:"bg-transparent text-agentprism-foreground",destructive:"bg-agentprism-error text-agentprism-primary-foreground",success:"bg-agentprism-success text-agentprism-primary-foreground"},BL=({children:e,size:t="6",rounded:n="md",variant:r="primary",fullWidth:a=!1,disabled:s=!1,iconStart:i,iconEnd:l,type:d="button",onClick:f,className:h="",...p})=>{const g=a?"w-full":"",y=s?"cursor-not-allowed opacity-50":"hover:opacity-70";return c.jsxs("button",{type:d,onClick:f,disabled:s,className:dt(ROe,kOe[t],bV[n],OOe[r],g,y,h),...p,children:[i&&c.jsx("span",{className:"mr-1",children:i}),e,l&&c.jsx("span",{className:"ml-1",children:l})]})},MOe=({traceRecords:e,traceListExpanded:t,setTraceListExpanded:n,selectedTrace:r,selectedTraceId:a,selectedSpan:s,setSelectedSpan:i,searchValue:l,setSearchValue:d,filteredSpans:f,expandedSpansIds:h,setExpandedSpansIds:p,handleExpandAll:g,handleCollapseAll:y,handleTraceSelect:S,spanCardViewOptions:w,onClearTraceSelection:b,detailsViewProps:x})=>r&&a&&f.length>0&&s?c.jsxs("div",{className:"flex h-full flex-col gap-4 overflow-y-auto",children:[c.jsx(BL,{onClick:()=>{i(void 0)},iconStart:c.jsx(Gg,{className:"size-3"}),variant:"ghost",className:"self-start",children:"Tree View"}),c.jsx(GV,{data:s,...x})]}):r&&a&&f.length>0&&!s?c.jsxs("div",{className:"flex h-full flex-col gap-4",children:[c.jsx("div",{className:"shrink-0",children:c.jsx(BL,{onClick:()=>{b&&b()},iconStart:c.jsx(Gg,{className:"size-3"}),variant:"ghost",className:"self-start",children:"Traces list"})}),c.jsx(QV,{searchValue:l,setSearchValue:d,handleExpandAll:g,handleCollapseAll:y,filteredSpans:f,selectedSpan:s,setSelectedSpan:i,expandedSpansIds:h,setExpandedSpansIds:p,spanCardViewOptions:w,selectedTrace:r})]}):c.jsx("div",{className:"h-full overflow-y-auto",children:c.jsx(YV,{traces:e,expanded:t,onExpandStateChange:n,onTraceSelect:S,selectedTrace:e.find(_=>_.id===a)})}),DOe=({data:e,initialTraceData:t})=>{const[n,r]=N.useState(t?{...t.traceRecord,badges:t.badges,spanCardViewOptions:t.spanCardViewOptions}:void 0),[a,s]=N.useState(t==null?void 0:t.traceRecord.id),[i,l]=N.useState((t==null?void 0:t.spans)??[]),[d,f]=N.useState(!1),[h,p]=N.useState(0),g=N.useRef(t==null?void 0:t.traceRecord.id),y=N.useCallback(()=>{p(x=>x+1)},[]),S=N.useCallback(()=>{g.current=void 0,f(!0),r(void 0),l([]),s(void 0),y()},[y]),w=N.useCallback((x,_)=>{const j=(_==null?void 0:_.source)??"user";f(j==="user"),s(x)},[]);return N.useEffect(()=>{if(e.length===0){r(void 0),l([]),s(void 0),d&&f(!1),g.current&&(g.current=void 0,y());return}if(!a){if(!d){const j=e[0];j&&s(j.traceRecord.id);return}r(void 0),l([]),g.current&&(g.current=void 0,y());return}const x=e.find(j=>j.traceRecord.id===a);if(!x){const j=e[0];j&&j.traceRecord.id!==a?(s(j.traceRecord.id),f(!1)):(r(void 0),l([]),d&&f(!1),g.current&&(g.current=void 0,y()));return}const _={...x.traceRecord,badges:x.badges,spanCardViewOptions:x.spanCardViewOptions};r(j=>j&&j.id===_.id&&j.badges===_.badges&&j.spanCardViewOptions===_.spanCardViewOptions?j:_),l(j=>j===x.spans?j:x.spans),g.current!==x.traceRecord.id&&(g.current=x.traceRecord.id,y())},[e,d,y,a]),N.useMemo(()=>({selectedTrace:n,selectedTraceId:a,selectedTraceSpans:i,hasUserSelection:d,traceChangeToken:h,selectTrace:w,clearSelection:S}),[S,d,w,n,a,i,h])},POe=({data:e,spanCardViewOptions:t,detailsViewProps:n,activeTraceId:r,onTraceSelect:a})=>{const s=XRe(),i=N.useMemo(()=>{if(r){const q=e.find(V=>V.traceRecord.id===r);if(q)return q}return e[0]},[r,e]),[l,d]=N.useState(),[f,h]=N.useState(""),[p,g]=N.useState(!0),{selectedTrace:y,selectedTraceId:S,selectedTraceSpans:w,traceChangeToken:b,selectTrace:x,clearSelection:_}=DOe({data:e,initialTraceData:i}),j=N.useMemo(()=>e.map(q=>({...q.traceRecord,badges:q.badges,spanCardViewOptions:q.spanCardViewOptions})),[e]),C=N.useMemo(()=>f.trim(),[f]),T=N.useMemo(()=>C?xV(w,C):w,[C,w]),A=N.useMemo(()=>NT(w).map(q=>q.id),[w]),[k,O]=N.useState(A);N.useEffect(()=>{O(A)},[A]),N.useEffect(()=>{if(!r)return;e.some(V=>V.traceRecord.id===r)&&r!==S&&x(r,{source:"external"})},[r,e,x,S]),N.useEffect(()=>{b!==0&&(d(void 0),O([]))},[b]),N.useEffect(()=>{!s&&w.length>0&&!l&&d(w[0])},[w,s,l]);const M=N.useCallback(()=>{O(A)},[A]),z=N.useCallback(()=>{O([])},[]),L=N.useCallback(q=>{x(q.id,{source:"user"}),a==null||a(q)},[a,x]),U=N.useCallback(()=>{_(),d(void 0),O([])},[_]),F={traceRecords:j,traceListExpanded:p,setTraceListExpanded:g,selectedTrace:y,selectedTraceId:S,selectedSpan:l,setSelectedSpan:d,searchValue:f,setSearchValue:h,filteredSpans:T,expandedSpansIds:k,setExpandedSpansIds:O,handleExpandAll:M,handleCollapseAll:z,handleTraceSelect:L,spanCardViewOptions:t||(y==null?void 0:y.spanCardViewOptions),onClearTraceSelection:U,detailsViewProps:n};return c.jsxs("div",{className:"h-[calc(100vh-50px)]",children:[c.jsx("div",{className:"hidden h-full lg:block",children:c.jsx(AOe,{...F})}),c.jsx("div",{className:"h-full lg:hidden",children:c.jsx(MOe,{...F})})]})},Nj="px-3 py-2",jj="flex w-full items-center justify-between gap-3 text-sm",$Oe=e=>{if(!e)return"Never";try{return zRe(new Date(e),{addSuffix:!0})}catch{return e}},IOe=e=>{const t=e.metadata,n=(t==null?void 0:t.artifacts)??[];return n.length===0?null:c.jsx("div",{className:"flex flex-wrap items-center gap-2",children:n.map(r=>c.jsxs(me,{size:"sm",variant:"outline",onClick:()=>{r.downloadUrl&&window.open(r.downloadUrl,"_blank","noopener,noreferrer")},children:["Download ",r.id]},r.id))})};function LOe({status:e,error:t,viewerData:n,activeViewer:r,onRefresh:a,onSelectTrace:s,summary:i,lastUpdatedAt:l,isLive:d}){const f=e==="loading"&&!r,h=n.length>0;return c.jsxs("div",{className:"flex h-full flex-col gap-4",children:[c.jsxs("div",{className:"flex flex-wrap items-center justify-between gap-3",children:[c.jsxs("div",{children:[c.jsx("h2",{className:"text-lg font-semibold",children:"Execution trace"}),c.jsx("p",{className:"text-sm text-muted-foreground",children:"Inspect span hierarchy, metrics, and artifacts for the selected run."})]}),c.jsxs(me,{size:"sm",variant:"outline",onClick:()=>{a()},children:[c.jsx(XC,{className:"mr-2 size-4"})," Refresh"]})]}),i&&c.jsxs("div",{className:"grid gap-3 md:grid-cols-3",children:[c.jsx(At,{className:Nj,children:c.jsxs("div",{className:jj,children:[c.jsxs("div",{className:"space-y-0.5",children:[c.jsx(Rt,{className:"text-xs font-semibold uppercase text-muted-foreground",children:"Spans"}),c.jsx(kt,{className:"text-xs text-muted-foreground",children:"Recorded nodes and events"})]}),c.jsx("span",{className:"text-sm font-semibold text-foreground",children:i.spanCount})]})}),c.jsx(At,{className:Nj,children:c.jsxs("div",{className:jj,children:[c.jsxs("div",{className:"space-y-0.5",children:[c.jsx(Rt,{className:"text-xs font-semibold uppercase text-muted-foreground",children:"Total tokens"}),c.jsx(kt,{className:"text-xs text-muted-foreground",children:"Input + output consumption"})]}),c.jsx("span",{className:"text-sm font-semibold text-foreground",children:i.totalTokens})]})}),c.jsx(At,{className:Nj,children:c.jsxs("div",{className:jj,children:[c.jsxs("div",{className:"space-y-0.5",children:[c.jsx(Rt,{className:"text-xs font-semibold uppercase text-muted-foreground",children:"Last update"}),c.jsx(kt,{className:"text-xs text-muted-foreground",children:d?"Live":"Completed"})]}),c.jsx("span",{className:"text-xs font-semibold text-foreground",children:$Oe(l)})]})})]}),t&&c.jsxs(Ho,{variant:"destructive",children:[c.jsx(Bo,{children:"Unable to load trace"}),c.jsx(Vo,{children:t})]}),f&&c.jsxs("div",{className:"space-y-4",children:[c.jsx(Ro,{className:"h-12 w-full"}),c.jsx(Ro,{className:"h-72 w-full"})]}),!f&&!h&&!t&&c.jsx("div",{className:"flex flex-1 items-center justify-center rounded-md border border-dashed border-border text-sm text-muted-foreground",children:"Trace data will appear here once spans are recorded."}),h&&c.jsx("div",{className:"min-h-0 flex-1 overflow-hidden rounded-lg border border-border bg-background",children:c.jsx(POe,{data:n,activeTraceId:r==null?void 0:r.traceRecord.id,onTraceSelect:p=>{s==null||s(p.id)},detailsViewProps:{headerActions:IOe}})})]})}const Cj={stable:"Stable",beta:"Beta",deprecated:"Deprecated"};function zOe(e){return e==="stable"?c.jsx(Ue,{variant:"secondary",children:Cj[e]}):e==="deprecated"?c.jsx(Ue,{variant:"destructive",className:"bg-destructive/10 text-destructive",children:Cj[e]}):c.jsx(Ue,{variant:"outline",children:Cj[e]})}function qOe({subworkflows:e,onCreateSubworkflow:t,onInsertSubworkflow:n,onDeleteSubworkflow:r}){return c.jsxs(At,{children:[c.jsxs(Ht,{className:"flex flex-col gap-2 md:flex-row md:items-start md:justify-between",children:[c.jsxs("div",{children:[c.jsx(Rt,{children:"Reusable Sub-workflows"}),c.jsx(kt,{children:"Curate reusable workflow templates to accelerate delivery across teams."})]}),c.jsxs(me,{onClick:t,className:"mt-2 md:mt-0",children:[c.jsx(ll,{className:"mr-2 h-4 w-4"}),"New sub-workflow"]})]}),c.jsx(Bt,{children:e.length===0?c.jsx("div",{className:"rounded-lg border border-dashed border-muted-foreground/50 p-10 text-center text-sm text-muted-foreground",children:"No reusable sub-workflows yet. Create your first template to share best practices with your team."}):c.jsx("div",{className:"grid gap-4 lg:grid-cols-2",children:e.map(a=>c.jsxs("div",{className:"flex h-full flex-col justify-between rounded-lg border border-border bg-muted/30 p-5",children:[c.jsxs("div",{className:"space-y-4",children:[c.jsxs("div",{className:"flex flex-wrap items-start justify-between gap-3",children:[c.jsxs("div",{children:[c.jsx("h3",{className:"text-base font-semibold leading-tight",children:a.name}),c.jsx("p",{className:"mt-1 text-sm text-muted-foreground",children:a.description})]}),zOe(a.status)]}),c.jsx("div",{className:"flex flex-wrap gap-2",children:a.tags.map(s=>c.jsx(Ue,{variant:"outline",children:s},`${a.id}-${s}`))})]}),c.jsxs("div",{className:"mt-6 space-y-3 text-sm text-muted-foreground",children:[c.jsxs("div",{className:"flex items-center gap-2",children:[c.jsx(UQ,{className:"h-4 w-4"}),a.usageCount," ",a.usageCount===1?"workflow":"workflows"," ","rely on this template"]}),c.jsxs("div",{className:"flex items-center gap-2",children:[c.jsx(tZ,{className:"h-4 w-4"}),"Updated ",new Date(a.lastUpdated).toLocaleString()]}),c.jsxs("div",{className:"flex items-center gap-2",children:[c.jsxs(Ue,{variant:"secondary",className:"uppercase",children:["v",a.version]}),"Versioned for consistency"]})]}),c.jsxs("div",{className:"mt-6 flex flex-wrap justify-end gap-2",children:[c.jsx(me,{size:"sm",variant:"outline",onClick:()=>n(a),children:"Insert into canvas"}),c.jsxs(me,{size:"sm",variant:"ghost",className:"text-destructive hover:text-destructive",onClick:()=>r(a.id),children:[c.jsx(QC,{className:"mr-2 h-4 w-4"}),"Remove"]})]})]},a.id))})})]})}function FOe({validationErrors:e,isValidating:t,onRunValidation:n,onDismissValidation:r,onFixValidation:a,lastValidationRun:s}){return c.jsxs(At,{children:[c.jsxs(Ht,{className:"flex flex-col gap-2 md:flex-row md:items-start md:justify-between",children:[c.jsxs("div",{children:[c.jsx(Rt,{children:"Publish-time validation"}),c.jsx(kt,{children:"Run automated checks to confirm your workflow is ready for production deployment."})]}),c.jsx(me,{onClick:n,disabled:t,variant:"secondary",children:t?c.jsxs(c.Fragment,{children:[c.jsx(zo,{className:"mr-2 h-4 w-4 animate-spin"}),"Validating..."]}):c.jsxs(c.Fragment,{children:[c.jsx(qz,{className:"mr-2 h-4 w-4"}),"Run validation"]})})]}),c.jsxs(Bt,{className:"space-y-4",children:[s&&c.jsxs("p",{className:"text-xs text-muted-foreground",children:["Last run ",new Date(s).toLocaleString()]}),e.length===0?c.jsxs(Ho,{className:"border-green-500/50 bg-green-500/5 text-green-900 dark:border-green-500/40 dark:bg-green-500/10 dark:text-green-200",children:[c.jsx(Az,{className:"h-4 w-4"}),c.jsx(Bo,{children:"Workflow is ready for publish"}),c.jsx(Vo,{children:"All automated checks have passed. You can publish with confidence."})]}):c.jsx("div",{className:"space-y-3",children:e.map(i=>c.jsxs(Ho,{variant:"destructive",className:"pr-3",children:[c.jsx(JC,{className:"h-4 w-4"}),c.jsxs("div",{className:"flex flex-col gap-3 sm:flex-row sm:items-start sm:justify-between",children:[c.jsxs("div",{children:[c.jsx(Bo,{className:"capitalize",children:i.type.replace("_"," ")}),c.jsxs(Vo,{className:"mt-1 text-sm",children:[i.message,i.type==="connection"&&i.sourceId&&i.targetId&&c.jsxs("span",{className:"mt-1 block text-xs opacity-80",children:[i.sourceId," → ",i.targetId]}),i.nodeName&&c.jsxs("span",{className:"mt-1 block text-xs opacity-80",children:["Node: ",i.nodeName]})]})]}),c.jsxs("div",{className:"flex flex-shrink-0 flex-wrap justify-end gap-2",children:[c.jsx(me,{size:"sm",variant:"secondary",onClick:()=>a(i),children:"Review"}),c.jsx(me,{size:"sm",variant:"ghost",className:"text-destructive hover:text-destructive",onClick:()=>r(i.id),children:"Dismiss"})]})]})]},i.id))})]})]})}function UOe({subworkflows:e,onCreateSubworkflow:t,onInsertSubworkflow:n,onDeleteSubworkflow:r,validationErrors:a,onRunValidation:s,onDismissValidation:i,onFixValidation:l,isValidating:d,lastValidationRun:f,className:h}){return c.jsxs("div",{className:ye("space-y-6",h),children:[c.jsx(qOe,{subworkflows:e,onCreateSubworkflow:t,onInsertSubworkflow:n,onDeleteSubworkflow:r}),c.jsx(FOe,{validationErrors:a,isValidating:d,onRunValidation:s,onDismissValidation:i,onFixValidation:l,lastValidationRun:f})]})}function HOe({subworkflows:e,onCreateSubworkflow:t,onInsertSubworkflow:n,onDeleteSubworkflow:r,validationErrors:a,onRunValidation:s,onDismissValidation:i,onFixValidation:l,isValidating:d,lastValidationRun:f}){return c.jsx("div",{className:"mx-auto max-w-5xl pb-12",children:c.jsx(UOe,{subworkflows:e,onCreateSubworkflow:t,onInsertSubworkflow:n,onDeleteSubworkflow:r,validationErrors:a,onRunValidation:s,onDismissValidation:i,onFixValidation:l,isValidating:d,lastValidationRun:f})})}var BOe=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],VOe=BOe.reduce((e,t)=>{const n=zy(`Primitive.${t}`),r=N.forwardRef((a,s)=>{const{asChild:i,...l}=a,d=i?n:t;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),c.jsx(d,{...l,ref:s})});return r.displayName=`Primitive.${t}`,{...e,[t]:r}},{}),WOe="Separator",VL="horizontal",GOe=["horizontal","vertical"],JV=N.forwardRef((e,t)=>{const{decorative:n,orientation:r=VL,...a}=e,s=KOe(r)?r:VL,l=n?{role:"none"}:{"aria-orientation":s==="vertical"?s:void 0,role:"separator"};return c.jsx(VOe.div,{"data-orientation":s,...l,...a,ref:t})});JV.displayName=WOe;function KOe(e){return GOe.includes(e)}var eW=JV;const xn=N.forwardRef(({className:e,orientation:t="horizontal",decorative:n=!0,...r},a)=>c.jsx(eW,{ref:a,decorative:n,orientation:t,className:ye("shrink-0 bg-border",t==="horizontal"?"h-[1px] w-full":"h-full w-[1px]",e),...r}));xn.displayName=eW.displayName;const zc={added:"bg-green-100 text-green-800 dark:bg-green-900/30 dark:text-green-400",removed:"bg-red-100 text-red-800 dark:bg-red-900/30 dark:text-red-400",modified:"bg-blue-100 text-blue-800 dark:bg-blue-900/30 dark:text-blue-400"},WL=e=>typeof e=="string"||typeof e=="number"||typeof e=="boolean"?e.toString():JSON.stringify(e,null,2),YOe=({diffContext:e})=>{const t=(e==null?void 0:e.result.summary)??{added:0,removed:0,modified:0};return c.jsxs("div",{className:"flex items-center gap-2",children:[c.jsxs(Ue,{className:zc.added,children:["Added ",t.added]}),c.jsxs(Ue,{className:zc.removed,children:["Removed ",t.removed]}),c.jsxs(Ue,{className:zc.modified,children:["Modified ",t.modified]})]})},XOe=({diffContext:e})=>!e||e.result.entries.length===0?c.jsx("div",{className:"text-sm text-muted-foreground",children:"No differences detected between the selected versions."}):c.jsx("div",{className:"space-y-4",children:e.result.entries.map(t=>{const n=t.type==="added"?zc.added:t.type==="removed"?zc.removed:zc.modified;return c.jsxs("div",{className:"border rounded-md overflow-hidden",children:[c.jsxs("div",{className:"bg-muted p-2 border-b border-border flex items-center justify-between",children:[c.jsxs("div",{children:[c.jsx("span",{className:"font-medium",children:t.name}),c.jsx("span",{className:"ml-2 text-xs uppercase text-muted-foreground",children:t.entity})]}),c.jsx(Ue,{className:n,children:t.type})]}),c.jsxs("div",{className:"p-3 space-y-2 text-sm",children:[t.detail&&c.jsx("p",{className:"text-muted-foreground",children:t.detail}),t.type!=="added"&&t.before!==void 0&&c.jsxs("pre",{className:"bg-red-50 dark:bg-red-900/20 rounded-md p-2 font-mono text-xs whitespace-pre-wrap",children:["- ",WL(t.before)]}),t.type!=="removed"&&t.after!==void 0&&c.jsxs("pre",{className:"bg-green-50 dark:bg-green-900/20 rounded-md p-2 font-mono text-xs whitespace-pre-wrap",children:["+ ",WL(t.after)]})]})]},t.id)})});function ZOe({open:e,onOpenChange:t,diffContext:n,selectedVersionRecord:r,compareVersionRecord:a}){const s=()=>{if(!n)return;const i={baseVersion:n.base.version,targetVersion:n.target.version,summary:n.result.summary,entries:n.result.entries},l=JSON.stringify(i,null,2),d=new Blob([l],{type:"application/json"}),f=URL.createObjectURL(d),h=document.createElement("a");h.href=f,h.download=`workflow-diff-${n.base.version}-vs-${n.target.version}.json`,h.click(),URL.revokeObjectURL(f)};return c.jsx(fl,{open:e,onOpenChange:t,children:c.jsxs(Jo,{className:"max-w-4xl",children:[c.jsxs(hl,{children:[c.jsx(pl,{children:"Compare Versions"}),c.jsx(yu,{children:n?`Comparing ${n.base.version} with ${n.target.version}`:"Select two versions to compare."})]}),c.jsxs("div",{className:"flex flex-col gap-4",children:[c.jsxs("div",{className:"flex items-center justify-between",children:[c.jsxs("div",{className:"flex items-center gap-2",children:[c.jsx(hf,{className:"h-4 w-4"}),c.jsx("span",{className:"font-medium",children:(n==null?void 0:n.base.version)??(r==null?void 0:r.version)??"Select a version"}),c.jsx("span",{className:"text-muted-foreground",children:"→"}),c.jsx(hf,{className:"h-4 w-4"}),c.jsx("span",{className:"font-medium",children:(n==null?void 0:n.target.version)??(a==null?void 0:a.version)??"Select a version"})]}),c.jsxs(me,{variant:"outline",size:"sm",onClick:s,disabled:!n,children:[c.jsx(Rz,{className:"h-4 w-4 mr-2"}),"Export Diff"]})]}),c.jsxs("div",{className:"border rounded-md overflow-hidden",children:[c.jsxs("div",{className:"bg-muted p-2 border-b border-border flex items-center justify-between",children:[c.jsx("div",{className:"text-sm font-medium",children:"Changes"}),c.jsx(YOe,{diffContext:n})]}),c.jsx("div",{className:"p-4 bg-muted/20",children:c.jsx(XOe,{diffContext:n})})]})]})]})})}function QOe({searchQuery:e,onSearchChange:t,compareVersionId:n,onSelectCompareVersion:r,versions:a,selectedVersionId:s}){return c.jsxs("div",{className:"flex items-center gap-2 p-4 border-b border-border",children:[c.jsxs("div",{className:"relative flex-1",children:[c.jsx(ia,{className:"absolute left-2 top-2.5 h-4 w-4 text-muted-foreground"}),c.jsx(Ct,{placeholder:"Search versions...",className:"pl-8",value:e,onChange:i=>t(i.target.value)})]}),c.jsxs(Fc,{value:n??"",onValueChange:i=>r(i||null),children:[c.jsx(Yi,{className:"w-[180px]",children:c.jsx(Uc,{placeholder:"Compare with..."})}),c.jsx(Xi,{children:a.filter(i=>i.id!==s).map(i=>c.jsx(Pn,{value:i.id,children:i.version},i.id))})]})]})}function JOe({totalVersions:e}){return c.jsxs("div",{className:"flex items-center justify-between p-4 border-t border-border",children:[c.jsxs("div",{className:"text-sm text-muted-foreground",children:[e," versions"]}),c.jsxs("div",{className:"flex items-center gap-1",children:[c.jsx(me,{variant:"outline",size:"icon",className:"h-8 w-8",children:c.jsx(ff,{className:"h-4 w-4"})}),c.jsx(me,{variant:"outline",size:"icon",className:"h-8 w-8",children:c.jsx(Io,{className:"h-4 w-4"})})]})]})}function eMe({onRestoreVersion:e,onCompareVersions:t,canRestore:n,canCompare:r}){return c.jsxs("div",{className:"flex items-center justify-between p-4 border-b border-border",children:[c.jsxs("div",{className:"flex items-center gap-2",children:[c.jsx(Dz,{className:"h-5 w-5"}),c.jsx("h3",{className:"font-medium",children:"Version History"})]}),c.jsxs("div",{className:"flex items-center gap-2",children:[c.jsxs(me,{variant:"outline",size:"sm",onClick:e,disabled:!n,children:[c.jsx(Fz,{className:"h-4 w-4 mr-2"}),"Restore"]}),c.jsx(me,{variant:"outline",size:"sm",onClick:t,disabled:!r,children:"Compare"})]})]})}const tW="bg-green-100 text-green-800 dark:bg-green-900/30 dark:text-green-400",tMe={added:tW,removed:"bg-red-100 text-red-800 dark:bg-red-900/30 dark:text-red-400",modified:"bg-blue-100 text-blue-800 dark:bg-blue-900/30 dark:text-blue-400"},Ej=({type:e,value:t})=>{if(t<=0)return null;const n=e==="added"?"+":e==="removed"?"-":"~";return c.jsx(Ue,{className:tMe[e],children:`${n}${t}`})};function nMe({filteredVersions:e,selectedVersionId:t,currentVersion:n,searchQuery:r,onSelectVersion:a}){const s=i=>i.version!==n?null:c.jsx(Ue,{className:tW,children:"Current"});return c.jsx(Mo,{className:"flex-1 h-[400px]",children:c.jsxs(w2,{children:[c.jsx(S2,{children:c.jsxs(To,{children:[c.jsx(hr,{className:"w-[100px]",children:"Version"}),c.jsx(hr,{children:"Message"}),c.jsx(hr,{children:"Author"}),c.jsx(hr,{children:"Date"}),c.jsx(hr,{className:"text-right",children:"Changes"})]})}),c.jsx(_2,{children:e.length===0?c.jsx(To,{children:c.jsx($n,{colSpan:5,className:"text-center py-8",children:c.jsxs("div",{className:"text-muted-foreground",children:["No versions found",r&&c.jsx("p",{className:"text-sm",children:"Try adjusting your search query"})]})})}):e.map(i=>{const l=t===i.id;return c.jsxs(To,{className:ye("cursor-pointer",l&&"bg-muted"),onClick:()=>a(i.id),children:[c.jsx($n,{className:"font-medium",children:c.jsxs("div",{className:"flex items-center gap-2",children:[c.jsx(eQ,{className:"h-4 w-4 text-muted-foreground"}),i.version,s(i)]})}),c.jsx($n,{children:i.message}),c.jsx($n,{children:c.jsxs("div",{className:"flex items-center gap-2",children:[c.jsx("div",{className:"h-6 w-6 rounded-full overflow-hidden bg-muted",children:c.jsx("img",{src:i.author.avatar,alt:i.author.name,className:"h-full w-full object-cover"})}),i.author.name]})}),c.jsx($n,{children:new Date(i.timestamp).toLocaleString()}),c.jsx($n,{className:"text-right",children:c.jsxs("div",{className:"flex items-center justify-end gap-2",children:[c.jsx(Ej,{type:"added",value:i.summary.added}),c.jsx(Ej,{type:"removed",value:i.summary.removed}),c.jsx(Ej,{type:"modified",value:i.summary.modified})]})})]},i.id)})})]})})}function rMe({versions:e=[],currentVersion:t,onRestoreVersion:n,className:r}){const[a,s]=N.useState(""),[i,l]=N.useState(null),[d,f]=N.useState(null),[h,p]=N.useState(!1),[g,y]=N.useState(null);N.useEffect(()=>{if(!e.length){l(null),f(null);return}if(t){const C=e.find(T=>T.version===t);l((C==null?void 0:C.id)??null)}else i||l(e[0].id)},[t,i,e]);const S=N.useMemo(()=>a?e.filter(C=>C.version.toLowerCase().includes(a.toLowerCase())||C.message.toLowerCase().includes(a.toLowerCase())||C.author.name.toLowerCase().includes(a.toLowerCase())):e,[a,e]),w=N.useMemo(()=>e.find(C=>C.id===i)??null,[i,e]),b=N.useMemo(()=>e.find(C=>C.id===d)??null,[d,e]),x=C=>{l(C),d===C&&f(null)},_=()=>{if(!w||!b)return;const C=Iq(w.snapshot,b.snapshot);y({base:w,target:b,result:C}),p(!0)},j=()=>{i&&(n==null||n(i))};return c.jsxs("div",{className:ye("flex flex-col border border-border rounded-lg bg-background shadow-lg",r),children:[c.jsx(eMe,{onRestoreVersion:j,onCompareVersions:_,canRestore:!!w&&(!t||w.version!==t),canCompare:!!w&&!!b}),c.jsx(QOe,{searchQuery:a,onSearchChange:C=>s(C),compareVersionId:d,onSelectCompareVersion:C=>f(C),versions:e,selectedVersionId:i}),c.jsx(nMe,{filteredVersions:S,selectedVersionId:i,currentVersion:t,searchQuery:a,onSelectVersion:x}),c.jsx(JOe,{totalVersions:S.length}),c.jsx(ZOe,{open:h,onOpenChange:p,diffContext:g,selectedVersionRecord:w,compareVersionRecord:b})]})}function aMe({workflowName:e,workflowDescription:t,workflowTags:n,onWorkflowNameChange:r,onWorkflowDescriptionChange:a,onTagsChange:s,workflowVersions:i,onRestoreVersion:l,onSaveWorkflow:d}){var f;return c.jsxs("div",{className:"max-w-3xl mx-auto space-y-8",children:[c.jsxs("div",{children:[c.jsx("h2",{className:"text-xl font-bold mb-4",children:"Workflow Settings"}),c.jsxs("div",{className:"space-y-4",children:[c.jsxs("div",{className:"grid gap-2",children:[c.jsx("label",{className:"text-sm font-medium",children:"Workflow Name"}),c.jsx("input",{type:"text",className:"border border-border rounded-md px-3 py-2 bg-background",value:e,onChange:h=>r(h.target.value)})]}),c.jsxs("div",{className:"grid gap-2",children:[c.jsx("label",{className:"text-sm font-medium",children:"Description"}),c.jsx("textarea",{className:"border border-border rounded-md px-3 py-2 bg-background",rows:3,value:t,onChange:h=>a(h.target.value)})]}),c.jsxs("div",{className:"grid gap-2",children:[c.jsx("label",{className:"text-sm font-medium",children:"Tags"}),c.jsx("input",{type:"text",className:"border border-border rounded-md px-3 py-2 bg-background",value:n.join(", "),onChange:h=>s(h.target.value)}),c.jsx("p",{className:"text-xs text-muted-foreground",children:"Separate tags with commas"})]})]})]}),c.jsx(xn,{}),c.jsxs("div",{children:[c.jsx("h2",{className:"text-xl font-bold mb-4",children:"Execution Settings"}),c.jsxs("div",{className:"space-y-4",children:[c.jsxs("div",{className:"flex items-center justify-between",children:[c.jsxs("div",{children:[c.jsx("label",{className:"text-sm font-medium",children:"Timeout (seconds)"}),c.jsx("p",{className:"text-xs text-muted-foreground",children:"Maximum execution time for the workflow"})]}),c.jsx("input",{type:"number",className:"border border-border rounded-md px-3 py-2 bg-background w-24",defaultValue:"300"})]}),c.jsxs("div",{className:"flex items-center justify-between",children:[c.jsxs("div",{children:[c.jsx("label",{className:"text-sm font-medium",children:"Retry on Failure"}),c.jsx("p",{className:"text-xs text-muted-foreground",children:"Automatically retry the workflow if it fails"})]}),c.jsx("div",{className:"flex items-center h-6",children:c.jsx("input",{type:"checkbox",className:"h-4 w-4",defaultChecked:!0})})]}),c.jsxs("div",{className:"flex items-center justify-between",children:[c.jsxs("div",{children:[c.jsx("label",{className:"text-sm font-medium",children:"Maximum Retries"}),c.jsx("p",{className:"text-xs text-muted-foreground",children:"Number of retry attempts before giving up"})]}),c.jsx("input",{type:"number",className:"border border-border rounded-md px-3 py-2 bg-background w-24",defaultValue:"3"})]})]})]}),c.jsx(xn,{}),c.jsxs("div",{children:[c.jsx("h2",{className:"text-xl font-bold mb-4",children:"Notifications"}),c.jsxs("div",{className:"space-y-4",children:[c.jsxs("div",{className:"flex items-center justify-between",children:[c.jsxs("div",{children:[c.jsx("label",{className:"text-sm font-medium",children:"Email Notifications"}),c.jsx("p",{className:"text-xs text-muted-foreground",children:"Send email when workflow fails"})]}),c.jsx("div",{className:"flex items-center h-6",children:c.jsx("input",{type:"checkbox",className:"h-4 w-4",defaultChecked:!0})})]}),c.jsxs("div",{className:"flex items-center justify-between",children:[c.jsxs("div",{children:[c.jsx("label",{className:"text-sm font-medium",children:"Slack Notifications"}),c.jsx("p",{className:"text-xs text-muted-foreground",children:"Send Slack message when workflow completes"})]}),c.jsx("div",{className:"flex items-center h-6",children:c.jsx("input",{type:"checkbox",className:"h-4 w-4"})})]})]})]}),c.jsx(xn,{}),c.jsx(rMe,{versions:i,currentVersion:(f=i.at(-1))==null?void 0:f.version,onRestoreVersion:l}),c.jsxs("div",{className:"flex justify-end gap-2",children:[c.jsx(me,{variant:"outline",children:"Cancel"}),c.jsx(me,{onClick:d,children:"Save Settings"})]})]})}function sMe({topNavigationProps:e,tabsProps:t,canvasProps:n,executionProps:r,traceProps:a,readinessProps:s,settingsProps:i,nodeInspector:l,chat:d}){return c.jsxs("div",{className:"flex flex-col h-screen overflow-hidden",children:[c.jsx(sh,{...e}),c.jsx(iSe,{activeTab:t.activeTab,onTabChange:t.onTabChange,readinessAlertCount:t.readinessAlertCount}),c.jsx("div",{className:"flex-1 flex flex-col min-h-0",children:c.jsxs(Da,{value:t.activeTab,onValueChange:t.onTabChange,className:"w-full flex flex-col flex-1 min-h-0",children:[c.jsx($t,{value:"canvas",className:"flex-1 m-0 p-0 overflow-hidden min-h-0",children:c.jsx(OAe,{...n})}),c.jsx($t,{value:"execution",className:"flex-1 m-0 p-0 overflow-hidden min-h-0",children:c.jsx(WAe,{...r})}),c.jsx($t,{value:"trace",className:"flex-1 m-0 p-4 overflow-hidden min-h-0",children:c.jsx(LOe,{...a})}),c.jsx($t,{value:"readiness",className:"m-0 p-4 overflow-auto",children:c.jsx(HOe,{...s})}),c.jsx($t,{value:"settings",className:"m-0 p-4 overflow-auto",children:c.jsx(aMe,{...i})})]})}),(l==null?void 0:l.selectedNode)&&c.jsx(KU,{node:{id:l.selectedNode.id,type:l.selectedNode.type||"default",data:l.selectedNode.data},nodes:l.nodes,edges:l.edges,onClose:l.onClose,onSave:l.onSave,runtimeCache:l.runtimeCache,onCacheRuntime:l.onCacheRuntime,className:"absolute top-1/2 left-1/2 transform -translate-x-1/2 -translate-y-1/2 z-50"}),d&&c.jsx(CSe,{title:d.chatTitle,user:d.user,ai:d.ai,workflowId:d.workflowId,sessionPayload:{workflowId:d.workflowId,workflowLabel:d.chatTitle,chatNodeId:d.activeChatNodeId},backendBaseUrl:d.backendBaseUrl,getClientSecret:d.getClientSecret,sessionStatus:d.sessionStatus,sessionError:d.sessionError,onRetry:d.refreshSession,onResponseStart:d.handleChatResponseStart,onResponseEnd:d.handleChatResponseEnd,onClientTool:d.handleChatClientTool,onDismiss:d.handleCloseChat,onOpen:()=>d.setIsChatOpen(!0),isExternallyOpen:d.isChatOpen})]})}const oMe="orcheo:workflow-runtime-cache:",iMe=e=>`${oMe}${e??"unsaved"}`,nW=e=>{if(typeof window>"u"||!window.sessionStorage)return{};const t=window.sessionStorage.getItem(e);if(!t)return{};try{const n=JSON.parse(t);if(n&&typeof n=="object")return n}catch(n){console.warn("Failed to parse node runtime cache from sessionStorage",n)}return{}},lMe=(e,t)=>{if(!(typeof window>"u"||!window.sessionStorage)){if(Object.keys(t).length===0){window.sessionStorage.removeItem(e);return}try{const n=JSON.stringify(t);window.sessionStorage.setItem(e,n)}catch(n){console.warn("Failed to persist node runtime cache to sessionStorage",n)}}},GL=e=>{typeof window>"u"||!window.sessionStorage||window.sessionStorage.removeItem(e)},cMe=new Set(["label","description","type","isDisabled"]),Oh="New Node",uMe=e=>typeof e!="string"?"":e.trim(),_0=(e,t=Oh)=>{const n=uMe(e);return n.length>0?n:t},dMe=e=>e.trim().toLowerCase().replace(/[^a-z0-9]+/g,"-").replace(/^-+|-+$/g,""),fMe=(e,t)=>{var r;const n=new Set;for(const a of e){if(t&&a.id===t)continue;const s=_0(((r=a.data)==null?void 0:r.label)??a.id??Oh);n.add(s.toLowerCase())}return n},hMe=(e,t)=>{const n=new Set;for(const r of e)t&&r.id===t||n.add(r.id);return n},pMe=(e,t,n)=>{const r=_0(e);let a=r,s=2;for(;t.has(a.toLowerCase());)a=`${r} (${s})`,s+=1;t.add(a.toLowerCase());const i=dMe(a)||"node";let l=i;for(s=2;n.has(l);)l=`${i}-${s}`,s+=1;return n.add(l),{id:l,label:a}},Mh=(e,t={})=>{const n=fMe(e,t.excludeId),r=hMe(e,t.excludeId);return a=>pMe(a,n,r)},mMe=e=>{const t={label:typeof(e==null?void 0:e.label)=="string"?e.label:(e==null?void 0:e.label)!==void 0?String(e.label):Oh};return typeof(e==null?void 0:e.description)=="string"&&(t.description=e.description),typeof(e==null?void 0:e.type)=="string"&&(t.type=e.type),typeof(e==null?void 0:e.isDisabled)=="boolean"&&(t.isDisabled=e.isDisabled),Object.entries(e??{}).forEach(([n,r])=>{if(!cMe.has(n)){if(r===null||typeof r=="string"||typeof r=="number"||typeof r=="boolean"){t[n]=r;return}if(Array.isArray(r)){t[n]=r;return}typeof r=="object"&&r!==null&&!r.$$typeof&&(t[n]=r)}}),t},OT={background:"none",border:"none",padding:0,borderRadius:0,width:"auto",boxShadow:"none"},MT=e=>{var t,n,r;return{id:e.id,type:typeof((t=e.data)==null?void 0:t.type)=="string"?e.data.type:e.type??"default",position:{x:((n=e.position)==null?void 0:n.x)??0,y:((r=e.position)==null?void 0:r.y)??0},data:mMe(e.data)}},DT=e=>({id:e.id,source:e.source,target:e.target,sourceHandle:e.sourceHandle,targetHandle:e.targetHandle,label:e.label,type:e.type,animated:e.animated,style:e.style}),gMe=e=>e?e==="chatTrigger"?"chatTrigger":e==="stickyNote"||e==="annotation"?"stickyNote":e==="start"||e==="end"||e==="startEnd"?"startEnd":"default":"default",yMe=e=>{var g,y,S,w,b;const t=Object.entries(e.data??{}).filter(([x])=>!["label","description","type","isDisabled"].includes(x)),n=Object.fromEntries(t),r=((g=e.data)==null?void 0:g.type)??e.type??"default",a={...n},s=a.iconKey;delete a.iconKey,delete a.icon;const i=a,l=typeof((y=e.data)==null?void 0:y.label)=="string"?e.data.label:"New Node",d=typeof((S=e.data)==null?void 0:S.description)=="string"?e.data.description:"",f=typeof s=="string"?s:void 0,h=_T({iconKey:f,label:l,type:r})??f,p=Rh(h);return{id:e.id,type:gMe(e.type),position:e.position??{x:0,y:0},style:OT,data:{type:r,label:l,description:d,status:((w=e.data)==null?void 0:w.status)??"idle",isDisabled:(b=e.data)==null?void 0:b.isDisabled,iconKey:h,icon:p,...i},draggable:!0}},vMe=e=>({id:e.id??`edge-${e.source}-${e.target}`,source:e.source,target:e.target,sourceHandle:e.sourceHandle,targetHandle:e.targetHandle,label:e.label,type:e.type??"default",animated:e.animated??!1,markerEnd:{type:Wo.ArrowClosed,width:12,height:12},style:e.style??{stroke:"#99a1b3",strokeWidth:2}}),cf=e=>e.map(vMe),qC="ORCHEO_WORKFLOW_CLIPBOARD_V1:",xMe=40,bMe=24,wMe=5,SMe=e=>`${qC}${JSON.stringify(e)}`,_Me=e=>{if(typeof e!="string")return null;const t=e.trim();if(t.length===0)return null;const n=t.startsWith(qC)?t.slice(qC.length):t;try{const r=JSON.parse(n);if(r&&r.version===1&&r.type==="workflow-selection"&&Array.isArray(r.nodes)&&Array.isArray(r.edges))return{version:1,type:"workflow-selection",nodes:r.nodes,edges:r.edges,copiedAt:typeof r.copiedAt=="number"?r.copiedAt:void 0}}catch{return null}return null},NMe=(e,t)=>({version:1,type:"workflow-selection",nodes:e,edges:t,copiedAt:Date.now()}),rW=e=>typeof e.copiedAt=="number"?`ts:${e.copiedAt}`:`ids:${e.nodes.map(t=>t.id).sort().join("|")}`,aW=e=>({...e,position:e.position?{...e.position}:e.position,data:e.data?{...e.data}:e.data}),sW=e=>({...e,data:e.data?{...e.data}:e.data});function jMe({initialNodes:e,initialEdges:t}){const[n,r,a]=rTe(e),[s,i,l]=aTe(t),[d,f]=N.useState(!1),[h,p]=N.useState(!1),g=N.useRef(n),y=N.useRef(s),S=N.useRef(n),w=N.useRef([]),b=N.useRef([]),x=N.useRef(!1);N.useEffect(()=>{g.current=n,S.current=n},[n]),N.useEffect(()=>{y.current=s},[s]),N.useLayoutEffect(()=>{x.current&&(x.current=!1)},[n,s]);const _=N.useCallback(()=>({nodes:g.current.map(aW),edges:y.current.map(sW)}),[]),j=N.useCallback(L=>{if(x.current&&!(L!=null&&L.force))return;const U=_();w.current=[...w.current,U].slice(-50),b.current=[],f(w.current.length>0),p(!1)},[_]),C=N.useCallback((L,U)=>{x.current=!0,r(L.nodes),i(L.edges),U!=null&&U.resetHistory&&(w.current=[],b.current=[],f(!1),p(!1))},[r,i]),T=N.useCallback(L=>{x.current||j(),r(U=>typeof L=="function"?L(U):L)},[j,r]),A=N.useCallback(L=>{x.current||j(),i(U=>typeof L=="function"?L(U):L)},[j,i]),k=N.useCallback(()=>{const L=w.current.pop();if(!L)return;const U=_();b.current=[...b.current,U].slice(-50),C(L),f(w.current.length>0),p(!0)},[C,_]),O=N.useCallback(()=>{const L=b.current.pop();if(!L)return;const U=_();w.current=[...w.current,U].slice(-50),C(L),p(b.current.length>0),f(!0)},[C,_]),M=N.useCallback(L=>{L.some(F=>!(F.type==="select"||F.type==="position"&&F.dragging))&&j(),a(L)},[a,j]),z=N.useCallback(L=>{L.some(U=>U.type!=="select")&&j(),l(L)},[l,j]);return{nodes:n,edges:s,nodesRef:g,edgesRef:y,latestNodesRef:S,isRestoringRef:x,onNodesChange:M,onEdgesChange:z,setNodes:T,setEdges:A,setNodesState:r,setEdgesState:i,createSnapshot:_,recordSnapshot:j,applySnapshot:C,handleUndo:k,handleRedo:O,canUndo:d,canRedo:h}}const CMe=({nodesRef:e,reactFlowInstance:t})=>{const[n,r]=N.useState(!1),[a,s]=N.useState([]),[i,l]=N.useState(0),d=N.useMemo(()=>new Set(a),[a]),f=N.useCallback(w=>{var M,z;const b=t.current;if(!b)return;const x=a[w];if(!x)return;const _=b.getNode(x);if(!_)return;const j=_.positionAbsolute??_.position,C=((M=_.measured)==null?void 0:M.width)??_.width??180,T=((z=_.measured)==null?void 0:z.height)??_.height??120,A=((j==null?void 0:j.x)??0)+C/2,k=((j==null?void 0:j.y)??0)+T/2,O=typeof b.getZoom=="function"?Math.max(b.getZoom(),1.2):1.2;b.setCenter(A,k,{zoom:O,duration:300})},[t,a]),h=N.useCallback(w=>{const b=w.trim().toLowerCase();if(!b){s([]),l(0);return}const x=e.current.filter(_=>{var T,A;const j=String(((T=_.data)==null?void 0:T.label)??"").toLowerCase(),C=String(((A=_.data)==null?void 0:A.description)??"").toLowerCase();return j.includes(b)||C.includes(b)||_.id.toLowerCase().includes(b)}).map(_=>_.id);s(x),l((x.length>0,0))},[e]),p=N.useCallback(()=>{a.length!==0&&l(w=>(w+1)%a.length)},[a]),g=N.useCallback(()=>{a.length!==0&&l(w=>(w-1+a.length)%a.length)},[a]),y=N.useCallback(()=>{r(!1),s([]),l(0)},[]),S=N.useCallback(()=>{r(w=>{const b=!w;return s([]),l(0),b})},[]);return N.useEffect(()=>{if(!n||a.length===0)return;const w=Math.min(i,Math.max(a.length-1,0));if(w!==i){l(w);return}f(w)},[i,f,n,a,l]),{isSearchOpen:n,setIsSearchOpen:r,searchMatches:a,setSearchMatches:s,currentSearchIndex:i,setCurrentSearchIndex:l,searchMatchSet:d,handleSearchNodes:h,handleHighlightNext:p,handleHighlightPrevious:g,handleCloseSearch:y,handleToggleSearch:S}},EMe=({latestNodesRef:e,isRestoringRef:t,setNodesState:n,setEdgesState:r,recordSnapshot:a,setNodeRuntimeCache:s,setValidationErrors:i,setSearchMatches:l,setSelectedNodeId:d,setActiveChatNodeId:f,setIsChatOpen:h,activeChatNodeId:p})=>{const g=N.useCallback(w=>{var _;const b=e.current.find(j=>j.id===w);return(typeof((_=b==null?void 0:b.data)==null?void 0:_.label)=="string"&&b.data.label.trim()?b.data.label.trim():null)??w},[e]),y=N.useCallback((w,b)=>{const x=Array.from(new Set(w)).filter(Boolean);if(x.length===0)return;const _=x.map(j=>g(j));s(j=>{if(Object.keys(j).length===0)return j;let C=!1;const T={...j};for(const A of x)A in T&&(delete T[A],C=!0);return C?T:j}),t.current=!0,a({force:!0});try{n(j=>j.filter(C=>!x.includes(C.id))),r(j=>j.filter(C=>!x.includes(C.source)&&!x.includes(C.target)))}catch(j){throw t.current=!1,j}i(j=>j.filter(C=>!(C.nodeId&&x.includes(C.nodeId)||C.sourceId&&x.includes(C.sourceId)||C.targetId&&x.includes(C.targetId)))),l(j=>j.filter(C=>!x.includes(C))),d(j=>j&&x.includes(j)?null:j),p&&x.includes(p)&&(f(null),h(!1)),b!=null&&b.suppressToast||Ne({title:x.length===1?"Node deleted":"Nodes deleted",description:x.length===1?`Removed ${_[0]}.`:`Removed ${x.length} nodes.`})},[p,t,a,g,f,r,h,s,n,l,d,i]),S=N.useCallback(w=>{y([w])},[y]);return{resolveNodeLabel:g,deleteNodes:y,handleDeleteNode:S}},TMe=["yellow","pink","blue","green","purple"],PT="yellow",oW="Leave a note for collaborators",$T=180,IT=150,LT=240,zT=200,qT=e=>typeof e=="string"&&TMe.includes(e),KL=(e,t)=>Number.isNaN(e)||!Number.isFinite(e)?t:Math.max(t,Math.round(e)),ou=(e,t,n)=>KL(typeof e=="number"?e:t,n),FT=e=>typeof e=="string"?e:oW,AMe=({setNodes:e})=>({handleUpdateStickyNoteNode:N.useCallback((n,r)=>{e(a=>a.map(s=>{if(s.id!==n)return s;const i={};return"color"in r&&(i.color=qT(r.color)?r.color:PT),"content"in r&&typeof r.content=="string"&&(i.content=FT(r.content)),"width"in r&&typeof r.width=="number"&&(i.width=ou(r.width,LT,$T)),"height"in r&&typeof r.height=="number"&&(i.height=ou(r.height,zT,IT)),Object.keys(i).length===0?s:{...s,data:{...s.data,...i}}}))},[e])}),RMe=({nodes:e,isSearchOpen:t,searchMatchSet:n,searchMatches:r,currentSearchIndex:a,handleDeleteNode:s,handleUpdateStickyNoteNode:i})=>N.useMemo(()=>e.map(l=>{const d=n.has(l.id),f=d&&t&&r[a]===l.id,h=l.type==="stickyNote",p={...l.data,onDelete:s,...h?{onUpdateStickyNote:i}:{}},g=h?{...p,label:typeof p.label=="string"&&p.label.length>0?p.label:"Sticky Note",color:qT(p.color)?p.color:PT,content:FT(p.content),width:ou(p.width,LT,$T),height:ou(p.height,zT,IT),onUpdateStickyNote:i}:p,y=t?{...g,isSearchMatch:d,isSearchActive:f}:{...g,isSearchMatch:!1,isSearchActive:!1};return{...l,data:y,...h?{connectable:!1}:{}}}),[a,s,i,t,e,n,r]),kMe=({nodes:e,searchMatches:t,searchMatchSet:n,isSearchOpen:r,currentSearchIndex:a,latestNodesRef:s,isRestoringRef:i,setNodes:l,setNodesState:d,setEdgesState:f,recordSnapshot:h,setNodeRuntimeCache:p,setValidationErrors:g,setSearchMatches:y,setSelectedNodeId:S,setActiveChatNodeId:w,setIsChatOpen:b,activeChatNodeId:x})=>{const{resolveNodeLabel:_,deleteNodes:j,handleDeleteNode:C}=EMe({latestNodesRef:s,isRestoringRef:i,setNodesState:d,setEdgesState:f,recordSnapshot:h,setNodeRuntimeCache:p,setValidationErrors:g,setSearchMatches:y,setSelectedNodeId:S,setActiveChatNodeId:w,setIsChatOpen:b,activeChatNodeId:x}),{handleUpdateStickyNoteNode:T}=AMe({setNodes:l});return{decoratedNodes:RMe({nodes:e,isSearchOpen:r,searchMatchSet:n,searchMatches:t,currentSearchIndex:a,handleDeleteNode:C,handleUpdateStickyNoteNode:T}),resolveNodeLabel:_,deleteNodes:j,handleDeleteNode:C,handleUpdateStickyNoteNode:T}},OMe=async e=>{try{const t=await e.json();if(typeof(t==null?void 0:t.detail)=="object"&&t.detail!==null){const n=t.detail,r=typeof n.message=="string"?n.message:null;if(r)return r}if(typeof t.message=="string")return t.message}catch{}return e.statusText||"ChatKit session request failed."};async function MMe(e,t){const n=gn(`/api/workflows/${e}/chatkit/session`,t??void 0),r=await fetch(n,{method:"POST",headers:{"Content-Type":"application/json"},credentials:"include"});if(!r.ok){const d=await OMe(r);throw new Error(d)}const a=await r.json(),s=a.client_secret??a.clientSecret;if(!s)throw new Error("ChatKit session response missing client secret.");const i=a.expires_at??a.expiresAt,l=i?new Date(i).getTime():null;return{clientSecret:s,expiresAt:l}}const DMe=3e4,PMe=({nodesRef:e,setNodes:t,workflowId:n,backendBaseUrl:r,userName:a})=>{const[s,i]=N.useState(!1),[l,d]=N.useState(null),[f,h]=N.useState("Chat"),[p,g]=N.useState("idle"),[y,S]=N.useState(null),w=N.useRef(null),b=N.useRef(null),x=N.useRef(n),_=N.useCallback(()=>{w.current=null,b.current=null,g("idle"),S(null)},[]);N.useEffect(()=>{n!==x.current&&(x.current=n,_())},[_,n]);const j=N.useCallback(U=>U!=null&&U.clientSecret?U.expiresAt?Date.now()+DMe<U.expiresAt:!0:!1,[]),C=N.useCallback(async()=>{if(!n){const F="Save the workflow before opening ChatKit.";throw g("error"),S(F),$i("canvas.chat.session.failure",{reason:"missing_workflow"}),new Error(F)}if(b.current)return b.current;const U=(async()=>{g("loading"),S(null);try{const F=await MMe(n,r??void 0);return w.current=F,g("ready"),$i("canvas.chat.session.success",{workflowId:n}),F.clientSecret}catch(F){const q=F instanceof Error?F.message:"Unable to start a ChatKit session.";throw g("error"),S(q),w.current=null,$i("canvas.chat.session.failure",{workflowId:n,message:q}),F instanceof Error?F:new Error(q)}finally{b.current=null}})();return b.current=U,U},[r,n]),T=N.useCallback(async U=>{const F=w.current;return F&&j(F)?F.clientSecret:C()},[j,C]),A=N.useCallback(U=>{const F=e.current.find(q=>q.id===U);F&&(h(F.data.label||"Chat"),d(U),i(!0),$i("canvas.chat.open",{workflowId:n,nodeId:U}),C())},[e,C,n]),k=N.useCallback(()=>{i(!1),d(null),$i("canvas.chat.close",{workflowId:n})},[n]),O=N.useCallback(()=>{l&&t(U=>U.map(F=>F.id===l?{...F,data:{...F.data,status:"running"}}:F))},[l,t]),M=N.useCallback(()=>{l&&t(U=>U.map(F=>F.id===l?{...F,data:{...F.data,status:"success"}}:F))},[l,t]),z=N.useCallback(async U=>{if(!l||U.name!=="orcheo.run_workflow")return{};if(!n)throw new Error("Cannot trigger workflow without a workflow ID");const F=U.params??{},q=typeof F.message=="string"?F.message:"",V=typeof F.threadId=="string"?F.threadId:typeof F.thread_id=="string"?F.thread_id:null,P={...F};delete P.message,delete P.threadId,delete P.thread_id;const K=await fetch(gn(`/api/chatkit/workflows/${n}/trigger`,r),{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({message:q,actor:a,client_thread_id:V,metadata:P})});if(!K.ok)throw new Error("Failed to trigger workflow via ChatKit client tool");return await K.json()},[l,r,a,n]),L=N.useCallback(U=>{if(U.type!=="chatTrigger")return U;const F=U.data;return{...U,data:{...F,onOpenChat:()=>A(U.id)}}},[A]);return{isChatOpen:s,setIsChatOpen:i,activeChatNodeId:l,setActiveChatNodeId:d,chatTitle:f,setChatTitle:h,handleOpenChat:A,handleCloseChat:k,handleChatResponseStart:O,handleChatResponseEnd:M,handleChatClientTool:z,attachChatHandlerToNode:L,getClientSecret:T,refreshSession:C,sessionStatus:p,sessionError:y,workflowId:n??null,backendBaseUrl:r}};function $Me(){const[e,t]=N.useState("New Workflow"),[n,r]=N.useState(""),[a,s]=N.useState(null),[i,l]=N.useState([]),[d,f]=N.useState(["draft"]);return{workflowName:e,setWorkflowName:t,workflowDescription:n,setWorkflowDescription:r,currentWorkflowId:a,setCurrentWorkflowId:s,workflowVersions:i,setWorkflowVersions:l,workflowTags:d,setWorkflowTags:f}}function IMe(){const[e,t]=N.useState([]),[n,r]=N.useState(!1),[a,s]=N.useState(null);return{validationErrors:e,setValidationErrors:t,isValidating:n,setIsValidating:r,lastValidationRun:a,setLastValidationRun:s}}function LMe(){const[e,t]=N.useState([]),[n,r]=N.useState(null),[a,s]=N.useState(!1);return{executions:e,setExecutions:t,activeExecutionId:n,setActiveExecutionId:r,isRunning:a,setIsRunning:s}}const zMe=[{id:"subflow-customer-onboarding",name:"Customer Onboarding Foundation",description:"Qualify leads, enrich CRM details, and orchestrate the welcome sequence.",tags:["crm","sales","email"],version:"1.3.0",status:"stable",usageCount:18,lastUpdated:new Date(Date.now()-1e3*60*60*24*2).toISOString()},{id:"subflow-incident-response",name:"Incident Response Escalation",description:"Route Sev1 incidents, notify stakeholders, and collect on-call context.",tags:["ops","pagerduty","slack"],version:"0.9.2",status:"beta",usageCount:7,lastUpdated:new Date(Date.now()-1e3*60*60*8).toISOString()},{id:"subflow-content-qa",name:"Content QA & Publishing",description:"Score AI-generated drafts, request revisions, and schedule approved posts.",tags:["marketing","ai","review"],version:"2.0.0",status:"stable",usageCount:11,lastUpdated:new Date(Date.now()-1e3*60*60*24*6).toISOString()}];function qMe(e=zMe){const[t,n]=N.useState(e);return{subworkflows:t,setSubworkflows:n}}function FMe(){const[e,t]=N.useState(!1),[n,r]=N.useState(null),[a,s]=N.useState("canvas"),[i,l]=N.useState(null);return{sidebarCollapsed:e,setSidebarCollapsed:t,selectedNodeId:n,setSelectedNodeId:r,activeTab:a,setActiveTab:s,hoveredEdgeId:i,setHoveredEdgeId:l}}function UMe({runtimeCacheKey:e,nodeRuntimeCache:t,setNodeRuntimeCache:n,previousRuntimeCacheKeyRef:r}){N.useEffect(()=>{r.current!==e&&(GL(r.current),r.current=e,n(nW(e)))},[e,r,n]),N.useEffect(()=>{if(typeof window>"u")return;const a=window.setTimeout(()=>{lMe(e,t)},200);return()=>{window.clearTimeout(a)}},[t,e]),N.useEffect(()=>()=>{GL(e)},[e])}function HMe({initialNodes:e,initialEdges:t}){const{workflowId:n}=Dy(),r=jMe({initialNodes:e,initialEdges:t}),a=$Me(),s=IMe(),i=LMe(),l=qMe(),d=FMe(),f=N.useRef(null),h=N.useRef(null),p=N.useRef(null),g=N.useRef(!0),y=N.useMemo(()=>iMe(n??null),[n]),[S,w]=N.useState(()=>nW(y)),b=N.useRef(y);UMe({runtimeCacheKey:y,nodeRuntimeCache:S,setNodeRuntimeCache:w,previousRuntimeCacheKeyRef:b}),N.useEffect(()=>(g.current=!0,()=>{g.current=!1,p.current&&(p.current.close(),p.current=null)}),[]);const x=CMe({nodesRef:r.nodesRef,reactFlowInstance:h}),_=N.useMemo(()=>({id:"user-1",name:"Avery Chen",avatar:"https://avatar.vercel.sh/avery"}),[]),j=N.useMemo(()=>({id:"ai-1",name:"Orcheo Canvas Assistant",avatar:"https://avatar.vercel.sh/orcheo-canvas"}),[]),C=PMe({nodesRef:r.nodesRef,setNodes:r.setNodes,workflowId:n,backendBaseUrl:ni(),userName:_.name}),T=N.useCallback(k=>k.map(O=>yMe(O)).map(C.attachChatHandlerToNode),[C.attachChatHandlerToNode]),A=kMe({nodes:r.nodes,searchMatches:x.searchMatches,searchMatchSet:x.searchMatchSet,isSearchOpen:x.isSearchOpen,currentSearchIndex:x.currentSearchIndex,latestNodesRef:r.latestNodesRef,isRestoringRef:r.isRestoringRef,setNodes:r.setNodes,setNodesState:r.setNodesState,setEdgesState:r.setEdgesState,recordSnapshot:r.recordSnapshot,setNodeRuntimeCache:w,setValidationErrors:s.setValidationErrors,setSearchMatches:x.setSearchMatches,setSelectedNodeId:d.setSelectedNodeId,setActiveChatNodeId:C.setActiveChatNodeId,setIsChatOpen:C.setIsChatOpen,activeChatNodeId:C.activeChatNodeId});return{history:r,metadata:a,validation:s,execution:i,subworkflowState:l,ui:d,reactFlowWrapper:f,reactFlowInstance:h,websocketRef:p,isMountedRef:g,nodeRuntimeCache:S,setNodeRuntimeCache:w,search:x,chat:C,nodeState:A,convertPersistedNodesToCanvas:T,user:_,ai:j}}const BMe=({backendBaseUrl:e,currentWorkflowId:t,userName:n,setCredentials:r})=>async a=>{var f,h;const s=(h=(f=a.secrets)==null?void 0:f.apiKey)==null?void 0:h.trim();if(!s){const p="API key is required to save a credential.";throw Ne({title:"Missing credential secret",description:p,variant:"destructive"}),new Error(p)}const i=await fetch(gn("/api/credentials",e),{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({name:a.name,provider:a.type??"custom",secret:s,actor:n,access:a.access,workflow_id:t,scopes:[]})});if(!i.ok){let p=`Failed to save credential (status ${i.status})`;try{const g=await i.json();typeof(g==null?void 0:g.detail)=="string"?p=g.detail:g!=null&&g.detail&&typeof g.detail.message=="string"&&(p=g.detail.message)}catch(g){console.warn("Failed to parse credential creation error",g)}throw Ne({title:"Unable to save credential",description:p,variant:"destructive"}),new Error(p)}const l=await i.json(),d={id:l.id,name:l.name,type:l.provider??l.kind,createdAt:l.created_at,updatedAt:l.updated_at,owner:l.owner,access:l.access,secrets:a.secrets,status:l.status};r(p=>[...p.filter(y=>y.id!==d.id),d]),Ne({title:"Credential added to vault",description:`${d.name} is now available for nodes that require secure access.`})},VMe=({backendBaseUrl:e,currentWorkflowId:t,setCredentials:n})=>async r=>{const a=new URL(gn(`/api/credentials/${r}`,e));t&&a.searchParams.set("workflow_id",t);try{const s=await fetch(a.toString(),{method:"DELETE"});if(!s.ok&&s.status!==404)throw new Error(`Failed to delete credential (status ${s.status})`);n(i=>i.filter(l=>l.id!==r)),Ne({title:"Credential removed",description:"Nodes referencing this credential will require reconfiguration before publish."})}catch(s){throw console.error("Failed to delete credential",s),Ne({title:"Unable to delete credential",description:s instanceof Error?s.message:"An unexpected error occurred while removing the credential.",variant:"destructive"}),s}},WMe=({routeWorkflowId:e,currentWorkflowId:t,backendBaseUrl:n,userName:r})=>{const[a,s]=N.useState([]),[i,l]=N.useState(!0);N.useEffect(()=>{const h=new AbortController;let p=!0;return(async()=>{if(p){l(!0);try{const y=new URL(gn("/api/credentials"));e&&y.searchParams.set("workflow_id",e);const S=await fetch(y.toString(),{signal:h.signal});if(!S.ok)throw new Error(`Failed to load credentials (status ${S.status})`);const w=await S.json();if(!p)return;const b=w.map(x=>({id:x.id,name:x.name,type:x.provider??x.kind,createdAt:x.created_at,updatedAt:x.updated_at,owner:x.owner??null,access:x.access,secrets:x.secret_preview?{secret:x.secret_preview}:void 0,status:x.status}));s(x=>{const _=new Set(b.map(C=>C.id)),j=x.filter(C=>!_.has(C.id));return[...b,...j]})}catch(y){if(h.signal.aborted)return;console.error("Failed to load credential vault",y),Ne({title:"Unable to load credentials",description:y instanceof Error?y.message:"An unexpected error occurred while loading credentials.",variant:"destructive"})}finally{p&&l(!1)}}})(),()=>{p=!1,h.abort()}},[e]);const d=N.useMemo(()=>BMe({backendBaseUrl:n,currentWorkflowId:t,userName:r,setCredentials:s}),[n,t,s,r]),f=N.useMemo(()=>VMe({backendBaseUrl:n,currentWorkflowId:t,setCredentials:s}),[n,t,s]);return{credentials:a,isCredentialsLoading:i,handleAddCredential:d,handleDeleteCredential:f}};function GMe(e){const{nodes:t,edges:n,nodesRef:r,isRestoringRef:a,recordSnapshot:s,setNodesState:i,setEdgesState:l,handleOpenChat:d}=e;return{handleDuplicateSelectedNodes:N.useCallback(()=>{const h=t.filter(b=>b.selected);if(h.length===0){Ne({title:"No nodes selected",description:"Select at least one node to duplicate.",variant:"destructive"});return}const p=new Map,g=Mh(r.current),y=h.map(b=>{var A,k,O;const x=aW(b),_=typeof((A=x.data)==null?void 0:A.label)=="string"&&x.data.label.trim().length>0?`${x.data.label} Copy`:`${x.id} Copy`,{id:j,label:C}=g(_);p.set(b.id,j);const T={...x.data,label:C};return x.type==="chatTrigger"&&(T.onOpenChat=()=>d(j)),{...x,id:j,position:{x:(((k=x.position)==null?void 0:k.x)??0)+40,y:(((O=x.position)==null?void 0:O.y)??0)+40},selected:!1,data:T}}),S=new Set(h.map(b=>b.id)),w=n.filter(b=>S.has(b.source)&&S.has(b.target)).map(b=>{const x=p.get(b.source),_=p.get(b.target);return!x||!_?null:{...sW(b),id:`edge-${x}-${_}-${Math.random().toString(36).slice(2,8)}`,source:x,target:_,selected:!1}}).filter(Boolean);a.current=!0,s({force:!0});try{i(b=>[...b,...y]),w.length>0&&l(b=>[...b,...w])}catch(b){throw a.current=!1,b}Ne({title:"Nodes duplicated",description:`${y.length} node${y.length===1?"":"s"} copied with their connections.`})},[n,d,a,t,r,s,l,i])}}async function YL(e){const{nodesToCopy:t,edges:n,copyOptions:r={}}=e;if(t.length===0)return Ne({title:"No nodes selected",description:"Select at least one node to copy.",variant:"destructive"}),null;const a=new Set(t.map(h=>h.id)),s=t.map(MT),i=n.filter(h=>a.has(h.source)&&a.has(h.target)).map(DT),l=NMe(s,i),d=rW(l);let f=!1;if(typeof navigator<"u"&&navigator.clipboard&&typeof navigator.clipboard.writeText=="function")try{await navigator.clipboard.writeText(SMe(l)),f=!0}catch(h){console.warn("Failed to write workflow selection to clipboard",h)}return r.skipSuccessToast?f||Ne({title:"Nodes copied (in-app clipboard)",description:"System clipboard unavailable. Paste with Ctrl/Cmd+V in this tab."}):Ne({title:t.length===1?"Node copied":"Nodes copied",description:`${t.length} node${t.length===1?"":"s"} copied${f?"":" (available for in-app paste)"}.`}),{payload:l,signature:d,result:{success:!0,nodeCount:t.length,edgeCount:i.length,usedFallback:!f}}}const Eu=e=>{if(typeof globalThis.crypto<"u"&&"randomUUID"in globalThis.crypto&&typeof globalThis.crypto.randomUUID=="function")return`${e}-${globalThis.crypto.randomUUID()}`;const t=Date.now().toString(36),n=Math.random().toString(36).slice(2,8);return`${e}-${t}-${n}`};function KMe(e){const{payload:t,existingNodes:n,pasteStep:r,convertPersistedNodesToCanvas:a,convertPersistedEdgesToCanvas:s}=e;if(t.nodes.length===0)return null;const i=xMe+r*bMe,l=Math.min(r+1,wMe),d=new Map,f=Mh(n),h=t.nodes.map(S=>{var j;const w=typeof((j=S.data)==null?void 0:j.label)=="string"&&S.data.label.trim().length>0?S.data.label:_0(S.id),{id:b,label:x}=f(w);d.set(S.id,b);const _=S.position??{x:0,y:0};return{...S,id:b,position:{x:_.x+i,y:_.y+i},data:{...S.data,label:x}}}),p=t.edges.map(S=>{const w=d.get(S.source),b=d.get(S.target);return!w||!b?null:{...S,id:Eu("edge"),source:w,target:b}}).filter(Boolean),g=a(h),y=s(p);return g.length===0?null:{nodes:g,edges:y,nextStep:l}}const YMe={success:!1,nodeCount:0,edgeCount:0,usedFallback:!1};function XMe(e){const{nodesRef:t,edgesRef:n,recordSnapshot:r,setNodesState:a,setEdgesState:s,deleteNodes:i,isRestoringRef:l,convertPersistedNodesToCanvas:d,convertPersistedEdgesToCanvas:f}=e,h=N.useRef(null),p=N.useRef(0),g=N.useRef(null),y=N.useCallback(async()=>{const b=t.current.filter(_=>_.selected),x=await YL({nodesToCopy:b,edges:n.current});return x?(h.current=x.payload,p.current=0,g.current=x.signature,x.result):YMe},[n,t]),S=N.useCallback(async()=>{const b=t.current.filter(C=>C.selected),x=b.map(C=>C.id),_=await YL({nodesToCopy:b,edges:n.current,copyOptions:{skipSuccessToast:!0}});if(!_)return;h.current=_.payload,p.current=0,g.current=_.signature,i(x,{suppressToast:!0});const j=_.result.usedFallback?"System clipboard unavailable. Paste with Ctrl/Cmd+V in this tab.":"Paste with Ctrl/Cmd+V.";Ne({title:x.length===1?"Node cut":"Nodes cut",description:`${x.length} node${x.length===1?"":"s"} ready to paste. ${j}`})},[i,n,t]),w=N.useCallback(async()=>{let b=null;if(typeof navigator<"u"&&navigator.clipboard&&typeof navigator.clipboard.readText=="function")try{const T=await navigator.clipboard.readText(),A=_Me(T);A&&(b=A)}catch{}if(b||(b=h.current),!b||b.nodes.length===0){Ne({title:"Nothing to paste",description:"Copy nodes before pasting.",variant:"destructive"});return}const x=rW(b);x!==g.current&&(p.current=0,g.current=x),h.current=b;const _=KMe({payload:b,existingNodes:t.current,pasteStep:p.current,convertPersistedNodesToCanvas:d,convertPersistedEdgesToCanvas:f});if(!_){Ne({title:"Nothing to paste",description:"Copied selection has no nodes.",variant:"destructive"});return}p.current=_.nextStep,l.current=!0,r({force:!0});try{a(T=>[...T,..._.nodes]),_.edges.length>0&&s(T=>[...T,..._.edges])}catch(T){throw l.current=!1,T}const j=_.edges.length,C=j>0?` with ${j} connection${j===1?"":"s"}`:"";Ne({title:_.nodes.length===1?"Node pasted":"Nodes pasted",description:`Added ${_.nodes.length} node${_.nodes.length===1?"":"s"}${C}.`})},[f,d,l,t,r,s,a]);return{copySelectedNodes:y,cutSelectedNodes:S,pasteNodes:w}}const js=e=>typeof e=="object"&&e!==null,ZMe=e=>e!=null&&e.includes("chat-trigger")?"chatTrigger":e==="sticky-note"?"stickyNote":e==="start-node"||e==="end-node"?"startEnd":"default",QMe=e=>{if(!js(e))throw new Error("Invalid workflow file structure.");const{nodes:t,edges:n}=e;if(!Array.isArray(t))throw new Error("Invalid nodes array in workflow file.");if(t.forEach((r,a)=>{if(!js(r))throw new Error(`Invalid node at index ${a}.`);if(!js(r.position))throw new Error(`Node ${r.id??a} is missing position data.`);const{x:s,y:i}=r.position;if(typeof s!="number"||typeof i!="number")throw new Error(`Node ${r.id??a} has invalid coordinates.`)}),!Array.isArray(n))throw new Error("Invalid edges array in workflow file.");n.forEach((r,a)=>{if(!js(r))throw new Error(`Invalid edge at index ${a}.`);if(typeof r.source!="string"||typeof r.target!="string")throw new Error(`Edge ${r.id??a} has invalid connections.`)})};function JMe(e){const t=JSON.parse(e);return QMe(t),t}function e4e(e){const{createSnapshot:t,convertPersistedNodesToCanvas:n,convertPersistedEdgesToCanvas:r,setNodesState:a,setEdgesState:s,setWorkflowName:i,setWorkflowDescription:l,setCurrentWorkflowId:d,setWorkflowVersions:f,setWorkflowTags:h,workflowName:p,workflowDescription:g,recordSnapshot:y,isRestoringRef:S}=e,w=N.useRef(null),b=N.useCallback(()=>{try{const j=t(),C={name:p,description:g,nodes:j.nodes.map(MT),edges:j.edges.map(DT)},T=JSON.stringify(C,null,2),A=new Blob([T],{type:"application/json"}),k=URL.createObjectURL(A),O=document.createElement("a");O.href=k,O.download=`${p.replace(/\s+/g,"-").toLowerCase()||"workflow"}.json`,O.click(),URL.revokeObjectURL(k),Ne({title:"Workflow exported",description:"A JSON export has been downloaded."})}catch(j){Ne({title:"Export failed",description:j instanceof Error?j.message:"Unable to export workflow.",variant:"destructive"})}},[t,g,p]),x=N.useCallback(()=>{var j;(j=w.current)==null||j.click()},[]),_=N.useCallback(j=>{var A;const C=(A=j.target.files)==null?void 0:A[0];if(!C)return;const T=new FileReader;T.onload=()=>{try{const k=typeof T.result=="string"?T.result:"",O=JMe(k),M=n(O.nodes),z=r(O.edges);S.current=!0,y({force:!0});try{a(M),s(z),typeof O.name=="string"&&O.name.trim().length>0&&i(O.name),typeof O.description=="string"&&l(O.description),d(null),f([]),h(["draft"])}catch(L){throw S.current=!1,L}Ne({title:"Workflow imported",description:`Loaded ${M.length} node${M.length===1?"":"s"} from file.`})}catch(k){Ne({title:"Import failed",description:k instanceof Error?k.message:"Invalid workflow file.",variant:"destructive"})}finally{j.target.value=""}},T.onerror=()=>{Ne({title:"Import failed",description:"Unable to read the selected file.",variant:"destructive"}),j.target.value=""},T.readAsText(C)},[r,n,S,y,d,s,a,l,i,h,f]);return{fileInputRef:w,handleExportWorkflow:b,handleImportWorkflow:x,handleWorkflowFileSelected:_}}function t4e(e){const{createSnapshot:t,convertPersistedNodesToCanvas:n,convertPersistedEdgesToCanvas:r,setWorkflowName:a,setWorkflowDescription:s,setCurrentWorkflowId:i,setWorkflowVersions:l,setWorkflowTags:d,workflowName:f,workflowDescription:h,workflowTags:p,currentWorkflowId:g,workflowIdFromRoute:y,navigate:S,applySnapshot:w}=e,b=N.useCallback(async()=>{const j=t(),C=j.nodes.map(MT),T=j.edges.map(DT),A=new Date().toLocaleString(),k=p.length>0?p:["draft"];try{const O=await yv({id:g??void 0,name:f.trim()||"Untitled Workflow",description:h.trim(),tags:k,nodes:C,edges:T},{versionMessage:`Manual save (${A})`});i(O.id),a(O.name),s(O.description??""),d(O.tags??k),l(O.versions??[]),Ne({title:"Workflow saved",description:`"${O.name}" has been updated.`}),(!y||y!==O.id)&&S(`/workflow-canvas/${O.id}`,{replace:!!y})}catch(O){Ne({title:"Failed to save workflow",description:O instanceof Error?O.message:"Unknown error occurred",variant:"destructive"})}},[t,g,S,i,s,a,d,l,h,y,f,p]),x=N.useCallback(j=>{const C=j.split(",").map(T=>T.trim()).filter(T=>T.length>0);d(C)},[d]),_=N.useCallback(async j=>{if(!g){Ne({title:"Save required",description:"Save this workflow before restoring versions.",variant:"destructive"});return}try{const C=await mle(g,j);if(!C){Ne({title:"Version unavailable",description:"We couldn't load that version. Please try again.",variant:"destructive"});return}const T=n(C.nodes??[]),A=r(C.edges??[]);w({nodes:T,edges:A},{resetHistory:!0}),a(C.name),s(C.description??""),Ne({title:"Version loaded",description:"Review the restored version and save to keep it."})}catch(C){Ne({title:"Failed to restore version",description:C instanceof Error?C.message:"Unknown error occurred",variant:"destructive"})}},[w,r,n,g,s,a]);return{handleSaveWorkflow:b,handleTagsChange:x,handleRestoreVersion:_}}function n4e(e,t){const n=My(),r=WMe({routeWorkflowId:t,currentWorkflowId:e.metadata.currentWorkflowId,backendBaseUrl:ni(),userName:e.user.name}),a=GMe({nodes:e.history.nodes,edges:e.history.edges,nodesRef:e.history.nodesRef,isRestoringRef:e.history.isRestoringRef,recordSnapshot:e.history.recordSnapshot,setNodesState:e.history.setNodesState,setEdgesState:e.history.setEdgesState,handleOpenChat:e.chat.handleOpenChat}),s=XMe({nodesRef:e.history.nodesRef,edgesRef:e.history.edgesRef,recordSnapshot:e.history.recordSnapshot,setNodesState:e.history.setNodesState,setEdgesState:e.history.setEdgesState,deleteNodes:e.nodeState.deleteNodes,isRestoringRef:e.history.isRestoringRef,convertPersistedNodesToCanvas:e.convertPersistedNodesToCanvas,convertPersistedEdgesToCanvas:cf}),i=e4e({createSnapshot:e.history.createSnapshot,convertPersistedNodesToCanvas:e.convertPersistedNodesToCanvas,convertPersistedEdgesToCanvas:cf,setNodesState:e.history.setNodesState,setEdgesState:e.history.setEdgesState,setWorkflowName:e.metadata.setWorkflowName,setWorkflowDescription:e.metadata.setWorkflowDescription,setCurrentWorkflowId:e.metadata.setCurrentWorkflowId,setWorkflowVersions:e.metadata.setWorkflowVersions,setWorkflowTags:e.metadata.setWorkflowTags,workflowName:e.metadata.workflowName,workflowDescription:e.metadata.workflowDescription,recordSnapshot:e.history.recordSnapshot,isRestoringRef:e.history.isRestoringRef}),l=t4e({createSnapshot:e.history.createSnapshot,convertPersistedNodesToCanvas:e.convertPersistedNodesToCanvas,convertPersistedEdgesToCanvas:cf,setWorkflowName:e.metadata.setWorkflowName,setWorkflowDescription:e.metadata.setWorkflowDescription,setCurrentWorkflowId:e.metadata.setCurrentWorkflowId,setWorkflowVersions:e.metadata.setWorkflowVersions,setWorkflowTags:e.metadata.setWorkflowTags,workflowName:e.metadata.workflowName,workflowDescription:e.metadata.workflowDescription,workflowTags:e.metadata.workflowTags,currentWorkflowId:e.metadata.currentWorkflowId,workflowIdFromRoute:t,navigate:n,applySnapshot:e.history.applySnapshot});return{credentials:r,duplicateNodes:a,clipboard:s,fileTransfer:i,saver:l}}function r4e(e){const t=e.level??e.log_level;if(typeof t=="string"){const r=t.trim().toLowerCase();if(r==="debug")return"DEBUG";if(r==="error")return"ERROR";if(r==="warning"||r==="warn")return"WARNING"}if(typeof e.error=="string"&&e.error.trim())return"ERROR";const n=typeof e.status=="string"?e.status.toLowerCase():null;return n==="error"||n==="failed"?"ERROR":n==="warning"||n==="cancelled"||n==="partial"?"WARNING":n==="debug"?"DEBUG":"INFO"}function a4e(e,t,n){if(typeof e.error=="string"&&e.error.trim())return`Run error: ${e.error.trim()}`;if(typeof e.message=="string"&&e.message.trim())return e.message.trim();const r=["node","step","name"].find(s=>typeof e[s]=="string"&&e[s]),a=typeof e.status=="string"?e.status.toLowerCase():void 0;if(r){const s=String(e[r]),i=t[s]??s,l=n(i);return a?`Node ${l} ${a}`:`Node ${l} emitted an update`}return a?`Run status changed to ${a}`:JSON.stringify(e)}const s4e=e=>{switch(e==null?void 0:e.toLowerCase()){case"running":return"running";case"error":case"failed":return"error";case"warning":case"cancelled":case"partial":return"warning";default:return"success"}},iW=e=>{switch(e==null?void 0:e.toLowerCase()){case"running":return"running";case"completed":case"success":return"success";case"error":case"failed":return"failed";case"cancelled":case"partial":return"partial";default:return null}};function o4e(e,t){const n=["node","step","name"].find(l=>typeof e[l]=="string"&&e[l]);if(!n)return{};const r=typeof e.status=="string"?e.status:void 0;if(!r)return{};const a=String(e[n]),s=t[a]??a,i=s4e(r);return{[s]:i}}function i4e(e,t){const n=typeof e.status=="string"?e.status:void 0;let r=iW(n);return t&&(r=null),typeof e.error=="string"&&e.error.trim()&&(r="failed"),r}function l4e(e,t,n){const r={};return Object.entries(e).forEach(([a,s])=>{if(typeof a!="string"||a==="status"||a==="level"||a==="error"||a==="message"||a==="type"||a==="timestamp"||a==="step")return;const i=t[a]??null;if(!i||!js(s))return;const l=s.results;let d;if(js(l)&&(d=l[a]??l[i]??Object.values(l)[0]),d===void 0){const g=typeof s[a]<"u"?s[a]:void 0;g!==void 0&&(d=g)}d===void 0&&s.value!==void 0&&(d=s.value),d===void 0&&(d=s);let f,h,p;js(d)&&(f=d.inputs!==void 0?d.inputs:d.input,h=d.outputs!==void 0?d.outputs:d.output??d.result,p=d.messages),r[i]={...f!==void 0?{inputs:f}:{},...h!==void 0?{outputs:h}:{},...p!==void 0?{messages:p}:{},raw:d,updatedAt:n}}),r}function c4e({execution:e,executionStatus:t,nodeUpdates:n,runtimeUpdates:r,logLevel:a,message:s,timestamp:i,graphToCanvas:l}){var w;const d=e.nodes.map(b=>{const x=n[b.id],_=r[b.id];let j=b;if(x?j={...j,status:x}:t&&t!=="running"&&b.status==="running"&&(j={...j,status:t==="failed"?"error":t==="partial"?"warning":"success"}),_){const T={...b.details&&js(b.details)?b.details:{}};_.inputs!==void 0&&(T.inputs=_.inputs),_.outputs!==void 0&&(T.outputs=_.outputs),_.messages!==void 0&&(T.messages=_.messages),T.raw=_.raw,T.updatedAt=_.updatedAt,j={...j,details:T}}return j}),f=[...e.logs,{timestamp:i.toLocaleTimeString([],{hour:"2-digit",minute:"2-digit",second:"2-digit"}),level:a,message:s}],h=i.getTime()-new Date(e.startTime).getTime(),p=a==="ERROR"?e.issues+1:e.issues,g={...e.metadata??{},graphToCanvas:{...((w=e.metadata)==null?void 0:w.graphToCanvas)??{},...l}},y=t??e.status,S=t&&t!=="running"?i.toISOString():e.endTime;return{...e,status:y,nodes:d,logs:f,duration:h,issues:p,endTime:S,metadata:g}}function u4e({nodes:e,nodeUpdates:t,runtimeUpdates:n,executionStatus:r}){return Object.keys(t).length>0||Object.keys(n).length>0||r&&r!=="running"?e.map(s=>{var h,p;const i=t[s.id],l=n[s.id];let d=s.data,f=!1;if(i?(d={...d,status:i},f=!0):r&&r!=="running"&&(((h=s.data)==null?void 0:h.status)==="running"||((p=s.data)==null?void 0:p.status)===void 0)&&(d={...d,status:r==="failed"?"error":r==="partial"?"warning":"success"},f=!0),l){const g={...d.runtime??{},...l.inputs!==void 0?{inputs:l.inputs}:{},...l.outputs!==void 0?{outputs:l.outputs}:{},...l.messages!==void 0?{messages:l.messages}:{},raw:l.raw,updatedAt:l.updatedAt};d={...d,runtime:g},f=!0}return f?{...s,data:d}:s}):e}function d4e({resolveNodeLabel:e,setExecutions:t,setNodes:n,setIsRunning:r,websocketRef:a,isMountedRef:s}){const i=N.useCallback(f=>r4e(f),[]),l=N.useCallback((f,h)=>a4e(f,h,e),[e]),d=N.useCallback((f,h,p)=>{if(!s.current)return;const g=["node","step","name"].some(C=>typeof h[C]=="string"&&h[C]),y=i4e(h,g),S=o4e(h,p),w=new Date,b=w.toISOString(),x=l4e(h,p,b),_=i(h),j=l(h,p);t(C=>C.map(T=>T.id!==f?T:c4e({execution:T,executionStatus:y,nodeUpdates:S,runtimeUpdates:x,logLevel:_,message:j,timestamp:w,graphToCanvas:p}))),n(C=>u4e({nodes:C,nodeUpdates:S,runtimeUpdates:x,executionStatus:y})),y&&y!=="running"&&(r(!1),a.current&&(a.current.close(),a.current=null))},[l,i,s,t,r,n,a]);return{determineLogLevel:i,describePayload:l,applyExecutionUpdate:d}}function f4e(e,t,n,r){const a=new Date,s=t.map(l=>{var d,f,h;return{id:l.id,type:typeof((d=l.data)==null?void 0:d.type)=="string"?l.data.type:l.type??"custom",name:typeof((f=l.data)==null?void 0:f.label)=="string"&&l.data.label.trim()?l.data.label:l.id,position:l.position,status:"running",iconKey:typeof((h=l.data)==null?void 0:h.iconKey)=="string"?l.data.iconKey:void 0}}),i=n.map(l=>({id:l.id??Eu("edge"),source:l.source,target:l.target}));return{id:e,runId:e,status:"running",startTime:a.toISOString(),duration:0,issues:0,nodes:s,edges:i,logs:[{timestamp:a.toLocaleTimeString([],{hour:"2-digit",minute:"2-digit",second:"2-digit"}),level:"INFO",message:"Workflow execution started"}],metadata:{graphToCanvas:r}}}function h4e(e){return e.map(t=>({...t,data:{...t.data,status:"running"}}))}function p4e({ws:e,executionId:t,config:n,graphToCanvas:r,nodes:a,currentWorkflowId:s,isMountedRef:i,applyExecutionUpdate:l,setIsRunning:d,setExecutions:f,websocketRef:h,onTraceUpdate:p}){const g=new Date;e.onopen=()=>{const y={type:"run_workflow",graph_config:n,inputs:{canvas:{triggered_from:"canvas-app",workflow_id:s??"canvas-preview",at:g.toISOString()},metadata:{node_count:a.length,edge_count:r?Object.keys(r).length:0}},execution_id:t};e.send(JSON.stringify(y))},e.onmessage=y=>{if(i.current)try{const S=JSON.parse(y.data);if((S==null?void 0:S.type)==="trace:update"){p==null||p(S);return}l(t,S,r)}catch(S){console.error("Failed to parse workflow update",S),Ne({title:"Workflow update error",description:S instanceof Error?S.message:"Unknown parsing error",variant:"destructive"})}},e.onerror=()=>{if(!i.current)return;const y=new Date;d(!1),f(S=>S.map(w=>{if(w.id!==t)return w;const b={timestamp:y.toLocaleTimeString([],{hour:"2-digit",minute:"2-digit",second:"2-digit"}),level:"ERROR",message:"WebSocket connection reported an error."},x=w.nodes.map(_=>_.status==="running"?{..._,status:"error"}:_);return{...w,status:w.status==="success"?w.status:"failed",nodes:x,logs:[...w.logs,b],endTime:w.endTime??y.toISOString(),duration:y.getTime()-new Date(w.startTime).getTime(),issues:w.issues+1}})),Ne({title:"Workflow stream error",description:"The WebSocket connection reported an error.",variant:"destructive"}),h.current===e&&(h.current.close(),h.current=null)},e.onclose=()=>{i.current&&(d(!1),h.current===e&&(h.current=null))}}function m4e({nodes:e,edges:t,setNodes:n,setExecutions:r,setActiveExecutionId:a,setIsRunning:s,websocketRef:i,isMountedRef:l,currentWorkflowId:d,applyExecutionUpdate:f,handleTraceUpdate:h}){return N.useCallback(async()=>{if(e.length===0){Ne({title:"Add nodes before running",description:"Create at least one node to build a runnable workflow.",variant:"destructive"});return}const{config:p,graphToCanvas:g,warnings:y}=await Hq(e,t);y.forEach(_=>{Ne({title:"Workflow configuration warning",description:_})});const S=Eu("run"),w=f4e(S,e,t,g);r(_=>[w,..._]),a(S),s(!0),n(_=>h4e(_)),i.current&&(i.current.close(),i.current=null);let b;try{b=yoe(d??"canvas-preview",ni())}catch(_){s(!1),Ne({title:"Unable to start execution",description:_ instanceof Error?_.message:"Invalid workflow identifier",variant:"destructive"});return}const x=new WebSocket(b);i.current=x,p4e({ws:x,executionId:S,config:p,graphToCanvas:g,nodes:e,currentWorkflowId:d,isMountedRef:l,applyExecutionUpdate:f,setIsRunning:s,setExecutions:r,websocketRef:i,onTraceUpdate:h})},[e,t,n,r,a,s,i,d,f,h,l])}function g4e({activeExecutionId:e,isRunning:t,setIsRunning:n,setNodes:r,setExecutions:a,websocketRef:s}){return N.useCallback(()=>{if(!t)return;n(!1),s.current&&(s.current.close(),s.current=null);const i=new Date;r(l=>l.map(d=>d.data.status==="running"?{...d,data:{...d.data,status:"warning"}}:d)),e&&a(l=>l.map(d=>d.id!==e?d:{...d,status:"partial",endTime:i.toISOString(),duration:i.getTime()-new Date(d.startTime).getTime(),logs:[...d.logs,{timestamp:i.toLocaleTimeString([],{hour:"2-digit",minute:"2-digit",second:"2-digit"}),level:"WARNING",message:"Execution paused from the canvas"}]})),Ne({title:"Workflow paused",description:"Live updates disconnected. Resume to reconnect."})},[e,t,a,n,r,s])}function XL(e,t){const n=ZMe(e.id),r=js(e.data)?{...e.data}:{};delete r.icon,delete r.onOpenChat;const a=n==="startEnd"?e.id==="start-node"?"start":"end":typeof e.type=="string"&&e.type.length>0?e.type:typeof r.type=="string"&&r.type.length>0?r.type:"default",s=typeof e.name=="string"&&e.name.length>0?e.name:typeof r.label=="string"&&r.label.length>0?r.label:Oh,i=Mh(t.current),{id:l,label:d}=i(s),f=typeof e.description=="string"&&e.description.length>0?e.description:typeof r.description=="string"?r.description:"";return{nodeType:n,baseDataRest:r,semanticType:a,nodeId:l,label:d,description:f}}function ZL(e,t,n){return{id:e.nodeId,type:"stickyNote",position:t,style:OT,data:{...e.baseDataRest,label:e.label,description:e.description,type:e.semanticType,status:"idle",color:qT(e.baseDataRest.color)?e.baseDataRest.color:PT,content:FT(e.baseDataRest.content??oW),width:ou(e.baseDataRest.width,LT,$T),height:ou(e.baseDataRest.height,zT,IT),onUpdateStickyNote:n},draggable:!0,connectable:!1}}function QL(e,t,n){const r=typeof e.baseDataRest.iconKey=="string"?e.baseDataRest.iconKey:void 0,a=_T({iconKey:r,label:e.label,type:e.semanticType})??r,s=Rh(a)??e.baseDataRest.icon;return{id:e.nodeId,type:e.nodeType,position:t,style:OT,data:{...e.baseDataRest,label:e.label,description:e.description,type:e.semanticType,status:"idle",iconKey:a,icon:s,onOpenChat:e.nodeType==="chatTrigger"?()=>n(e.nodeId):void 0},draggable:!0}}function y4e({reactFlowWrapper:e,reactFlowInstance:t,nodesRef:n,setNodes:r,handleOpenChat:a,handleUpdateStickyNoteNode:s}){const i=N.useCallback(f=>{f.preventDefault(),f.dataTransfer.dropEffect="move"},[]),l=N.useCallback(f=>{if(!t.current)return;const h=XL(f,n);if(h.nodeType==="stickyNote"){const y={x:Math.random()*300+100,y:Math.random()*300+100},S=ZL(h,y,s);r(w=>[...w,S]);return}const p={x:Math.random()*300+100,y:Math.random()*300+100},g=QL(h,p,a);r(y=>[...y,g])},[a,s,n,t,r]),d=N.useCallback(f=>{if(f.preventDefault(),!e.current||!t.current)return;const h=e.current.getBoundingClientRect(),p=f.dataTransfer.getData("application/reactflow");if(p)try{const g=JSON.parse(p),y=t.current.project({x:f.clientX-h.left,y:f.clientY-h.top}),S=XL(g,n);if(S.nodeType==="stickyNote"){const b=ZL(S,y,s);r(x=>x.concat(b));return}const w=QL(S,y,a);r(b=>b.concat(w))}catch(g){console.error("Error adding new node:",g)}},[a,s,n,t,e,r]);return{onDragOver:i,onDrop:d,handleAddNode:l}}function v4e({nodesRef:e,deleteNodes:t,handleUndo:n,handleRedo:r,copySelectedNodes:a,cutSelectedNodes:s,pasteNodes:i,setIsSearchOpen:l,setSearchMatches:d,setCurrentSearchIndex:f}){N.useEffect(()=>{const h=typeof document<"u"?document:void 0;if(!h)return;const p=g=>{const y=g.target,S=!!y&&(y.tagName==="INPUT"||y.tagName==="TEXTAREA"||y.isContentEditable);if((g.key==="Delete"||g.key==="Backspace")&&!S){const b=e.current.filter(x=>x.selected).map(x=>x.id);if(b.length>0){g.preventDefault(),t(b);return}}if(!(g.ctrlKey||g.metaKey))return;const w=g.key.toLowerCase();if(!((w==="c"||w==="x"||w==="v")&&S)){if(w==="c"){g.preventDefault(),a();return}if(w==="x"){g.preventDefault(),s();return}if(w==="v"){g.preventDefault(),i();return}if(w==="f"){g.preventDefault(),l(!0),d([]),f(0);return}if(w==="z"){g.preventDefault(),g.shiftKey?r():n();return}w==="y"&&(g.preventDefault(),r())}};return h.addEventListener("keydown",p),()=>h.removeEventListener("keydown",p)},[e,t,r,n,a,s,i,f,l,d])}function x4e({nodesRef:e,edgesRef:t,isRestoringRef:n,recordSnapshot:r,setNodesState:a,setEdgesState:s,setValidationErrors:i,setSearchMatches:l,setActiveChatNodeId:d,setChatTitle:f,setSelectedNodeId:h,setNodeRuntimeCache:p,handleOpenChat:g,activeChatNodeId:y}){const S=N.useCallback(()=>{h(null)},[h]),w=N.useCallback((x,_)=>{p(j=>({...j,[x]:_}))},[p]),b=N.useCallback((x,_)=>{var V,P;const j=e.current,C=t.current,T=j.find(K=>K.id===x);if(!T)return;const A=_.label!==void 0?_.label:(V=T.data)==null?void 0:V.label,k=_0(A),O=Mh(j,{excludeId:x}),{id:M,label:z}=O(k),L=_.status||((P=T.data)==null?void 0:P.status)||"idle",U={...T.data,..._,label:z,status:L};T.type==="chatTrigger"&&(U.onOpenChat=()=>g(M));const F=j.map(K=>K.id===x?{...K,id:M,data:U}:K),q=C.map(K=>{let H=!1;const Z={...K};return K.source===x&&(Z.source=M,H=!0),K.target===x&&(Z.target=M,H=!0),H?Z:K});n.current=!0,r({force:!0});try{a(F),s(q)}finally{n.current=!1}i(K=>K.map(H=>{let Z=!1;const J={...H};return H.nodeId===x&&(J.nodeId=M,Z=!0),H.sourceId===x&&(J.sourceId=M,Z=!0),H.targetId===x&&(J.targetId=M,Z=!0),Z?J:H})),l(K=>K.map(H=>H===x?M:H)),d(K=>K===x?M:K),f(K=>y===x?z:K),k!==z&&Ne({title:"Adjusted node name",description:`Renamed to "${z}" to keep names unique.`}),h(null)},[y,g,n,e,t,r,a,s,i,l,d,f,h]);return{handleCloseNodeInspector:S,handleCacheNodeRuntime:w,handleNodeUpdate:b}}function b4e({setNodes:e,setExecutions:t,setActiveExecutionId:n,activeExecutionId:r,executions:a,determineLogLevel:s,describePayload:i,setActiveTab:l}){const d=N.useCallback(g=>{const y=g.nodes.map(S=>({id:S.id,type:S.type||"default",position:S.position,data:{type:S.type||"default",label:S.name,status:S.status||"idle",details:S.details},draggable:!0}));e(y),n(g.id),l("trace")},[n,l,e]),f=N.useCallback(g=>{d(g),Ne({title:"Execution copied to canvas",description:`Run ${g.runId} was loaded into the editor.`})},[d]),h=N.useCallback(g=>{t(y=>y.filter(S=>S.id!==g.id)),r===g.id&&n(null),Ne({title:"Execution removed",description:`Run ${g.runId} was removed from the history view.`})},[r,n,t]),p=N.useCallback(async()=>{var S;if(typeof fetch>"u"){Ne({title:"Refresh unavailable",description:"The Fetch API is not available in this environment.",variant:"destructive"});return}const g=r&&a.find(w=>w.id===r)||a[0];if(!g){Ne({title:"No executions to refresh",description:"Run a workflow to create live execution history."});return}const y=gn(`/api/executions/${g.id}/history`);try{const w=await fetch(y);if(!w.ok){const j=await w.text();throw new Error(j||`Request failed with status ${w.status}`)}const b=await w.json(),x=((S=g.metadata)==null?void 0:S.graphToCanvas)??{},_=b.steps.map(j=>({timestamp:new Date(j.at).toLocaleTimeString([],{hour:"2-digit",minute:"2-digit",second:"2-digit"}),level:s(j.payload),message:i(j.payload,x)}));t(j=>j.map(C=>{if(C.id!==b.execution_id)return C;const T=iW(b.status)??C.status,A=b.completed_at??C.endTime;return{...C,status:T,logs:_,endTime:A??void 0,duration:A?new Date(A).getTime()-new Date(b.started_at).getTime():C.duration}})),Ne({title:"Execution history refreshed",description:`Loaded ${b.steps.length} streamed updates.`})}catch(w){Ne({title:"Failed to refresh execution history",description:w instanceof Error?w.message:"Unknown error occurred",variant:"destructive"})}},[r,i,s,a,t]);return{handleViewExecutionDetails:d,handleCopyExecutionToEditor:f,handleDeleteExecution:h,handleRefreshExecutionHistory:p}}const w4e={OK:"STATUS_CODE_OK",ERROR:"STATUS_CODE_ERROR",UNSET:"STATUS_CODE_UNSET"},S4e=BigInt(1e6),FC=e=>{if(!e)return"0";const t=Date.parse(e);return Number.isNaN(t)?"0":(BigInt(t)*S4e).toString()},_4e=e=>typeof e=="string"?{stringValue:e}:typeof e=="number"&&Number.isFinite(e)?{intValue:String(e)}:typeof e=="boolean"?{boolValue:e}:e==null?{stringValue:""}:typeof e=="object"?{stringValue:JSON.stringify(e)}:{stringValue:String(e)},lW=e=>Object.entries(e).map(([t,n])=>({key:t,value:_4e(n)})),N4e=e=>{if(e!=null&&e.length)return e.map(t=>({name:t.name,timeUnixNano:FC(t.time),attributes:t.attributes?lW(t.attributes):void 0}))},j4e=e=>{var f,h,p,g,y,S;const t=(f=e.attributes)==null?void 0:f["orcheo.artifact.ids"],r={artifacts:Array.isArray(t)?t.map(w=>({id:String(w)})).filter(w=>w.id.trim().length>0):[]},a=(h=e.attributes)==null?void 0:h["orcheo.node.id"];a&&(r.nodeId=String(a));const s=(p=e.attributes)==null?void 0:p["orcheo.node.kind"];s&&(r.nodeKind=String(s));const i=(g=e.attributes)==null?void 0:g["orcheo.node.status"];i&&(r.nodeStatus=String(i));const l=(y=e.attributes)==null?void 0:y["orcheo.token.input"],d=(S=e.attributes)==null?void 0:S["orcheo.token.output"];return typeof l=="number"&&Number.isFinite(l)&&(r.tokenInput=l),typeof d=="number"&&Number.isFinite(d)&&(r.tokenOutput=d),r},C4e=(e,t)=>({...e,...t}),E4e=(e,t)=>{if(!(e!=null&&e.length))return t==null?void 0:t.slice();if(!(t!=null&&t.length))return e;const n=[...e],r=new Set(n.map(a=>JSON.stringify(a)));for(const a of t){const s=JSON.stringify(a);r.has(s)||(n.push(a),r.add(s))}return n},T4e=(e,t)=>e?{span_id:t.span_id||e.span_id,parent_span_id:t.parent_span_id!==void 0?t.parent_span_id:e.parent_span_id,name:t.name??e.name,start_time:t.start_time??e.start_time,end_time:t.end_time??e.end_time,attributes:t.attributes?C4e(e.attributes,t.attributes):e.attributes,events:E4e(e.events,t.events),status:t.status??e.status,links:t.links??e.links}:{...t,attributes:{...t.attributes}},qd=e=>({executionId:e,traceId:null,metadata:void 0,spansById:{},spanMetadata:{},status:"idle",error:void 0,isComplete:!1,lastUpdatedAt:void 0}),cW=(e,t)=>{const n=T4e(e.spansById[t.span_id],t);return{...e,spansById:{...e.spansById,[n.span_id]:n},spanMetadata:{...e.spanMetadata,[n.span_id]:j4e(n)},lastUpdatedAt:new Date().toISOString()}},A4e=(e,t)=>{let n={...e,status:"ready",metadata:t.execution,traceId:t.execution.trace_id??e.traceId,error:void 0,isComplete:e.isComplete||!!t.execution.finished_at||t.page_info.has_next_page===!1};for(const r of t.spans)n=cW(n,r);return n},R4e=(e,t)=>{let n={...e,traceId:t.trace_id,lastUpdatedAt:new Date().toISOString()};for(const r of t.spans)n=cW(n,r);return t.complete&&(n={...n,isComplete:!0}),n},k4e=(e,t)=>{var n,r;return{traceId:e,spanId:t.span_id,parentSpanId:t.parent_span_id??void 0,name:t.name??"span",kind:"SPAN_KIND_INTERNAL",startTimeUnixNano:FC(t.start_time),endTimeUnixNano:FC(t.end_time??t.start_time),attributes:lW(t.attributes??{}),status:{code:w4e[((n=t.status)==null?void 0:n.code)??"UNSET"],message:((r=t.status)==null?void 0:r.message)??void 0},flags:0,events:N4e(t.events),links:void 0}},O4e=(e,t)=>{var i,l,d,f,h,p,g,y;const n=(i=e.metadata)!=null&&i.started_at?Date.parse(e.metadata.started_at):void 0,r=(l=e.metadata)!=null&&l.finished_at?Date.parse(e.metadata.finished_at):void 0,a=n&&r?Math.max(r-n,0):0,s=(((f=(d=e.metadata)==null?void 0:d.token_usage)==null?void 0:f.input)??0)+(((p=(h=e.metadata)==null?void 0:h.token_usage)==null?void 0:p.output)??0);return{id:e.executionId,name:((g=e.metadata)==null?void 0:g.trace_id)??e.executionId,spansCount:t.length,durationMs:a,agentDescription:((y=e.metadata)==null?void 0:y.status)??"unknown",totalTokens:s,startTime:n}},uW=(e,t,n)=>{var a;const r=t[e.id];return r&&(e.metadata={...r,artifacts:r.artifacts.map(s=>{if(!n)return{id:s.id};try{return{id:s.id,downloadUrl:n(s.id)}}catch{return{id:s.id}}})}),(a=e.children)!=null&&a.length&&(e.children=e.children.map(s=>uW(s,t,n))),e},dW=e=>{var t;return(t=e.children)!=null&&t.length&&(e.children=e.children.map(n=>dW(n)).sort((n,r)=>n.startTime.getTime()-r.startTime.getTime())),e},fW=(e,t={})=>{var g,y,S,w,b,x;const n=e.traceId??((g=e.metadata)==null?void 0:g.trace_id);if(!n)return;const r=Object.values(e.spansById);if(r.length===0)return;const a={resourceSpans:[{resource:{attributes:[]},scopeSpans:[{scope:{name:"orcheo.trace"},spans:r.map(_=>k4e(n,_))}]}]},i=GRe.convertRawDocumentsToSpans(a).map(_=>uW(_,e.spanMetadata,t.resolveArtifactUrl)).map(_=>dW(_)),l=NT(i),d=O4e(e,l),f=[];(y=e.metadata)!=null&&y.status&&f.push({label:`Status: ${e.metadata.status}`});const h=((w=(S=e.metadata)==null?void 0:S.token_usage)==null?void 0:w.input)??0,p=((x=(b=e.metadata)==null?void 0:b.token_usage)==null?void 0:x.output)??0;return(h||p)&&f.push({label:`Tokens in/out: ${h}/${p}`}),e.isComplete||f.push({label:"Live",className:"bg-agentprism-warning text-agentprism-warning-muted-foreground"}),{traceRecord:d,spans:i,badges:f}},M4e=e=>(e==null?void 0:e.status)??"idle",D4e=e=>e==null?void 0:e.error,hW=e=>{var r,a,s,i;const t=Object.keys(e.spansById).length,n=(((a=(r=e.metadata)==null?void 0:r.token_usage)==null?void 0:a.input)??0)+(((i=(s=e.metadata)==null?void 0:s.token_usage)==null?void 0:i.output)??0);return{spanCount:t,totalTokens:n}},P4e=e=>({...e,status:"loading",error:void 0}),$4e=(e,t={})=>Object.values(e).map(n=>fW(n,t)).filter(n=>!!n).sort((n,r)=>{const a=n.traceRecord.startTime??0;return(r.traceRecord.startTime??0)-a}),JL=2,I4e=300,L4e=(e,t)=>gn(`/api/executions/${t}/trace`,e),z4e=e=>t=>{const n=typeof t=="string"?t.trim():"";if(!n)throw new Error("Invalid artifact identifier provided.");return gn(`/api/artifacts/${encodeURIComponent(n)}/download`,e)},q4e=e=>new Promise(t=>{setTimeout(t,e)});class uf extends Error{constructor(t,n){super(t),this.status=n,this.name="TraceRequestError"}}const F4e=async(e,t)=>{const n=(await e.text()).trim(),r=`${e.status} ${e.statusText}`.trim(),a=`Trace fetch for execution ${t} failed (${r})`,s=n?`${a}: ${n}`:a;return new uf(s,e.status)},U4e=(e,t)=>e instanceof uf?e:e instanceof Error?new uf(`Network error while fetching trace for execution ${t}: ${e.message}`):new uf(`Unknown error while fetching trace for execution ${t}.`),H4e=e=>e.message;function B4e({backendBaseUrl:e,activeExecutionId:t,isMountedRef:n,executionIds:r}){const[a,s]=N.useState({}),i=N.useRef(new Set),l=N.useRef(new Set),d=N.useMemo(()=>z4e(e),[e]),f=N.useCallback(async b=>{const x=b??t;if(x&&!i.current.has(x)){i.current.add(x),s(_=>({..._,[x]:P4e(_[x]??qd(x))}));try{let _,j=!1;for(let T=0;T<=JL;T+=1)try{const A=await fetch(L4e(e,x));if(!A.ok)throw await F4e(A,x);const k=await A.json();if(!n.current)return;s(O=>{const M=O[x]??qd(x),z=A4e(M,k);return{...O,[x]:z}}),j=!0,_=void 0;break}catch(A){_=U4e(A,x),T<JL&&await q4e(I4e*(T+1))}if(j||!n.current)return;const C=H4e(_??new uf(`Unknown error while fetching trace for execution ${x}.`));Ne({title:"Trace fetch failed",description:C,variant:"destructive"}),s(T=>{const A=T[x]??qd(x);return{...T,[x]:{...A,status:"error",error:C}}})}finally{i.current.delete(x)}}},[t,e,n]),h=N.useCallback(b=>{s(x=>{const _=x[b.execution_id]??qd(b.execution_id),j=R4e(_,b);return{...x,[b.execution_id]:j}})},[]);N.useEffect(()=>{if(r!=null&&r.length){s(b=>{let x;for(const _ of r)b[_]||(x||(x={...b}),x[_]=qd(_));return x??b});for(const b of r)l.current.has(b)||(l.current.add(b),f(b))}},[r,f]),N.useEffect(()=>{if(!t)return;const b=a[t];(!b||b.status==="idle"||b.status==="error")&&f(t)},[t,f,a]);const p=t?a[t]:void 0,g=N.useMemo(()=>{if(p)return fW(p,{resolveArtifactUrl:d})},[p,d]),y=N.useMemo(()=>$4e(a,{resolveArtifactUrl:d}),[a,d]),S=M4e(p),w=D4e(p);return N.useEffect(()=>{p&&p.status==="ready"&&!p.isComplete&&hW(p).spanCount===0&&!i.current.size&&f(p.executionId)},[p,f]),{traces:a,activeTrace:p,activeTraceViewer:g,viewerData:y,status:S,error:w,refresh:f,handleTraceUpdate:h}}const V4e={nodes:[{id:"draft-ready",type:"trigger",position:{x:0,y:0},data:{type:"trigger",label:"Draft ready for review",description:"Start QA once an AI draft is submitted.",status:"idle"}},{id:"score-quality",type:"ai",position:{x:260,y:0},data:{type:"ai",label:"Score quality",description:"Use AI rubric to score voice, tone, and accuracy.",status:"idle"}},{id:"collect-feedback",type:"function",position:{x:520,y:-120},data:{type:"function",label:"Collect revisions",description:"Request edits from stakeholders when needed.",status:"idle"}},{id:"schedule-publish",type:"api",position:{x:520,y:120},data:{type:"api",label:"Schedule publish",description:"Queue approved content in the CMS calendar.",status:"idle"}},{id:"final-approval",type:"function",position:{x:780,y:0},data:{type:"function",label:"Finalize and log",description:"Capture QA notes and mark the run complete.",status:"idle"}}],edges:[{id:"edge-draft-score",source:"draft-ready",target:"score-quality"},{id:"edge-score-feedback",source:"score-quality",target:"collect-feedback"},{id:"edge-score-schedule",source:"score-quality",target:"schedule-publish"},{id:"edge-feedback-final",source:"collect-feedback",target:"final-approval"},{id:"edge-schedule-final",source:"schedule-publish",target:"final-approval"}]},W4e={nodes:[{id:"capture-intake",type:"trigger",position:{x:0,y:0},data:{type:"trigger",label:"Capture intake request",description:"Webhook triggered when a signup is submitted.",status:"idle"}},{id:"enrich-profile",type:"function",position:{x:260,y:0},data:{type:"function",label:"Enrich CRM profile",description:"Collect firmographic data for the new customer.",status:"idle"}},{id:"provision-access",type:"api",position:{x:520,y:0},data:{type:"api",label:"Provision access",description:"Create accounts across internal and SaaS tools.",status:"idle"}},{id:"send-welcome",type:"api",position:{x:780,y:0},data:{type:"api",label:"Send welcome sequence",description:"Kick off emails, docs, and success team handoff.",status:"idle"}}],edges:[{id:"edge-capture-enrich",source:"capture-intake",target:"enrich-profile"},{id:"edge-enrich-provision",source:"enrich-profile",target:"provision-access"},{id:"edge-provision-welcome",source:"provision-access",target:"send-welcome"}]},G4e={nodes:[{id:"incident-raised",type:"trigger",position:{x:0,y:0},data:{type:"trigger",label:"PagerDuty incident raised",description:"Triggered when a Sev1 alert fires.",status:"idle"}},{id:"triage-severity",type:"function",position:{x:260,y:0},data:{type:"function",label:"Triage severity",description:"Evaluate runbooks and required responders.",status:"idle"}},{id:"notify-oncall",type:"api",position:{x:520,y:-120},data:{type:"api",label:"Notify on-call",description:"Post critical details into the on-call channel.",status:"idle"}},{id:"escalate-leads",type:"api",position:{x:520,y:120},data:{type:"api",label:"Escalate to leads",description:"Escalate if no acknowledgement within SLA.",status:"idle"}},{id:"update-status",type:"function",position:{x:780,y:0},data:{type:"function",label:"Update status page",description:"Publish current impact for stakeholders.",status:"idle"}}],edges:[{id:"edge-raised-triage",source:"incident-raised",target:"triage-severity"},{id:"edge-triage-notify",source:"triage-severity",target:"notify-oncall"},{id:"edge-triage-escalate",source:"triage-severity",target:"escalate-leads"},{id:"edge-notify-update",source:"notify-oncall",target:"update-status"},{id:"edge-escalate-update",source:"escalate-leads",target:"update-status"}]},K4e={"subflow-customer-onboarding":W4e,"subflow-incident-response":G4e,"subflow-content-qa":V4e},Y4e=({getSelectedNodes:e,setSubworkflows:t})=>()=>{const n=e(),r=new Date().toISOString(),a=Array.from(new Set(n.map(i=>typeof i.data.type=="string"?i.data.type:"workflow").filter(Boolean))).slice(0,4),s={id:Eu("subflow"),name:n.length>0?`${n.length}-step sub-workflow`:"Draft sub-workflow",description:n.length>0?"Captured the selected nodes so the pattern can be reused across projects.":"Start from an empty template and drag nodes into the canvas to define the steps.",tags:a.length>0?a:["workflow"],version:"0.1.0",status:"beta",usageCount:0,lastUpdated:r};t(i=>[s,...i]),Ne({title:"Sub-workflow draft created",description:"Find it in the Readiness tab to document, version, and share with your team."})},X4e=({setSubworkflows:e})=>t=>{e(n=>n.filter(r=>r.id!==t)),Ne({title:"Sub-workflow removed",description:"It will remain available in version history for audit purposes."})},Z4e=({nodesRef:e,setNodes:t,setEdges:n,setSubworkflows:r,convertPersistedNodesToCanvas:a,convertPersistedEdgesToCanvas:s,setSelectedNodeId:i,setActiveTab:l,reactFlowInstance:d})=>f=>{const h=K4e[f.id];if(!h){Ne({title:"Template unavailable",description:"This sub-workflow doesn't have a canvas definition yet. Please try another template.",variant:"destructive"});return}const p=h.nodes.map(z=>{var L;return((L=z.position)==null?void 0:L.x)??0}),g=h.nodes.map(z=>{var L;return((L=z.position)==null?void 0:L.y)??0}),y=p.length>0?Math.min(...p):0,S=g.length>0?Math.min(...g):0,w=e.current,b=w.length?Math.max(...w.map(z=>{var L;return((L=z.position)==null?void 0:L.x)??0})):0,x=w.length?Math.min(...w.map(z=>{var L;return((L=z.position)==null?void 0:L.y)??0})):0,_=w.length>0?b+320:200,j=w.length>0?x:200,C=new Map,T=Mh(e.current),A=h.nodes.map(z=>{var q,V,P,K,H;const L=typeof((q=z.data)==null?void 0:q.label)=="string"&&z.data.label.length>0?z.data.label:typeof((V=z.data)==null?void 0:V.type)=="string"&&z.data.type.length>0?`${z.data.type} Node`:Oh,{id:U,label:F}=T(L);return C.set(z.id,U),{...z,id:U,position:{x:_+((((P=z.position)==null?void 0:P.x)??0)-y),y:j+((((K=z.position)==null?void 0:K.y)??0)-S)},data:{...z.data,type:((H=z.data)==null?void 0:H.type)??z.type??"default",status:"idle",label:F}}}),k=h.edges.map(z=>({...z,id:Eu("edge"),source:C.get(z.source)??z.source,target:C.get(z.target)??z.target})),O=a(A),M=s(k);if(t(z=>[...z,...O]),n(z=>[...z,...M]),r(z=>z.map(L=>L.id===f.id?{...L,usageCount:L.usageCount+1,lastUpdated:new Date().toISOString()}:L)),O.length>0){i(O[0].id),l("canvas");const z=d.current;if(z){const L=O.map(Z=>Z.position.x),U=O.map(Z=>Z.position.y),F=Math.min(...L),q=Math.max(...L),V=Math.min(...U),P=Math.max(...U),K=F+(q-F)/2,H=V+(P-V)/2;z.setCenter(K,H,{zoom:1.15,duration:400})}}Ne({title:`${f.name} inserted`,description:`Added ${O.length} nodes and ${M.length} connections to the canvas.`})},Q4e=({getNodes:e,getEdges:t,setValidationErrors:n,setIsValidating:r,setLastValidationRun:a})=>()=>{r(!0),window.setTimeout(()=>{const s=e(),i=t(),l=s.map(y=>({...y,data:{...y.data,label:typeof y.data.label=="string"?y.data.label:y.data.label??y.data.name??y.id,credentials:y.data.credentials??null}})),d=[],f=i.map(y=>{const S=RAe({source:y.source,target:y.target,sourceHandle:y.sourceHandle??null,targetHandle:y.targetHandle??null},l,d);return d.push(y),S}).filter(y=>!!y),h=l.map(y=>kAe(y)).filter(y=>!!y),p=[...f,...h];s.length===0&&p.push({id:Eu("validation"),type:"node",message:"Add at least one node before publishing the workflow."}),n(p),r(!1);const g=new Date().toISOString();a(g),Ne({title:p.length===0?"Workflow passed all validation checks":`Validation found ${p.length} issue${p.length===1?"":"s"}`,description:p.length===0?"You can proceed to publish once final reviews are complete.":"Resolve the flagged items from the Readiness tab or directly on the canvas."})},250)},J4e=({setValidationErrors:e})=>t=>{e(n=>n.filter(r=>r.id!==t))},eDe=({getNodes:e,setActiveTab:t,setSelectedNodeId:n,reactFlowInstance:r})=>a=>{t("canvas");const s=e();if(a.nodeId){const i=s.find(l=>l.id===a.nodeId);i&&(n(i.id),requestAnimationFrame(()=>{var l;(l=r.current)==null||l.setCenter(i.position.x+(i.width??0)/2,i.position.y+(i.height??0)/2,{zoom:1.15,duration:400})}));return}a.sourceId&&a.targetId&&Ne({title:"Review the highlighted connection",description:`${a.sourceId} → ${a.targetId} needs to be updated before publishing.`})};function tDe(e,t){const n=d4e({resolveNodeLabel:e.nodeState.resolveNodeLabel,setExecutions:e.execution.setExecutions,setNodes:e.history.setNodes,setIsRunning:e.execution.setIsRunning,websocketRef:e.websocketRef,isMountedRef:e.isMountedRef}),r=N.useMemo(()=>e.execution.executions.map(_=>_.id),[e.execution.executions]),a=B4e({backendBaseUrl:e.chat.backendBaseUrl??ni(),activeExecutionId:e.execution.activeExecutionId,isMountedRef:e.isMountedRef,executionIds:r}),s=m4e({nodes:e.history.nodes,edges:e.history.edges,setNodes:e.history.setNodes,setExecutions:e.execution.setExecutions,setActiveExecutionId:e.execution.setActiveExecutionId,setIsRunning:e.execution.setIsRunning,websocketRef:e.websocketRef,isMountedRef:e.isMountedRef,currentWorkflowId:e.metadata.currentWorkflowId,applyExecutionUpdate:n.applyExecutionUpdate,handleTraceUpdate:a.handleTraceUpdate}),i=g4e({activeExecutionId:e.execution.activeExecutionId,isRunning:e.execution.isRunning,setIsRunning:e.execution.setIsRunning,setNodes:e.history.setNodes,setExecutions:e.execution.setExecutions,websocketRef:e.websocketRef}),l=y4e({reactFlowWrapper:e.reactFlowWrapper,reactFlowInstance:e.reactFlowInstance,nodesRef:e.history.nodesRef,setNodes:e.history.setNodes,handleOpenChat:e.chat.handleOpenChat,handleUpdateStickyNoteNode:e.nodeState.handleUpdateStickyNoteNode});v4e({nodesRef:e.history.nodesRef,deleteNodes:e.nodeState.deleteNodes,handleUndo:e.history.handleUndo,handleRedo:e.history.handleRedo,copySelectedNodes:t.clipboard.copySelectedNodes,cutSelectedNodes:t.clipboard.cutSelectedNodes,pasteNodes:t.clipboard.pasteNodes,setIsSearchOpen:e.search.setIsSearchOpen,setSearchMatches:e.search.setSearchMatches,setCurrentSearchIndex:e.search.setCurrentSearchIndex});const d=x4e({nodesRef:e.history.nodesRef,edgesRef:e.history.edgesRef,isRestoringRef:e.history.isRestoringRef,recordSnapshot:e.history.recordSnapshot,setNodesState:e.history.setNodesState,setEdgesState:e.history.setEdgesState,setValidationErrors:e.validation.setValidationErrors,setSearchMatches:e.search.setSearchMatches,setActiveChatNodeId:e.chat.setActiveChatNodeId,setChatTitle:e.chat.setChatTitle,setSelectedNodeId:e.ui.setSelectedNodeId,setNodeRuntimeCache:e.setNodeRuntimeCache,handleOpenChat:e.chat.handleOpenChat,activeChatNodeId:e.chat.activeChatNodeId}),f=b4e({setNodes:e.history.setNodes,setExecutions:e.execution.setExecutions,setActiveExecutionId:e.execution.setActiveExecutionId,activeExecutionId:e.execution.activeExecutionId,executions:e.execution.executions,determineLogLevel:n.determineLogLevel,describePayload:n.describePayload,setActiveTab:e.ui.setActiveTab}),h=N.useMemo(()=>Y4e({getSelectedNodes:()=>e.history.nodesRef.current.filter(_=>_.selected),setSubworkflows:e.subworkflowState.setSubworkflows}),[e.history.nodesRef,e.subworkflowState.setSubworkflows]),p=N.useMemo(()=>X4e({setSubworkflows:e.subworkflowState.setSubworkflows}),[e.subworkflowState.setSubworkflows]),g=N.useMemo(()=>Z4e({nodesRef:e.history.nodesRef,setNodes:e.history.setNodes,setEdges:e.history.setEdges,setSubworkflows:e.subworkflowState.setSubworkflows,convertPersistedNodesToCanvas:e.convertPersistedNodesToCanvas,convertPersistedEdgesToCanvas:cf,setSelectedNodeId:e.ui.setSelectedNodeId,setActiveTab:e.ui.setActiveTab,reactFlowInstance:e.reactFlowInstance}),[e.convertPersistedNodesToCanvas,e.history.nodesRef,e.history.setEdges,e.history.setNodes,e.reactFlowInstance,e.subworkflowState.setSubworkflows,e.ui]),y=N.useMemo(()=>Q4e({getNodes:()=>e.history.nodesRef.current,getEdges:()=>e.history.edgesRef.current,setValidationErrors:e.validation.setValidationErrors,setIsValidating:e.validation.setIsValidating,setLastValidationRun:e.validation.setLastValidationRun}),[e.history.edgesRef,e.history.nodesRef,e.validation]),S=N.useMemo(()=>J4e({setValidationErrors:e.validation.setValidationErrors}),[e.validation.setValidationErrors]),w=N.useMemo(()=>eDe({getNodes:()=>e.history.nodesRef.current,setActiveTab:e.ui.setActiveTab,setSelectedNodeId:e.ui.setSelectedNodeId,reactFlowInstance:e.reactFlowInstance}),[e.history.nodesRef,e.reactFlowInstance,e.ui]);return{executionUpdates:n,handleRunWorkflow:s,handlePauseWorkflow:i,nodeCreation:l,inspectorHandlers:d,executionHistoryHandlers:f,trace:a,runPublishValidation:y,handleDismissValidation:S,handleFixValidation:w,handleCreateSubworkflow:h,handleDeleteSubworkflow:p,handleInsertSubworkflow:g,handleConnect:_=>{const j=`edge-${_.source}-${_.target}`;e.history.edges.some(T=>T.source===_.source&&T.target===_.target)||e.history.setEdges(T=>BH({..._,id:j,animated:!1,type:"default",markerEnd:{type:Wo.ArrowClosed,width:12,height:12},style:{stroke:"#99a1b3",strokeWidth:2}},T))},edgeHoverHandlers:{onEnter:(_,j)=>e.ui.setHoveredEdgeId(j.id),onLeave:(_,j)=>{var T;const C=_.relatedTarget;(T=C==null?void 0:C.closest)!=null&&T.call(C,`[data-edge-id="${j.id}"]`)||e.ui.setHoveredEdgeId(A=>A===j.id?null:A)}}}}const nDe=e=>{switch(e.toLowerCase()){case"completed":case"success":return"success";case"error":case"failed":return"failed";case"cancelled":case"partial":return"partial";case"running":default:return"running"}},rDe=e=>{switch(e){case"running":return"running";case"failed":return"error";case"partial":return"warning";case"success":default:return"success"}},aDe=e=>{const t=e.level??e.log_level;if(typeof t=="string"){const r=t.trim().toLowerCase();if(r==="debug")return"DEBUG";if(r==="error")return"ERROR";if(r==="warning"||r==="warn")return"WARNING"}if(typeof e.error=="string"&&e.error.trim())return"ERROR";const n=typeof e.status=="string"?e.status.toLowerCase():null;return n==="error"||n==="failed"?"ERROR":n==="warning"||n==="cancelled"||n==="partial"?"WARNING":n==="debug"?"DEBUG":"INFO"},sDe=(e,t)=>{var n;return((n=t.get(e))==null?void 0:n.name)??e},oDe=(e,t,n)=>{if(typeof e.error=="string"&&e.error.trim())return`Run error: ${e.error.trim()}`;if(typeof e.message=="string"&&e.message.trim())return e.message.trim();const r=["node","step","name"].find(s=>typeof e[s]=="string"&&e[s]),a=typeof e.status=="string"?e.status.toLowerCase():void 0;if(r){const s=String(e[r]),i=t[s]??s,l=sDe(i,n);return a?`Node ${l} ${a}`:`Node ${l} emitted an update`}if(a)return`Run status changed to ${a}`;try{return JSON.stringify(e)}catch{return String(e)}},iDe=e=>new Date(e).toLocaleTimeString([],{hour:"2-digit",minute:"2-digit",second:"2-digit"}),lDe=(e,t)=>{const n=e.filter(r=>r.level!=="INFO"&&r.level!=="DEBUG").length;return t?n+1:n},cDe=(e,t)=>{const n=rDe(t);return e.map(r=>{var a,s;return{id:r.id,type:r.type,name:typeof((a=r.data)==null?void 0:a.label)=="string"&&r.data.label.trim()?r.data.label:r.id,position:{...r.position},status:n,iconKey:typeof((s=r.data)==null?void 0:s.iconKey)=="string"?r.data.iconKey:void 0,details:r.data?{...r.data}:void 0}})},uDe=e=>e.map(t=>({id:t.id??`${t.source}-${t.target}`,source:t.source,target:t.target})),dDe=(e,t)=>{const n=e.inputs??{},r=n.metadata??n.canvas??{},a=r==null?void 0:r.workflow_version_id;if(typeof a=="string"&&a)return t.versions.get(a)},fDe=(e,t)=>{const n=nDe(e.status),r=dDe(e,t),a=(r==null?void 0:r.snapshot.nodes)??t.defaultNodes,s=(r==null?void 0:r.snapshot.edges)??t.defaultEdges,i=(r==null?void 0:r.graphToCanvas)??t.defaultMapping,l=cDe(a,n),d=new Map(l.map(b=>[b.id,b])),f=uDe(s),h=e.steps.map(b=>({timestamp:iDe(b.at),level:aDe(b.payload),message:oDe(b.payload,i,d)})),p=e.started_at,g=e.completed_at??void 0,y=new Date(p).getTime(),S=g?new Date(g).getTime():Date.now(),w=Number.isFinite(y)?Math.max(0,S-y):0;return{id:e.execution_id,runId:e.execution_id,status:n,startTime:p,endTime:g,duration:w,issues:lDe(h,e.error??void 0),nodes:l,edges:f,logs:h,metadata:{graphToCanvas:i}}},hDe=async(e,t={})=>{var f,h;if(!e)return[];if(typeof fetch>"u")throw new Error("Fetch API is not available in this environment.");const n=t.limit??50,r=gn(`/api/workflows/${e}/executions?limit=${encodeURIComponent(String(n))}`,t.backendBaseUrl),a=await fetch(r);if(!a.ok){const p=await a.text();throw new Error(p||`Failed to load execution history (${a.status})`)}const s=await a.json(),i=t.workflow,l={defaultNodes:(i==null?void 0:i.nodes)??[],defaultEdges:(i==null?void 0:i.edges)??[],defaultMapping:((h=(f=i==null?void 0:i.versions)==null?void 0:f.at(-1))==null?void 0:h.graphToCanvas)??{},versions:new Map(((i==null?void 0:i.versions)??[]).map(p=>[p.id,p]))};return s.map(p=>fDe(p,l)).sort((p,g)=>new Date(g.startTime).getTime()-new Date(p.startTime).getTime())};function pDe({workflowId:e,setCurrentWorkflowId:t,setWorkflowName:n,setWorkflowDescription:r,setWorkflowTags:a,setWorkflowVersions:s,setExecutions:i,setActiveExecutionId:l,convertPersistedNodesToCanvas:d,convertPersistedEdgesToCanvas:f,applySnapshot:h}){N.useEffect(()=>{let p=!0;const g=()=>{t(null),n("New Workflow"),r(""),a(["draft"]),s([]),i([]),l(null),h({nodes:[],edges:[]},{resetHistory:!0})};return(async()=>{var w;if(!e)return;try{const b=await gv(e);if(b&&p){t(b.id),n(b.name),r(b.description??""),a(b.tags??["draft"]),s(b.versions??[]);const x=d(b.nodes??[]),_=f(b.edges??[]);h({nodes:x,edges:_},{resetHistory:!0});try{const j=await hDe(e,{workflow:b});p&&(i(j),l(((w=j[0])==null?void 0:w.id)??null))}catch(j){p&&(i([]),l(null),Ne({title:"Failed to load execution history",description:j instanceof Error?j.message:"Unable to retrieve workflow runs.",variant:"destructive"})),console.error("Failed to load workflow executions",j)}return}}catch(b){p&&(Ne({title:"Failed to load workflow",description:b instanceof Error?b.message:"Unknown error occurred",variant:"destructive"}),i([]),l(null))}if(!p)return;const S=fv.find(b=>b.id===e);if(S){t(null),n(S.name),r(S.description??""),a(S.tags.filter(_=>_!=="template")),s([]),i([]),l(null);const b=d(S.nodes),x=f(S.edges);h({nodes:b,edges:x},{resetHistory:!0}),Ne({title:"Template loaded",description:"Save to add this workflow to your workspace."});return}Ne({title:"Workflow not found",description:"Starting a new workflow instead.",variant:"destructive"}),g()})(),()=>{p=!1}},[h,f,d,t,i,l,r,n,a,s,e])}function mDe({currentWorkflowId:e,setWorkflowVersions:t,setWorkflowTags:n}){N.useEffect(()=>{if(!e)return;const r=typeof window<"u"?window:void 0;if(!r)return;const a=async()=>{try{const s=await gv(e);s&&(t(s.versions??[]),n(s.tags??["draft"]))}catch(s){console.error("Failed to reload workflow",s)}};return r.addEventListener(vf,a),()=>{r.removeEventListener(vf,a)}},[e,n,t])}function gDe(e){N.useEffect(()=>{const t=window.setTimeout(()=>{e.current&&e.current.fitView({padding:.2})},100);return()=>{window.clearTimeout(t)}},[e])}function yDe(e,t){pDe({workflowId:t,setCurrentWorkflowId:e.metadata.setCurrentWorkflowId,setWorkflowName:e.metadata.setWorkflowName,setWorkflowDescription:e.metadata.setWorkflowDescription,setWorkflowTags:e.metadata.setWorkflowTags,setWorkflowVersions:e.metadata.setWorkflowVersions,setExecutions:e.execution.setExecutions,setActiveExecutionId:e.execution.setActiveExecutionId,convertPersistedNodesToCanvas:e.convertPersistedNodesToCanvas,convertPersistedEdgesToCanvas:cf,applySnapshot:e.history.applySnapshot}),mDe({currentWorkflowId:e.metadata.currentWorkflowId,setWorkflowVersions:e.metadata.setWorkflowVersions,setWorkflowTags:e.metadata.setWorkflowTags}),gDe(e.reactFlowInstance),N.useEffect(()=>{e.ui.hoveredEdgeId&&!e.history.edges.some(n=>n.id===e.ui.hoveredEdgeId)&&e.ui.setHoveredEdgeId(null)},[e.history.edges,e.ui])}function vDe(e,t,n){const r=e.history.nodes.find(p=>p.id===e.ui.selectedNodeId)??null,a={sidebarCollapsed:e.ui.sidebarCollapsed,onToggleSidebar:()=>e.ui.setSidebarCollapsed(!e.ui.sidebarCollapsed),onAddNode:n.nodeCreation.handleAddNode,reactFlowWrapperRef:e.reactFlowWrapper,onDragOver:n.nodeCreation.onDragOver,onDrop:n.nodeCreation.onDrop,edgeHoverContextValue:{hoveredEdgeId:e.ui.hoveredEdgeId,setHoveredEdgeId:e.ui.setHoveredEdgeId},flowHandlers:{nodes:e.nodeState.decoratedNodes,edges:e.history.edges,onNodesChange:e.history.onNodesChange,onEdgesChange:e.history.onEdgesChange,onConnect:n.handleConnect,onNodeClick:()=>{},onNodeDoubleClick:(p,g)=>{g.type!=="startEnd"&&e.ui.setSelectedNodeId(g.id)},onEdgeMouseEnter:n.edgeHoverHandlers.onEnter,onEdgeMouseLeave:n.edgeHoverHandlers.onLeave,onInit:p=>{e.reactFlowInstance.current=p}},searchHandlers:{isOpen:e.search.isSearchOpen,onSearch:e.search.handleSearchNodes,onHighlightNext:e.search.handleHighlightNext,onHighlightPrevious:e.search.handleHighlightPrevious,onClose:e.search.handleCloseSearch,matchCount:e.search.searchMatches.length,currentMatchIndex:e.search.currentSearchIndex,className:"backdrop-blur supports-[backdrop-filter]:bg-background/60"},controlsHandlers:{isRunning:e.execution.isRunning,onRun:n.handleRunWorkflow,onPause:n.handlePauseWorkflow,onSave:t.saver.handleSaveWorkflow,onUndo:e.history.handleUndo,onRedo:e.history.handleRedo,canUndo:e.history.canUndo,canRedo:e.history.canRedo,onDuplicate:t.duplicateNodes.handleDuplicateSelectedNodes,onExport:t.fileTransfer.handleExportWorkflow,onImport:t.fileTransfer.handleImportWorkflow,onToggleSearch:e.search.handleToggleSearch,isSearchOpen:e.search.isSearchOpen},fileInputRef:t.fileTransfer.fileInputRef,onFileSelected:t.fileTransfer.handleWorkflowFileSelected,validation:{errors:e.validation.validationErrors,onDismiss:n.handleDismissValidation,onFix:n.handleFixValidation}},s={executions:e.execution.executions,onViewDetails:n.executionHistoryHandlers.handleViewExecutionDetails,onRefresh:n.executionHistoryHandlers.handleRefreshExecutionHistory,onCopyToEditor:n.executionHistoryHandlers.handleCopyExecutionToEditor,onDelete:n.executionHistoryHandlers.handleDeleteExecution,onRunWorkflow:n.handleRunWorkflow,onPauseWorkflow:n.handlePauseWorkflow,isRunning:e.execution.isRunning,activeExecutionId:e.execution.activeExecutionId,setActiveExecutionId:e.execution.setActiveExecutionId},i=n.trace.activeTrace,l=i?hW(i):void 0,d={status:n.trace.status,error:n.trace.error,viewerData:n.trace.viewerData,activeViewer:n.trace.activeTraceViewer,onRefresh:()=>n.trace.refresh(),onSelectTrace:p=>e.execution.setActiveExecutionId(p),summary:l,lastUpdatedAt:i==null?void 0:i.lastUpdatedAt,isLive:!!(i&&!i.isComplete)},f={subworkflows:e.subworkflowState.subworkflows,onCreateSubworkflow:n.handleCreateSubworkflow,onInsertSubworkflow:n.handleInsertSubworkflow,onDeleteSubworkflow:n.handleDeleteSubworkflow,validationErrors:e.validation.validationErrors,onRunValidation:n.runPublishValidation,onDismissValidation:n.handleDismissValidation,onFixValidation:n.handleFixValidation,isValidating:e.validation.isValidating,lastValidationRun:e.validation.lastValidationRun},h={workflowName:e.metadata.workflowName,workflowDescription:e.metadata.workflowDescription,workflowTags:e.metadata.workflowTags,onWorkflowNameChange:e.metadata.setWorkflowName,onWorkflowDescriptionChange:e.metadata.setWorkflowDescription,onTagsChange:t.saver.handleTagsChange,workflowVersions:e.metadata.workflowVersions??[],onRestoreVersion:t.saver.handleRestoreVersion,onSaveWorkflow:t.saver.handleSaveWorkflow};return{topNavigationProps:{currentWorkflow:{name:e.metadata.workflowName,path:["Projects","Workflows",e.metadata.workflowName]},credentials:t.credentials.credentials,isCredentialsLoading:t.credentials.isCredentialsLoading,onAddCredential:t.credentials.handleAddCredential,onDeleteCredential:t.credentials.handleDeleteCredential},tabsProps:{activeTab:e.ui.activeTab,onTabChange:e.ui.setActiveTab,readinessAlertCount:e.validation.validationErrors.length},canvasProps:a,executionProps:s,traceProps:d,readinessProps:f,settingsProps:h,nodeInspector:r?{selectedNode:r,nodes:e.history.nodes,edges:e.history.edges,onClose:n.inspectorHandlers.handleCloseNodeInspector,onSave:n.inspectorHandlers.handleNodeUpdate,runtimeCache:e.nodeRuntimeCache,onCacheRuntime:n.inspectorHandlers.handleCacheNodeRuntime}:null,chat:{isChatOpen:e.chat.isChatOpen,chatTitle:e.chat.chatTitle,user:e.user,ai:e.ai,activeChatNodeId:e.chat.activeChatNodeId,workflowId:e.chat.workflowId,backendBaseUrl:e.chat.backendBaseUrl,handleChatResponseStart:e.chat.handleChatResponseStart,handleChatResponseEnd:e.chat.handleChatResponseEnd,handleChatClientTool:e.chat.handleChatClientTool,getClientSecret:e.chat.getClientSecret,refreshSession:e.chat.refreshSession,sessionStatus:e.chat.sessionStatus,sessionError:e.chat.sessionError,handleCloseChat:e.chat.handleCloseChat,setIsChatOpen:e.chat.setIsChatOpen}}}function xDe(e,t){const{workflowId:n}=Dy(),r=HMe({initialNodes:e,initialEdges:t}),a=n4e(r,n??void 0),s=tDe(r,a);return yDe(r,n??void 0),{layoutProps:vDe(r,a,s)}}function ez({initialNodes:e=[],initialEdges:t=[]}){const{layoutProps:n}=xDe(e,t);return c.jsx(sMe,{...n})}function bDe({header:e,children:t,className:n,headerClassName:r,mainClassName:a}){return c.jsxs("div",{className:ye("h-screen w-full flex flex-col overflow-hidden bg-background",n),children:[e&&c.jsx("header",{className:ye("flex-shrink-0 border-b border-border bg-card",r),children:e}),c.jsx("main",{className:ye("flex-1 overflow-hidden min-h-0",a),children:t})]})}function wDe(){const{executionId:e="1"}=Dy(),t={id:e,runId:e,workflowName:"Customer Onboarding Workflow",status:"success",startTime:new Date().toISOString(),endTime:new Date(Date.now()+45e3).toISOString(),duration:45e3,issues:0,triggeredBy:{name:"Avery Chen",avatar:"https://avatar.vercel.sh/avery"},nodes:[{id:"node-1",type:"webhook",name:"New Customer Webhook",position:{x:100,y:100},status:"success"},{id:"node-2",type:"http",name:"Fetch Customer Details",position:{x:400,y:100},status:"success",details:{method:"GET",url:"https://api.example.com/customers/123",items:1}},{id:"node-3",type:"function",name:"Format Customer Data",position:{x:700,y:100},status:"success"},{id:"node-4",type:"api",name:"Create Account",position:{x:400,y:250},status:"success"},{id:"node-5",type:"api",name:"Send Welcome Email",position:{x:700,y:250},status:"success",details:{message:"Welcome to our platform!"}}],edges:[{id:"edge-1",source:"node-1",target:"node-2"},{id:"edge-2",source:"node-2",target:"node-3"},{id:"edge-3",source:"node-3",target:"node-4"},{id:"edge-4",source:"node-4",target:"node-5"}],logs:[{timestamp:"10:23:15",level:"INFO",message:"Workflow execution started"},{timestamp:"10:23:16",level:"DEBUG",message:'Executing node "New Customer Webhook"'},{timestamp:"10:23:17",level:"INFO",message:'Node "New Customer Webhook" completed successfully'},{timestamp:"10:23:18",level:"DEBUG",message:'Executing node "Fetch Customer Details"'},{timestamp:"10:23:20",level:"INFO",message:'Node "Fetch Customer Details" completed successfully'},{timestamp:"10:23:21",level:"DEBUG",message:'Executing node "Format Customer Data"'},{timestamp:"10:23:23",level:"INFO",message:'Node "Format Customer Data" completed successfully'},{timestamp:"10:23:24",level:"DEBUG",message:'Executing node "Create Account"'},{timestamp:"10:23:40",level:"INFO",message:'Node "Create Account" completed successfully'},{timestamp:"10:23:41",level:"DEBUG",message:'Executing node "Send Welcome Email"'},{timestamp:"10:23:45",level:"INFO",message:'Node "Send Welcome Email" completed successfully'},{timestamp:"10:23:45",level:"INFO",message:"Workflow execution completed successfully"}]},n=r=>{switch(r){case"success":return c.jsx(Ue,{className:"bg-green-500",children:"Success"});case"failed":return c.jsx(Ue,{className:"bg-red-500",children:"Failed"});case"running":return c.jsx(Ue,{className:"bg-blue-500",children:"Running"});case"partial":return c.jsx(Ue,{className:"bg-yellow-500",children:"Partial Success"});default:return c.jsx(Ue,{className:"bg-gray-500",children:"Unknown"})}};return c.jsx(bDe,{header:c.jsxs("div",{className:"flex items-center justify-between p-4",children:[c.jsxs("div",{className:"flex items-center space-x-2",children:[c.jsx(pn,{to:"/workflow-canvas",children:c.jsx(me,{variant:"ghost",size:"icon",children:c.jsx(Gg,{className:"h-4 w-4"})})}),c.jsx("h1",{className:"text-2xl font-bold",children:"Execution Details"}),n(t.status)]}),c.jsx("div",{className:"flex items-center space-x-2",children:c.jsxs(me,{variant:"outline",children:[c.jsx(ZC,{className:"mr-2 h-4 w-4"}),"Re-run Workflow"]})})]}),children:c.jsx(mV,{executions:[t],onViewDetails:()=>{},onRefresh:()=>{},onCopyToEditor:()=>{},onDelete:()=>{},showList:!1,defaultSelectedExecution:t})})}const SDe=({className:e})=>c.jsxs("svg",{className:ye("w-5 h-5",e),viewBox:"0 0 32 32",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[c.jsx("path",{d:"M16.2856 13.4546V18.8764H23.974C23.6364 20.62 22.6233 22.0964 21.1038 23.0891L25.7402 26.6146C28.4415 24.1711 30 20.582 30 16.3184C30 15.3257 29.9091 14.371 29.7402 13.4547L16.2856 13.4546Z",fill:"#4285F4"}),c.jsx("path",{d:"M8.27956 18.6646L7.23387 19.449L3.53247 22.2744C5.88314 26.8434 10.701 29.9998 16.2855 29.9998C20.1425 29.9998 23.3763 28.7525 25.74 26.6144L21.1036 23.089C19.8309 23.9289 18.2075 24.4381 16.2855 24.4381C12.5711 24.4381 9.41536 21.9817 8.2854 18.6726L8.27956 18.6646Z",fill:"#34A853"}),c.jsx("path",{d:"M3.53237 9.72559C2.55839 11.6091 2 13.7346 2 16C2 18.2654 2.55839 20.3909 3.53237 22.2745C3.53237 22.2871 8.28576 18.6599 8.28576 18.6599C8.00004 17.8199 7.83116 16.9291 7.83116 15.9999C7.83116 15.0707 8.00004 14.1798 8.28576 13.3398L3.53237 9.72559Z",fill:"#FBBC05"}),c.jsx("path",{d:"M16.2858 7.57452C18.3897 7.57452 20.2598 8.28723 21.7533 9.66179L25.8443 5.65276C23.3637 3.38735 20.143 2 16.2858 2C10.7013 2 5.88314 5.14362 3.53247 9.72544L8.28571 13.34C9.41552 10.0309 12.5714 7.57452 16.2858 7.57452Z",fill:"#EA4335"})]}),_De=({className:e})=>c.jsx("svg",{className:ye("w-5 h-5 dark:fill-white",e),width:"32",height:"32",viewBox:"0 0 32 32",xmlns:"http://www.w3.org/2000/svg",children:c.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M16.0099 4C9.36875 4 4 9.49998 4 16.3042C4 21.7432 7.43994 26.3472 12.2121 27.9767C12.8087 28.0991 13.0272 27.7119 13.0272 27.3862C13.0272 27.1009 13.0076 26.1232 13.0076 25.1044C9.6667 25.8379 8.97099 23.6377 8.97099 23.6377C8.43409 22.2117 7.63858 21.8452 7.63858 21.8452C6.54511 21.0914 7.71823 21.0914 7.71823 21.0914C8.93117 21.1729 9.56763 22.3544 9.56763 22.3544C10.6412 24.2284 12.3711 23.6989 13.0671 23.3729C13.1664 22.5784 13.4847 22.0284 13.8228 21.7229C11.1582 21.4377 8.35469 20.3784 8.35469 15.6522C8.35469 14.3077 8.8316 13.2077 9.58729 12.3522C9.46807 12.0467 9.0504 10.7835 9.70677 9.09273C9.70677 9.09273 10.7208 8.76673 13.0073 10.3557C13.9863 10.0864 14.9958 9.94938 16.0099 9.94823C17.024 9.94823 18.0577 10.091 19.0123 10.3557C21.299 8.76673 22.3131 9.09273 22.3131 9.09273C22.9695 10.7835 22.5515 12.0467 22.4323 12.3522C23.2079 13.2077 23.6652 14.3077 23.6652 15.6522C23.6652 20.3784 20.8617 21.4172 18.1772 21.7229C18.6148 22.1099 18.9924 22.8432 18.9924 24.0044C18.9924 25.6544 18.9727 26.9787 18.9727 27.3859C18.9727 27.7119 19.1915 28.0991 19.7879 27.9769C24.56 26.3469 27.9999 21.7432 27.9999 16.3042C28.0196 9.49998 22.6312 4 16.0099 4Z"})});function pW({type:e="login"}){const t=My(),[n,r]=N.useState(""),[a,s]=N.useState(""),[i,l]=N.useState(null),d=h=>{h.preventDefault(),Ne({title:"Authentication coming soon",description:"The canvas prototype does not include authentication yet. Your credentials were not sent anywhere."})},f=async h=>{var p;l(h);try{const g=await fetch(gn("/api/auth/dev/login"),{method:"POST",headers:{"Content-Type":"application/json"},credentials:"include",body:JSON.stringify({provider:h,email:n||void 0,name:n?n.split("@")[0]:void 0})});if(!g.ok){const y=await g.json().catch(()=>null),S=(y==null?void 0:y.message)||((p=y==null?void 0:y.detail)==null?void 0:p.message)||"Developer login is disabled for this environment. Set ORCHEO_AUTH_DEV_LOGIN_ENABLED=true on the backend.";throw new Error(S)}Ne({title:"Signed in",description:`Authenticated via ${h} (dev mode).`}),t("/")}catch(g){const y=g instanceof Error?g.message:"Unable to start the login flow.";Ne({title:"Login failed",description:y,variant:"destructive"})}finally{l(null)}};return c.jsx("div",{className:"flex items-center justify-center min-h-screen bg-cover bg-center bg-[url('https://picsum.photos/seed/orcheocanvas/1920/1080')] dark:bg-[url('https://picsum.photos/seed/orcheocanvasdark/1920/1080')]",children:c.jsxs(At,{className:"mx-auto min-w-80 max-w-md backdrop-blur-xl bg-primary/5 border-primary/25",children:[c.jsxs(Ht,{className:"space-y-1",children:[c.jsx("div",{className:"flex items-center justify-center mb-2",children:c.jsxs(pn,{to:"/",className:"flex items-center gap-2 font-semibold",children:[c.jsx("img",{src:"/favicon.png",alt:"Orcheo Logo",className:"h-8 w-8"}),c.jsx("span",{className:"text-xl font-bold",children:"Orcheo Canvas"})]})}),c.jsx(Rt,{className:"text-2xl",children:e==="login"?"Login":"Create an account"}),c.jsx(kt,{children:e==="login"?"Enter your email below to login to your account":"Enter your information below to create your account"})]}),c.jsxs(Bt,{className:"grid gap-4",children:[c.jsxs("div",{className:"grid grid-cols-2 gap-2",children:[c.jsxs(me,{variant:"outline",className:"w-full",onClick:()=>f("google"),disabled:i!==null,children:[i==="google"?c.jsx(zo,{className:"h-5 w-5 mr-2 animate-spin"}):c.jsx(SDe,{className:"h-5 w-5 mr-2"}),i==="google"?"Signing in…":"Google"]}),c.jsxs(me,{variant:"outline",className:"w-full",onClick:()=>f("github"),disabled:i!==null,children:[i==="github"?c.jsx(zo,{className:"h-5 w-5 mr-2 animate-spin"}):c.jsx(_De,{className:"h-5 w-5 mr-2"}),i==="github"?"Signing in…":"GitHub"]})]}),c.jsxs("div",{className:"relative",children:[c.jsx("div",{className:"absolute inset-0 flex items-center",children:c.jsx(xn,{className:"w-full"})}),c.jsx("div",{className:"relative flex justify-center text-xs uppercase",children:c.jsx("span",{className:"bg-background px-2 text-muted-foreground",children:"Or continue with"})})]}),c.jsx("form",{onSubmit:d,children:c.jsxs("div",{className:"grid gap-4",children:[c.jsxs("div",{className:"grid gap-2",children:[c.jsx(jt,{htmlFor:"email",children:"Email"}),c.jsx(Ct,{id:"email",type:"email",placeholder:"you@orcheo.dev",value:n,onChange:h=>r(h.target.value),required:!0})]}),c.jsxs("div",{className:"grid gap-2",children:[c.jsxs("div",{className:"flex items-center justify-between",children:[c.jsx(jt,{htmlFor:"password",children:"Password"}),e==="login"&&c.jsx(pn,{to:"/forgot-password",className:"text-sm text-primary underline-offset-4 hover:underline",children:"Forgot password?"})]}),c.jsx(Ct,{id:"password",type:"password",value:a,onChange:h=>s(h.target.value),required:!0})]}),c.jsx(me,{className:"w-full",type:"submit",children:e==="login"?"Login":"Create account"})]})}),c.jsx("div",{className:"mt-4 text-center text-sm",children:e==="login"?c.jsxs("div",{children:["Don't have an account?"," ",c.jsx(pn,{to:"/signup",className:"text-primary underline-offset-4 hover:underline",children:"Sign up"})]}):c.jsxs("div",{children:["Already have an account?"," ",c.jsx(pn,{to:"/login",className:"text-primary underline-offset-4 hover:underline",children:"Login"})]})})]})]})})}function NDe(){return c.jsx(pW,{type:"login"})}function jDe(){return c.jsx(pW,{type:"signup"})}function CDe({user:e}){return c.jsxs("div",{className:"space-y-4",children:[c.jsxs(At,{children:[c.jsxs(Ht,{children:[c.jsx(Rt,{children:"Profile Information"}),c.jsx(kt,{children:"Update your account profile information and email address."})]}),c.jsxs(Bt,{className:"space-y-6",children:[c.jsxs("div",{className:"flex items-center space-x-4",children:[c.jsxs(O2,{className:"h-20 w-20",children:[c.jsx(M2,{src:e.avatar,alt:e.name}),c.jsx(D2,{children:e.name.charAt(0)})]}),c.jsxs("div",{className:"space-y-1",children:[c.jsx("h3",{className:"font-medium",children:e.name}),c.jsxs("div",{className:"flex items-center space-x-2",children:[c.jsx(Ue,{variant:"outline",children:e.role}),c.jsxs("span",{className:"text-sm text-muted-foreground",children:["Member since ",e.joinDate]})]}),c.jsx(me,{size:"sm",variant:"outline",children:"Change Avatar"})]})]}),c.jsx(xn,{}),c.jsxs("form",{className:"space-y-4",children:[c.jsxs("div",{className:"grid grid-cols-1 gap-4 sm:grid-cols-2",children:[c.jsxs("div",{className:"space-y-2",children:[c.jsx(jt,{htmlFor:"name",children:"Name"}),c.jsx(Ct,{id:"name",defaultValue:e.name,placeholder:"Your name"})]}),c.jsxs("div",{className:"space-y-2",children:[c.jsx(jt,{htmlFor:"email",children:"Email"}),c.jsx(Ct,{id:"email",type:"email",defaultValue:e.email,placeholder:"Your email"})]})]}),c.jsxs("div",{className:"space-y-2",children:[c.jsx(jt,{htmlFor:"bio",children:"Bio"}),c.jsx("textarea",{id:"bio",className:"flex min-h-[80px] w-full rounded-md border border-input bg-background px-3 py-2 text-sm ring-offset-background placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50",placeholder:"Write a short bio about yourself"})]})]})]}),c.jsx(rr,{children:c.jsx(me,{children:"Save Changes"})})]}),c.jsxs(At,{children:[c.jsxs(Ht,{children:[c.jsx(Rt,{children:"Preferences"}),c.jsx(kt,{children:"Manage your notification preferences and timezone settings."})]}),c.jsx(Bt,{className:"space-y-4",children:c.jsxs("div",{className:"space-y-2",children:[c.jsx(jt,{htmlFor:"timezone",children:"Timezone"}),c.jsxs("select",{id:"timezone",className:"flex h-10 w-full rounded-md border border-input bg-background px-3 py-2 text-sm ring-offset-background placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50",children:[c.jsx("option",{value:"UTC",children:"UTC (Coordinated Universal Time)"}),c.jsx("option",{value:"America/New_York",children:"Eastern Time (US & Canada)"}),c.jsx("option",{value:"America/Chicago",children:"Central Time (US & Canada)"}),c.jsx("option",{value:"America/Denver",children:"Mountain Time (US & Canada)"}),c.jsx("option",{value:"America/Los_Angeles",children:"Pacific Time (US & Canada)"}),c.jsx("option",{value:"Europe/London",children:"London (GMT/BST)"}),c.jsx("option",{value:"Europe/Paris",children:"Paris, Berlin, Rome (CET)"})]})]})}),c.jsx(rr,{children:c.jsx(me,{children:"Save Preferences"})})]})]})}function EDe({user:e}){return c.jsxs("div",{className:"space-y-4",children:[c.jsxs(At,{children:[c.jsxs(Ht,{children:[c.jsx(Rt,{children:"Password"}),c.jsx(kt,{children:"Change your password here. After saving, you'll be logged out."})]}),c.jsxs(Bt,{className:"space-y-4",children:[c.jsxs("div",{className:"space-y-2",children:[c.jsx("label",{className:"text-sm font-medium",htmlFor:"current",children:"Current Password"}),c.jsx(Ct,{id:"current",type:"password"})]}),c.jsxs("div",{className:"space-y-2",children:[c.jsx("label",{className:"text-sm font-medium",htmlFor:"new",children:"New Password"}),c.jsx(Ct,{id:"new",type:"password"})]}),c.jsxs("div",{className:"space-y-2",children:[c.jsx("label",{className:"text-sm font-medium",htmlFor:"confirm",children:"Confirm Password"}),c.jsx(Ct,{id:"confirm",type:"password"})]})]}),c.jsx(rr,{children:c.jsx(me,{children:"Change Password"})})]}),c.jsxs(At,{children:[c.jsxs(Ht,{children:[c.jsx(Rt,{children:"Two-Factor Authentication"}),c.jsx(kt,{children:"Add an extra layer of security to your account."})]}),c.jsx(Bt,{className:"space-y-4",children:c.jsxs("div",{className:"flex items-center justify-between rounded-lg border p-4",children:[c.jsxs("div",{className:"space-y-0.5",children:[c.jsx("div",{className:"font-medium",children:"Two-Factor Authentication (2FA)"}),c.jsx("div",{className:"text-sm text-muted-foreground",children:e.twoFactorEnabled?"Two-factor authentication is enabled.":"Two-factor authentication is not enabled yet."})]}),c.jsx(me,{variant:e.twoFactorEnabled?"destructive":"default",children:e.twoFactorEnabled?"Disable":"Enable"})]})})]}),c.jsxs(At,{children:[c.jsxs(Ht,{children:[c.jsx(Rt,{children:"Active Sessions"}),c.jsx(kt,{children:"Manage your active sessions across devices."})]}),c.jsx(Bt,{children:c.jsxs("div",{className:"space-y-4",children:[c.jsxs("div",{className:"flex items-center justify-between rounded-lg border p-4",children:[c.jsxs("div",{className:"space-y-0.5",children:[c.jsx("div",{className:"font-medium",children:"Current Session"}),c.jsx("div",{className:"text-sm text-muted-foreground",children:"Chrome on macOS • San Francisco, CA • Active now"})]}),c.jsx(Ue,{children:"Current"})]}),c.jsxs("div",{className:"flex items-center justify-between rounded-lg border p-4",children:[c.jsxs("div",{className:"space-y-0.5",children:[c.jsx("div",{className:"font-medium",children:"Mobile App"}),c.jsx("div",{className:"text-sm text-muted-foreground",children:"iOS • New York, NY • Active 2 days ago"})]}),c.jsx(me,{variant:"outline",size:"sm",children:"Revoke"})]})]})}),c.jsx(rr,{children:c.jsx(me,{variant:"destructive",children:"Sign Out All Devices"})})]})]})}function TDe(){return c.jsxs(At,{children:[c.jsxs(Ht,{children:[c.jsx(Rt,{children:"API Keys"}),c.jsx(kt,{children:"Manage your API keys for programmatic access to Orcheo Canvas."})]}),c.jsxs(Bt,{className:"space-y-4",children:[c.jsxs("div",{className:"flex items-center justify-between rounded-lg border p-4",children:[c.jsxs("div",{className:"space-y-0.5",children:[c.jsx("div",{className:"font-medium",children:"Production Key"}),c.jsx("div",{className:"text-sm text-muted-foreground",children:"Created on Jan 12, 2023 • Last used 2 days ago"})]}),c.jsxs("div",{className:"flex items-center gap-2",children:[c.jsx(me,{variant:"outline",size:"sm",children:"View"}),c.jsx(me,{variant:"destructive",size:"sm",children:"Revoke"})]})]}),c.jsxs("div",{className:"flex items-center justify-between rounded-lg border p-4",children:[c.jsxs("div",{className:"space-y-0.5",children:[c.jsx("div",{className:"font-medium",children:"Development Key"}),c.jsx("div",{className:"text-sm text-muted-foreground",children:"Created on Mar 5, 2023 • Last used 5 hours ago"})]}),c.jsxs("div",{className:"flex items-center gap-2",children:[c.jsx(me,{variant:"outline",size:"sm",children:"View"}),c.jsx(me,{variant:"destructive",size:"sm",children:"Revoke"})]})]})]}),c.jsx(rr,{children:c.jsx(me,{children:"Generate New API Key"})})]})}function ADe(){const[e]=N.useState({name:"Avery Chen",email:"avery@orcheo.dev",avatar:"https://avatar.vercel.sh/avery",role:"Admin",joinDate:"January 2023",twoFactorEnabled:!1}),{credentials:t,isLoading:n,onAddCredential:r,onDeleteCredential:a}=lv({actorName:e.name});return c.jsxs("div",{className:"flex min-h-screen flex-col",children:[c.jsx(sh,{credentials:t,isCredentialsLoading:n,onAddCredential:r,onDeleteCredential:a}),c.jsxs("div",{className:"flex-1 space-y-4 p-8 pt-6 mx-auto w-full max-w-7xl",children:[c.jsx("div",{className:"flex items-center justify-between space-y-2",children:c.jsx("h2",{className:"text-3xl font-bold tracking-tight",children:"Profile"})}),c.jsxs(Da,{defaultValue:"general",className:"space-y-4",children:[c.jsxs(Ls,{children:[c.jsx(St,{value:"general",children:"General"}),c.jsx(St,{value:"security",children:"Security"}),c.jsx(St,{value:"api-keys",children:"API Keys"})]}),c.jsx($t,{value:"general",className:"space-y-4",children:c.jsx(CDe,{user:e})}),c.jsx($t,{value:"security",className:"space-y-4",children:c.jsx(EDe,{user:e})}),c.jsx($t,{value:"api-keys",className:"space-y-4",children:c.jsx(TDe,{})})]})]})]})}var UT="Radio",[RDe,mW]=wn(UT),[kDe,ODe]=RDe(UT),gW=N.forwardRef((e,t)=>{const{__scopeRadio:n,name:r,checked:a=!1,required:s,disabled:i,value:l="on",onCheck:d,form:f,...h}=e,[p,g]=N.useState(null),y=ze(t,b=>g(b)),S=N.useRef(!1),w=p?f||!!p.closest("form"):!0;return c.jsxs(kDe,{scope:n,checked:a,disabled:i,children:[c.jsx(Ae.button,{type:"button",role:"radio","aria-checked":a,"data-state":bW(a),"data-disabled":i?"":void 0,disabled:i,value:l,...h,ref:y,onClick:_e(e.onClick,b=>{a||d==null||d(),w&&(S.current=b.isPropagationStopped(),S.current||b.stopPropagation())})}),w&&c.jsx(xW,{control:p,bubbles:!S.current,name:r,value:l,checked:a,required:s,disabled:i,form:f,style:{transform:"translateX(-100%)"}})]})});gW.displayName=UT;var yW="RadioIndicator",vW=N.forwardRef((e,t)=>{const{__scopeRadio:n,forceMount:r,...a}=e,s=ODe(yW,n);return c.jsx(sn,{present:r||s.checked,children:c.jsx(Ae.span,{"data-state":bW(s.checked),"data-disabled":s.disabled?"":void 0,...a,ref:t})})});vW.displayName=yW;var MDe="RadioBubbleInput",xW=N.forwardRef(({__scopeRadio:e,control:t,checked:n,bubbles:r=!0,...a},s)=>{const i=N.useRef(null),l=ze(i,s),d=av(n),f=Wy(t);return N.useEffect(()=>{const h=i.current;if(!h)return;const p=window.HTMLInputElement.prototype,y=Object.getOwnPropertyDescriptor(p,"checked").set;if(d!==n&&y){const S=new Event("click",{bubbles:r});y.call(h,n),h.dispatchEvent(S)}},[d,n,r]),c.jsx(Ae.input,{type:"radio","aria-hidden":!0,defaultChecked:n,...a,tabIndex:-1,ref:l,style:{...a.style,...f,position:"absolute",pointerEvents:"none",opacity:0,margin:0}})});xW.displayName=MDe;function bW(e){return e?"checked":"unchecked"}var DDe=["ArrowUp","ArrowDown","ArrowLeft","ArrowRight"],N0="RadioGroup",[PDe]=wn(N0,[Xo,mW]),wW=Xo(),SW=mW(),[$De,IDe]=PDe(N0),_W=N.forwardRef((e,t)=>{const{__scopeRadioGroup:n,name:r,defaultValue:a,value:s,required:i=!1,disabled:l=!1,orientation:d,dir:f,loop:h=!0,onValueChange:p,...g}=e,y=wW(n),S=Ko(f),[w,b]=bn({prop:s,defaultProp:a??null,onChange:p,caller:N0});return c.jsx($De,{scope:n,name:r,required:i,disabled:l,value:w,onValueChange:b,children:c.jsx(Yy,{asChild:!0,...y,orientation:d,dir:S,loop:h,children:c.jsx(Ae.div,{role:"radiogroup","aria-required":i,"aria-orientation":d,"data-disabled":l?"":void 0,dir:S,...g,ref:t})})})});_W.displayName=N0;var NW="RadioGroupItem",jW=N.forwardRef((e,t)=>{const{__scopeRadioGroup:n,disabled:r,...a}=e,s=IDe(NW,n),i=s.disabled||r,l=wW(n),d=SW(n),f=N.useRef(null),h=ze(t,f),p=s.value===a.value,g=N.useRef(!1);return N.useEffect(()=>{const y=w=>{DDe.includes(w.key)&&(g.current=!0)},S=()=>g.current=!1;return document.addEventListener("keydown",y),document.addEventListener("keyup",S),()=>{document.removeEventListener("keydown",y),document.removeEventListener("keyup",S)}},[]),c.jsx(Xy,{asChild:!0,...l,focusable:!i,active:p,children:c.jsx(gW,{disabled:i,required:s.required,checked:p,...d,...a,name:s.name,ref:h,onCheck:()=>s.onValueChange(a.value),onKeyDown:_e(y=>{y.key==="Enter"&&y.preventDefault()}),onFocus:_e(a.onFocus,()=>{var y;g.current&&((y=f.current)==null||y.click())})})})});jW.displayName=NW;var LDe="RadioGroupIndicator",CW=N.forwardRef((e,t)=>{const{__scopeRadioGroup:n,...r}=e,a=SW(n);return c.jsx(vW,{...a,...r,ref:t})});CW.displayName=LDe;var EW=_W,TW=jW,zDe=CW;const AW=N.forwardRef(({className:e,...t},n)=>c.jsx(EW,{className:ye("grid gap-2",e),...t,ref:n}));AW.displayName=EW.displayName;const RW=N.forwardRef(({className:e,...t},n)=>c.jsx(TW,{ref:n,className:ye("aspect-square h-4 w-4 rounded-full border border-primary text-primary shadow focus:outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:cursor-not-allowed disabled:opacity-50",e),...t,children:c.jsx(zDe,{className:"flex items-center justify-center",children:c.jsx(YC,{className:"h-3.5 w-3.5 fill-primary"})})}));RW.displayName=TW.displayName;const ko=()=>typeof window<"u",qDe=()=>ko()&&window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light",FDe=()=>ko()?localStorage.getItem("theme")??"system":"system",tz=e=>ko()?localStorage.getItem(e)==="true":!1,UDe=()=>ko()&&localStorage.getItem("accentColor")||"blue",kW=({onThemeChange:e,onReducedMotionChange:t,onHighContrastChange:n})=>{const[r,a]=N.useState(()=>FDe()),[s,i]=N.useState(()=>tz("reducedMotion")),[l,d]=N.useState(()=>tz("highContrast")),[f,h]=N.useState(()=>UDe());return N.useEffect(()=>{if(!ko())return;localStorage.setItem("theme",r);const p=r==="system"?qDe():r;document.documentElement.classList.toggle("dark",p==="dark"),e==null||e(r)},[r,e]),N.useEffect(()=>{ko()&&(localStorage.setItem("reducedMotion",String(s)),document.documentElement.classList.toggle("reduce-motion",s),t==null||t(s))},[s,t]),N.useEffect(()=>{ko()&&(localStorage.setItem("highContrast",String(l)),document.documentElement.classList.toggle("high-contrast",l),n==null||n(l))},[l,n]),N.useEffect(()=>{ko()&&(localStorage.setItem("accentColor",f),document.documentElement.setAttribute("data-accent",f))},[f]),{accentColor:f,highContrast:l,reducedMotion:s,setAccentColor:h,setHighContrast:d,setReducedMotion:i,setTheme:a,theme:r}},HDe=[{name:"Blue",value:"blue",class:"bg-blue-500"},{name:"Green",value:"green",class:"bg-green-500"},{name:"Purple",value:"purple",class:"bg-purple-500"},{name:"Red",value:"red",class:"bg-red-500"},{name:"Orange",value:"orange",class:"bg-orange-500"},{name:"Pink",value:"pink",class:"bg-pink-500"}];function BDe({onThemeChange:e,onReducedMotionChange:t,onHighContrastChange:n,className:r}){const{accentColor:a,highContrast:s,reducedMotion:i,setAccentColor:l,setHighContrast:d,setReducedMotion:f,setTheme:h,theme:p}=kW({onThemeChange:e,onHighContrastChange:n,onReducedMotionChange:t});return c.jsxs("div",{className:ye("space-y-6",r),children:[c.jsxs("div",{children:[c.jsxs("h3",{className:"text-lg font-medium flex items-center gap-2",children:[c.jsx(zz,{className:"h-5 w-5"}),"Appearance"]}),c.jsx("p",{className:"text-sm text-muted-foreground",children:"Customize the appearance of the application"})]}),c.jsx(xn,{}),c.jsxs("div",{className:"space-y-4",children:[c.jsxs("div",{children:[c.jsx("h4",{className:"text-sm font-medium mb-3",children:"Theme"}),c.jsxs("div",{className:"grid grid-cols-3 gap-2",children:[c.jsx(Tj,{label:"Light",icon:c.jsx(Bz,{className:"h-6 w-6"}),isActive:p==="light",onClick:()=>h("light")}),c.jsx(Tj,{label:"Dark",icon:c.jsx(Lz,{className:"h-6 w-6"}),isActive:p==="dark",onClick:()=>h("dark")}),c.jsx(Tj,{label:"System",icon:c.jsx(Iz,{className:"h-6 w-6"}),isActive:p==="system",onClick:()=>h("system")})]})]}),c.jsxs("div",{children:[c.jsx("h4",{className:"text-sm font-medium mb-3",children:"Accent Color"}),c.jsx(AW,{value:a,onValueChange:l,className:"grid grid-cols-3 sm:grid-cols-6 gap-2",children:HDe.map(g=>c.jsxs("div",{className:"flex items-center space-x-2",children:[c.jsx(RW,{value:g.value,id:`color-${g.value}`,className:"sr-only"}),c.jsx(jt,{htmlFor:`color-${g.value}`,className:ye("h-8 w-full cursor-pointer rounded-md border-2 flex items-center justify-center",a===g.value?"border-primary":"border-transparent"),children:c.jsx("span",{className:ye("h-6 w-6 rounded-full",g.class)})})]},g.value))})]})]}),c.jsx(xn,{}),c.jsxs("div",{className:"space-y-4",children:[c.jsx(nz,{icon:c.jsx(rJ,{className:"h-4 w-4"}),title:"Accessibility"}),c.jsx(Aj,{id:"reduced-motion",label:"Reduced motion",description:"Reduce the amount of animations",checked:i,onToggle:f}),c.jsx(Aj,{id:"high-contrast",label:"High contrast",description:"Increase the contrast for better visibility",checked:s,onToggle:d})]}),c.jsx(xn,{}),c.jsxs("div",{className:"space-y-4",children:[c.jsx(nz,{icon:c.jsx(Gf,{className:"h-4 w-4"}),title:"Performance"}),c.jsx(Aj,{id:"disable-animations",label:"Disable animations",description:"Turn off all animations for better performance"})]})]})}const Tj=({icon:e,isActive:t,label:n,onClick:r})=>c.jsxs(me,{variant:t?"default":"outline",className:"flex flex-col items-center justify-center gap-2 h-24",onClick:r,children:[e,c.jsx("span",{children:n}),t&&c.jsx(Is,{className:"absolute top-2 right-2 h-4 w-4 text-primary-foreground"})]}),Aj=({checked:e,description:t,id:n,label:r,onToggle:a})=>{const s=typeof e=="boolean"?{checked:e,onCheckedChange:a}:{};return c.jsxs("div",{className:"flex items-center justify-between",children:[c.jsxs("div",{className:"space-y-0.5",children:[c.jsx(jt,{htmlFor:n,children:r}),c.jsx("p",{className:"text-sm text-muted-foreground",children:t})]}),c.jsx(tr,{id:n,...s})]})},nz=({icon:e,title:t})=>c.jsx("div",{children:c.jsxs("h4",{className:"text-sm font-medium mb-3 flex items-center gap-2",children:[e,t]})}),VDe=()=>c.jsxs("div",{className:"space-y-4",children:[c.jsxs(At,{children:[c.jsxs(Ht,{children:[c.jsx(Rt,{children:"Theme & Accessibility"}),c.jsx(kt,{children:"Customize the appearance of the application and accessibility settings."})]}),c.jsx(Bt,{children:c.jsx(BDe,{})})]}),c.jsxs(At,{children:[c.jsxs(Ht,{children:[c.jsx(Rt,{children:"Interface Density"}),c.jsx(kt,{children:"Adjust the density of the user interface elements."})]}),c.jsx(Bt,{children:c.jsx("div",{className:"grid gap-4",children:c.jsxs("div",{className:"grid grid-cols-3 gap-4",children:[c.jsxs("div",{className:"flex flex-col items-center justify-between rounded-md border-2 border-muted bg-popover p-4 hover:bg-accent hover:text-accent-foreground",children:[c.jsxs("div",{className:"mb-3 mt-2 space-y-2",children:[c.jsx("div",{className:"h-2 w-full rounded-lg bg-primary/10"}),c.jsx("div",{className:"h-2 w-full rounded-lg bg-primary/20"}),c.jsx("div",{className:"h-2 w-full rounded-lg bg-primary/10"})]}),c.jsx("span",{className:"text-xs font-medium",children:"Compact"})]}),c.jsxs("div",{className:"flex flex-col items-center justify-between rounded-md border-2 border-primary bg-popover p-4 hover:bg-accent hover:text-accent-foreground",children:[c.jsxs("div",{className:"mb-3 mt-2 space-y-3",children:[c.jsx("div",{className:"h-3 w-full rounded-lg bg-primary/10"}),c.jsx("div",{className:"h-3 w-full rounded-lg bg-primary/20"}),c.jsx("div",{className:"h-3 w-full rounded-lg bg-primary/10"})]}),c.jsx("span",{className:"text-xs font-medium",children:"Default"})]}),c.jsxs("div",{className:"flex flex-col items-center justify-between rounded-md border-2 border-muted bg-popover p-4 hover:bg-accent hover:text-accent-foreground",children:[c.jsxs("div",{className:"mb-3 mt-2 space-y-4",children:[c.jsx("div",{className:"h-4 w-full rounded-lg bg-primary/10"}),c.jsx("div",{className:"h-4 w-full rounded-lg bg-primary/20"}),c.jsx("div",{className:"h-4 w-full rounded-lg bg-primary/10"})]}),c.jsx("span",{className:"text-xs font-medium",children:"Comfortable"})]})]})})}),c.jsx(rr,{children:c.jsx(me,{children:"Save Changes"})})]})]}),WDe=()=>{const[e,t]=N.useState({autoSave:!0,showNodeLabels:!0,confirmBeforeDelete:!0,showMinimap:!1});return c.jsxs("div",{className:"space-y-4",children:[c.jsxs(At,{children:[c.jsxs(Ht,{children:[c.jsx(Rt,{children:"Workflow Editor Settings"}),c.jsx(kt,{children:"Configure how the workflow editor behaves."})]}),c.jsxs(Bt,{className:"space-y-4",children:[c.jsxs("div",{className:"flex items-center justify-between space-x-2",children:[c.jsxs(jt,{htmlFor:"autosave",className:"flex flex-col space-y-1",children:[c.jsx("span",{children:"Auto-save Workflows"}),c.jsx("span",{className:"font-normal text-xs text-muted-foreground",children:"Automatically save changes as you work"})]}),c.jsx(tr,{id:"autosave",checked:e.autoSave,onCheckedChange:n=>t(r=>({...r,autoSave:n}))})]}),c.jsx(xn,{}),c.jsxs("div",{className:"flex items-center justify-between space-x-2",children:[c.jsxs(jt,{htmlFor:"nodelabels",className:"flex flex-col space-y-1",children:[c.jsx("span",{children:"Show Node Labels"}),c.jsx("span",{className:"font-normal text-xs text-muted-foreground",children:"Display labels on workflow nodes"})]}),c.jsx(tr,{id:"nodelabels",checked:e.showNodeLabels,onCheckedChange:n=>t(r=>({...r,showNodeLabels:n}))})]}),c.jsx(xn,{}),c.jsxs("div",{className:"flex items-center justify-between space-x-2",children:[c.jsxs(jt,{htmlFor:"confirmdelete",className:"flex flex-col space-y-1",children:[c.jsx("span",{children:"Confirm Before Delete"}),c.jsx("span",{className:"font-normal text-xs text-muted-foreground",children:"Show confirmation dialog before deleting nodes"})]}),c.jsx(tr,{id:"confirmdelete",checked:e.confirmBeforeDelete,onCheckedChange:n=>t(r=>({...r,confirmBeforeDelete:n}))})]}),c.jsx(xn,{}),c.jsxs("div",{className:"flex items-center justify-between space-x-2",children:[c.jsxs(jt,{htmlFor:"minimap",className:"flex flex-col space-y-1",children:[c.jsx("span",{children:"Show Minimap"}),c.jsx("span",{className:"font-normal text-xs text-muted-foreground",children:"Display minimap navigation in workflow editor"})]}),c.jsx(tr,{id:"minimap",checked:e.showMinimap,onCheckedChange:n=>t(r=>({...r,showMinimap:n}))})]})]}),c.jsx(rr,{children:c.jsx(me,{children:"Save Editor Settings"})})]}),c.jsxs(At,{children:[c.jsxs(Ht,{children:[c.jsx(Rt,{children:"Data Storage"}),c.jsx(kt,{children:"Manage your data storage preferences."})]}),c.jsxs(Bt,{className:"space-y-4",children:[c.jsxs("div",{className:"space-y-1",children:[c.jsx("h3",{className:"font-medium",children:"Storage Usage"}),c.jsx("div",{className:"h-4 w-full rounded-full bg-secondary",children:c.jsx("div",{className:"h-4 rounded-full bg-primary",style:{width:"35%"}})}),c.jsx("p",{className:"text-xs text-muted-foreground",children:"3.5 GB used of 10 GB (35%)"})]}),c.jsx("div",{className:"pt-2",children:c.jsx(me,{variant:"outline",children:"Manage Storage"})})]})]})]})},GDe=()=>{const[e,t]=N.useState({workflow:!0,security:!0,marketing:!1});return c.jsxs("div",{className:"space-y-4",children:[c.jsxs(At,{children:[c.jsxs(Ht,{children:[c.jsx(Rt,{children:"Email Notifications"}),c.jsx(kt,{children:"Configure when you'll receive email notifications."})]}),c.jsxs(Bt,{className:"space-y-4",children:[c.jsxs("div",{className:"flex items-center justify-between space-x-2",children:[c.jsxs(jt,{htmlFor:"workflow",className:"flex flex-col space-y-1",children:[c.jsx("span",{children:"Workflow Notifications"}),c.jsx("span",{className:"font-normal text-xs text-muted-foreground",children:"Receive emails when workflows fail or complete"})]}),c.jsx(tr,{id:"workflow",checked:e.workflow,onCheckedChange:n=>t(r=>({...r,workflow:n}))})]}),c.jsx(xn,{}),c.jsxs("div",{className:"flex items-center justify-between space-x-2",children:[c.jsxs(jt,{htmlFor:"security",className:"flex flex-col space-y-1",children:[c.jsx("span",{children:"Security Alerts"}),c.jsx("span",{className:"font-normal text-xs text-muted-foreground",children:"Receive emails about security events"})]}),c.jsx(tr,{id:"security",checked:e.security,onCheckedChange:n=>t(r=>({...r,security:n}))})]}),c.jsx(xn,{}),c.jsxs("div",{className:"flex items-center justify-between space-x-2",children:[c.jsxs(jt,{htmlFor:"marketing",className:"flex flex-col space-y-1",children:[c.jsx("span",{children:"Marketing"}),c.jsx("span",{className:"font-normal text-xs text-muted-foreground",children:"Receive emails about new features and updates"})]}),c.jsx(tr,{id:"marketing",checked:e.marketing,onCheckedChange:n=>t(r=>({...r,marketing:n}))})]})]}),c.jsx(rr,{children:c.jsx(me,{children:"Save Notification Settings"})})]}),c.jsxs(At,{children:[c.jsxs(Ht,{children:[c.jsx(Rt,{children:"In-App Notifications"}),c.jsx(kt,{children:"Configure notifications that appear within the application."})]}),c.jsx(Bt,{children:c.jsxs("div",{className:"grid gap-4",children:[c.jsxs("div",{className:"flex items-center space-x-4 rounded-md border p-4",children:[c.jsxs("div",{children:[c.jsx("p",{className:"text-sm font-medium leading-none",children:"Workflow Status Updates"}),c.jsx("p",{className:"text-sm text-muted-foreground",children:"Show notifications when workflow status changes"})]}),c.jsx("div",{className:"ml-auto",children:c.jsx(tr,{defaultChecked:!0})})]}),c.jsxs("div",{className:"flex items-center space-x-4 rounded-md border p-4",children:[c.jsxs("div",{children:[c.jsx("p",{className:"text-sm font-medium leading-none",children:"Team Mentions"}),c.jsx("p",{className:"text-sm text-muted-foreground",children:"Show notifications when you're mentioned in comments"})]}),c.jsx("div",{className:"ml-auto",children:c.jsx(tr,{defaultChecked:!0})})]}),c.jsxs("div",{className:"flex items-center space-x-4 rounded-md border p-4",children:[c.jsxs("div",{children:[c.jsx("p",{className:"text-sm font-medium leading-none",children:"System Announcements"}),c.jsx("p",{className:"text-sm text-muted-foreground",children:"Show notifications about system updates"})]}),c.jsx("div",{className:"ml-auto",children:c.jsx(tr,{})})]})]})})]})]})},KDe=()=>c.jsxs("div",{className:"space-y-4",children:[c.jsxs(At,{children:[c.jsxs(Ht,{children:[c.jsx(Rt,{children:"Team Management"}),c.jsx(kt,{children:"Manage your team members and their access levels."})]}),c.jsx(Bt,{children:c.jsxs("div",{className:"space-y-4",children:[c.jsxs("div",{className:"grid gap-2",children:[c.jsx("h3",{className:"text-sm font-medium",children:"Current Plan"}),c.jsxs("div",{className:"flex items-center justify-between rounded-lg border p-4",children:[c.jsxs("div",{children:[c.jsx("p",{className:"font-medium",children:"Pro Plan"}),c.jsx("p",{className:"text-sm text-muted-foreground",children:"$49/month • 10 team members • Unlimited workflows"})]}),c.jsx(me,{variant:"outline",children:"Upgrade"})]})]}),c.jsxs("div",{className:"grid gap-2",children:[c.jsx("h3",{className:"text-sm font-medium",children:"Team Members"}),c.jsxs("div",{className:"rounded-lg border",children:[c.jsxs("div",{className:"flex items-center justify-between p-4",children:[c.jsxs("div",{className:"flex items-center space-x-3",children:[c.jsx("div",{className:"h-9 w-9 rounded-full bg-primary/10"}),c.jsxs("div",{children:[c.jsx("p",{className:"font-medium",children:"Avery Chen"}),c.jsx("p",{className:"text-sm text-muted-foreground",children:"avery@orcheo.dev • Owner"})]})]}),c.jsx(me,{variant:"ghost",size:"sm",disabled:!0,children:"You"})]}),c.jsx(xn,{}),c.jsxs("div",{className:"flex items-center justify-between p-4",children:[c.jsxs("div",{className:"flex items-center space-x-3",children:[c.jsx("div",{className:"h-9 w-9 rounded-full bg-primary/10"}),c.jsxs("div",{children:[c.jsx("p",{className:"font-medium",children:"Sky Patel"}),c.jsx("p",{className:"text-sm text-muted-foreground",children:"sky@orcheo.dev • Admin"})]})]}),c.jsx(me,{variant:"ghost",size:"sm",children:"Manage"})]}),c.jsx(xn,{}),c.jsxs("div",{className:"flex items-center justify-between p-4",children:[c.jsxs("div",{className:"flex items-center space-x-3",children:[c.jsx("div",{className:"h-9 w-9 rounded-full bg-primary/10"}),c.jsxs("div",{children:[c.jsx("p",{className:"font-medium",children:"Riley Morgan"}),c.jsx("p",{className:"text-sm text-muted-foreground",children:"riley@orcheo.dev • Editor"})]})]}),c.jsx(me,{variant:"ghost",size:"sm",children:"Manage"})]})]})]}),c.jsxs("div",{className:"flex justify-between",children:[c.jsx(me,{variant:"outline",children:"Invite Team Member"}),c.jsx(me,{variant:"outline",children:"Manage Team"})]})]})})]}),c.jsxs(At,{children:[c.jsxs(Ht,{children:[c.jsx(Rt,{children:"Billing"}),c.jsx(kt,{children:"Manage your billing information and view your invoices."})]}),c.jsxs(Bt,{className:"space-y-4",children:[c.jsxs("div",{className:"rounded-lg border",children:[c.jsxs("div",{className:"flex items-center justify-between p-4",children:[c.jsxs("div",{children:[c.jsx("p",{className:"font-medium",children:"Payment Method"}),c.jsx("p",{className:"text-sm text-muted-foreground",children:"Visa ending in 4242"})]}),c.jsx(me,{variant:"ghost",size:"sm",children:"Change"})]}),c.jsx(xn,{}),c.jsxs("div",{className:"flex items-center justify-between p-4",children:[c.jsxs("div",{children:[c.jsx("p",{className:"font-medium",children:"Billing Cycle"}),c.jsx("p",{className:"text-sm text-muted-foreground",children:"Monthly • Next billing date: Nov 15, 2023"})]}),c.jsx(me,{variant:"ghost",size:"sm",children:"Change"})]})]}),c.jsxs("div",{className:"grid gap-2",children:[c.jsx("h3",{className:"text-sm font-medium",children:"Recent Invoices"}),c.jsxs("div",{className:"rounded-lg border",children:[c.jsxs("div",{className:"flex items-center justify-between p-4",children:[c.jsxs("div",{children:[c.jsx("p",{className:"font-medium",children:"October 2023"}),c.jsx("p",{className:"text-sm text-muted-foreground",children:"Pro Plan • $49.00"})]}),c.jsx(me,{variant:"ghost",size:"sm",children:"Download"})]}),c.jsx(xn,{}),c.jsxs("div",{className:"flex items-center justify-between p-4",children:[c.jsxs("div",{children:[c.jsx("p",{className:"font-medium",children:"September 2023"}),c.jsx("p",{className:"text-sm text-muted-foreground",children:"Pro Plan • $49.00"})]}),c.jsx(me,{variant:"ghost",size:"sm",children:"Download"})]})]})]})]}),c.jsx(rr,{children:c.jsx(me,{variant:"outline",children:"View All Invoices"})})]})]});function YDe(){const{credentials:e,isLoading:t,onAddCredential:n,onDeleteCredential:r}=lv();return c.jsxs("div",{className:"flex min-h-screen flex-col",children:[c.jsx(sh,{credentials:e,isCredentialsLoading:t,onAddCredential:n,onDeleteCredential:r}),c.jsxs("div",{className:"flex-1 space-y-4 p-8 pt-6 mx-auto w-full max-w-7xl",children:[c.jsx("div",{className:"flex items-center justify-between space-y-2",children:c.jsx("h2",{className:"text-3xl font-bold tracking-tight",children:"Settings"})}),c.jsxs(Da,{defaultValue:"appearance",className:"space-y-4",children:[c.jsxs(Ls,{children:[c.jsx(St,{value:"appearance",children:"Appearance"}),c.jsx(St,{value:"notifications",children:"Notifications"}),c.jsx(St,{value:"application",children:"Application"}),c.jsx(St,{value:"teams",children:"Teams & Billing"})]}),c.jsx($t,{value:"appearance",className:"space-y-4",children:c.jsx(VDe,{})}),c.jsx($t,{value:"notifications",className:"space-y-4",children:c.jsx(GDe,{})}),c.jsx($t,{value:"application",className:"space-y-4",children:c.jsx(WDe,{})}),c.jsx($t,{value:"teams",className:"space-y-4",children:c.jsx(KDe,{})})]})]})]})}function XDe({searchQuery:e,onSearchChange:t}){const n=r=>{t(r.target.value)};return c.jsxs("section",{className:"space-y-4",children:[c.jsx("div",{className:"flex items-center justify-between space-y-2",children:c.jsx("h2",{className:"text-3xl font-bold tracking-tight",children:"Help & Support"})}),c.jsxs(At,{children:[c.jsxs(Ht,{children:[c.jsx(Rt,{children:"How can we help you?"}),c.jsx(kt,{children:"Search our knowledge base or contact support"})]}),c.jsx(Bt,{children:c.jsxs("div",{className:"relative",children:[c.jsx(ia,{className:"absolute left-2.5 top-2.5 h-4 w-4 text-muted-foreground"}),c.jsx(Ct,{type:"search",placeholder:"Search for help articles...",className:"pl-8",value:e,onChange:n})]})})]})]})}const ZDe=[{label:"Getting Started Guide",to:"#",icon:c.jsx(GX,{className:"h-4 w-4"})},{label:"API Reference",to:"#",icon:c.jsx(kZ,{className:"h-4 w-4"})},{label:"Workflow Examples",to:"#",icon:c.jsx(dQ,{className:"h-4 w-4"})},{label:"Node Reference",to:"#",icon:c.jsx(Wz,{className:"h-4 w-4"})}],QDe=[{label:"Introduction to Orcheo Canvas",to:"#",icon:c.jsx(Gb,{className:"h-4 w-4"}),badge:"New"},{label:"Building Your First Workflow",to:"#",icon:c.jsx(Gb,{className:"h-4 w-4"})},{label:"Advanced Workflow Techniques",to:"#",icon:c.jsx(Gb,{className:"h-4 w-4"})},{label:"Debugging and Troubleshooting",to:"#",icon:c.jsx(OJ,{className:"h-4 w-4"})}],JDe=[{label:"Community Forum",to:"#",icon:c.jsx(Ea,{className:"h-4 w-4"})},{label:"Discord Server",to:"#",icon:c.jsx(CQ,{className:"h-4 w-4"})},{label:"LinkedIn Group",to:"#",icon:c.jsx(mQ,{className:"h-4 w-4"})},{label:"Twitter",to:"#",icon:c.jsx(NJ,{className:"h-4 w-4"})}],ePe=[{title:"Documentation",description:"Explore our guides and examples",cta:"View All Documentation",links:ZDe},{title:"Video Tutorials",description:"Learn through step-by-step videos",cta:"View All Tutorials",links:QDe},{title:"Community",description:"Connect with other Orcheo Canvas users",cta:"Join Our Community",links:JDe}];function tPe(){return c.jsx("section",{className:"grid gap-4 md:grid-cols-2 lg:grid-cols-3",children:ePe.map(e=>c.jsxs(At,{children:[c.jsxs(Ht,{children:[c.jsx(Rt,{children:e.title}),c.jsx(kt,{children:e.description})]}),c.jsx(Bt,{className:"grid gap-2",children:e.links.map(t=>c.jsxs(pn,{to:t.to,className:"flex items-center gap-2 rounded-md p-2 hover:bg-muted",children:[t.icon,t.label,t.badge?c.jsx(Ue,{variant:"secondary",className:"ml-auto",children:t.badge}):null]},t.label))}),c.jsx(rr,{children:c.jsx(me,{variant:"outline",className:"w-full",children:e.cta})})]},e.title))})}const nPe=[{id:"item-1",question:"What is Orcheo Canvas and how does it work?",answer:"Orcheo Canvas is a visual workflow automation platform that lets you connect triggers, actions, and logic nodes on a canvas to build powerful automations without writing code."},{id:"item-2",question:"How do I create my first workflow?",answer:'Create a new workflow from the dashboard, add a trigger node, attach action nodes, connect them together, then save and activate it when you are ready. The "New Workflow" button guides you through the process.'},{id:"item-3",question:"What types of integrations are available?",answer:"We support Google Workspace, Microsoft 365, Slack, Salesforce, HubSpot, HTTP requests, webhooks, databases, and any service with a public API."},{id:"item-4",question:"How do I debug a workflow that's not working?",answer:"Use execution history, the workflow debugger, and node-level breakpoints to step through your automation and inspect the data flowing between nodes."},{id:"item-5",question:"How do I manage team access and permissions?",answer:"Invite teammates from Settings → Teams and assign Owner, Admin, Editor, or Viewer roles to control who can view, edit, or manage workflows."}];function rPe(){return c.jsxs(At,{children:[c.jsxs(Ht,{children:[c.jsx(Rt,{children:"Frequently Asked Questions"}),c.jsx(kt,{children:"Find answers to common questions about Orcheo Canvas"})]}),c.jsx(Bt,{children:c.jsx(nV,{type:"single",collapsible:!0,className:"w-full",children:nPe.map(e=>c.jsxs(bT,{value:e.id,children:[c.jsx(wT,{children:e.question}),c.jsx(ST,{children:e.answer})]},e.id))})}),c.jsx(rr,{children:c.jsx(me,{variant:"outline",className:"w-full",children:"View All FAQs"})})]})}function aPe(){return c.jsxs(At,{children:[c.jsxs(Ht,{children:[c.jsx(Rt,{children:"Contact Support"}),c.jsx(kt,{children:"Get help from our support team"})]}),c.jsx(Bt,{children:c.jsxs("div",{className:"grid gap-6",children:[c.jsxs("div",{className:"grid grid-cols-1 gap-4 md:grid-cols-2",children:[c.jsxs("div",{className:"grid gap-2",children:[c.jsx("label",{htmlFor:"support-name",className:"text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70",children:"Name"}),c.jsx(Ct,{id:"support-name",placeholder:"Enter your name"})]}),c.jsxs("div",{className:"grid gap-2",children:[c.jsx("label",{htmlFor:"support-email",className:"text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70",children:"Email"}),c.jsx(Ct,{id:"support-email",type:"email",placeholder:"Enter your email"})]})]}),c.jsxs("div",{className:"grid gap-2",children:[c.jsx("label",{htmlFor:"support-subject",className:"text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70",children:"Subject"}),c.jsx(Ct,{id:"support-subject",placeholder:"Enter subject"})]}),c.jsxs("div",{className:"grid gap-2",children:[c.jsx("label",{htmlFor:"support-message",className:"text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70",children:"Message"}),c.jsx(ih,{id:"support-message",placeholder:"Enter your message",className:"min-h-[120px]"})]})]})}),c.jsxs(rr,{className:"flex justify-between",children:[c.jsx(me,{variant:"outline",children:"Cancel"}),c.jsx(me,{children:"Submit"})]})]})}function sPe(){return c.jsxs(Da,{defaultValue:"faq",className:"space-y-4",children:[c.jsxs(Ls,{children:[c.jsx(St,{value:"faq",children:"Frequently Asked Questions"}),c.jsx(St,{value:"contact",children:"Contact Support"})]}),c.jsx($t,{value:"faq",className:"space-y-4",children:c.jsx(rPe,{})}),c.jsx($t,{value:"contact",className:"space-y-4",children:c.jsx(aPe,{})})]})}var oPe=N.forwardRef(function({control:t,...n},r){const a=N.useRef(null);return N.useLayoutEffect(()=>{const s=a.current;if(!s)return;if(customElements.get("openai-chatkit")){s.setOptions(t.options);return}let i=!0;return customElements.whenDefined("openai-chatkit").then(()=>{i&&s.setOptions(t.options)}),()=>{i=!1}},[t.options]),c.jsx("openai-chatkit",{ref:s=>{if(a.current=s,t.setInstance(s),typeof r=="function"?r(s):r&&(r.current=s),!a.current)return;const i={"chatkit.error":"onError","chatkit.response.end":"onResponseEnd","chatkit.response.start":"onResponseStart","chatkit.log":"onLog","chatkit.thread.change":"onThreadChange","chatkit.thread.load.start":"onThreadLoadStart","chatkit.thread.load.end":"onThreadLoadEnd","chatkit.ready":"onReady"},l=Object.keys(i);for(const d of l)a.current.addEventListener(d,f=>{const h=t.handlers[i[d]];typeof h=="function"&&h(f.detail)})},...n})});function rz(e){return e!==null&&typeof e=="object"&&[null,Object.prototype].includes(Object.getPrototypeOf(e))||Array.isArray(e)}function UC(e,t,n=new WeakMap){if(Object.is(e,t))return!0;if(typeof e=="function"&&typeof t=="function")return typeof e==typeof t;if(!rz(e)||!rz(t))return!1;const r=n.get(e);if(r&&r===t)return!0;if(n.set(e,t),Array.isArray(e)||Array.isArray(t)){if(!Array.isArray(e)||!Array.isArray(t)||e.length!==t.length)return!1;for(let i=0;i<e.length;i++)if(!UC(e[i],t[i],n))return!1;return!0}const a=Object.keys(e),s=Object.keys(t);if(a.length!==s.length)return!1;for(let i=0;i<a.length;i++){const l=a[i];if(!Object.prototype.hasOwnProperty.call(t,l))return!1;const d=e[l],f=t[l];if(!UC(d,f,n))return!1}return!0}function iPe(e){const t=[],n=(s,i)=>i.reduce((l,d)=>l==null?l:l[d],s),r=(s,i)=>(...l)=>{const d=n(e.current,s),f=d==null?void 0:d[i];if(typeof f=="function")return f.apply(d,l)},a=s=>{if(typeof s=="function"){const i=t[t.length-1],l=t.slice(0,-1);return r(l,i)}if(Array.isArray(s)){const i=t.length,l=new Array(s.length);for(let d=0;d<s.length;d++)t[i]=d,l[d]=a(s[d]);return t.length=i,l}if(s&&typeof s=="object"){const i=t.length,l={};for(const d of Object.keys(s))t[i]=d,l[d]=a(s[d]);return t.length=i,l}return s};return a(e.current)}function lPe(e){const t=Me.useRef(e);t.current=e;const n=Me.useRef(null);return(!n.current||!UC(n.current.snapshot,e))&&(n.current={snapshot:e,shaped:iPe(t)}),n.current.shaped}var cPe=Object.freeze(["focusComposer","setThreadId","sendUserMessage","setComposerValue","fetchUpdates","sendCustomAction"]);function uPe(e){const t=N.useRef(null),n=lPe(e),r=N.useMemo(()=>cPe.reduce((i,l)=>(i[l]=(...d)=>{if(!t.current){console.warn("ChatKit element is not mounted");return}return t.current[l](...d)},i),{}),[]),a=N.useCallback(i=>{t.current=i},[]),s=N.useMemo(()=>{const i={},l={};for(const[d,f]of Object.entries(n))/^on[A-Z]/.test(d)&&d!=="onClientTool"?l[d]=f:i[d]=f;return{setInstance:a,options:i,handlers:l}},[n,a]);return N.useMemo(()=>({...r,control:s,ref:t}),[r,s])}function Ay({options:e,className:t}){const{control:n}=uPe(e);return c.jsx("div",{className:ye("flex h-full w-full flex-col",t),children:c.jsx(oPe,{control:n,className:"flex h-full w-full flex-col"})})}const dPe=Object.freeze(Object.defineProperty({__proto__:null,ChatKitSurface:Ay},Symbol.toStringTag,{value:"Module"}));function fPe({title:e="Chat",initialMessages:t=[],className:n,isMinimizable:r=!0,isClosable:a=!0,position:s="bottom-right",triggerButton:i,user:l,ai:d,backendBaseUrl:f,workflowId:h,sessionPayload:p,getClientSecret:g,chatkitOptions:y,onResponseStart:S,onResponseEnd:w,onThreadChange:b,onLog:x}){const[_,j]=N.useState(!1),[C,T]=N.useState(!1),A=XU({chatkitOptions:y,getClientSecret:g,backendBaseUrl:f,workflowId:h,sessionPayload:p,title:e,user:l,ai:d,initialMessages:t,onResponseStart:S,onResponseEnd:w,onThreadChange:b,onLog:x}),k=()=>{T(!C)},O=()=>{j(!1),T(!1)},M={"bottom-right":"bottom-4 right-4","bottom-left":"bottom-4 left-4","top-right":"top-4 right-4","top-left":"top-4 left-4",center:"bottom-1/2 right-1/2 transform translate-x-1/2 translate-y-1/2"};return i?c.jsxs(fl,{open:_,onOpenChange:j,children:[c.jsx(ah,{asChild:!0,children:i}),c.jsxs(Jo,{className:"sm:max-w-md",children:[c.jsx(hl,{children:c.jsx(pl,{children:e})}),c.jsx("div",{className:"flex h-[60vh] flex-col",children:c.jsx(Ay,{options:A})})]})]}):c.jsxs(c.Fragment,{children:[!_&&c.jsx(Vn,{children:c.jsxs(Wn,{children:[c.jsx(Gn,{asChild:!0,children:c.jsx(me,{onClick:()=>j(!0),className:"rounded-full h-14 w-14 shadow-lg fixed z-50 bottom-4 right-4",children:c.jsx(Ea,{className:"h-6 w-6"})})}),c.jsx(In,{children:"Open chat"})]})}),_&&c.jsxs("div",{className:ye("fixed z-50 flex flex-col rounded-lg shadow-lg bg-background border",M[s],C?"w-72 h-12":"w-80 sm:w-96 h-[500px]",n),children:[c.jsxs("div",{className:"flex items-center justify-between p-3 border-b",children:[c.jsx("h3",{className:"font-medium truncate",children:e}),c.jsxs("div",{className:"flex items-center gap-1",children:[r&&c.jsx(me,{variant:"ghost",size:"icon",className:"h-6 w-6",onClick:k,children:c.jsx($z,{className:"h-4 w-4"})}),a&&c.jsx(me,{variant:"ghost",size:"icon",className:"h-6 w-6",onClick:O,children:c.jsx(la,{className:"h-4 w-4"})})]})]}),!C&&c.jsx(c.Fragment,{children:c.jsx("div",{className:"flex-1 overflow-hidden",children:c.jsx(Ay,{options:A})})})]})]})}function hPe({ai:e,user:t,initialMessages:n}){return c.jsx("section",{className:"rounded-lg border bg-card text-card-foreground shadow-sm",children:c.jsxs("div",{className:"flex flex-col items-center gap-4 p-6 md:flex-row",children:[c.jsxs("div",{className:"flex-1",children:[c.jsx("h3",{className:"text-2xl font-bold",children:"Need immediate help?"}),c.jsx("p",{className:"text-muted-foreground",children:"Chat with our AI assistant for instant answers"})]}),c.jsx(fPe,{title:"Orcheo Canvas Support",initialMessages:n,user:t,ai:e,triggerButton:c.jsxs(me,{size:"lg",className:"w-full md:w-auto",children:[c.jsx(Ea,{className:"mr-2 h-4 w-4"}),"Chat with Support"]})})]})})}const az={id:"user-1",name:"Avery Chen",avatar:"https://avatar.vercel.sh/avery"},sz={id:"ai-1",name:"Orcheo Canvas Support",avatar:"https://avatar.vercel.sh/orcheo-canvas",isAI:!0};function pPe(){const[e,t]=N.useState(""),n=N.useMemo(()=>[{id:"msg-1",content:"Hello! I'm the Orcheo Canvas support assistant. How can I help you today?",sender:sz,timestamp:new Date(Date.now()-6e4)}],[]),{credentials:r,isLoading:a,onAddCredential:s,onDeleteCredential:i}=lv({actorName:az.name});return c.jsxs("div",{className:"flex min-h-screen flex-col",children:[c.jsx(sh,{credentials:r,isCredentialsLoading:a,onAddCredential:s,onDeleteCredential:i}),c.jsxs("main",{className:"mx-auto w-full max-w-7xl flex-1 space-y-6 p-8 pt-6",children:[c.jsx(XDe,{searchQuery:e,onSearchChange:t}),c.jsx(tPe,{}),c.jsx(sPe,{}),c.jsx(hPe,{ai:sz,user:az,initialMessages:n})]})]})}var OW="Toggle",HT=N.forwardRef((e,t)=>{const{pressed:n,defaultPressed:r,onPressedChange:a,...s}=e,[i,l]=bn({prop:n,onChange:a,defaultProp:r??!1,caller:OW});return c.jsx(Ae.button,{type:"button","aria-pressed":i,"data-state":i?"on":"off","data-disabled":e.disabled?"":void 0,...s,ref:t,onClick:_e(e.onClick,()=>{e.disabled||l(!i)})})});HT.displayName=OW;var MW=HT,oi="ToggleGroup",[DW]=wn(oi,[Xo]),PW=Xo(),BT=Me.forwardRef((e,t)=>{const{type:n,...r}=e;if(n==="single"){const a=r;return c.jsx(mPe,{...a,ref:t})}if(n==="multiple"){const a=r;return c.jsx(gPe,{...a,ref:t})}throw new Error(`Missing prop \`type\` expected on \`${oi}\``)});BT.displayName=oi;var[$W,IW]=DW(oi),mPe=Me.forwardRef((e,t)=>{const{value:n,defaultValue:r,onValueChange:a=()=>{},...s}=e,[i,l]=bn({prop:n,defaultProp:r??"",onChange:a,caller:oi});return c.jsx($W,{scope:e.__scopeToggleGroup,type:"single",value:Me.useMemo(()=>i?[i]:[],[i]),onItemActivate:l,onItemDeactivate:Me.useCallback(()=>l(""),[l]),children:c.jsx(LW,{...s,ref:t})})}),gPe=Me.forwardRef((e,t)=>{const{value:n,defaultValue:r,onValueChange:a=()=>{},...s}=e,[i,l]=bn({prop:n,defaultProp:r??[],onChange:a,caller:oi}),d=Me.useCallback(h=>l((p=[])=>[...p,h]),[l]),f=Me.useCallback(h=>l((p=[])=>p.filter(g=>g!==h)),[l]);return c.jsx($W,{scope:e.__scopeToggleGroup,type:"multiple",value:i,onItemActivate:d,onItemDeactivate:f,children:c.jsx(LW,{...s,ref:t})})});BT.displayName=oi;var[yPe,vPe]=DW(oi),LW=Me.forwardRef((e,t)=>{const{__scopeToggleGroup:n,disabled:r=!1,rovingFocus:a=!0,orientation:s,dir:i,loop:l=!0,...d}=e,f=PW(n),h=Ko(i),p={role:"group",dir:h,...d};return c.jsx(yPe,{scope:n,rovingFocus:a,disabled:r,children:a?c.jsx(Yy,{asChild:!0,...f,orientation:s,dir:h,loop:l,children:c.jsx(Ae.div,{...p,ref:t})}):c.jsx(Ae.div,{...p,ref:t})})}),Ry="ToggleGroupItem",zW=Me.forwardRef((e,t)=>{const n=IW(Ry,e.__scopeToggleGroup),r=vPe(Ry,e.__scopeToggleGroup),a=PW(e.__scopeToggleGroup),s=n.value.includes(e.value),i=r.disabled||e.disabled,l={...e,pressed:s,disabled:i},d=Me.useRef(null);return r.rovingFocus?c.jsx(Xy,{asChild:!0,...a,focusable:!i,active:s,ref:d,children:c.jsx(oz,{...l,ref:t})}):c.jsx(oz,{...l,ref:t})});zW.displayName=Ry;var oz=Me.forwardRef((e,t)=>{const{__scopeToggleGroup:n,value:r,...a}=e,s=IW(Ry,n),i={role:"radio","aria-checked":e.pressed,"aria-pressed":void 0},l=s.type==="single"?i:void 0;return c.jsx(HT,{...l,...a,ref:t,onPressedChange:d=>{d?s.onItemActivate(r):s.onItemDeactivate(r)}})}),qW=BT,FW=zW;const UW=Kf("inline-flex items-center justify-center gap-2 rounded-md text-sm font-medium transition-colors hover:bg-muted hover:text-muted-foreground focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:pointer-events-none disabled:opacity-50 data-[state=on]:bg-accent data-[state=on]:text-accent-foreground [&_svg]:pointer-events-none [&_svg]:size-4 [&_svg]:shrink-0",{variants:{variant:{default:"bg-transparent",outline:"border border-input bg-transparent shadow-sm hover:bg-accent hover:text-accent-foreground"},size:{default:"h-9 px-2 min-w-9",sm:"h-8 px-1.5 min-w-8",lg:"h-10 px-2.5 min-w-10"}},defaultVariants:{variant:"default",size:"default"}}),xPe=N.forwardRef(({className:e,variant:t,size:n,...r},a)=>c.jsx(MW,{ref:a,className:ye(UW({variant:t,size:n,className:e})),...r}));xPe.displayName=MW.displayName;const HW=N.createContext({size:"default",variant:"default"}),BW=N.forwardRef(({className:e,variant:t,size:n,children:r,...a},s)=>c.jsx(qW,{ref:s,className:ye("flex items-center justify-center gap-1",e),...a,children:c.jsx(HW.Provider,{value:{variant:t,size:n},children:r})}));BW.displayName=qW.displayName;const VW=N.forwardRef(({className:e,children:t,variant:n,size:r,...a},s)=>{const i=N.useContext(HW);return c.jsx(FW,{ref:s,className:ye(UW({variant:i.variant||n,size:i.size||r}),e),...a,children:t})});VW.displayName=FW.displayName;const bPe=e=>[{label:"What can you do?",prompt:`What can ${e} help with?`,icon:"circle-question"},{label:"Introduce yourself",prompt:"My name is ...",icon:"book-open"},{label:"Latest results",prompt:`Summarize the latest run for ${e}.`,icon:"search"},{label:"Switch theme",prompt:"Change the theme to dark mode",icon:"sparkle"}],wPe=e=>`Welcome to the ${e} public chat.`,SPe=e=>`Share a fact for ${e}`;function _Pe({workflowId:e,workflowName:t,backendBaseUrl:n,onReady:r,onHttpError:a,onLog:s,colorScheme:i="light",onThemeRequest:l}){const d=N.useMemo(()=>{const f=YU();return{api:{url:gn("/api/chatkit",n),domainKey:f,fetch:vC({workflowId:e,backendBaseUrl:n,onHttpError:a,metadata:{workflow_name:t}})},header:{enabled:!0,title:{text:t}},history:{enabled:!0},theme:ZU(i),startScreen:{greeting:wPe(t),prompts:bPe(t)},composer:{placeholder:SPe(t)},threadItemActions:{feedback:!1},onClientTool:async h=>{var p;if(h.name==="switch_theme"){const g=(p=h.params)==null?void 0:p.theme;return g==="light"||g==="dark"?l?(await l(g),{success:!0}):{success:!1}:{success:!1}}return{success:!1}},onReady:r,onLog:s}},[n,i,a,s,r,l,e,t]);return c.jsx("div",{className:ye("relative h-full w-full overflow-hidden rounded-3xl","border border-slate-200/70 bg-white","shadow-[0_25px_80px_rgba(15,23,42,0.12)]","dark:border-slate-800/70 dark:bg-slate-900"),children:c.jsx(Ay,{options:d})})}class NPe extends N.Component{constructor(){super(...arguments);ft(this,"state",{hasError:!1,errorMessage:void 0});ft(this,"handleReset",()=>{var n,r;this.setState({hasError:!1,errorMessage:void 0}),(r=(n=this.props).onReset)==null||r.call(n)})}static getDerivedStateFromError(n){return{hasError:!0,errorMessage:n.message}}componentDidCatch(n,r){console.error("PublicChatErrorBoundary caught an error",n,r)}render(){return this.state.hasError?c.jsxs(Ho,{className:"rounded-3xl border-red-500/40 bg-red-500/10 p-6 text-red-100",children:[c.jsx(Bo,{children:"Something went wrong"}),c.jsx(Vo,{children:this.state.errorMessage||"The public chat encountered an unexpected error. Please try again."}),c.jsxs("div",{className:"mt-4 flex flex-wrap gap-3",children:[c.jsx(me,{variant:"outline",onClick:this.handleReset,children:"Try again"}),c.jsx(me,{variant:"ghost",onClick:()=>{typeof window<"u"&&window.location.reload()},children:"Reload page"})]})]}):this.props.children}}const jPe=e=>e.replace(/[\r\n]+/g," ").replace(/[<>]/g,"").trim();function CPe(){const{workflowId:e}=Dy(),[t,n]=N.useState({status:e?"loading":"error",...e?{}:{message:"Workflow identifier missing from URL."}}),[r,a]=N.useState(null),[s,i]=N.useState(null),[l,d]=N.useState(!1),[f,h]=N.useState(()=>typeof window<"u"&&window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light"),{theme:p,setTheme:g}=kW({}),y=N.useMemo(()=>ni(),[]);N.useEffect(()=>{a(null),i(null),d(!1)},[e]),N.useEffect(()=>{if(!e)return;let C=!1;return n({status:"loading"}),Fq(e).then(T=>{if(!C){if(!T){n({status:"error",message:"This workflow does not exist or is no longer available."});return}if(!T.is_public){n({status:"error",message:"This workflow is private. Ask the owner to republish it before trying again."});return}n({status:"ready",workflow:T})}}).catch(T=>{if(!C){if(T instanceof mv){const A=T.status>=500?"The workflow service is unavailable. Please try again later.":"Unable to load workflow metadata.";n({status:"error",message:A});return}n({status:"error",message:"Unexpected error while loading workflow metadata."})}}),()=>{C=!0}},[e]);const S=N.useMemo(()=>{if(t.status!=="ready")return"mailto:?subject=Orcheo%20workflow%20access";const C=jPe(t.workflow.name),T=encodeURIComponent(`Request access to ${C}`),A=typeof window<"u"?window.location.href:"",k=encodeURIComponent(`Hi,%0A%0ACould you confirm access for workflow "${C}" (${t.workflow.id})?%0A%0ALink: ${A}%0A`);return`mailto:?subject=${T}&body=${k}`},[t]),w=N.useCallback(()=>{a(null),i(null),d(!1)},[]),b=C=>{var T;if(C.status===429||(T=C.code)!=null&&T.startsWith("chatkit.rate_limit")){i(C);return}if(C.code==="chatkit.auth.oauth_required"){a({...C,message:"OAuth login is required before this workflow can be used. Sign in and try again."}),d(!1);return}if(C.status===401||C.status===403){a({...C,message:"You do not have access to this workflow yet. Ask the owner to confirm it is still published."}),d(!1);return}a({...C,message:C.message||"ChatKit could not start this conversation. Please try again shortly."}),d(!1)},x=p==="system"?f:p;N.useEffect(()=>{if(typeof window>"u")return;const C=window.matchMedia("(prefers-color-scheme: dark)"),T=A=>{h(A.matches?"dark":"light")};return typeof C.addEventListener=="function"?C.addEventListener("change",T):C.addListener(T),()=>{typeof C.removeEventListener=="function"?C.removeEventListener("change",T):C.removeListener(T)}},[]);const _=N.useCallback(C=>{g(C)},[g]),j=()=>{const C=t.status==="ready"?t.workflow.name:"this workflow",T=()=>t.status==="loading"?c.jsxs("div",{className:"space-y-4",children:[c.jsx(Ro,{className:"h-10 w-40 rounded-full"}),c.jsx(Ro,{className:"h-[520px] w-full rounded-3xl"})]}):t.status==="error"?c.jsxs("div",{className:"rounded-3xl border border-slate-200/80 bg-white/70 p-6 text-slate-900 shadow-sm dark:border-slate-800/60 dark:bg-slate-950/40 dark:text-white",children:[c.jsx("p",{className:"text-lg font-semibold",children:"Chat unavailable"}),c.jsx("p",{className:"mt-2 text-sm text-slate-600 dark:text-slate-300",children:"We cannot open a ChatKit session until the workflow loads."}),c.jsx(me,{asChild:!0,variant:"secondary",className:"mt-4",children:c.jsx(pn,{to:"/",children:"Return home"})})]}):c.jsxs("div",{className:"space-y-4",children:[s&&c.jsxs(Ho,{className:"border-amber-500/50 bg-amber-500/[0.08] text-amber-100",children:[c.jsx(Bo,{children:"Slow down for a moment"}),c.jsx(Vo,{children:s.message||"Too many requests were sent for this workflow. Please wait before retrying."}),c.jsx("div",{className:"mt-3",children:c.jsx(me,{size:"sm",variant:"outline",className:"border-amber-400/60 text-amber-100",onClick:()=>i(null),children:"Dismiss"})})]}),r?c.jsxs("div",{className:"space-y-4 rounded-3xl border border-red-500/40 bg-red-500/10 p-6 text-center",children:[c.jsx("p",{className:"font-medium text-red-100",children:r.message}),c.jsx("div",{className:"flex flex-wrap justify-center gap-3",children:c.jsx(me,{asChild:!0,variant:"outline",children:c.jsx("a",{href:S,children:"Contact owner"})})})]}):c.jsxs("div",{className:"relative min-h-[520px]",children:[!l&&c.jsxs("div",{className:"absolute inset-0 flex flex-col gap-4 rounded-3xl bg-white/90 p-6 shadow-sm dark:bg-slate-950/80",children:[c.jsx(Ro,{className:"h-10 w-1/2 self-center"}),c.jsx(Ro,{className:"h-full w-full"})]}),c.jsx("div",{className:ye("h-[520px] w-full",l?"opacity-100":"opacity-0","transition-opacity duration-200"),children:c.jsx(_Pe,{workflowId:t.workflow.id,workflowName:t.workflow.name,backendBaseUrl:y,onHttpError:b,onReady:()=>d(!0),colorScheme:x,onThemeRequest:_},t.workflow.id)})]})]});return c.jsxs("div",{className:"space-y-6",children:[c.jsxs("div",{className:"flex flex-col gap-4 sm:flex-row sm:items-center sm:justify-between",children:[c.jsxs("div",{className:"space-y-2",children:[c.jsxs("p",{className:"text-3xl font-semibold text-slate-900 dark:text-white",children:["Chat with “",C,"”"]}),c.jsx("p",{className:"text-base text-slate-600 dark:text-slate-300",children:"Chat sessions open automatically for published workflows unless the owner requires OAuth login."})]}),c.jsx(TPe,{value:p,onChange:g})]}),T()]})};return c.jsx(NPe,{onReset:w,children:c.jsx("div",{className:"h-screen overflow-hidden bg-white text-slate-900 dark:bg-slate-950 dark:text-white",children:c.jsx("div",{className:"mx-auto flex h-full max-w-6xl flex-col px-4 py-6 lg:py-8",children:c.jsx("div",{className:"flex flex-1 items-center justify-center",children:c.jsx("div",{className:"w-full max-w-3xl",children:j()})})})})})}const WW=[{value:"light",label:"Light",icon:c.jsx(Bz,{className:"h-4 w-4"})},{value:"dark",label:"Dark",icon:c.jsx(Lz,{className:"h-4 w-4"})},{value:"system",label:"System",icon:c.jsx(Iz,{className:"h-4 w-4"})}],EPe=e=>WW.some(t=>t.value===e);function TPe({className:e,value:t,onChange:n}){const r=a=>{!a||!EPe(a)||n(a)};return c.jsx(BW,{type:"single",value:t,onValueChange:r,"aria-label":"Select display theme",className:ye("rounded-full border border-slate-200 bg-white/90 px-1 py-1 shadow-[inset_0_-1px_4px_rgba(15,23,42,0.12)] backdrop-blur-sm dark:border-slate-800 dark:bg-slate-950/70",e),variant:"default",size:"default",children:WW.map(a=>c.jsxs(VW,{value:a.value,"aria-label":`Use ${a.label.toLowerCase()} theme`,className:"h-9 w-9 rounded-full border border-transparent p-0 text-slate-400 transition-all hover:bg-transparent hover:text-slate-900 dark:text-slate-400 dark:hover:text-white data-[state=on]:border-slate-900/20 data-[state=on]:bg-slate-900 data-[state=on]:text-white data-[state=on]:shadow-[0_4px_12px_rgba(15,23,42,0.3)] dark:data-[state=on]:border-white/30 dark:data-[state=on]:bg-white dark:data-[state=on]:text-slate-900",children:[a.icon,c.jsx("span",{className:"sr-only",children:a.label})]},a.value))})}function APe(){return c.jsx(_X,{children:c.jsxs(eX,{children:[c.jsx(Qr,{path:"/",element:c.jsx(wle,{})}),c.jsx(Qr,{path:"/workflow-canvas",element:c.jsx(ez,{})}),c.jsx(Qr,{path:"/workflow-canvas/:workflowId",element:c.jsx(ez,{})}),c.jsx(Qr,{path:"/workflow-execution-details/:executionId",element:c.jsx(wDe,{})}),c.jsx(Qr,{path:"/login",element:c.jsx(NDe,{})}),c.jsx(Qr,{path:"/signup",element:c.jsx(jDe,{})}),c.jsx(Qr,{path:"/profile",element:c.jsx(ADe,{})}),c.jsx(Qr,{path:"/settings",element:c.jsx(YDe,{})}),c.jsx(Qr,{path:"/help-support",element:c.jsx(pPe,{})}),c.jsx(Qr,{path:"/chat/:workflowId",element:c.jsx(CPe,{})})]})})}function RPe(){const t=localStorage.getItem("theme")||"system";kPe(t);const n=localStorage.getItem("reducedMotion")==="true",r=localStorage.getItem("highContrast")==="true",a=localStorage.getItem("accentColor")||"blue";document.documentElement.classList.toggle("reduce-motion",n),document.documentElement.classList.toggle("high-contrast",r),document.documentElement.setAttribute("data-accent",a)}function kPe(e){if(e==="system"){const t=window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light";document.documentElement.classList.toggle("dark",t==="dark")}else document.documentElement.classList.toggle("dark",e==="dark")}RPe();window.React=Me;window.ReactDOM=sY;const OPe=uY.createRoot(document.getElementById("root"));OPe.render(c.jsx(Me.StrictMode,{children:c.jsx(APe,{})}))});export default MPe();
|