diff --git a/.DS_Store b/.DS_Store index 8f805800..24f9b358 100644 Binary files a/.DS_Store and b/.DS_Store differ diff --git a/.claude/settings.local.json b/.claude/settings.local.json index fd76537e..28405bc3 100644 --- a/.claude/settings.local.json +++ b/.claude/settings.local.json @@ -15,7 +15,8 @@ "Bash(npm run build:*)", "Bash(source:*)", "Bash(python:*)", - "Bash(find:*)" + "Bash(find:*)", + "Bash(npx tsc:*)" ], "deny": [] }, diff --git a/CLAUDE.md b/CLAUDE.md index ee78add9..9567c7a8 100644 --- a/CLAUDE.md +++ b/CLAUDE.md @@ -3,14 +3,28 @@ This file provides guidance to Claude Code (claude.ai/code) when working with code in this repository. ## Commands -- Build: `npm run build` (use this for all testing and verification) -- Lint code: `npm run lint` -- Preview production build: `npm run preview` -- Python testing: When modifying Python files, activate the virtual environment with `source backend/venv/bin/activate` and test syntax by importing the module with `python -c "import app.services.module_name"` +- **Build**: `npm run build` (use this for all testing and verification) +- **Dev Build**: `npm run build:dev` (development mode build) +- **Lint**: `npm run lint` +- **Preview**: `npm run preview` +- **Backend**: `cd backend && python run.py` **Note**: This project is hosted on a server. Always use `npm run build` instead of `npm run dev` for testing changes. -**Python Testing**: After modifying any Python files in the backend, ALWAYS activate the virtual environment and test for syntax errors by attempting to import the modified module. This catches syntax errors before deployment. +## Backend Commands +- **Start Backend**: `python run.py` (from backend/ directory) +- **Backend Server**: Runs on port 5137 with Hypercorn ASGI server +- **Database**: MongoDB with PyMongo +- **Authentication**: JWT tokens via Flask-JWT-Extended + +## Testing +**Python Backend**: After modifying any Python files: +```bash +source backend/venv/bin/activate +python -c "import app.services.module_name" # Test specific module +python -c "from app import create_app; app = create_app()" # Test app creation +``` +**Frontend**: Run `npm run build` to verify TypeScript compilation ## Code Style Guidelines - **Imports**: Group imports by source (React, third-party, local) @@ -26,4 +40,36 @@ This file provides guidance to Claude Code (claude.ai/code) when working with co - **URL Construction**: ALWAYS use `import.meta.env.BASE_URL` when constructing URLs for static assets, images, or links. This project uses base path `/semblance/` in production. Example: `${import.meta.env.BASE_URL}image.png` instead of `/image.png` ## Project Stack -Vite, React, TypeScript, Tailwind CSS, shadcn-ui \ No newline at end of file +**Frontend**: Vite, React 18, TypeScript, Tailwind CSS, shadcn-ui +**Backend**: Flask 2.2.3, Hypercorn, PyMongo, JWT Extended +**Key Libraries**: +- UI: Radix UI components, Lucide React icons +- State: TanStack Query, React Hook Form with Zod validation +- Routing: React Router DOM +- AI/LLM: OpenAI, Google Generative AI +- Charts: Recharts +- Drag & Drop: DND Kit + +## API Configuration +- **Frontend API Base**: `/semblance_back/api` (configurable via VITE_API_BASE_URL) +- **Backend Proxy**: Vite dev server proxies `/api` to `localhost:5137` +- **Production Base Path**: `/semblance/` (configured in vite.config.ts) +- **Authentication**: JWT tokens stored in localStorage + +## File Organization +- **Backend Services**: `/backend/app/services/` - Business logic and AI integrations +- **Backend Models**: `/backend/app/models/` - Data models (User, FocusGroup, Persona) +- **Backend Routes**: `/backend/app/routes/` - API endpoints +- **AI Prompts**: `/backend/prompts/` - LLM prompt templates +- **Frontend Components**: + - `/src/components/ui/` - Reusable shadcn-ui components + - `/src/components/focus-group-session/` - Focus group specific components + - `/src/components/persona/` - Persona management components +- **Types**: `/src/types/` - TypeScript type definitions +- **Contexts**: `/src/contexts/` - React context providers + +## Environment +- **Base Path**: Uses `/semblance/` in production (configured in vite.config.ts) +- **Backend Port**: 5137 (Hypercorn ASGI server) +- **Frontend Dev Port**: 5173 +- **Temp Directories**: Backend creates `/backend/temp/` for file handling \ No newline at end of file diff --git a/backend/.DS_Store b/backend/.DS_Store index 1c50d729..8358d2dc 100644 Binary files a/backend/.DS_Store and b/backend/.DS_Store differ diff --git a/backend/app/services/__pycache__/ai_moderator_service.cpython-313.pyc b/backend/app/services/__pycache__/ai_moderator_service.cpython-313.pyc index f51fc53f..29175a19 100644 Binary files a/backend/app/services/__pycache__/ai_moderator_service.cpython-313.pyc and b/backend/app/services/__pycache__/ai_moderator_service.cpython-313.pyc differ diff --git a/backend/app/services/__pycache__/autonomous_conversation_controller.cpython-313.pyc b/backend/app/services/__pycache__/autonomous_conversation_controller.cpython-313.pyc index 83adf563..95a97a56 100644 Binary files a/backend/app/services/__pycache__/autonomous_conversation_controller.cpython-313.pyc and b/backend/app/services/__pycache__/autonomous_conversation_controller.cpython-313.pyc differ diff --git a/backend/app/services/ai_moderator_service.py b/backend/app/services/ai_moderator_service.py index c8d3c692..ce212186 100644 --- a/backend/app/services/ai_moderator_service.py +++ b/backend/app/services/ai_moderator_service.py @@ -700,17 +700,23 @@ class AIModeratorService: 'status': 'completed' }) - # Add mode event for AI auto-completion (only for auto_complete reason) - if reason == 'auto_complete': + # Add mode event for AI-driven session conclusions + # This includes auto_complete, natural_completion, discussion_guide_completed, etc. + ai_driven_reasons = [ + 'auto_complete', 'natural_completion', 'discussion_guide_completed', + 'action_limit_reached', 'time_limit' + ] + + if reason in ai_driven_reasons: mode_event_id = FocusGroup.add_mode_event( focus_group_id=focus_group_id, event_type='ai_session_concluded' ) if mode_event_id: - print(f"🎯 Added AI session concluded mode event for focus group {focus_group_id}") + print(f"🎯 Added AI session concluded mode event for focus group {focus_group_id} (reason: {reason})") else: - print(f"Warning: Failed to add AI session concluded mode event for focus group {focus_group_id}") + print(f"Warning: Failed to add AI session concluded mode event for focus group {focus_group_id} (reason: {reason})") print(f"🎬 Session ended for focus group {focus_group_id} with reason: {reason}") diff --git a/backend/app/services/autonomous_conversation_controller.py b/backend/app/services/autonomous_conversation_controller.py index c7c1fdf5..c5fca26e 100644 --- a/backend/app/services/autonomous_conversation_controller.py +++ b/backend/app/services/autonomous_conversation_controller.py @@ -24,6 +24,7 @@ class AutonomousConversationController: self.logger = logger or logging.getLogger(__name__) self.is_running = False self.conversation_state = "idle" # idle, running, paused, completed, error + self.is_generating = False # Track when actively generating responses self.last_action_time = None self.action_count = 0 self.max_actions_per_session = 500 # Safety limit @@ -164,8 +165,20 @@ class AutonomousConversationController: # Only add completion message for specific reasons (skip manual_stop) if reason in completion_messages: - completion_message = completion_messages[reason] - await self._add_moderator_message(completion_message, "system") + # Use the AI moderator service to properly end the session with mode events + from app.services.ai_moderator_service import AIModeratorService + + ending_result = AIModeratorService.end_session_with_concluding_statement( + self.focus_group_id, reason + ) + + if "error" in ending_result: + self.logger.error(f"Error ending session with concluding statement: {ending_result['error']}") + # Fallback to simple message + completion_message = completion_messages[reason] + await self._add_moderator_message(completion_message, "system") + else: + self.logger.info(f"Successfully ended session with concluding statement: {ending_result.get('concluding_statement', '')[:100]}...") # For discussion guide completion, ensure all items are marked as completed (100% progress) if reason in ["discussion_guide_completed", "natural_completion"]: @@ -525,6 +538,7 @@ class AutonomousConversationController: async def _execute_participant_respond(self, details: Dict[str, Any]) -> Dict[str, Any]: """Execute participant respond action.""" try: + self.is_generating = True # Mark as generating participant_id = details["participant_id"] topic_context = details["topic_context"] @@ -542,10 +556,14 @@ class AutonomousConversationController: import traceback self.logger.error(f"❌ Full traceback: {traceback.format_exc()}") return {"error": error_msg} + finally: + self.is_generating = False # Always clear generating state async def _execute_participant_interaction(self, details: Dict[str, Any]) -> Dict[str, Any]: """Execute participant interaction action.""" try: + self.is_generating = True # Mark as generating + participant_ids = details["participant_ids"] moderator_prompt = details["moderator_prompt"] @@ -565,6 +583,8 @@ class AutonomousConversationController: except Exception as e: return {"error": f"Error in participant interaction: {str(e)}"} + finally: + self.is_generating = False # Always clear generating state async def _execute_probe_trigger(self, details: Dict[str, Any]) -> Dict[str, Any]: """Execute probe trigger action.""" @@ -1035,6 +1055,7 @@ class AutonomousConversationController: "focus_group_id": self.focus_group_id, "is_running": self.is_running, "conversation_state": self.conversation_state, + "is_generating": self.is_generating, "action_count": self.action_count, "last_action_time": self.last_action_time.isoformat() if self.last_action_time else None, "consecutive_silence_count": self.consecutive_silence_count, diff --git a/dist/assets/index-ByQ3S_f0.css b/dist/assets/index-ByQ3S_f0.css deleted file mode 100644 index 77e64133..00000000 --- a/dist/assets/index-ByQ3S_f0.css +++ /dev/null @@ -1 +0,0 @@ -@import"https://fonts.googleapis.com/css2?family=Inter:wght@100;200;300;400;500;600;700;800;900&display=swap";.back-button{position:absolute;top:1.25rem;left:1.25rem;z-index:10;display:flex;align-items:center;justify-content:center;width:2.5rem;height:2.5rem;border-radius:9999px;background-color:#fffc;border:1px solid rgba(0,0,0,.1);-webkit-backdrop-filter:blur(4px);backdrop-filter:blur(4px);transition:all .15s ease}.back-button:hover{background-color:#ffffffe6;transform:translateY(-1px);box-shadow:0 2px 4px #0000000d}.back-button:active{transform:translateY(0)}.back-button-content{display:flex;align-items:center;gap:.25rem}.page-header-with-back{display:flex;align-items:center;gap:.75rem;padding-left:2.5rem;position:relative}*,:before,:after{--tw-border-spacing-x: 0;--tw-border-spacing-y: 0;--tw-translate-x: 0;--tw-translate-y: 0;--tw-rotate: 0;--tw-skew-x: 0;--tw-skew-y: 0;--tw-scale-x: 1;--tw-scale-y: 1;--tw-pan-x: ;--tw-pan-y: ;--tw-pinch-zoom: ;--tw-scroll-snap-strictness: proximity;--tw-gradient-from-position: ;--tw-gradient-via-position: ;--tw-gradient-to-position: ;--tw-ordinal: ;--tw-slashed-zero: ;--tw-numeric-figure: ;--tw-numeric-spacing: ;--tw-numeric-fraction: ;--tw-ring-inset: ;--tw-ring-offset-width: 0px;--tw-ring-offset-color: #fff;--tw-ring-color: rgb(59 130 246 / .5);--tw-ring-offset-shadow: 0 0 #0000;--tw-ring-shadow: 0 0 #0000;--tw-shadow: 0 0 #0000;--tw-shadow-colored: 0 0 #0000;--tw-blur: ;--tw-brightness: ;--tw-contrast: ;--tw-grayscale: ;--tw-hue-rotate: ;--tw-invert: ;--tw-saturate: ;--tw-sepia: ;--tw-drop-shadow: ;--tw-backdrop-blur: ;--tw-backdrop-brightness: ;--tw-backdrop-contrast: ;--tw-backdrop-grayscale: ;--tw-backdrop-hue-rotate: ;--tw-backdrop-invert: ;--tw-backdrop-opacity: ;--tw-backdrop-saturate: ;--tw-backdrop-sepia: ;--tw-contain-size: ;--tw-contain-layout: ;--tw-contain-paint: ;--tw-contain-style: }::backdrop{--tw-border-spacing-x: 0;--tw-border-spacing-y: 0;--tw-translate-x: 0;--tw-translate-y: 0;--tw-rotate: 0;--tw-skew-x: 0;--tw-skew-y: 0;--tw-scale-x: 1;--tw-scale-y: 1;--tw-pan-x: ;--tw-pan-y: ;--tw-pinch-zoom: ;--tw-scroll-snap-strictness: proximity;--tw-gradient-from-position: ;--tw-gradient-via-position: ;--tw-gradient-to-position: ;--tw-ordinal: ;--tw-slashed-zero: ;--tw-numeric-figure: ;--tw-numeric-spacing: ;--tw-numeric-fraction: ;--tw-ring-inset: ;--tw-ring-offset-width: 0px;--tw-ring-offset-color: #fff;--tw-ring-color: rgb(59 130 246 / .5);--tw-ring-offset-shadow: 0 0 #0000;--tw-ring-shadow: 0 0 #0000;--tw-shadow: 0 0 #0000;--tw-shadow-colored: 0 0 #0000;--tw-blur: ;--tw-brightness: ;--tw-contrast: ;--tw-grayscale: ;--tw-hue-rotate: ;--tw-invert: ;--tw-saturate: ;--tw-sepia: ;--tw-drop-shadow: ;--tw-backdrop-blur: ;--tw-backdrop-brightness: ;--tw-backdrop-contrast: ;--tw-backdrop-grayscale: ;--tw-backdrop-hue-rotate: ;--tw-backdrop-invert: ;--tw-backdrop-opacity: ;--tw-backdrop-saturate: ;--tw-backdrop-sepia: ;--tw-contain-size: ;--tw-contain-layout: ;--tw-contain-paint: ;--tw-contain-style: }*,:before,:after{box-sizing:border-box;border-width:0;border-style:solid;border-color:#e5e7eb}:before,:after{--tw-content: ""}html,:host{line-height:1.5;-webkit-text-size-adjust:100%;-moz-tab-size:4;-o-tab-size:4;tab-size:4;font-family:Inter,system-ui,sans-serif;font-feature-settings:normal;font-variation-settings:normal;-webkit-tap-highlight-color:transparent}body{margin:0;line-height:inherit}hr{height:0;color:inherit;border-top-width:1px}abbr:where([title]){-webkit-text-decoration:underline dotted;text-decoration:underline dotted}h1,h2,h3,h4,h5,h6{font-size:inherit;font-weight:inherit}a{color:inherit;text-decoration:inherit}b,strong{font-weight:bolder}code,kbd,samp,pre{font-family:ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,Liberation Mono,Courier New,monospace;font-feature-settings:normal;font-variation-settings:normal;font-size:1em}small{font-size:80%}sub,sup{font-size:75%;line-height:0;position:relative;vertical-align:baseline}sub{bottom:-.25em}sup{top:-.5em}table{text-indent:0;border-color:inherit;border-collapse:collapse}button,input,optgroup,select,textarea{font-family:inherit;font-feature-settings:inherit;font-variation-settings:inherit;font-size:100%;font-weight:inherit;line-height:inherit;letter-spacing:inherit;color:inherit;margin:0;padding:0}button,select{text-transform:none}button,input:where([type=button]),input:where([type=reset]),input:where([type=submit]){-webkit-appearance:button;background-color:transparent;background-image:none}:-moz-focusring{outline:auto}:-moz-ui-invalid{box-shadow:none}progress{vertical-align:baseline}::-webkit-inner-spin-button,::-webkit-outer-spin-button{height:auto}[type=search]{-webkit-appearance:textfield;outline-offset:-2px}::-webkit-search-decoration{-webkit-appearance:none}::-webkit-file-upload-button{-webkit-appearance:button;font:inherit}summary{display:list-item}blockquote,dl,dd,h1,h2,h3,h4,h5,h6,hr,figure,p,pre{margin:0}fieldset{margin:0;padding:0}legend{padding:0}ol,ul,menu{list-style:none;margin:0;padding:0}dialog{padding:0}textarea{resize:vertical}input::-moz-placeholder,textarea::-moz-placeholder{opacity:1;color:#9ca3af}input::placeholder,textarea::placeholder{opacity:1;color:#9ca3af}button,[role=button]{cursor:pointer}:disabled{cursor:default}img,svg,video,canvas,audio,iframe,embed,object{display:block;vertical-align:middle}img,video{max-width:100%;height:auto}[hidden]:where(:not([hidden=until-found])){display:none}:root{--background: 350 30% 98%;--foreground: 345 30% 15%;--card: 0 0% 100%;--card-foreground: 345 30% 15%;--popover: 0 0% 100%;--popover-foreground: 345 30% 15%;--primary: 350 85% 80%;--primary-foreground: 350 30% 20%;--secondary: 350 30% 96.1%;--secondary-foreground: 345 30% 15%;--muted: 350 30% 96.1%;--muted-foreground: 350 10% 50%;--accent: 350 30% 96.1%;--accent-foreground: 345 30% 15%;--destructive: 0 84.2% 60.2%;--destructive-foreground: 350 30% 98%;--border: 350 30% 91.4%;--input: 350 30% 91.4%;--ring: 350 85% 80%;--radius: .5rem;--sidebar-background: 0 0% 100%;--sidebar-foreground: 345 30% 15%;--sidebar-primary: 350 85% 80%;--sidebar-primary-foreground: 350 30% 20%;--sidebar-accent: 350 30% 96.1%;--sidebar-accent-foreground: 345 30% 15%;--sidebar-border: 350 30% 91.4%;--sidebar-ring: 350 85% 80%}.dark{--background: 345 30% 10%;--foreground: 350 30% 98%;--card: 345 30% 10%;--card-foreground: 350 30% 98%;--popover: 345 30% 10%;--popover-foreground: 350 30% 98%;--primary: 350 85% 80%;--primary-foreground: 345 30% 15%;--secondary: 342 20% 17.5%;--secondary-foreground: 350 30% 98%;--muted: 342 20% 17.5%;--muted-foreground: 350 10% 70%;--accent: 342 20% 17.5%;--accent-foreground: 350 30% 98%;--destructive: 0 62.8% 30.6%;--destructive-foreground: 350 30% 98%;--border: 342 20% 17.5%;--input: 342 20% 17.5%;--ring: 350 70% 85%;--sidebar-background: 345 30% 10%;--sidebar-foreground: 350 30% 98%;--sidebar-primary: 350 85% 80%;--sidebar-primary-foreground: 350 30% 98%;--sidebar-accent: 342 20% 17.5%;--sidebar-accent-foreground: 350 30% 98%;--sidebar-border: 342 20% 17.5%;--sidebar-ring: 350 70% 85%}*{border-color:hsl(var(--border))}body{background-color:hsl(var(--background));font-family:Inter,system-ui,sans-serif;color:hsl(var(--foreground));font-feature-settings:"rlig" 1,"calt" 1}::-webkit-scrollbar{width:8px;height:8px}::-webkit-scrollbar-track{background-color:transparent}::-webkit-scrollbar-thumb{border-radius:9999px;background-color:hsl(var(--muted-foreground) / .4)}::-webkit-scrollbar-thumb:hover{background-color:hsl(var(--muted-foreground) / .6)}@font-face{font-family:SF Pro Display;src:local("SF Pro Display"),local("SFProDisplay"),url(https://applesocial.s3.amazonaws.com/assets/styles/fonts/sanfrancisco/sanfranciscodisplay-regular-webfont.woff) format("woff");font-weight:400;font-style:normal}@font-face{font-family:SF Pro Display;src:local("SF Pro Display Medium"),local("SFProDisplay-Medium"),url(https://applesocial.s3.amazonaws.com/assets/styles/fonts/sanfrancisco/sanfranciscodisplay-medium-webfont.woff) format("woff");font-weight:500;font-style:normal}@font-face{font-family:SF Pro Display;src:local("SF Pro Display Semibold"),local("SFProDisplay-Semibold"),url(https://applesocial.s3.amazonaws.com/assets/styles/fonts/sanfrancisco/sanfranciscodisplay-semibold-webfont.woff) format("woff");font-weight:600;font-style:normal}@font-face{font-family:SF Pro Display;src:local("SF Pro Display Bold"),local("SFProDisplay-Bold"),url(https://applesocial.s3.amazonaws.com/assets/styles/fonts/sanfrancisco/sanfranciscodisplay-bold-webfont.woff) format("woff");font-weight:700;font-style:normal}.container{width:100%;margin-right:auto;margin-left:auto;padding-right:2rem;padding-left:2rem}@media (min-width: 1400px){.container{max-width:1400px}}.glass-card{border-width:1px;border-color:#fff3;background-color:#fffc;--tw-shadow: 0 1px 2px 0 rgb(0 0 0 / .05);--tw-shadow-colored: 0 1px 2px 0 var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow);--tw-backdrop-blur: blur(12px);-webkit-backdrop-filter:var(--tw-backdrop-blur) var(--tw-backdrop-brightness) var(--tw-backdrop-contrast) var(--tw-backdrop-grayscale) var(--tw-backdrop-hue-rotate) var(--tw-backdrop-invert) var(--tw-backdrop-opacity) var(--tw-backdrop-saturate) var(--tw-backdrop-sepia);backdrop-filter:var(--tw-backdrop-blur) var(--tw-backdrop-brightness) var(--tw-backdrop-contrast) var(--tw-backdrop-grayscale) var(--tw-backdrop-hue-rotate) var(--tw-backdrop-invert) var(--tw-backdrop-opacity) var(--tw-backdrop-saturate) var(--tw-backdrop-sepia)}.glass-panel{border-width:1px;border-color:#fff6;background-color:#ffffffe6;--tw-shadow: 0 1px 2px 0 rgb(0 0 0 / .05);--tw-shadow-colored: 0 1px 2px 0 var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow);--tw-backdrop-blur: blur(4px);-webkit-backdrop-filter:var(--tw-backdrop-blur) var(--tw-backdrop-brightness) var(--tw-backdrop-contrast) var(--tw-backdrop-grayscale) var(--tw-backdrop-hue-rotate) var(--tw-backdrop-invert) var(--tw-backdrop-opacity) var(--tw-backdrop-saturate) var(--tw-backdrop-sepia);backdrop-filter:var(--tw-backdrop-blur) var(--tw-backdrop-brightness) var(--tw-backdrop-contrast) var(--tw-backdrop-grayscale) var(--tw-backdrop-hue-rotate) var(--tw-backdrop-invert) var(--tw-backdrop-opacity) var(--tw-backdrop-saturate) var(--tw-backdrop-sepia)}.text-gradient{background-image:linear-gradient(to right,var(--tw-gradient-stops));--tw-gradient-from: hsl(var(--primary)) var(--tw-gradient-from-position);--tw-gradient-to: hsl(var(--primary) / 0) var(--tw-gradient-to-position);--tw-gradient-stops: var(--tw-gradient-from), var(--tw-gradient-to);--tw-gradient-to: #f9a8d4 var(--tw-gradient-to-position);-webkit-background-clip:text;background-clip:text;color:transparent}.hover-transition{transition-property:all;transition-duration:.3s;transition-timing-function:cubic-bezier(.4,0,.2,1);animation-duration:.3s;animation-timing-function:cubic-bezier(.4,0,.2,1)}.button-transition{transition-property:all;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.2s;transition-timing-function:cubic-bezier(0,0,.2,1);animation-duration:.2s;animation-timing-function:cubic-bezier(0,0,.2,1)}.sidebar-icon{margin-right:.75rem;margin-top:.125rem;height:1rem;width:1rem;flex-shrink:0;--tw-text-opacity: 1;color:rgb(100 116 139 / var(--tw-text-opacity, 1))}.sidebar-section{display:flex;align-items:flex-start}.sidebar-sub-item{margin-left:1.75rem;font-size:.875rem;line-height:1.25rem;color:hsl(var(--muted-foreground))}.sidebar-sub-item:before{content:"•";margin-right:.5rem;margin-left:-.75rem;--tw-text-opacity: 1;color:rgb(148 163 184 / var(--tw-text-opacity, 1))}.persona-card{position:relative;overflow:hidden;min-height:360px}.persona-card-overlay{pointer-events:none;position:absolute;top:0;right:0;bottom:0;left:0;transition-property:all;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.2s;transition-timing-function:cubic-bezier(0,0,.2,1);animation-duration:.2s;animation-timing-function:cubic-bezier(0,0,.2,1)}.persona-card:hover .persona-card-overlay,.persona-card.selected .persona-card-overlay{background-color:#ecd1de4d}.persona-card-checkmark{position:absolute;top:.75rem;left:.75rem;z-index:20;opacity:0;transition-property:all;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.2s;transition-timing-function:cubic-bezier(0,0,.2,1);animation-duration:.2s;animation-timing-function:cubic-bezier(0,0,.2,1);border-radius:9999px;border-width:1px;border-color:#fff6;background-color:#ffffffe6;padding:.25rem;--tw-shadow: 0 1px 2px 0 rgb(0 0 0 / .05);--tw-shadow-colored: 0 1px 2px 0 var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)}.persona-card.selected .persona-card-checkmark{opacity:1}.sr-only{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0,0,0,0);white-space:nowrap;border-width:0}.pointer-events-none{pointer-events:none}.visible{visibility:visible}.invisible{visibility:hidden}.fixed{position:fixed}.absolute{position:absolute}.relative{position:relative}.sticky{position:sticky}.inset-0{top:0;right:0;bottom:0;left:0}.inset-x-0{left:0;right:0}.inset-y-0{top:0;bottom:0}.-bottom-12{bottom:-3rem}.-left-12{left:-3rem}.-right-12{right:-3rem}.-top-12{top:-3rem}.bottom-0{bottom:0}.bottom-4{bottom:1rem}.bottom-5{bottom:1.25rem}.bottom-6{bottom:1.5rem}.bottom-\[-10rem\]{bottom:-10rem}.bottom-full{bottom:100%}.left-0{left:0}.left-1{left:.25rem}.left-1\/2{left:50%}.left-2{left:.5rem}.left-3{left:.75rem}.left-4{left:1rem}.left-\[50\%\]{left:50%}.left-\[calc\(50\%\+11rem\)\]{left:calc(50% + 11rem)}.left-\[calc\(50\%-11rem\)\]{left:calc(50% - 11rem)}.right-0{right:0}.right-1{right:.25rem}.right-2{right:.5rem}.right-3{right:.75rem}.right-4{right:1rem}.right-6{right:1.5rem}.top-0{top:0}.top-1{top:.25rem}.top-1\.5{top:.375rem}.top-1\/2{top:50%}.top-16{top:4rem}.top-2{top:.5rem}.top-20{top:5rem}.top-3\.5{top:.875rem}.top-4{top:1rem}.top-\[-10rem\]{top:-10rem}.top-\[1px\]{top:1px}.top-\[50\%\]{top:50%}.top-\[60\%\]{top:60%}.top-full{top:100%}.isolate{isolation:isolate}.-z-10{z-index:-10}.z-10{z-index:10}.z-20{z-index:20}.z-40{z-index:40}.z-50{z-index:50}.z-\[100\]{z-index:100}.z-\[1\]{z-index:1}.col-span-full{grid-column:1 / -1}.m-0{margin:0}.-mx-1{margin-left:-.25rem;margin-right:-.25rem}.mx-2{margin-left:.5rem;margin-right:.5rem}.mx-3\.5{margin-left:.875rem;margin-right:.875rem}.mx-4{margin-left:1rem;margin-right:1rem}.mx-auto{margin-left:auto;margin-right:auto}.my-0\.5{margin-top:.125rem;margin-bottom:.125rem}.my-1{margin-top:.25rem;margin-bottom:.25rem}.my-6{margin-top:1.5rem;margin-bottom:1.5rem}.-ml-4{margin-left:-1rem}.-mt-4{margin-top:-1rem}.mb-1{margin-bottom:.25rem}.mb-16{margin-bottom:4rem}.mb-2{margin-bottom:.5rem}.mb-3{margin-bottom:.75rem}.mb-4{margin-bottom:1rem}.mb-6{margin-bottom:1.5rem}.mb-8{margin-bottom:2rem}.ml-1{margin-left:.25rem}.ml-2{margin-left:.5rem}.ml-4{margin-left:1rem}.ml-6{margin-left:1.5rem}.ml-auto{margin-left:auto}.mr-1{margin-right:.25rem}.mr-2{margin-right:.5rem}.mr-3{margin-right:.75rem}.mr-5{margin-right:1.25rem}.mt-0\.5{margin-top:.125rem}.mt-1{margin-top:.25rem}.mt-1\.5{margin-top:.375rem}.mt-10{margin-top:2.5rem}.mt-12{margin-top:3rem}.mt-16{margin-top:4rem}.mt-2{margin-top:.5rem}.mt-24{margin-top:6rem}.mt-3{margin-top:.75rem}.mt-4{margin-top:1rem}.mt-6{margin-top:1.5rem}.mt-8{margin-top:2rem}.mt-auto{margin-top:auto}.line-clamp-2{overflow:hidden;display:-webkit-box;-webkit-box-orient:vertical;-webkit-line-clamp:2}.line-clamp-3{overflow:hidden;display:-webkit-box;-webkit-box-orient:vertical;-webkit-line-clamp:3}.block{display:block}.inline{display:inline}.flex{display:flex}.inline-flex{display:inline-flex}.table{display:table}.grid{display:grid}.hidden{display:none}.aspect-\[1155\/678\]{aspect-ratio:1155/678}.aspect-square{aspect-ratio:1 / 1}.aspect-video{aspect-ratio:16 / 9}.size-4{width:1rem;height:1rem}.h-0{height:0px}.h-1{height:.25rem}.h-1\.5{height:.375rem}.h-10{height:2.5rem}.h-11{height:2.75rem}.h-12{height:3rem}.h-16{height:4rem}.h-2{height:.5rem}.h-2\.5{height:.625rem}.h-24{height:6rem}.h-3{height:.75rem}.h-3\.5{height:.875rem}.h-32{height:8rem}.h-36{height:9rem}.h-4{height:1rem}.h-40{height:10rem}.h-5{height:1.25rem}.h-6{height:1.5rem}.h-60{height:15rem}.h-64{height:16rem}.h-7{height:1.75rem}.h-8{height:2rem}.h-80{height:20rem}.h-9{height:2.25rem}.h-\[1px\]{height:1px}.h-\[25vh\]{height:25vh}.h-\[450px\]{height:450px}.h-\[70vh\]{height:70vh}.h-\[calc\(100vh-12rem\)\]{height:calc(100vh - 12rem)}.h-\[var\(--radix-navigation-menu-viewport-height\)\]{height:var(--radix-navigation-menu-viewport-height)}.h-\[var\(--radix-select-trigger-height\)\]{height:var(--radix-select-trigger-height)}.h-auto{height:auto}.h-full{height:100%}.h-px{height:1px}.h-svh{height:100svh}.max-h-48{max-height:12rem}.max-h-60{max-height:15rem}.max-h-96{max-height:24rem}.max-h-\[300px\]{max-height:300px}.max-h-\[400px\]{max-height:400px}.max-h-\[70vh\]{max-height:70vh}.max-h-\[80vh\]{max-height:80vh}.max-h-\[90vh\]{max-height:90vh}.max-h-full{max-height:100%}.min-h-0{min-height:0px}.min-h-\[100px\]{min-height:100px}.min-h-\[40px\]{min-height:40px}.min-h-\[60px\]{min-height:60px}.min-h-\[80px\]{min-height:80px}.min-h-screen{min-height:100vh}.min-h-svh{min-height:100svh}.w-0{width:0px}.w-1{width:.25rem}.w-10{width:2.5rem}.w-11{width:2.75rem}.w-12{width:3rem}.w-16{width:4rem}.w-2{width:.5rem}.w-2\.5{width:.625rem}.w-2\/3{width:66.666667%}.w-20{width:5rem}.w-24{width:6rem}.w-3{width:.75rem}.w-3\.5{width:.875rem}.w-3\/4{width:75%}.w-32{width:8rem}.w-36{width:9rem}.w-4{width:1rem}.w-40{width:10rem}.w-48{width:12rem}.w-5{width:1.25rem}.w-5\/6{width:83.333333%}.w-6{width:1.5rem}.w-64{width:16rem}.w-7{width:1.75rem}.w-72{width:18rem}.w-8{width:2rem}.w-80{width:20rem}.w-9{width:2.25rem}.w-96{width:24rem}.w-\[--sidebar-width\]{width:var(--sidebar-width)}.w-\[100px\]{width:100px}.w-\[1px\]{width:1px}.w-\[350px\]{width:350px}.w-\[36\.125rem\]{width:36.125rem}.w-auto{width:auto}.w-fit{width:-moz-fit-content;width:fit-content}.w-full{width:100%}.w-max{width:-moz-max-content;width:max-content}.w-px{width:1px}.min-w-0{min-width:0px}.min-w-32{min-width:8rem}.min-w-36{min-width:9rem}.min-w-5{min-width:1.25rem}.min-w-\[12rem\]{min-width:12rem}.min-w-\[8rem\]{min-width:8rem}.min-w-\[var\(--radix-select-trigger-width\)\]{min-width:var(--radix-select-trigger-width)}.max-w-2xl{max-width:42rem}.max-w-3xl{max-width:48rem}.max-w-4xl{max-width:56rem}.max-w-5xl{max-width:64rem}.max-w-7xl{max-width:80rem}.max-w-\[--skeleton-width\]{max-width:var(--skeleton-width)}.max-w-\[400px\]{max-width:400px}.max-w-\[70\%\]{max-width:70%}.max-w-full{max-width:100%}.max-w-lg{max-width:32rem}.max-w-max{max-width:-moz-max-content;max-width:max-content}.max-w-md{max-width:28rem}.max-w-none{max-width:none}.flex-1{flex:1 1 0%}.flex-shrink-0,.shrink-0{flex-shrink:0}.flex-grow,.grow{flex-grow:1}.grow-0{flex-grow:0}.basis-full{flex-basis:100%}.caption-bottom{caption-side:bottom}.border-collapse{border-collapse:collapse}.-translate-x-1\/2{--tw-translate-x: -50%;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.-translate-x-px{--tw-translate-x: -1px;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.-translate-y-1\/2{--tw-translate-y: -50%;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.translate-x-\[-50\%\]{--tw-translate-x: -50%;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.translate-x-px{--tw-translate-x: 1px;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.translate-y-\[-50\%\]{--tw-translate-y: -50%;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.rotate-45{--tw-rotate: 45deg;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.rotate-90{--tw-rotate: 90deg;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.rotate-\[30deg\]{--tw-rotate: 30deg;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.transform{transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.transform-gpu{transform:translate3d(var(--tw-translate-x),var(--tw-translate-y),0) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}@keyframes fade-in{0%{opacity:0}to{opacity:1}}.animate-fade-in{animation:fade-in .5s ease-out}@keyframes float{0%,to{transform:translateY(0)}50%{transform:translateY(-5px)}}.animate-float{animation:float 3s ease-in-out infinite}@keyframes pulse{50%{opacity:.5}}.animate-pulse{animation:pulse 2s cubic-bezier(.4,0,.6,1) infinite}@keyframes spin{to{transform:rotate(360deg)}}.animate-spin{animation:spin 1s linear infinite}.cursor-default{cursor:default}.cursor-pointer{cursor:pointer}.touch-none{touch-action:none}.select-none{-webkit-user-select:none;-moz-user-select:none;user-select:none}.select-all{-webkit-user-select:all;-moz-user-select:all;user-select:all}.resize-none{resize:none}.resize-y{resize:vertical}.list-disc{list-style-type:disc}.list-none{list-style-type:none}.grid-cols-1{grid-template-columns:repeat(1,minmax(0,1fr))}.grid-cols-2{grid-template-columns:repeat(2,minmax(0,1fr))}.grid-cols-3{grid-template-columns:repeat(3,minmax(0,1fr))}.grid-cols-4{grid-template-columns:repeat(4,minmax(0,1fr))}.grid-cols-6{grid-template-columns:repeat(6,minmax(0,1fr))}.flex-row{flex-direction:row}.flex-col{flex-direction:column}.flex-col-reverse{flex-direction:column-reverse}.flex-wrap{flex-wrap:wrap}.items-start{align-items:flex-start}.items-end{align-items:flex-end}.items-center{align-items:center}.items-stretch{align-items:stretch}.justify-start{justify-content:flex-start}.justify-end{justify-content:flex-end}.justify-center{justify-content:center}.justify-between{justify-content:space-between}.gap-1{gap:.25rem}.gap-1\.5{gap:.375rem}.gap-2{gap:.5rem}.gap-3{gap:.75rem}.gap-4{gap:1rem}.gap-6{gap:1.5rem}.gap-8{gap:2rem}.gap-x-4{-moz-column-gap:1rem;column-gap:1rem}.gap-x-6{-moz-column-gap:1.5rem;column-gap:1.5rem}.space-x-1>:not([hidden])~:not([hidden]){--tw-space-x-reverse: 0;margin-right:calc(.25rem * var(--tw-space-x-reverse));margin-left:calc(.25rem * calc(1 - var(--tw-space-x-reverse)))}.space-x-2>:not([hidden])~:not([hidden]){--tw-space-x-reverse: 0;margin-right:calc(.5rem * var(--tw-space-x-reverse));margin-left:calc(.5rem * calc(1 - var(--tw-space-x-reverse)))}.space-x-4>:not([hidden])~:not([hidden]){--tw-space-x-reverse: 0;margin-right:calc(1rem * var(--tw-space-x-reverse));margin-left:calc(1rem * calc(1 - var(--tw-space-x-reverse)))}.space-x-8>:not([hidden])~:not([hidden]){--tw-space-x-reverse: 0;margin-right:calc(2rem * var(--tw-space-x-reverse));margin-left:calc(2rem * calc(1 - var(--tw-space-x-reverse)))}.space-y-1>:not([hidden])~:not([hidden]){--tw-space-y-reverse: 0;margin-top:calc(.25rem * calc(1 - var(--tw-space-y-reverse)));margin-bottom:calc(.25rem * var(--tw-space-y-reverse))}.space-y-1\.5>:not([hidden])~:not([hidden]){--tw-space-y-reverse: 0;margin-top:calc(.375rem * calc(1 - var(--tw-space-y-reverse)));margin-bottom:calc(.375rem * var(--tw-space-y-reverse))}.space-y-2>:not([hidden])~:not([hidden]){--tw-space-y-reverse: 0;margin-top:calc(.5rem * calc(1 - var(--tw-space-y-reverse)));margin-bottom:calc(.5rem * var(--tw-space-y-reverse))}.space-y-3>:not([hidden])~:not([hidden]){--tw-space-y-reverse: 0;margin-top:calc(.75rem * calc(1 - var(--tw-space-y-reverse)));margin-bottom:calc(.75rem * var(--tw-space-y-reverse))}.space-y-4>:not([hidden])~:not([hidden]){--tw-space-y-reverse: 0;margin-top:calc(1rem * calc(1 - var(--tw-space-y-reverse)));margin-bottom:calc(1rem * var(--tw-space-y-reverse))}.space-y-6>:not([hidden])~:not([hidden]){--tw-space-y-reverse: 0;margin-top:calc(1.5rem * calc(1 - var(--tw-space-y-reverse)));margin-bottom:calc(1.5rem * var(--tw-space-y-reverse))}.overflow-auto{overflow:auto}.overflow-hidden{overflow:hidden}.overflow-y-auto{overflow-y:auto}.overflow-x-hidden{overflow-x:hidden}.truncate{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.whitespace-nowrap{white-space:nowrap}.whitespace-pre-wrap{white-space:pre-wrap}.break-words{overflow-wrap:break-word}.rounded{border-radius:.25rem}.rounded-2xl{border-radius:1rem}.rounded-\[2px\]{border-radius:2px}.rounded-\[inherit\]{border-radius:inherit}.rounded-full{border-radius:9999px}.rounded-lg{border-radius:var(--radius)}.rounded-md{border-radius:calc(var(--radius) - 2px)}.rounded-sm{border-radius:calc(var(--radius) - 4px)}.rounded-xl{border-radius:.75rem}.rounded-t-\[10px\]{border-top-left-radius:10px;border-top-right-radius:10px}.rounded-tl-sm{border-top-left-radius:calc(var(--radius) - 4px)}.border{border-width:1px}.border-0{border-width:0px}.border-2{border-width:2px}.border-\[1\.5px\]{border-width:1.5px}.border-y{border-top-width:1px;border-bottom-width:1px}.border-b{border-bottom-width:1px}.border-b-2{border-bottom-width:2px}.border-l{border-left-width:1px}.border-l-2{border-left-width:2px}.border-l-4{border-left-width:4px}.border-r{border-right-width:1px}.border-t{border-top-width:1px}.border-t-2{border-top-width:2px}.border-dashed{border-style:dashed}.border-\[--color-border\]{border-color:var(--color-border)}.border-amber-200{--tw-border-opacity: 1;border-color:rgb(253 230 138 / var(--tw-border-opacity, 1))}.border-blue-200{--tw-border-opacity: 1;border-color:rgb(191 219 254 / var(--tw-border-opacity, 1))}.border-blue-500{--tw-border-opacity: 1;border-color:rgb(59 130 246 / var(--tw-border-opacity, 1))}.border-border{border-color:hsl(var(--border))}.border-border\/50{border-color:hsl(var(--border) / .5)}.border-destructive\/50{border-color:hsl(var(--destructive) / .5)}.border-gray-100{--tw-border-opacity: 1;border-color:rgb(243 244 246 / var(--tw-border-opacity, 1))}.border-gray-200{--tw-border-opacity: 1;border-color:rgb(229 231 235 / var(--tw-border-opacity, 1))}.border-gray-300{--tw-border-opacity: 1;border-color:rgb(209 213 219 / var(--tw-border-opacity, 1))}.border-green-200{--tw-border-opacity: 1;border-color:rgb(187 247 208 / var(--tw-border-opacity, 1))}.border-input{border-color:hsl(var(--input))}.border-primary{border-color:hsl(var(--primary))}.border-primary\/50{border-color:hsl(var(--primary) / .5)}.border-purple-200{--tw-border-opacity: 1;border-color:rgb(233 213 255 / var(--tw-border-opacity, 1))}.border-red-200{--tw-border-opacity: 1;border-color:rgb(254 202 202 / var(--tw-border-opacity, 1))}.border-sidebar-border{border-color:hsl(var(--sidebar-border))}.border-slate-100{--tw-border-opacity: 1;border-color:rgb(241 245 249 / var(--tw-border-opacity, 1))}.border-slate-200{--tw-border-opacity: 1;border-color:rgb(226 232 240 / var(--tw-border-opacity, 1))}.border-slate-200\/80{border-color:#e2e8f0cc}.border-slate-300{--tw-border-opacity: 1;border-color:rgb(203 213 225 / var(--tw-border-opacity, 1))}.border-transparent{border-color:transparent}.border-white{--tw-border-opacity: 1;border-color:rgb(255 255 255 / var(--tw-border-opacity, 1))}.border-l-green-500{--tw-border-opacity: 1;border-left-color:rgb(34 197 94 / var(--tw-border-opacity, 1))}.border-l-primary{border-left-color:hsl(var(--primary))}.border-l-transparent{border-left-color:transparent}.border-t-transparent{border-top-color:transparent}.bg-\[--color-bg\]{background-color:var(--color-bg)}.bg-accent{background-color:hsl(var(--accent))}.bg-amber-100{--tw-bg-opacity: 1;background-color:rgb(254 243 199 / var(--tw-bg-opacity, 1))}.bg-amber-50{--tw-bg-opacity: 1;background-color:rgb(255 251 235 / var(--tw-bg-opacity, 1))}.bg-amber-500{--tw-bg-opacity: 1;background-color:rgb(245 158 11 / var(--tw-bg-opacity, 1))}.bg-background{background-color:hsl(var(--background))}.bg-black\/80{background-color:#000c}.bg-blue-100{--tw-bg-opacity: 1;background-color:rgb(219 234 254 / var(--tw-bg-opacity, 1))}.bg-blue-50{--tw-bg-opacity: 1;background-color:rgb(239 246 255 / var(--tw-bg-opacity, 1))}.bg-blue-50\/50{background-color:#eff6ff80}.bg-blue-500{--tw-bg-opacity: 1;background-color:rgb(59 130 246 / var(--tw-bg-opacity, 1))}.bg-blue-600{--tw-bg-opacity: 1;background-color:rgb(37 99 235 / var(--tw-bg-opacity, 1))}.bg-border{background-color:hsl(var(--border))}.bg-card{background-color:hsl(var(--card))}.bg-destructive{background-color:hsl(var(--destructive))}.bg-foreground{background-color:hsl(var(--foreground))}.bg-gray-100{--tw-bg-opacity: 1;background-color:rgb(243 244 246 / var(--tw-bg-opacity, 1))}.bg-gray-200{--tw-bg-opacity: 1;background-color:rgb(229 231 235 / var(--tw-bg-opacity, 1))}.bg-gray-50{--tw-bg-opacity: 1;background-color:rgb(249 250 251 / var(--tw-bg-opacity, 1))}.bg-gray-500{--tw-bg-opacity: 1;background-color:rgb(107 114 128 / var(--tw-bg-opacity, 1))}.bg-gray-900\/10{background-color:#1118271a}.bg-green-100{--tw-bg-opacity: 1;background-color:rgb(220 252 231 / var(--tw-bg-opacity, 1))}.bg-green-400{--tw-bg-opacity: 1;background-color:rgb(74 222 128 / var(--tw-bg-opacity, 1))}.bg-green-50{--tw-bg-opacity: 1;background-color:rgb(240 253 244 / var(--tw-bg-opacity, 1))}.bg-green-500{--tw-bg-opacity: 1;background-color:rgb(34 197 94 / var(--tw-bg-opacity, 1))}.bg-muted{background-color:hsl(var(--muted))}.bg-muted\/30{background-color:hsl(var(--muted) / .3)}.bg-muted\/50{background-color:hsl(var(--muted) / .5)}.bg-pink-200{--tw-bg-opacity: 1;background-color:rgb(251 207 232 / var(--tw-bg-opacity, 1))}.bg-pink-300{--tw-bg-opacity: 1;background-color:rgb(249 168 212 / var(--tw-bg-opacity, 1))}.bg-pink-400{--tw-bg-opacity: 1;background-color:rgb(244 114 182 / var(--tw-bg-opacity, 1))}.bg-pink-500{--tw-bg-opacity: 1;background-color:rgb(236 72 153 / var(--tw-bg-opacity, 1))}.bg-popover{background-color:hsl(var(--popover))}.bg-primary{background-color:hsl(var(--primary))}.bg-primary\/10{background-color:hsl(var(--primary) / .1)}.bg-primary\/5{background-color:hsl(var(--primary) / .05)}.bg-purple-100{--tw-bg-opacity: 1;background-color:rgb(243 232 255 / var(--tw-bg-opacity, 1))}.bg-purple-50{--tw-bg-opacity: 1;background-color:rgb(250 245 255 / var(--tw-bg-opacity, 1))}.bg-purple-500{--tw-bg-opacity: 1;background-color:rgb(168 85 247 / var(--tw-bg-opacity, 1))}.bg-red-100{--tw-bg-opacity: 1;background-color:rgb(254 226 226 / var(--tw-bg-opacity, 1))}.bg-red-400{--tw-bg-opacity: 1;background-color:rgb(248 113 113 / var(--tw-bg-opacity, 1))}.bg-red-50{--tw-bg-opacity: 1;background-color:rgb(254 242 242 / var(--tw-bg-opacity, 1))}.bg-red-500{--tw-bg-opacity: 1;background-color:rgb(239 68 68 / var(--tw-bg-opacity, 1))}.bg-red-600{--tw-bg-opacity: 1;background-color:rgb(220 38 38 / var(--tw-bg-opacity, 1))}.bg-secondary{background-color:hsl(var(--secondary))}.bg-sidebar{background-color:hsl(var(--sidebar-background))}.bg-sidebar-border{background-color:hsl(var(--sidebar-border))}.bg-slate-100{--tw-bg-opacity: 1;background-color:rgb(241 245 249 / var(--tw-bg-opacity, 1))}.bg-slate-200{--tw-bg-opacity: 1;background-color:rgb(226 232 240 / var(--tw-bg-opacity, 1))}.bg-slate-50{--tw-bg-opacity: 1;background-color:rgb(248 250 252 / var(--tw-bg-opacity, 1))}.bg-transparent{background-color:transparent}.bg-white{--tw-bg-opacity: 1;background-color:rgb(255 255 255 / var(--tw-bg-opacity, 1))}.bg-white\/70{background-color:#ffffffb3}.bg-white\/80{background-color:#fffc}.bg-yellow-400{--tw-bg-opacity: 1;background-color:rgb(250 204 21 / var(--tw-bg-opacity, 1))}.bg-gradient-to-b{background-image:linear-gradient(to bottom,var(--tw-gradient-stops))}.bg-gradient-to-br{background-image:linear-gradient(to bottom right,var(--tw-gradient-stops))}.bg-gradient-to-r{background-image:linear-gradient(to right,var(--tw-gradient-stops))}.bg-gradient-to-tr{background-image:linear-gradient(to top right,var(--tw-gradient-stops))}.from-blue-400{--tw-gradient-from: #60a5fa var(--tw-gradient-from-position);--tw-gradient-to: rgb(96 165 250 / 0) var(--tw-gradient-to-position);--tw-gradient-stops: var(--tw-gradient-from), var(--tw-gradient-to)}.from-gray-100{--tw-gradient-from: #f3f4f6 var(--tw-gradient-from-position);--tw-gradient-to: rgb(243 244 246 / 0) var(--tw-gradient-to-position);--tw-gradient-stops: var(--tw-gradient-from), var(--tw-gradient-to)}.from-primary{--tw-gradient-from: hsl(var(--primary)) var(--tw-gradient-from-position);--tw-gradient-to: hsl(var(--primary) / 0) var(--tw-gradient-to-position);--tw-gradient-stops: var(--tw-gradient-from), var(--tw-gradient-to)}.from-primary\/5{--tw-gradient-from: hsl(var(--primary) / .05) var(--tw-gradient-from-position);--tw-gradient-to: hsl(var(--primary) / 0) var(--tw-gradient-to-position);--tw-gradient-stops: var(--tw-gradient-from), var(--tw-gradient-to)}.from-white{--tw-gradient-from: #fff var(--tw-gradient-from-position);--tw-gradient-to: rgb(255 255 255 / 0) var(--tw-gradient-to-position);--tw-gradient-stops: var(--tw-gradient-from), var(--tw-gradient-to)}.to-blue-400{--tw-gradient-to: #60a5fa var(--tw-gradient-to-position)}.to-blue-400\/5{--tw-gradient-to: rgb(96 165 250 / .05) var(--tw-gradient-to-position)}.to-gray-200{--tw-gradient-to: #e5e7eb var(--tw-gradient-to-position)}.to-primary{--tw-gradient-to: hsl(var(--primary)) var(--tw-gradient-to-position)}.to-slate-50{--tw-gradient-to: #f8fafc var(--tw-gradient-to-position)}.fill-amber-400{fill:#fbbf24}.fill-current{fill:currentColor}.object-contain{-o-object-fit:contain;object-fit:contain}.object-cover{-o-object-fit:cover;object-fit:cover}.p-0{padding:0}.p-1{padding:.25rem}.p-2{padding:.5rem}.p-3{padding:.75rem}.p-4{padding:1rem}.p-6{padding:1.5rem}.p-8{padding:2rem}.p-\[1px\]{padding:1px}.px-1{padding-left:.25rem;padding-right:.25rem}.px-2{padding-left:.5rem;padding-right:.5rem}.px-2\.5{padding-left:.625rem;padding-right:.625rem}.px-3{padding-left:.75rem;padding-right:.75rem}.px-4{padding-left:1rem;padding-right:1rem}.px-5{padding-left:1.25rem;padding-right:1.25rem}.px-6{padding-left:1.5rem;padding-right:1.5rem}.px-8{padding-left:2rem;padding-right:2rem}.py-0\.5{padding-top:.125rem;padding-bottom:.125rem}.py-1{padding-top:.25rem;padding-bottom:.25rem}.py-1\.5{padding-top:.375rem;padding-bottom:.375rem}.py-12{padding-top:3rem;padding-bottom:3rem}.py-2{padding-top:.5rem;padding-bottom:.5rem}.py-20{padding-top:5rem;padding-bottom:5rem}.py-24{padding-top:6rem;padding-bottom:6rem}.py-3{padding-top:.75rem;padding-bottom:.75rem}.py-4{padding-top:1rem;padding-bottom:1rem}.py-6{padding-top:1.5rem;padding-bottom:1.5rem}.pb-16{padding-bottom:4rem}.pb-2{padding-bottom:.5rem}.pb-3{padding-bottom:.75rem}.pb-4{padding-bottom:1rem}.pl-10{padding-left:2.5rem}.pl-2\.5{padding-left:.625rem}.pl-4{padding-left:1rem}.pl-8{padding-left:2rem}.pr-2{padding-right:.5rem}.pr-2\.5{padding-right:.625rem}.pr-4{padding-right:1rem}.pt-0{padding-top:0}.pt-1{padding-top:.25rem}.pt-16{padding-top:4rem}.pt-2{padding-top:.5rem}.pt-20{padding-top:5rem}.pt-3{padding-top:.75rem}.pt-4{padding-top:1rem}.pt-6{padding-top:1.5rem}.pt-8{padding-top:2rem}.text-left{text-align:left}.text-center{text-align:center}.align-middle{vertical-align:middle}.font-mono{font-family:ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,Liberation Mono,Courier New,monospace}.font-sans{font-family:Inter,system-ui,sans-serif}.font-sf{font-family:SF Pro Display,system-ui,sans-serif}.text-2xl{font-size:1.5rem;line-height:2rem}.text-3xl{font-size:1.875rem;line-height:2.25rem}.text-4xl{font-size:2.25rem;line-height:2.5rem}.text-\[0\.8rem\]{font-size:.8rem}.text-base{font-size:1rem;line-height:1.5rem}.text-lg{font-size:1.125rem;line-height:1.75rem}.text-sm{font-size:.875rem;line-height:1.25rem}.text-xl{font-size:1.25rem;line-height:1.75rem}.text-xs{font-size:.75rem;line-height:1rem}.font-bold{font-weight:700}.font-medium{font-weight:500}.font-normal{font-weight:400}.font-semibold{font-weight:600}.italic{font-style:italic}.tabular-nums{--tw-numeric-spacing: tabular-nums;font-variant-numeric:var(--tw-ordinal) var(--tw-slashed-zero) var(--tw-numeric-figure) var(--tw-numeric-spacing) var(--tw-numeric-fraction)}.leading-6{line-height:1.5rem}.leading-8{line-height:2rem}.leading-none{line-height:1}.leading-relaxed{line-height:1.625}.tracking-tight{letter-spacing:-.025em}.tracking-widest{letter-spacing:.1em}.text-accent-foreground{color:hsl(var(--accent-foreground))}.text-amber-400{--tw-text-opacity: 1;color:rgb(251 191 36 / var(--tw-text-opacity, 1))}.text-amber-500{--tw-text-opacity: 1;color:rgb(245 158 11 / var(--tw-text-opacity, 1))}.text-amber-600{--tw-text-opacity: 1;color:rgb(217 119 6 / var(--tw-text-opacity, 1))}.text-amber-700{--tw-text-opacity: 1;color:rgb(180 83 9 / var(--tw-text-opacity, 1))}.text-amber-800{--tw-text-opacity: 1;color:rgb(146 64 14 / var(--tw-text-opacity, 1))}.text-blue-500{--tw-text-opacity: 1;color:rgb(59 130 246 / var(--tw-text-opacity, 1))}.text-blue-600{--tw-text-opacity: 1;color:rgb(37 99 235 / var(--tw-text-opacity, 1))}.text-blue-700{--tw-text-opacity: 1;color:rgb(29 78 216 / var(--tw-text-opacity, 1))}.text-blue-800{--tw-text-opacity: 1;color:rgb(30 64 175 / var(--tw-text-opacity, 1))}.text-blue-900{--tw-text-opacity: 1;color:rgb(30 58 138 / var(--tw-text-opacity, 1))}.text-card-foreground{color:hsl(var(--card-foreground))}.text-current{color:currentColor}.text-destructive{color:hsl(var(--destructive))}.text-destructive-foreground{color:hsl(var(--destructive-foreground))}.text-foreground{color:hsl(var(--foreground))}.text-gray-300{--tw-text-opacity: 1;color:rgb(209 213 219 / var(--tw-text-opacity, 1))}.text-gray-400{--tw-text-opacity: 1;color:rgb(156 163 175 / var(--tw-text-opacity, 1))}.text-gray-500{--tw-text-opacity: 1;color:rgb(107 114 128 / var(--tw-text-opacity, 1))}.text-gray-600{--tw-text-opacity: 1;color:rgb(75 85 99 / var(--tw-text-opacity, 1))}.text-gray-700{--tw-text-opacity: 1;color:rgb(55 65 81 / var(--tw-text-opacity, 1))}.text-gray-800{--tw-text-opacity: 1;color:rgb(31 41 55 / var(--tw-text-opacity, 1))}.text-gray-900{--tw-text-opacity: 1;color:rgb(17 24 39 / var(--tw-text-opacity, 1))}.text-green-500{--tw-text-opacity: 1;color:rgb(34 197 94 / var(--tw-text-opacity, 1))}.text-green-600{--tw-text-opacity: 1;color:rgb(22 163 74 / var(--tw-text-opacity, 1))}.text-green-700{--tw-text-opacity: 1;color:rgb(21 128 61 / var(--tw-text-opacity, 1))}.text-green-800{--tw-text-opacity: 1;color:rgb(22 101 52 / var(--tw-text-opacity, 1))}.text-muted-foreground{color:hsl(var(--muted-foreground))}.text-orange-500{--tw-text-opacity: 1;color:rgb(249 115 22 / var(--tw-text-opacity, 1))}.text-popover-foreground{color:hsl(var(--popover-foreground))}.text-primary{color:hsl(var(--primary))}.text-primary-foreground{color:hsl(var(--primary-foreground))}.text-purple-500{--tw-text-opacity: 1;color:rgb(168 85 247 / var(--tw-text-opacity, 1))}.text-purple-600{--tw-text-opacity: 1;color:rgb(147 51 234 / var(--tw-text-opacity, 1))}.text-purple-700{--tw-text-opacity: 1;color:rgb(126 34 206 / var(--tw-text-opacity, 1))}.text-purple-800{--tw-text-opacity: 1;color:rgb(107 33 168 / var(--tw-text-opacity, 1))}.text-red-500{--tw-text-opacity: 1;color:rgb(239 68 68 / var(--tw-text-opacity, 1))}.text-red-600{--tw-text-opacity: 1;color:rgb(220 38 38 / var(--tw-text-opacity, 1))}.text-red-800{--tw-text-opacity: 1;color:rgb(153 27 27 / var(--tw-text-opacity, 1))}.text-secondary-foreground{color:hsl(var(--secondary-foreground))}.text-sidebar-foreground{color:hsl(var(--sidebar-foreground))}.text-sidebar-foreground\/70{color:hsl(var(--sidebar-foreground) / .7)}.text-slate-400{--tw-text-opacity: 1;color:rgb(148 163 184 / var(--tw-text-opacity, 1))}.text-slate-500{--tw-text-opacity: 1;color:rgb(100 116 139 / var(--tw-text-opacity, 1))}.text-slate-600{--tw-text-opacity: 1;color:rgb(71 85 105 / var(--tw-text-opacity, 1))}.text-slate-700{--tw-text-opacity: 1;color:rgb(51 65 85 / var(--tw-text-opacity, 1))}.text-slate-800{--tw-text-opacity: 1;color:rgb(30 41 59 / var(--tw-text-opacity, 1))}.text-slate-900{--tw-text-opacity: 1;color:rgb(15 23 42 / var(--tw-text-opacity, 1))}.text-white{--tw-text-opacity: 1;color:rgb(255 255 255 / var(--tw-text-opacity, 1))}.text-yellow-500{--tw-text-opacity: 1;color:rgb(234 179 8 / var(--tw-text-opacity, 1))}.underline-offset-4{text-underline-offset:4px}.opacity-0{opacity:0}.opacity-20{opacity:.2}.opacity-50{opacity:.5}.opacity-60{opacity:.6}.opacity-70{opacity:.7}.opacity-75{opacity:.75}.shadow-\[0_-2px_4px_rgba\(0\,0\,0\,0\.05\)\]{--tw-shadow: 0 -2px 4px rgba(0,0,0,.05);--tw-shadow-colored: 0 -2px 4px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)}.shadow-\[0_0_0_1px_hsl\(var\(--sidebar-border\)\)\]{--tw-shadow: 0 0 0 1px hsl(var(--sidebar-border));--tw-shadow-colored: 0 0 0 1px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)}.shadow-lg{--tw-shadow: 0 10px 15px -3px rgb(0 0 0 / .1), 0 4px 6px -4px rgb(0 0 0 / .1);--tw-shadow-colored: 0 10px 15px -3px var(--tw-shadow-color), 0 4px 6px -4px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)}.shadow-md{--tw-shadow: 0 4px 6px -1px rgb(0 0 0 / .1), 0 2px 4px -2px rgb(0 0 0 / .1);--tw-shadow-colored: 0 4px 6px -1px var(--tw-shadow-color), 0 2px 4px -2px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)}.shadow-none{--tw-shadow: 0 0 #0000;--tw-shadow-colored: 0 0 #0000;box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)}.shadow-sm{--tw-shadow: 0 1px 2px 0 rgb(0 0 0 / .05);--tw-shadow-colored: 0 1px 2px 0 var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)}.shadow-xl{--tw-shadow: 0 20px 25px -5px rgb(0 0 0 / .1), 0 8px 10px -6px rgb(0 0 0 / .1);--tw-shadow-colored: 0 20px 25px -5px var(--tw-shadow-color), 0 8px 10px -6px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)}.outline-none{outline:2px solid transparent;outline-offset:2px}.outline{outline-style:solid}.ring-0{--tw-ring-offset-shadow: var(--tw-ring-inset) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-shadow: var(--tw-ring-inset) 0 0 0 calc(0px + var(--tw-ring-offset-width)) var(--tw-ring-color);box-shadow:var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow, 0 0 #0000)}.ring-1{--tw-ring-offset-shadow: var(--tw-ring-inset) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-shadow: var(--tw-ring-inset) 0 0 0 calc(1px + var(--tw-ring-offset-width)) var(--tw-ring-color);box-shadow:var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow, 0 0 #0000)}.ring-2{--tw-ring-offset-shadow: var(--tw-ring-inset) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-shadow: var(--tw-ring-inset) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color);box-shadow:var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow, 0 0 #0000)}.ring-blue-200{--tw-ring-opacity: 1;--tw-ring-color: rgb(191 219 254 / var(--tw-ring-opacity, 1))}.ring-gray-900\/10{--tw-ring-color: rgb(17 24 39 / .1)}.ring-primary{--tw-ring-color: hsl(var(--primary))}.ring-ring{--tw-ring-color: hsl(var(--ring))}.ring-sidebar-ring{--tw-ring-color: hsl(var(--sidebar-ring))}.ring-offset-background{--tw-ring-offset-color: hsl(var(--background))}.ring-offset-white{--tw-ring-offset-color: #fff}.blur-3xl{--tw-blur: blur(64px);filter:var(--tw-blur) var(--tw-brightness) var(--tw-contrast) var(--tw-grayscale) var(--tw-hue-rotate) var(--tw-invert) var(--tw-saturate) var(--tw-sepia) var(--tw-drop-shadow)}.filter{filter:var(--tw-blur) var(--tw-brightness) var(--tw-contrast) var(--tw-grayscale) var(--tw-hue-rotate) var(--tw-invert) var(--tw-saturate) var(--tw-sepia) var(--tw-drop-shadow)}.backdrop-blur-md{--tw-backdrop-blur: blur(12px);-webkit-backdrop-filter:var(--tw-backdrop-blur) var(--tw-backdrop-brightness) var(--tw-backdrop-contrast) var(--tw-backdrop-grayscale) var(--tw-backdrop-hue-rotate) var(--tw-backdrop-invert) var(--tw-backdrop-opacity) var(--tw-backdrop-saturate) var(--tw-backdrop-sepia);backdrop-filter:var(--tw-backdrop-blur) var(--tw-backdrop-brightness) var(--tw-backdrop-contrast) var(--tw-backdrop-grayscale) var(--tw-backdrop-hue-rotate) var(--tw-backdrop-invert) var(--tw-backdrop-opacity) var(--tw-backdrop-saturate) var(--tw-backdrop-sepia)}.backdrop-blur-sm{--tw-backdrop-blur: blur(4px);-webkit-backdrop-filter:var(--tw-backdrop-blur) var(--tw-backdrop-brightness) var(--tw-backdrop-contrast) var(--tw-backdrop-grayscale) var(--tw-backdrop-hue-rotate) var(--tw-backdrop-invert) var(--tw-backdrop-opacity) var(--tw-backdrop-saturate) var(--tw-backdrop-sepia);backdrop-filter:var(--tw-backdrop-blur) var(--tw-backdrop-brightness) var(--tw-backdrop-contrast) var(--tw-backdrop-grayscale) var(--tw-backdrop-hue-rotate) var(--tw-backdrop-invert) var(--tw-backdrop-opacity) var(--tw-backdrop-saturate) var(--tw-backdrop-sepia)}.transition{transition-property:color,background-color,border-color,text-decoration-color,fill,stroke,opacity,box-shadow,transform,filter,-webkit-backdrop-filter;transition-property:color,background-color,border-color,text-decoration-color,fill,stroke,opacity,box-shadow,transform,filter,backdrop-filter;transition-property:color,background-color,border-color,text-decoration-color,fill,stroke,opacity,box-shadow,transform,filter,backdrop-filter,-webkit-backdrop-filter;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s}.transition-\[left\,right\,width\]{transition-property:left,right,width;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s}.transition-\[margin\,opa\]{transition-property:margin,opa;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s}.transition-\[width\,height\,padding\]{transition-property:width,height,padding;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s}.transition-\[width\]{transition-property:width;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s}.transition-all{transition-property:all;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s}.transition-colors{transition-property:color,background-color,border-color,text-decoration-color,fill,stroke;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s}.transition-opacity{transition-property:opacity;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s}.transition-shadow{transition-property:box-shadow;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s}.transition-transform{transition-property:transform;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s}.duration-1000{transition-duration:1s}.duration-200{transition-duration:.2s}.duration-300{transition-duration:.3s}.ease-in-out{transition-timing-function:cubic-bezier(.4,0,.2,1)}.ease-linear{transition-timing-function:linear}@keyframes enter{0%{opacity:var(--tw-enter-opacity, 1);transform:translate3d(var(--tw-enter-translate-x, 0),var(--tw-enter-translate-y, 0),0) scale3d(var(--tw-enter-scale, 1),var(--tw-enter-scale, 1),var(--tw-enter-scale, 1)) rotate(var(--tw-enter-rotate, 0))}}@keyframes exit{to{opacity:var(--tw-exit-opacity, 1);transform:translate3d(var(--tw-exit-translate-x, 0),var(--tw-exit-translate-y, 0),0) scale3d(var(--tw-exit-scale, 1),var(--tw-exit-scale, 1),var(--tw-exit-scale, 1)) rotate(var(--tw-exit-rotate, 0))}}.animate-in{animation-name:enter;animation-duration:.15s;--tw-enter-opacity: initial;--tw-enter-scale: initial;--tw-enter-rotate: initial;--tw-enter-translate-x: initial;--tw-enter-translate-y: initial}.fade-in-0{--tw-enter-opacity: 0}.fade-in-80{--tw-enter-opacity: .8}.zoom-in-95{--tw-enter-scale: .95}.duration-1000{animation-duration:1s}.duration-200{animation-duration:.2s}.duration-300{animation-duration:.3s}.ease-in-out{animation-timing-function:cubic-bezier(.4,0,.2,1)}.ease-linear{animation-timing-function:linear}.running{animation-play-state:running}.paused{animation-play-state:paused}.file\:border-0::file-selector-button{border-width:0px}.file\:bg-transparent::file-selector-button{background-color:transparent}.file\:text-sm::file-selector-button{font-size:.875rem;line-height:1.25rem}.file\:font-medium::file-selector-button{font-weight:500}.file\:text-foreground::file-selector-button{color:hsl(var(--foreground))}.placeholder\:text-muted-foreground::-moz-placeholder{color:hsl(var(--muted-foreground))}.placeholder\:text-muted-foreground::placeholder{color:hsl(var(--muted-foreground))}.placeholder\:text-slate-500::-moz-placeholder{--tw-text-opacity: 1;color:rgb(100 116 139 / var(--tw-text-opacity, 1))}.placeholder\:text-slate-500::placeholder{--tw-text-opacity: 1;color:rgb(100 116 139 / var(--tw-text-opacity, 1))}.after\:absolute:after{content:var(--tw-content);position:absolute}.after\:-inset-2:after{content:var(--tw-content);top:-.5rem;right:-.5rem;bottom:-.5rem;left:-.5rem}.after\:inset-y-0:after{content:var(--tw-content);top:0;bottom:0}.after\:left-1\/2:after{content:var(--tw-content);left:50%}.after\:w-1:after{content:var(--tw-content);width:.25rem}.after\:w-\[2px\]:after{content:var(--tw-content);width:2px}.after\:-translate-x-1\/2:after{content:var(--tw-content);--tw-translate-x: -50%;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.first\:rounded-l-md:first-child{border-top-left-radius:calc(var(--radius) - 2px);border-bottom-left-radius:calc(var(--radius) - 2px)}.first\:border-l:first-child{border-left-width:1px}.last\:rounded-r-md:last-child{border-top-right-radius:calc(var(--radius) - 2px);border-bottom-right-radius:calc(var(--radius) - 2px)}.last\:border-b-0:last-child{border-bottom-width:0px}.last\:pb-0:last-child{padding-bottom:0}.focus-within\:relative:focus-within{position:relative}.focus-within\:z-20:focus-within{z-index:20}.hover\:translate-y-\[-2px\]:hover{--tw-translate-y: -2px;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.hover\:translate-y-\[-4px\]:hover{--tw-translate-y: -4px;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.hover\:border-slate-300:hover{--tw-border-opacity: 1;border-color:rgb(203 213 225 / var(--tw-border-opacity, 1))}.hover\:bg-accent:hover{background-color:hsl(var(--accent))}.hover\:bg-blue-100:hover{--tw-bg-opacity: 1;background-color:rgb(219 234 254 / var(--tw-bg-opacity, 1))}.hover\:bg-destructive\/80:hover{background-color:hsl(var(--destructive) / .8)}.hover\:bg-destructive\/90:hover{background-color:hsl(var(--destructive) / .9)}.hover\:bg-gray-300:hover{--tw-bg-opacity: 1;background-color:rgb(209 213 219 / var(--tw-bg-opacity, 1))}.hover\:bg-gray-50:hover{--tw-bg-opacity: 1;background-color:rgb(249 250 251 / var(--tw-bg-opacity, 1))}.hover\:bg-gray-50\/50:hover{background-color:#f9fafb80}.hover\:bg-muted:hover{background-color:hsl(var(--muted))}.hover\:bg-muted\/50:hover{background-color:hsl(var(--muted) / .5)}.hover\:bg-primary:hover{background-color:hsl(var(--primary))}.hover\:bg-primary\/80:hover{background-color:hsl(var(--primary) / .8)}.hover\:bg-primary\/90:hover{background-color:hsl(var(--primary) / .9)}.hover\:bg-red-100:hover{--tw-bg-opacity: 1;background-color:rgb(254 226 226 / var(--tw-bg-opacity, 1))}.hover\:bg-red-700:hover{--tw-bg-opacity: 1;background-color:rgb(185 28 28 / var(--tw-bg-opacity, 1))}.hover\:bg-secondary\/80:hover{background-color:hsl(var(--secondary) / .8)}.hover\:bg-sidebar-accent:hover{background-color:hsl(var(--sidebar-accent))}.hover\:bg-slate-100:hover{--tw-bg-opacity: 1;background-color:rgb(241 245 249 / var(--tw-bg-opacity, 1))}.hover\:bg-slate-200:hover{--tw-bg-opacity: 1;background-color:rgb(226 232 240 / var(--tw-bg-opacity, 1))}.hover\:bg-slate-300:hover{--tw-bg-opacity: 1;background-color:rgb(203 213 225 / var(--tw-bg-opacity, 1))}.hover\:bg-slate-50:hover{--tw-bg-opacity: 1;background-color:rgb(248 250 252 / var(--tw-bg-opacity, 1))}.hover\:text-accent-foreground:hover{color:hsl(var(--accent-foreground))}.hover\:text-blue-600:hover{--tw-text-opacity: 1;color:rgb(37 99 235 / var(--tw-text-opacity, 1))}.hover\:text-blue-800:hover{--tw-text-opacity: 1;color:rgb(30 64 175 / var(--tw-text-opacity, 1))}.hover\:text-foreground:hover{color:hsl(var(--foreground))}.hover\:text-muted-foreground:hover{color:hsl(var(--muted-foreground))}.hover\:text-primary:hover{color:hsl(var(--primary))}.hover\:text-primary-foreground:hover{color:hsl(var(--primary-foreground))}.hover\:text-red-700:hover{--tw-text-opacity: 1;color:rgb(185 28 28 / var(--tw-text-opacity, 1))}.hover\:text-sidebar-accent-foreground:hover{color:hsl(var(--sidebar-accent-foreground))}.hover\:text-slate-900:hover{--tw-text-opacity: 1;color:rgb(15 23 42 / var(--tw-text-opacity, 1))}.hover\:underline:hover{text-decoration-line:underline}.hover\:opacity-100:hover{opacity:1}.hover\:shadow-\[0_0_0_1px_hsl\(var\(--sidebar-accent\)\)\]:hover{--tw-shadow: 0 0 0 1px hsl(var(--sidebar-accent));--tw-shadow-colored: 0 0 0 1px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)}.hover\:shadow-lg:hover{--tw-shadow: 0 10px 15px -3px rgb(0 0 0 / .1), 0 4px 6px -4px rgb(0 0 0 / .1);--tw-shadow-colored: 0 10px 15px -3px var(--tw-shadow-color), 0 4px 6px -4px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)}.hover\:shadow-md:hover{--tw-shadow: 0 4px 6px -1px rgb(0 0 0 / .1), 0 2px 4px -2px rgb(0 0 0 / .1);--tw-shadow-colored: 0 4px 6px -1px var(--tw-shadow-color), 0 2px 4px -2px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)}.hover\:ring-gray-900\/20:hover{--tw-ring-color: rgb(17 24 39 / .2)}.hover\:after\:bg-sidebar-border:hover:after{content:var(--tw-content);background-color:hsl(var(--sidebar-border))}.focus\:bg-accent:focus{background-color:hsl(var(--accent))}.focus\:bg-primary:focus{background-color:hsl(var(--primary))}.focus\:text-accent-foreground:focus{color:hsl(var(--accent-foreground))}.focus\:text-primary-foreground:focus{color:hsl(var(--primary-foreground))}.focus\:outline-none:focus{outline:2px solid transparent;outline-offset:2px}.focus\:ring-2:focus{--tw-ring-offset-shadow: var(--tw-ring-inset) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-shadow: var(--tw-ring-inset) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color);box-shadow:var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow, 0 0 #0000)}.focus\:ring-primary:focus{--tw-ring-color: hsl(var(--primary))}.focus\:ring-ring:focus{--tw-ring-color: hsl(var(--ring))}.focus\:ring-offset-2:focus{--tw-ring-offset-width: 2px}.focus-visible\:outline-none:focus-visible{outline:2px solid transparent;outline-offset:2px}.focus-visible\:ring-1:focus-visible{--tw-ring-offset-shadow: var(--tw-ring-inset) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-shadow: var(--tw-ring-inset) 0 0 0 calc(1px + var(--tw-ring-offset-width)) var(--tw-ring-color);box-shadow:var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow, 0 0 #0000)}.focus-visible\:ring-2:focus-visible{--tw-ring-offset-shadow: var(--tw-ring-inset) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-shadow: var(--tw-ring-inset) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color);box-shadow:var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow, 0 0 #0000)}.focus-visible\:ring-ring:focus-visible{--tw-ring-color: hsl(var(--ring))}.focus-visible\:ring-sidebar-ring:focus-visible{--tw-ring-color: hsl(var(--sidebar-ring))}.focus-visible\:ring-slate-950:focus-visible{--tw-ring-opacity: 1;--tw-ring-color: rgb(2 6 23 / var(--tw-ring-opacity, 1))}.focus-visible\:ring-offset-1:focus-visible{--tw-ring-offset-width: 1px}.focus-visible\:ring-offset-2:focus-visible{--tw-ring-offset-width: 2px}.focus-visible\:ring-offset-background:focus-visible{--tw-ring-offset-color: hsl(var(--background))}.active\:bg-sidebar-accent:active{background-color:hsl(var(--sidebar-accent))}.active\:text-sidebar-accent-foreground:active{color:hsl(var(--sidebar-accent-foreground))}.disabled\:pointer-events-none:disabled{pointer-events:none}.disabled\:cursor-not-allowed:disabled{cursor:not-allowed}.disabled\:opacity-50:disabled{opacity:.5}.group\/menu-item:focus-within .group-focus-within\/menu-item\:opacity-100{opacity:1}.group\/menu-item:hover .group-hover\/menu-item\:opacity-100,.group:hover .group-hover\:opacity-100{opacity:1}.group.toast .group-\[\.toast\]\:absolute{position:absolute}.group.toast .group-\[\.toast\]\:left-3{left:.75rem}.group.toast .group-\[\.toast\]\:top-3{top:.75rem}.group.toast .group-\[\.toast\]\:h-5{height:1.25rem}.group.toast .group-\[\.toast\]\:w-5{width:1.25rem}.group.toast .group-\[\.toast\]\:rounded-md{border-radius:calc(var(--radius) - 2px)}.group.toaster .group-\[\.toaster\]\:border-border{border-color:hsl(var(--border))}.group.toast .group-\[\.toast\]\:bg-muted{background-color:hsl(var(--muted))}.group.toast .group-\[\.toast\]\:bg-primary{background-color:hsl(var(--primary))}.group.toaster .group-\[\.toaster\]\:bg-background{background-color:hsl(var(--background))}.group.toast .group-\[\.toast\]\:p-1{padding:.25rem}.group.toaster .group-\[\.toaster\]\:pr-8{padding-right:2rem}.group.toast .group-\[\.toast\]\:text-foreground\/70{color:hsl(var(--foreground) / .7)}.group.toast .group-\[\.toast\]\:text-muted-foreground{color:hsl(var(--muted-foreground))}.group.toast .group-\[\.toast\]\:text-primary-foreground{color:hsl(var(--primary-foreground))}.group.toaster .group-\[\.toaster\]\:text-foreground{color:hsl(var(--foreground))}.group.toast .group-\[\.toast\]\:opacity-100{opacity:1}.group.toaster .group-\[\.toaster\]\:shadow-lg{--tw-shadow: 0 10px 15px -3px rgb(0 0 0 / .1), 0 4px 6px -4px rgb(0 0 0 / .1);--tw-shadow-colored: 0 10px 15px -3px var(--tw-shadow-color), 0 4px 6px -4px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)}.group.toast .group-\[\.toast\]\:transition-opacity{transition-property:opacity;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s}.group.toast .hover\:group-\[\.toast\]\:bg-muted\/50:hover{background-color:hsl(var(--muted) / .5)}.group.toast .hover\:group-\[\.toast\]\:text-foreground:hover{color:hsl(var(--foreground))}.group.toast .focus\:group-\[\.toast\]\:opacity-100:focus{opacity:1}.group.toast .focus\:group-\[\.toast\]\:outline-none:focus{outline:2px solid transparent;outline-offset:2px}.group.toast .focus\:group-\[\.toast\]\:ring-1:focus{--tw-ring-offset-shadow: var(--tw-ring-inset) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-shadow: var(--tw-ring-inset) 0 0 0 calc(1px + var(--tw-ring-offset-width)) var(--tw-ring-color);box-shadow:var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow, 0 0 #0000)}.group.toast .focus\:group-\[\.toast\]\:ring-ring:focus{--tw-ring-color: hsl(var(--ring))}.peer\/menu-button:hover~.peer-hover\/menu-button\:text-sidebar-accent-foreground{color:hsl(var(--sidebar-accent-foreground))}.peer:disabled~.peer-disabled\:cursor-not-allowed{cursor:not-allowed}.peer:disabled~.peer-disabled\:opacity-70{opacity:.7}.has-\[\[data-variant\=inset\]\]\:bg-sidebar:has([data-variant=inset]){background-color:hsl(var(--sidebar-background))}.has-\[\:disabled\]\:opacity-50:has(:disabled){opacity:.5}.group\/menu-item:has([data-sidebar=menu-action]) .group-has-\[\[data-sidebar\=menu-action\]\]\/menu-item\:pr-8{padding-right:2rem}.aria-disabled\:pointer-events-none[aria-disabled=true]{pointer-events:none}.aria-disabled\:opacity-50[aria-disabled=true]{opacity:.5}.aria-selected\:bg-accent[aria-selected=true]{background-color:hsl(var(--accent))}.aria-selected\:bg-accent\/50[aria-selected=true]{background-color:hsl(var(--accent) / .5)}.aria-selected\:text-accent-foreground[aria-selected=true]{color:hsl(var(--accent-foreground))}.aria-selected\:text-muted-foreground[aria-selected=true]{color:hsl(var(--muted-foreground))}.aria-selected\:opacity-100[aria-selected=true]{opacity:1}.aria-selected\:opacity-30[aria-selected=true]{opacity:.3}.data-\[disabled\=true\]\:pointer-events-none[data-disabled=true],.data-\[disabled\]\:pointer-events-none[data-disabled]{pointer-events:none}.data-\[panel-group-direction\=vertical\]\:h-px[data-panel-group-direction=vertical]{height:1px}.data-\[panel-group-direction\=vertical\]\:w-full[data-panel-group-direction=vertical]{width:100%}.data-\[side\=bottom\]\:translate-y-1[data-side=bottom]{--tw-translate-y: .25rem;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.data-\[side\=left\]\:-translate-x-1[data-side=left]{--tw-translate-x: -.25rem;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.data-\[side\=right\]\:translate-x-1[data-side=right]{--tw-translate-x: .25rem;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.data-\[side\=top\]\:-translate-y-1[data-side=top]{--tw-translate-y: -.25rem;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.data-\[state\=checked\]\:translate-x-5[data-state=checked]{--tw-translate-x: 1.25rem;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.data-\[state\=unchecked\]\:translate-x-0[data-state=unchecked]{--tw-translate-x: 0px;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.data-\[state\=open\]\:rotate-90[data-state=open]{--tw-rotate: 90deg;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}@keyframes accordion-up{0%{height:var(--radix-accordion-content-height)}to{height:0}}.data-\[state\=closed\]\:animate-accordion-up[data-state=closed]{animation:accordion-up .2s ease-out}@keyframes accordion-down{0%{height:0}to{height:var(--radix-accordion-content-height)}}.data-\[state\=open\]\:animate-accordion-down[data-state=open]{animation:accordion-down .2s ease-out}.data-\[panel-group-direction\=vertical\]\:flex-col[data-panel-group-direction=vertical]{flex-direction:column}.data-\[active\=true\]\:bg-sidebar-accent[data-active=true]{background-color:hsl(var(--sidebar-accent))}.data-\[active\]\:bg-accent\/50[data-active]{background-color:hsl(var(--accent) / .5)}.data-\[selected\=\'true\'\]\:bg-accent[data-selected=true]{background-color:hsl(var(--accent))}.data-\[state\=active\]\:bg-background[data-state=active]{background-color:hsl(var(--background))}.data-\[state\=checked\]\:bg-primary[data-state=checked]{background-color:hsl(var(--primary))}.data-\[state\=on\]\:bg-accent[data-state=on],.data-\[state\=open\]\:bg-accent[data-state=open]{background-color:hsl(var(--accent))}.data-\[state\=open\]\:bg-accent\/50[data-state=open]{background-color:hsl(var(--accent) / .5)}.data-\[state\=open\]\:bg-secondary[data-state=open]{background-color:hsl(var(--secondary))}.data-\[state\=selected\]\:bg-muted[data-state=selected]{background-color:hsl(var(--muted))}.data-\[state\=unchecked\]\:bg-input[data-state=unchecked]{background-color:hsl(var(--input))}.data-\[active\=true\]\:font-medium[data-active=true]{font-weight:500}.data-\[active\=true\]\:text-sidebar-accent-foreground[data-active=true]{color:hsl(var(--sidebar-accent-foreground))}.data-\[selected\=true\]\:text-accent-foreground[data-selected=true]{color:hsl(var(--accent-foreground))}.data-\[state\=active\]\:text-foreground[data-state=active]{color:hsl(var(--foreground))}.data-\[state\=checked\]\:text-primary-foreground[data-state=checked]{color:hsl(var(--primary-foreground))}.data-\[state\=on\]\:text-accent-foreground[data-state=on],.data-\[state\=open\]\:text-accent-foreground[data-state=open]{color:hsl(var(--accent-foreground))}.data-\[state\=open\]\:text-muted-foreground[data-state=open]{color:hsl(var(--muted-foreground))}.data-\[disabled\=true\]\:opacity-50[data-disabled=true],.data-\[disabled\]\:opacity-50[data-disabled]{opacity:.5}.data-\[state\=open\]\:opacity-100[data-state=open]{opacity:1}.data-\[state\=active\]\:shadow-sm[data-state=active]{--tw-shadow: 0 1px 2px 0 rgb(0 0 0 / .05);--tw-shadow-colored: 0 1px 2px 0 var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)}.data-\[state\=closed\]\:duration-300[data-state=closed]{transition-duration:.3s}.data-\[state\=open\]\:duration-500[data-state=open]{transition-duration:.5s}.data-\[motion\^\=from-\]\:animate-in[data-motion^=from-],.data-\[state\=open\]\:animate-in[data-state=open],.data-\[state\=visible\]\:animate-in[data-state=visible]{animation-name:enter;animation-duration:.15s;--tw-enter-opacity: initial;--tw-enter-scale: initial;--tw-enter-rotate: initial;--tw-enter-translate-x: initial;--tw-enter-translate-y: initial}.data-\[motion\^\=to-\]\:animate-out[data-motion^=to-],.data-\[state\=closed\]\:animate-out[data-state=closed],.data-\[state\=hidden\]\:animate-out[data-state=hidden]{animation-name:exit;animation-duration:.15s;--tw-exit-opacity: initial;--tw-exit-scale: initial;--tw-exit-rotate: initial;--tw-exit-translate-x: initial;--tw-exit-translate-y: initial}.data-\[motion\^\=from-\]\:fade-in[data-motion^=from-]{--tw-enter-opacity: 0}.data-\[motion\^\=to-\]\:fade-out[data-motion^=to-],.data-\[state\=closed\]\:fade-out-0[data-state=closed],.data-\[state\=hidden\]\:fade-out[data-state=hidden]{--tw-exit-opacity: 0}.data-\[state\=open\]\:fade-in-0[data-state=open],.data-\[state\=visible\]\:fade-in[data-state=visible]{--tw-enter-opacity: 0}.data-\[state\=closed\]\:zoom-out-95[data-state=closed]{--tw-exit-scale: .95}.data-\[state\=open\]\:zoom-in-90[data-state=open]{--tw-enter-scale: .9}.data-\[state\=open\]\:zoom-in-95[data-state=open]{--tw-enter-scale: .95}.data-\[motion\=from-end\]\:slide-in-from-right-52[data-motion=from-end]{--tw-enter-translate-x: 13rem}.data-\[motion\=from-start\]\:slide-in-from-left-52[data-motion=from-start]{--tw-enter-translate-x: -13rem}.data-\[motion\=to-end\]\:slide-out-to-right-52[data-motion=to-end]{--tw-exit-translate-x: 13rem}.data-\[motion\=to-start\]\:slide-out-to-left-52[data-motion=to-start]{--tw-exit-translate-x: -13rem}.data-\[side\=bottom\]\:slide-in-from-top-2[data-side=bottom]{--tw-enter-translate-y: -.5rem}.data-\[side\=left\]\:slide-in-from-right-2[data-side=left]{--tw-enter-translate-x: .5rem}.data-\[side\=right\]\:slide-in-from-left-2[data-side=right]{--tw-enter-translate-x: -.5rem}.data-\[side\=top\]\:slide-in-from-bottom-2[data-side=top]{--tw-enter-translate-y: .5rem}.data-\[state\=closed\]\:slide-out-to-bottom[data-state=closed]{--tw-exit-translate-y: 100%}.data-\[state\=closed\]\:slide-out-to-left[data-state=closed]{--tw-exit-translate-x: -100%}.data-\[state\=closed\]\:slide-out-to-left-1\/2[data-state=closed]{--tw-exit-translate-x: -50%}.data-\[state\=closed\]\:slide-out-to-right[data-state=closed]{--tw-exit-translate-x: 100%}.data-\[state\=closed\]\:slide-out-to-top[data-state=closed]{--tw-exit-translate-y: -100%}.data-\[state\=closed\]\:slide-out-to-top-\[48\%\][data-state=closed]{--tw-exit-translate-y: -48%}.data-\[state\=open\]\:slide-in-from-bottom[data-state=open]{--tw-enter-translate-y: 100%}.data-\[state\=open\]\:slide-in-from-left[data-state=open]{--tw-enter-translate-x: -100%}.data-\[state\=open\]\:slide-in-from-left-1\/2[data-state=open]{--tw-enter-translate-x: -50%}.data-\[state\=open\]\:slide-in-from-right[data-state=open]{--tw-enter-translate-x: 100%}.data-\[state\=open\]\:slide-in-from-top[data-state=open]{--tw-enter-translate-y: -100%}.data-\[state\=open\]\:slide-in-from-top-\[48\%\][data-state=open]{--tw-enter-translate-y: -48%}.data-\[state\=closed\]\:duration-300[data-state=closed]{animation-duration:.3s}.data-\[state\=open\]\:duration-500[data-state=open]{animation-duration:.5s}.data-\[panel-group-direction\=vertical\]\:after\:left-0[data-panel-group-direction=vertical]:after{content:var(--tw-content);left:0}.data-\[panel-group-direction\=vertical\]\:after\:h-1[data-panel-group-direction=vertical]:after{content:var(--tw-content);height:.25rem}.data-\[panel-group-direction\=vertical\]\:after\:w-full[data-panel-group-direction=vertical]:after{content:var(--tw-content);width:100%}.data-\[panel-group-direction\=vertical\]\:after\:-translate-y-1\/2[data-panel-group-direction=vertical]:after{content:var(--tw-content);--tw-translate-y: -50%;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.data-\[panel-group-direction\=vertical\]\:after\:translate-x-0[data-panel-group-direction=vertical]:after{content:var(--tw-content);--tw-translate-x: 0px;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.data-\[state\=open\]\:hover\:bg-sidebar-accent:hover[data-state=open]{background-color:hsl(var(--sidebar-accent))}.data-\[state\=open\]\:hover\:text-sidebar-accent-foreground:hover[data-state=open]{color:hsl(var(--sidebar-accent-foreground))}.group[data-collapsible=offcanvas] .group-data-\[collapsible\=offcanvas\]\:left-\[calc\(var\(--sidebar-width\)\*-1\)\]{left:calc(var(--sidebar-width) * -1)}.group[data-collapsible=offcanvas] .group-data-\[collapsible\=offcanvas\]\:right-\[calc\(var\(--sidebar-width\)\*-1\)\]{right:calc(var(--sidebar-width) * -1)}.group[data-side=left] .group-data-\[side\=left\]\:-right-4{right:-1rem}.group[data-side=right] .group-data-\[side\=right\]\:left-0{left:0}.group[data-collapsible=icon] .group-data-\[collapsible\=icon\]\:-mt-8{margin-top:-2rem}.group[data-collapsible=icon] .group-data-\[collapsible\=icon\]\:hidden{display:none}.group[data-collapsible=icon] .group-data-\[collapsible\=icon\]\:\!size-8{width:2rem!important;height:2rem!important}.group[data-collapsible=icon] .group-data-\[collapsible\=icon\]\:w-\[--sidebar-width-icon\]{width:var(--sidebar-width-icon)}.group[data-collapsible=icon] .group-data-\[collapsible\=icon\]\:w-\[calc\(var\(--sidebar-width-icon\)_\+_theme\(spacing\.4\)\)\]{width:calc(var(--sidebar-width-icon) + 1rem)}.group[data-collapsible=icon] .group-data-\[collapsible\=icon\]\:w-\[calc\(var\(--sidebar-width-icon\)_\+_theme\(spacing\.4\)_\+2px\)\]{width:calc(var(--sidebar-width-icon) + 1rem + 2px)}.group[data-collapsible=offcanvas] .group-data-\[collapsible\=offcanvas\]\:w-0{width:0px}.group[data-collapsible=offcanvas] .group-data-\[collapsible\=offcanvas\]\:translate-x-0{--tw-translate-x: 0px;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.group[data-side=right] .group-data-\[side\=right\]\:rotate-180,.group[data-state=open] .group-data-\[state\=open\]\:rotate-180{--tw-rotate: 180deg;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.group[data-collapsible=icon] .group-data-\[collapsible\=icon\]\:overflow-hidden{overflow:hidden}.group[data-variant=floating] .group-data-\[variant\=floating\]\:rounded-lg{border-radius:var(--radius)}.group[data-variant=floating] .group-data-\[variant\=floating\]\:border{border-width:1px}.group[data-side=left] .group-data-\[side\=left\]\:border-r{border-right-width:1px}.group[data-side=right] .group-data-\[side\=right\]\:border-l{border-left-width:1px}.group[data-variant=floating] .group-data-\[variant\=floating\]\:border-sidebar-border{border-color:hsl(var(--sidebar-border))}.group[data-collapsible=icon] .group-data-\[collapsible\=icon\]\:\!p-0{padding:0!important}.group[data-collapsible=icon] .group-data-\[collapsible\=icon\]\:\!p-2{padding:.5rem!important}.group[data-collapsible=icon] .group-data-\[collapsible\=icon\]\:opacity-0{opacity:0}.group[data-variant=floating] .group-data-\[variant\=floating\]\:shadow{--tw-shadow: 0 1px 3px 0 rgb(0 0 0 / .1), 0 1px 2px -1px rgb(0 0 0 / .1);--tw-shadow-colored: 0 1px 3px 0 var(--tw-shadow-color), 0 1px 2px -1px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)}.group[data-collapsible=offcanvas] .group-data-\[collapsible\=offcanvas\]\:after\:left-full:after{content:var(--tw-content);left:100%}.group[data-collapsible=offcanvas] .group-data-\[collapsible\=offcanvas\]\:hover\:bg-sidebar:hover{background-color:hsl(var(--sidebar-background))}.peer\/menu-button[data-size=default]~.peer-data-\[size\=default\]\/menu-button\:top-1\.5{top:.375rem}.peer\/menu-button[data-size=lg]~.peer-data-\[size\=lg\]\/menu-button\:top-2\.5{top:.625rem}.peer\/menu-button[data-size=sm]~.peer-data-\[size\=sm\]\/menu-button\:top-1{top:.25rem}.peer[data-variant=inset]~.peer-data-\[variant\=inset\]\:min-h-\[calc\(100svh-theme\(spacing\.4\)\)\]{min-height:calc(100svh - 1rem)}.peer\/menu-button[data-active=true]~.peer-data-\[active\=true\]\/menu-button\:text-sidebar-accent-foreground{color:hsl(var(--sidebar-accent-foreground))}.dark\:border-destructive:is(.dark *){border-color:hsl(var(--destructive))}.dark\:from-gray-900:is(.dark *){--tw-gradient-from: #111827 var(--tw-gradient-from-position);--tw-gradient-to: rgb(17 24 39 / 0) var(--tw-gradient-to-position);--tw-gradient-stops: var(--tw-gradient-from), var(--tw-gradient-to)}.dark\:to-gray-800:is(.dark *){--tw-gradient-to: #1f2937 var(--tw-gradient-to-position)}@media (min-width: 640px){.sm\:bottom-\[-20rem\]{bottom:-20rem}.sm\:left-\[calc\(50\%\+30rem\)\]{left:calc(50% + 30rem)}.sm\:left-\[calc\(50\%-30rem\)\]{left:calc(50% - 30rem)}.sm\:top-\[-20rem\]{top:-20rem}.sm\:mt-0{margin-top:0}.sm\:mt-24{margin-top:6rem}.sm\:flex{display:flex}.sm\:w-\[72\.1875rem\]{width:72.1875rem}.sm\:max-w-md{max-width:28rem}.sm\:max-w-sm{max-width:24rem}.sm\:grid-cols-1{grid-template-columns:repeat(1,minmax(0,1fr))}.sm\:grid-cols-2{grid-template-columns:repeat(2,minmax(0,1fr))}.sm\:grid-cols-3{grid-template-columns:repeat(3,minmax(0,1fr))}.sm\:flex-row{flex-direction:row}.sm\:items-center{align-items:center}.sm\:justify-end{justify-content:flex-end}.sm\:gap-2\.5{gap:.625rem}.sm\:space-x-2>:not([hidden])~:not([hidden]){--tw-space-x-reverse: 0;margin-right:calc(.5rem * var(--tw-space-x-reverse));margin-left:calc(.5rem * calc(1 - var(--tw-space-x-reverse)))}.sm\:space-x-4>:not([hidden])~:not([hidden]){--tw-space-x-reverse: 0;margin-right:calc(1rem * var(--tw-space-x-reverse));margin-left:calc(1rem * calc(1 - var(--tw-space-x-reverse)))}.sm\:space-y-0>:not([hidden])~:not([hidden]){--tw-space-y-reverse: 0;margin-top:calc(0px * calc(1 - var(--tw-space-y-reverse)));margin-bottom:calc(0px * var(--tw-space-y-reverse))}.sm\:rounded-lg{border-radius:var(--radius)}.sm\:px-6{padding-left:1.5rem;padding-right:1.5rem}.sm\:py-32{padding-top:8rem;padding-bottom:8rem}.sm\:text-left{text-align:left}.sm\:text-4xl{font-size:2.25rem;line-height:2.5rem}.sm\:text-6xl{font-size:3.75rem;line-height:1}}@media (min-width: 768px){.md\:absolute{position:absolute}.md\:mb-0{margin-bottom:0}.md\:block{display:block}.md\:flex{display:flex}.md\:hidden{display:none}.md\:w-64{width:16rem}.md\:w-\[var\(--radix-navigation-menu-viewport-width\)\]{width:var(--radix-navigation-menu-viewport-width)}.md\:w-auto{width:auto}.md\:grid-cols-2{grid-template-columns:repeat(2,minmax(0,1fr))}.md\:grid-cols-3{grid-template-columns:repeat(3,minmax(0,1fr))}.md\:grid-cols-4{grid-template-columns:repeat(4,minmax(0,1fr))}.md\:flex-row{flex-direction:row}.md\:border-l{border-left-width:1px}.md\:text-sm{font-size:.875rem;line-height:1.25rem}.md\:opacity-0{opacity:0}.after\:md\:hidden:after{content:var(--tw-content);display:none}.peer[data-variant=inset]~.md\:peer-data-\[variant\=inset\]\:m-2{margin:.5rem}.peer[data-state=collapsed][data-variant=inset]~.md\:peer-data-\[state\=collapsed\]\:peer-data-\[variant\=inset\]\:ml-2{margin-left:.5rem}.peer[data-variant=inset]~.md\:peer-data-\[variant\=inset\]\:ml-0{margin-left:0}.peer[data-variant=inset]~.md\:peer-data-\[variant\=inset\]\:rounded-xl{border-radius:.75rem}.peer[data-variant=inset]~.md\:peer-data-\[variant\=inset\]\:shadow{--tw-shadow: 0 1px 3px 0 rgb(0 0 0 / .1), 0 1px 2px -1px rgb(0 0 0 / .1);--tw-shadow-colored: 0 1px 3px 0 var(--tw-shadow-color), 0 1px 2px -1px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)}}@media (min-width: 1024px){.lg\:col-span-1{grid-column:span 1 / span 1}.lg\:col-span-2{grid-column:span 2 / span 2}.lg\:mx-0{margin-left:0;margin-right:0}.lg\:mt-0{margin-top:0}.lg\:flex{display:flex}.lg\:w-64{width:16rem}.lg\:flex-auto{flex:1 1 auto}.lg\:flex-shrink-0{flex-shrink:0}.lg\:flex-grow{flex-grow:1}.lg\:grid-cols-2{grid-template-columns:repeat(2,minmax(0,1fr))}.lg\:grid-cols-3{grid-template-columns:repeat(3,minmax(0,1fr))}.lg\:flex-row{flex-direction:row}.lg\:items-center{align-items:center}.lg\:gap-x-10{-moz-column-gap:2.5rem;column-gap:2.5rem}.lg\:px-8{padding-left:2rem;padding-right:2rem}.lg\:py-40{padding-top:10rem;padding-bottom:10rem}}@media (min-width: 1280px){.xl\:grid-cols-2{grid-template-columns:repeat(2,minmax(0,1fr))}}.\[\&\:has\(\[aria-selected\]\)\]\:bg-accent:has([aria-selected]){background-color:hsl(var(--accent))}.first\:\[\&\:has\(\[aria-selected\]\)\]\:rounded-l-md:has([aria-selected]):first-child{border-top-left-radius:calc(var(--radius) - 2px);border-bottom-left-radius:calc(var(--radius) - 2px)}.last\:\[\&\:has\(\[aria-selected\]\)\]\:rounded-r-md:has([aria-selected]):last-child{border-top-right-radius:calc(var(--radius) - 2px);border-bottom-right-radius:calc(var(--radius) - 2px)}.\[\&\:has\(\[aria-selected\]\.day-outside\)\]\:bg-accent\/50:has([aria-selected].day-outside){background-color:hsl(var(--accent) / .5)}.\[\&\:has\(\[aria-selected\]\.day-range-end\)\]\:rounded-r-md:has([aria-selected].day-range-end){border-top-right-radius:calc(var(--radius) - 2px);border-bottom-right-radius:calc(var(--radius) - 2px)}.\[\&\:has\(\[role\=checkbox\]\)\]\:pr-0:has([role=checkbox]){padding-right:0}.\[\&\>button\]\:hidden>button{display:none}.\[\&\>span\:last-child\]\:truncate>span:last-child{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.\[\&\>span\]\:line-clamp-1>span{overflow:hidden;display:-webkit-box;-webkit-box-orient:vertical;-webkit-line-clamp:1}.\[\&\>svg\+div\]\:translate-y-\[-3px\]>svg+div{--tw-translate-y: -3px;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.\[\&\>svg\]\:absolute>svg{position:absolute}.\[\&\>svg\]\:left-4>svg{left:1rem}.\[\&\>svg\]\:top-4>svg{top:1rem}.\[\&\>svg\]\:size-3\.5>svg{width:.875rem;height:.875rem}.\[\&\>svg\]\:size-4>svg{width:1rem;height:1rem}.\[\&\>svg\]\:h-2\.5>svg{height:.625rem}.\[\&\>svg\]\:h-3>svg{height:.75rem}.\[\&\>svg\]\:w-2\.5>svg{width:.625rem}.\[\&\>svg\]\:w-3>svg{width:.75rem}.\[\&\>svg\]\:shrink-0>svg{flex-shrink:0}.\[\&\>svg\]\:text-destructive>svg{color:hsl(var(--destructive))}.\[\&\>svg\]\:text-foreground>svg{color:hsl(var(--foreground))}.\[\&\>svg\]\:text-muted-foreground>svg{color:hsl(var(--muted-foreground))}.\[\&\>svg\]\:text-sidebar-accent-foreground>svg{color:hsl(var(--sidebar-accent-foreground))}.\[\&\>svg\~\*\]\:pl-7>svg~*{padding-left:1.75rem}.\[\&\>tr\]\:last\:border-b-0:last-child>tr{border-bottom-width:0px}.\[\&\[data-panel-group-direction\=vertical\]\>div\]\:rotate-90[data-panel-group-direction=vertical]>div{--tw-rotate: 90deg;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.\[\&\[data-state\=open\]\>svg\]\:rotate-180[data-state=open]>svg{--tw-rotate: 180deg;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.\[\&_\.recharts-cartesian-axis-tick_text\]\:fill-muted-foreground .recharts-cartesian-axis-tick text{fill:hsl(var(--muted-foreground))}.\[\&_\.recharts-cartesian-grid_line\[stroke\=\'\#ccc\'\]\]\:stroke-border\/50 .recharts-cartesian-grid line[stroke="#ccc"]{stroke:hsl(var(--border) / .5)}.\[\&_\.recharts-curve\.recharts-tooltip-cursor\]\:stroke-border .recharts-curve.recharts-tooltip-cursor{stroke:hsl(var(--border))}.\[\&_\.recharts-dot\[stroke\=\'\#fff\'\]\]\:stroke-transparent .recharts-dot[stroke="#fff"]{stroke:transparent}.\[\&_\.recharts-layer\]\:outline-none .recharts-layer{outline:2px solid transparent;outline-offset:2px}.\[\&_\.recharts-polar-grid_\[stroke\=\'\#ccc\'\]\]\:stroke-border .recharts-polar-grid [stroke="#ccc"]{stroke:hsl(var(--border))}.\[\&_\.recharts-radial-bar-background-sector\]\:fill-muted .recharts-radial-bar-background-sector,.\[\&_\.recharts-rectangle\.recharts-tooltip-cursor\]\:fill-muted .recharts-rectangle.recharts-tooltip-cursor{fill:hsl(var(--muted))}.\[\&_\.recharts-reference-line_\[stroke\=\'\#ccc\'\]\]\:stroke-border .recharts-reference-line [stroke="#ccc"]{stroke:hsl(var(--border))}.\[\&_\.recharts-sector\[stroke\=\'\#fff\'\]\]\:stroke-transparent .recharts-sector[stroke="#fff"]{stroke:transparent}.\[\&_\.recharts-sector\]\:outline-none .recharts-sector,.\[\&_\.recharts-surface\]\:outline-none .recharts-surface{outline:2px solid transparent;outline-offset:2px}.\[\&_\[cmdk-group-heading\]\]\:px-2 [cmdk-group-heading]{padding-left:.5rem;padding-right:.5rem}.\[\&_\[cmdk-group-heading\]\]\:py-1\.5 [cmdk-group-heading]{padding-top:.375rem;padding-bottom:.375rem}.\[\&_\[cmdk-group-heading\]\]\:text-xs [cmdk-group-heading]{font-size:.75rem;line-height:1rem}.\[\&_\[cmdk-group-heading\]\]\:font-medium [cmdk-group-heading]{font-weight:500}.\[\&_\[cmdk-group-heading\]\]\:text-muted-foreground [cmdk-group-heading]{color:hsl(var(--muted-foreground))}.\[\&_\[cmdk-group\]\:not\(\[hidden\]\)_\~\[cmdk-group\]\]\:pt-0 [cmdk-group]:not([hidden])~[cmdk-group]{padding-top:0}.\[\&_\[cmdk-group\]\]\:px-2 [cmdk-group]{padding-left:.5rem;padding-right:.5rem}.\[\&_\[cmdk-input-wrapper\]_svg\]\:h-5 [cmdk-input-wrapper] svg{height:1.25rem}.\[\&_\[cmdk-input-wrapper\]_svg\]\:w-5 [cmdk-input-wrapper] svg{width:1.25rem}.\[\&_\[cmdk-input\]\]\:h-12 [cmdk-input]{height:3rem}.\[\&_\[cmdk-item\]\]\:px-2 [cmdk-item]{padding-left:.5rem;padding-right:.5rem}.\[\&_\[cmdk-item\]\]\:py-3 [cmdk-item]{padding-top:.75rem;padding-bottom:.75rem}.\[\&_\[cmdk-item\]_svg\]\:h-5 [cmdk-item] svg{height:1.25rem}.\[\&_\[cmdk-item\]_svg\]\:w-5 [cmdk-item] svg{width:1.25rem}.\[\&_p\]\:leading-relaxed p{line-height:1.625}.\[\&_svg\]\:pointer-events-none svg{pointer-events:none}.\[\&_svg\]\:size-4 svg{width:1rem;height:1rem}.\[\&_svg\]\:shrink-0 svg{flex-shrink:0}.\[\&_tr\:last-child\]\:border-0 tr:last-child{border-width:0px}.\[\&_tr\]\:border-b tr{border-bottom-width:1px}[data-side=left][data-collapsible=offcanvas] .\[\[data-side\=left\]\[data-collapsible\=offcanvas\]_\&\]\:-right-2{right:-.5rem}[data-side=left][data-state=collapsed] .\[\[data-side\=left\]\[data-state\=collapsed\]_\&\]\:cursor-e-resize{cursor:e-resize}[data-side=left] .\[\[data-side\=left\]_\&\]\:cursor-w-resize{cursor:w-resize}[data-side=right][data-collapsible=offcanvas] .\[\[data-side\=right\]\[data-collapsible\=offcanvas\]_\&\]\:-left-2{left:-.5rem}[data-side=right][data-state=collapsed] .\[\[data-side\=right\]\[data-state\=collapsed\]_\&\]\:cursor-w-resize{cursor:w-resize}[data-side=right] .\[\[data-side\=right\]_\&\]\:cursor-e-resize{cursor:e-resize} diff --git a/dist/assets/index-ImyDGn9B.js b/dist/assets/index-DCgbxyKr.js similarity index 61% rename from dist/assets/index-ImyDGn9B.js rename to dist/assets/index-DCgbxyKr.js index 22679abd..e30b6c0d 100644 --- a/dist/assets/index-ImyDGn9B.js +++ b/dist/assets/index-DCgbxyKr.js @@ -1,4 +1,4 @@ -var K_=e=>{throw TypeError(e)};var $x=(e,t,n)=>t.has(e)||K_("Cannot "+n);var pe=(e,t,n)=>($x(e,t,"read from private field"),n?n.call(e):t.get(e)),qt=(e,t,n)=>t.has(e)?K_("Cannot add the same private member more than once"):t instanceof WeakSet?t.add(e):t.set(e,n),Tt=(e,t,n,r)=>($x(e,t,"write to private field"),r?r.call(e,n):t.set(e,n),n),cr=(e,t,n)=>($x(e,t,"access private method"),n);var Np=(e,t,n,r)=>({set _(s){Tt(e,t,s,n)},get _(){return pe(e,t,r)}});function cB(e,t){for(var n=0;nr[s]})}}}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 s of document.querySelectorAll('link[rel="modulepreload"]'))r(s);new MutationObserver(s=>{for(const a of s)if(a.type==="childList")for(const o of a.addedNodes)o.tagName==="LINK"&&o.rel==="modulepreload"&&r(o)}).observe(document,{childList:!0,subtree:!0});function n(s){const a={};return s.integrity&&(a.integrity=s.integrity),s.referrerPolicy&&(a.referrerPolicy=s.referrerPolicy),s.crossOrigin==="use-credentials"?a.credentials="include":s.crossOrigin==="anonymous"?a.credentials="omit":a.credentials="same-origin",a}function r(s){if(s.ep)return;s.ep=!0;const a=n(s);fetch(s.href,a)}})();var _p=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function Gt(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var Uk={exports:{}},Vv={},Vk={exports:{}},Dt={};/** +var J_=e=>{throw TypeError(e)};var Rx=(e,t,n)=>t.has(e)||J_("Cannot "+n);var pe=(e,t,n)=>(Rx(e,t,"read from private field"),n?n.call(e):t.get(e)),qt=(e,t,n)=>t.has(e)?J_("Cannot add the same private member more than once"):t instanceof WeakSet?t.add(e):t.set(e,n),Tt=(e,t,n,r)=>(Rx(e,t,"write to private field"),r?r.call(e,n):t.set(e,n),n),cr=(e,t,n)=>(Rx(e,t,"access private method"),n);var _p=(e,t,n,r)=>({set _(s){Tt(e,t,s,n)},get _(){return pe(e,t,r)}});function mB(e,t){for(var n=0;nr[s]})}}}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 s of document.querySelectorAll('link[rel="modulepreload"]'))r(s);new MutationObserver(s=>{for(const a of s)if(a.type==="childList")for(const o of a.addedNodes)o.tagName==="LINK"&&o.rel==="modulepreload"&&r(o)}).observe(document,{childList:!0,subtree:!0});function n(s){const a={};return s.integrity&&(a.integrity=s.integrity),s.referrerPolicy&&(a.referrerPolicy=s.referrerPolicy),s.crossOrigin==="use-credentials"?a.credentials="include":s.crossOrigin==="anonymous"?a.credentials="omit":a.credentials="same-origin",a}function r(s){if(s.ep)return;s.ep=!0;const a=n(s);fetch(s.href,a)}})();var Pp=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function Ht(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var qk={exports:{}},Gv={},Kk={exports:{}},Dt={};/** * @license React * react.production.min.js * @@ -6,7 +6,7 @@ var K_=e=>{throw TypeError(e)};var $x=(e,t,n)=>t.has(e)||K_("Cannot "+n);var pe= * * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. - */var Kh=Symbol.for("react.element"),uB=Symbol.for("react.portal"),dB=Symbol.for("react.fragment"),fB=Symbol.for("react.strict_mode"),hB=Symbol.for("react.profiler"),pB=Symbol.for("react.provider"),mB=Symbol.for("react.context"),gB=Symbol.for("react.forward_ref"),vB=Symbol.for("react.suspense"),yB=Symbol.for("react.memo"),xB=Symbol.for("react.lazy"),X_=Symbol.iterator;function bB(e){return e===null||typeof e!="object"?null:(e=X_&&e[X_]||e["@@iterator"],typeof e=="function"?e:null)}var Wk={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},Hk=Object.assign,Gk={};function Bu(e,t,n){this.props=e,this.context=t,this.refs=Gk,this.updater=n||Wk}Bu.prototype.isReactComponent={};Bu.prototype.setState=function(e,t){if(typeof e!="object"&&typeof e!="function"&&e!=null)throw Error("setState(...): takes an object of state variables to update or a function which returns an object of state variables.");this.updater.enqueueSetState(this,e,t,"setState")};Bu.prototype.forceUpdate=function(e){this.updater.enqueueForceUpdate(this,e,"forceUpdate")};function qk(){}qk.prototype=Bu.prototype;function yj(e,t,n){this.props=e,this.context=t,this.refs=Gk,this.updater=n||Wk}var xj=yj.prototype=new qk;xj.constructor=yj;Hk(xj,Bu.prototype);xj.isPureReactComponent=!0;var Y_=Array.isArray,Kk=Object.prototype.hasOwnProperty,bj={current:null},Xk={key:!0,ref:!0,__self:!0,__source:!0};function Yk(e,t,n){var r,s={},a=null,o=null;if(t!=null)for(r in t.ref!==void 0&&(o=t.ref),t.key!==void 0&&(a=""+t.key),t)Kk.call(t,r)&&!Xk.hasOwnProperty(r)&&(s[r]=t[r]);var l=arguments.length-2;if(l===1)s.children=n;else if(1{throw TypeError(e)};var $x=(e,t,n)=>t.has(e)||K_("Cannot "+n);var pe= * * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. - */var _B=v,PB=Symbol.for("react.element"),AB=Symbol.for("react.fragment"),CB=Object.prototype.hasOwnProperty,EB=_B.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,OB={key:!0,ref:!0,__self:!0,__source:!0};function Jk(e,t,n){var r,s={},a=null,o=null;n!==void 0&&(a=""+n),t.key!==void 0&&(a=""+t.key),t.ref!==void 0&&(o=t.ref);for(r in t)CB.call(t,r)&&!OB.hasOwnProperty(r)&&(s[r]=t[r]);if(e&&e.defaultProps)for(r in t=e.defaultProps,t)s[r]===void 0&&(s[r]=t[r]);return{$$typeof:PB,type:e,key:a,ref:o,props:s,_owner:EB.current}}Vv.Fragment=AB;Vv.jsx=Jk;Vv.jsxs=Jk;Uk.exports=Vv;var i=Uk.exports,eT={exports:{}},us={},tT={exports:{}},nT={};/** + */var kB=v,TB=Symbol.for("react.element"),$B=Symbol.for("react.fragment"),MB=Object.prototype.hasOwnProperty,IB=kB.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,RB={key:!0,ref:!0,__self:!0,__source:!0};function sT(e,t,n){var r,s={},a=null,o=null;n!==void 0&&(a=""+n),t.key!==void 0&&(a=""+t.key),t.ref!==void 0&&(o=t.ref);for(r in t)MB.call(t,r)&&!RB.hasOwnProperty(r)&&(s[r]=t[r]);if(e&&e.defaultProps)for(r in t=e.defaultProps,t)s[r]===void 0&&(s[r]=t[r]);return{$$typeof:TB,type:e,key:a,ref:o,props:s,_owner:IB.current}}Gv.Fragment=$B;Gv.jsx=sT;Gv.jsxs=sT;qk.exports=Gv;var i=qk.exports,aT={exports:{}},us={},iT={exports:{}},oT={};/** * @license React * scheduler.production.min.js * @@ -22,7 +22,7 @@ var K_=e=>{throw TypeError(e)};var $x=(e,t,n)=>t.has(e)||K_("Cannot "+n);var pe= * * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. - */(function(e){function t(T,F){var q=T.length;T.push(F);e:for(;0>>1,re=T[Z];if(0>>1;Zs(le,q))ses(ce,le)?(T[Z]=ce,T[se]=q,Z=se):(T[Z]=le,T[B]=q,Z=B);else if(ses(ce,q))T[Z]=ce,T[se]=q,Z=se;else break e}}return F}function s(T,F){var q=T.sortIndex-F.sortIndex;return q!==0?q:T.id-F.id}if(typeof performance=="object"&&typeof performance.now=="function"){var a=performance;e.unstable_now=function(){return a.now()}}else{var o=Date,l=o.now();e.unstable_now=function(){return o.now()-l}}var c=[],u=[],d=1,f=null,h=3,p=!1,g=!1,m=!1,y=typeof setTimeout=="function"?setTimeout:null,b=typeof clearTimeout=="function"?clearTimeout:null,x=typeof setImmediate<"u"?setImmediate:null;typeof navigator<"u"&&navigator.scheduling!==void 0&&navigator.scheduling.isInputPending!==void 0&&navigator.scheduling.isInputPending.bind(navigator.scheduling);function w(T){for(var F=n(u);F!==null;){if(F.callback===null)r(u);else if(F.startTime<=T)r(u),F.sortIndex=F.expirationTime,t(c,F);else break;F=n(u)}}function j(T){if(m=!1,w(T),!g)if(n(c)!==null)g=!0,D(S);else{var F=n(u);F!==null&&V(j,F.startTime-T)}}function S(T,F){g=!1,m&&(m=!1,b(P),P=-1),p=!0;var q=h;try{for(w(F),f=n(c);f!==null&&(!(f.expirationTime>F)||T&&!M());){var Z=f.callback;if(typeof Z=="function"){f.callback=null,h=f.priorityLevel;var re=Z(f.expirationTime<=F);F=e.unstable_now(),typeof re=="function"?f.callback=re:f===n(c)&&r(c),w(F)}else r(c);f=n(c)}if(f!==null)var ge=!0;else{var B=n(u);B!==null&&V(j,B.startTime-F),ge=!1}return ge}finally{f=null,h=q,p=!1}}var N=!1,_=null,P=-1,k=5,O=-1;function M(){return!(e.unstable_now()-OT||125Z?(T.sortIndex=q,t(u,T),n(c)===null&&T===n(u)&&(m?(b(P),P=-1):m=!0,V(j,q-Z))):(T.sortIndex=re,t(c,T),g||p||(g=!0,D(S))),T},e.unstable_shouldYield=M,e.unstable_wrapCallback=function(T){var F=h;return function(){var q=h;h=F;try{return T.apply(this,arguments)}finally{h=q}}}})(nT);tT.exports=nT;var kB=tT.exports;/** + */(function(e){function t(T,F){var q=T.length;T.push(F);e:for(;0>>1,re=T[Z];if(0>>1;Zs(le,q))ses(ce,le)?(T[Z]=ce,T[se]=q,Z=se):(T[Z]=le,T[B]=q,Z=B);else if(ses(ce,q))T[Z]=ce,T[se]=q,Z=se;else break e}}return F}function s(T,F){var q=T.sortIndex-F.sortIndex;return q!==0?q:T.id-F.id}if(typeof performance=="object"&&typeof performance.now=="function"){var a=performance;e.unstable_now=function(){return a.now()}}else{var o=Date,l=o.now();e.unstable_now=function(){return o.now()-l}}var c=[],u=[],d=1,f=null,h=3,p=!1,g=!1,m=!1,y=typeof setTimeout=="function"?setTimeout:null,b=typeof clearTimeout=="function"?clearTimeout:null,x=typeof setImmediate<"u"?setImmediate:null;typeof navigator<"u"&&navigator.scheduling!==void 0&&navigator.scheduling.isInputPending!==void 0&&navigator.scheduling.isInputPending.bind(navigator.scheduling);function w(T){for(var F=n(u);F!==null;){if(F.callback===null)r(u);else if(F.startTime<=T)r(u),F.sortIndex=F.expirationTime,t(c,F);else break;F=n(u)}}function j(T){if(m=!1,w(T),!g)if(n(c)!==null)g=!0,D(S);else{var F=n(u);F!==null&&V(j,F.startTime-T)}}function S(T,F){g=!1,m&&(m=!1,b(P),P=-1),p=!0;var q=h;try{for(w(F),f=n(c);f!==null&&(!(f.expirationTime>F)||T&&!M());){var Z=f.callback;if(typeof Z=="function"){f.callback=null,h=f.priorityLevel;var re=Z(f.expirationTime<=F);F=e.unstable_now(),typeof re=="function"?f.callback=re:f===n(c)&&r(c),w(F)}else r(c);f=n(c)}if(f!==null)var ge=!0;else{var B=n(u);B!==null&&V(j,B.startTime-F),ge=!1}return ge}finally{f=null,h=q,p=!1}}var N=!1,_=null,P=-1,k=5,O=-1;function M(){return!(e.unstable_now()-OT||125Z?(T.sortIndex=q,t(u,T),n(c)===null&&T===n(u)&&(m?(b(P),P=-1):m=!0,V(j,q-Z))):(T.sortIndex=re,t(c,T),g||p||(g=!0,D(S))),T},e.unstable_shouldYield=M,e.unstable_wrapCallback=function(T){var F=h;return function(){var q=h;h=F;try{return T.apply(this,arguments)}finally{h=q}}}})(oT);iT.exports=oT;var DB=iT.exports;/** * @license React * react-dom.production.min.js * @@ -30,15 +30,15 @@ var K_=e=>{throw TypeError(e)};var $x=(e,t,n)=>t.has(e)||K_("Cannot "+n);var pe= * * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. - */var TB=v,cs=kB;function Ne(e){for(var t="https://reactjs.org/docs/error-decoder.html?invariant="+e,n=1;n"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),rb=Object.prototype.hasOwnProperty,$B=/^[: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]*$/,Q_={},J_={};function MB(e){return rb.call(J_,e)?!0:rb.call(Q_,e)?!1:$B.test(e)?J_[e]=!0:(Q_[e]=!0,!1)}function IB(e,t,n,r){if(n!==null&&n.type===0)return!1;switch(typeof t){case"function":case"symbol":return!0;case"boolean":return r?!1:n!==null?!n.acceptsBooleans:(e=e.toLowerCase().slice(0,5),e!=="data-"&&e!=="aria-");default:return!1}}function RB(e,t,n,r){if(t===null||typeof t>"u"||IB(e,t,n,r))return!0;if(r)return!1;if(n!==null)switch(n.type){case 3:return!t;case 4:return t===!1;case 5:return isNaN(t);case 6:return isNaN(t)||1>t}return!1}function $r(e,t,n,r,s,a,o){this.acceptsBooleans=t===2||t===3||t===4,this.attributeName=r,this.attributeNamespace=s,this.mustUseProperty=n,this.propertyName=e,this.type=t,this.sanitizeURL=a,this.removeEmptyString=o}var ar={};"children dangerouslySetInnerHTML defaultValue defaultChecked innerHTML suppressContentEditableWarning suppressHydrationWarning style".split(" ").forEach(function(e){ar[e]=new $r(e,0,!1,e,null,!1,!1)});[["acceptCharset","accept-charset"],["className","class"],["htmlFor","for"],["httpEquiv","http-equiv"]].forEach(function(e){var t=e[0];ar[t]=new $r(t,1,!1,e[1],null,!1,!1)});["contentEditable","draggable","spellCheck","value"].forEach(function(e){ar[e]=new $r(e,2,!1,e.toLowerCase(),null,!1,!1)});["autoReverse","externalResourcesRequired","focusable","preserveAlpha"].forEach(function(e){ar[e]=new $r(e,2,!1,e,null,!1,!1)});"allowFullScreen async autoFocus autoPlay controls default defer disabled disablePictureInPicture disableRemotePlayback formNoValidate hidden loop noModule noValidate open playsInline readOnly required reversed scoped seamless itemScope".split(" ").forEach(function(e){ar[e]=new $r(e,3,!1,e.toLowerCase(),null,!1,!1)});["checked","multiple","muted","selected"].forEach(function(e){ar[e]=new $r(e,3,!0,e,null,!1,!1)});["capture","download"].forEach(function(e){ar[e]=new $r(e,4,!1,e,null,!1,!1)});["cols","rows","size","span"].forEach(function(e){ar[e]=new $r(e,6,!1,e,null,!1,!1)});["rowSpan","start"].forEach(function(e){ar[e]=new $r(e,5,!1,e.toLowerCase(),null,!1,!1)});var jj=/[\-:]([a-z])/g;function Sj(e){return e[1].toUpperCase()}"accent-height alignment-baseline arabic-form baseline-shift cap-height clip-path clip-rule color-interpolation color-interpolation-filters color-profile color-rendering dominant-baseline enable-background fill-opacity fill-rule flood-color flood-opacity font-family font-size font-size-adjust font-stretch font-style font-variant font-weight glyph-name glyph-orientation-horizontal glyph-orientation-vertical horiz-adv-x horiz-origin-x image-rendering letter-spacing lighting-color marker-end marker-mid marker-start overline-position overline-thickness paint-order panose-1 pointer-events rendering-intent shape-rendering stop-color stop-opacity strikethrough-position strikethrough-thickness stroke-dasharray stroke-dashoffset stroke-linecap stroke-linejoin stroke-miterlimit stroke-opacity stroke-width text-anchor text-decoration text-rendering underline-position underline-thickness unicode-bidi unicode-range units-per-em v-alphabetic v-hanging v-ideographic v-mathematical vector-effect vert-adv-y vert-origin-x vert-origin-y word-spacing writing-mode xmlns:xlink x-height".split(" ").forEach(function(e){var t=e.replace(jj,Sj);ar[t]=new $r(t,1,!1,e,null,!1,!1)});"xlink:actuate xlink:arcrole xlink:role xlink:show xlink:title xlink:type".split(" ").forEach(function(e){var t=e.replace(jj,Sj);ar[t]=new $r(t,1,!1,e,"http://www.w3.org/1999/xlink",!1,!1)});["xml:base","xml:lang","xml:space"].forEach(function(e){var t=e.replace(jj,Sj);ar[t]=new $r(t,1,!1,e,"http://www.w3.org/XML/1998/namespace",!1,!1)});["tabIndex","crossOrigin"].forEach(function(e){ar[e]=new $r(e,1,!1,e.toLowerCase(),null,!1,!1)});ar.xlinkHref=new $r("xlinkHref",1,!1,"xlink:href","http://www.w3.org/1999/xlink",!0,!1);["src","href","action","formAction"].forEach(function(e){ar[e]=new $r(e,1,!1,e.toLowerCase(),null,!0,!0)});function Nj(e,t,n,r){var s=ar.hasOwnProperty(t)?ar[t]:null;(s!==null?s.type!==0:r||!(2"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),ib=Object.prototype.hasOwnProperty,FB=/^[: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]*$/,rP={},sP={};function BB(e){return ib.call(sP,e)?!0:ib.call(rP,e)?!1:FB.test(e)?sP[e]=!0:(rP[e]=!0,!1)}function zB(e,t,n,r){if(n!==null&&n.type===0)return!1;switch(typeof t){case"function":case"symbol":return!0;case"boolean":return r?!1:n!==null?!n.acceptsBooleans:(e=e.toLowerCase().slice(0,5),e!=="data-"&&e!=="aria-");default:return!1}}function UB(e,t,n,r){if(t===null||typeof t>"u"||zB(e,t,n,r))return!0;if(r)return!1;if(n!==null)switch(n.type){case 3:return!t;case 4:return t===!1;case 5:return isNaN(t);case 6:return isNaN(t)||1>t}return!1}function $r(e,t,n,r,s,a,o){this.acceptsBooleans=t===2||t===3||t===4,this.attributeName=r,this.attributeNamespace=s,this.mustUseProperty=n,this.propertyName=e,this.type=t,this.sanitizeURL=a,this.removeEmptyString=o}var ir={};"children dangerouslySetInnerHTML defaultValue defaultChecked innerHTML suppressContentEditableWarning suppressHydrationWarning style".split(" ").forEach(function(e){ir[e]=new $r(e,0,!1,e,null,!1,!1)});[["acceptCharset","accept-charset"],["className","class"],["htmlFor","for"],["httpEquiv","http-equiv"]].forEach(function(e){var t=e[0];ir[t]=new $r(t,1,!1,e[1],null,!1,!1)});["contentEditable","draggable","spellCheck","value"].forEach(function(e){ir[e]=new $r(e,2,!1,e.toLowerCase(),null,!1,!1)});["autoReverse","externalResourcesRequired","focusable","preserveAlpha"].forEach(function(e){ir[e]=new $r(e,2,!1,e,null,!1,!1)});"allowFullScreen async autoFocus autoPlay controls default defer disabled disablePictureInPicture disableRemotePlayback formNoValidate hidden loop noModule noValidate open playsInline readOnly required reversed scoped seamless itemScope".split(" ").forEach(function(e){ir[e]=new $r(e,3,!1,e.toLowerCase(),null,!1,!1)});["checked","multiple","muted","selected"].forEach(function(e){ir[e]=new $r(e,3,!0,e,null,!1,!1)});["capture","download"].forEach(function(e){ir[e]=new $r(e,4,!1,e,null,!1,!1)});["cols","rows","size","span"].forEach(function(e){ir[e]=new $r(e,6,!1,e,null,!1,!1)});["rowSpan","start"].forEach(function(e){ir[e]=new $r(e,5,!1,e.toLowerCase(),null,!1,!1)});var Pj=/[\-:]([a-z])/g;function Aj(e){return e[1].toUpperCase()}"accent-height alignment-baseline arabic-form baseline-shift cap-height clip-path clip-rule color-interpolation color-interpolation-filters color-profile color-rendering dominant-baseline enable-background fill-opacity fill-rule flood-color flood-opacity font-family font-size font-size-adjust font-stretch font-style font-variant font-weight glyph-name glyph-orientation-horizontal glyph-orientation-vertical horiz-adv-x horiz-origin-x image-rendering letter-spacing lighting-color marker-end marker-mid marker-start overline-position overline-thickness paint-order panose-1 pointer-events rendering-intent shape-rendering stop-color stop-opacity strikethrough-position strikethrough-thickness stroke-dasharray stroke-dashoffset stroke-linecap stroke-linejoin stroke-miterlimit stroke-opacity stroke-width text-anchor text-decoration text-rendering underline-position underline-thickness unicode-bidi unicode-range units-per-em v-alphabetic v-hanging v-ideographic v-mathematical vector-effect vert-adv-y vert-origin-x vert-origin-y word-spacing writing-mode xmlns:xlink x-height".split(" ").forEach(function(e){var t=e.replace(Pj,Aj);ir[t]=new $r(t,1,!1,e,null,!1,!1)});"xlink:actuate xlink:arcrole xlink:role xlink:show xlink:title xlink:type".split(" ").forEach(function(e){var t=e.replace(Pj,Aj);ir[t]=new $r(t,1,!1,e,"http://www.w3.org/1999/xlink",!1,!1)});["xml:base","xml:lang","xml:space"].forEach(function(e){var t=e.replace(Pj,Aj);ir[t]=new $r(t,1,!1,e,"http://www.w3.org/XML/1998/namespace",!1,!1)});["tabIndex","crossOrigin"].forEach(function(e){ir[e]=new $r(e,1,!1,e.toLowerCase(),null,!1,!1)});ir.xlinkHref=new $r("xlinkHref",1,!1,"xlink:href","http://www.w3.org/1999/xlink",!0,!1);["src","href","action","formAction"].forEach(function(e){ir[e]=new $r(e,1,!1,e.toLowerCase(),null,!0,!0)});function Cj(e,t,n,r){var s=ir.hasOwnProperty(t)?ir[t]:null;(s!==null?s.type!==0:r||!(2l||s[o]!==a[l]){var c=` -`+s[o].replace(" at new "," at ");return e.displayName&&c.includes("")&&(c=c.replace("",e.displayName)),c}while(1<=o&&0<=l);break}}}finally{Rx=!1,Error.prepareStackTrace=n}return(e=e?e.displayName||e.name:"")?Ud(e):""}function DB(e){switch(e.tag){case 5:return Ud(e.type);case 16:return Ud("Lazy");case 13:return Ud("Suspense");case 19:return Ud("SuspenseList");case 0:case 2:case 15:return e=Dx(e.type,!1),e;case 11:return e=Dx(e.type.render,!1),e;case 1:return e=Dx(e.type,!0),e;default:return""}}function ob(e){if(e==null)return null;if(typeof e=="function")return e.displayName||e.name||null;if(typeof e=="string")return e;switch(e){case pc:return"Fragment";case hc:return"Portal";case sb:return"Profiler";case _j:return"StrictMode";case ab:return"Suspense";case ib:return"SuspenseList"}if(typeof e=="object")switch(e.$$typeof){case aT:return(e.displayName||"Context")+".Consumer";case sT:return(e._context.displayName||"Context")+".Provider";case Pj:var t=e.render;return e=e.displayName,e||(e=t.displayName||t.name||"",e=e!==""?"ForwardRef("+e+")":"ForwardRef"),e;case Aj:return t=e.displayName||null,t!==null?t:ob(e.type)||"Memo";case Di:t=e._payload,e=e._init;try{return ob(e(t))}catch{}}return null}function LB(e){var t=e.type;switch(e.tag){case 24:return"Cache";case 9:return(t.displayName||"Context")+".Consumer";case 10:return(t._context.displayName||"Context")+".Provider";case 18:return"DehydratedFragment";case 11:return e=t.render,e=e.displayName||e.name||"",t.displayName||(e!==""?"ForwardRef("+e+")":"ForwardRef");case 7:return"Fragment";case 5:return t;case 4:return"Portal";case 3:return"Root";case 6:return"Text";case 16:return ob(t);case 8:return t===_j?"StrictMode":"Mode";case 22:return"Offscreen";case 12:return"Profiler";case 21:return"Scope";case 13:return"Suspense";case 19:return"SuspenseList";case 25:return"TracingMarker";case 1:case 0:case 17:case 2:case 14:case 15:if(typeof t=="function")return t.displayName||t.name||null;if(typeof t=="string")return t}return null}function bo(e){switch(typeof e){case"boolean":case"number":case"string":case"undefined":return e;case"object":return e;default:return""}}function oT(e){var t=e.type;return(e=e.nodeName)&&e.toLowerCase()==="input"&&(t==="checkbox"||t==="radio")}function FB(e){var t=oT(e)?"checked":"value",n=Object.getOwnPropertyDescriptor(e.constructor.prototype,t),r=""+e[t];if(!e.hasOwnProperty(t)&&typeof n<"u"&&typeof n.get=="function"&&typeof n.set=="function"){var s=n.get,a=n.set;return Object.defineProperty(e,t,{configurable:!0,get:function(){return s.call(this)},set:function(o){r=""+o,a.call(this,o)}}),Object.defineProperty(e,t,{enumerable:n.enumerable}),{getValue:function(){return r},setValue:function(o){r=""+o},stopTracking:function(){e._valueTracker=null,delete e[t]}}}}function Cp(e){e._valueTracker||(e._valueTracker=FB(e))}function lT(e){if(!e)return!1;var t=e._valueTracker;if(!t)return!0;var n=t.getValue(),r="";return e&&(r=oT(e)?e.checked?"true":"false":e.value),e=r,e!==n?(t.setValue(e),!0):!1}function Mm(e){if(e=e||(typeof document<"u"?document:void 0),typeof e>"u")return null;try{return e.activeElement||e.body}catch{return e.body}}function lb(e,t){var n=t.checked;return yn({},t,{defaultChecked:void 0,defaultValue:void 0,value:void 0,checked:n??e._wrapperState.initialChecked})}function tP(e,t){var n=t.defaultValue==null?"":t.defaultValue,r=t.checked!=null?t.checked:t.defaultChecked;n=bo(t.value!=null?t.value:n),e._wrapperState={initialChecked:r,initialValue:n,controlled:t.type==="checkbox"||t.type==="radio"?t.checked!=null:t.value!=null}}function cT(e,t){t=t.checked,t!=null&&Nj(e,"checked",t,!1)}function cb(e,t){cT(e,t);var n=bo(t.value),r=t.type;if(n!=null)r==="number"?(n===0&&e.value===""||e.value!=n)&&(e.value=""+n):e.value!==""+n&&(e.value=""+n);else if(r==="submit"||r==="reset"){e.removeAttribute("value");return}t.hasOwnProperty("value")?ub(e,t.type,n):t.hasOwnProperty("defaultValue")&&ub(e,t.type,bo(t.defaultValue)),t.checked==null&&t.defaultChecked!=null&&(e.defaultChecked=!!t.defaultChecked)}function nP(e,t,n){if(t.hasOwnProperty("value")||t.hasOwnProperty("defaultValue")){var r=t.type;if(!(r!=="submit"&&r!=="reset"||t.value!==void 0&&t.value!==null))return;t=""+e._wrapperState.initialValue,n||t===e.value||(e.value=t),e.defaultValue=t}n=e.name,n!==""&&(e.name=""),e.defaultChecked=!!e._wrapperState.initialChecked,n!==""&&(e.name=n)}function ub(e,t,n){(t!=="number"||Mm(e.ownerDocument)!==e)&&(n==null?e.defaultValue=""+e._wrapperState.initialValue:e.defaultValue!==""+n&&(e.defaultValue=""+n))}var Vd=Array.isArray;function Oc(e,t,n,r){if(e=e.options,t){t={};for(var s=0;s"+t.valueOf().toString()+"",t=Ep.firstChild;e.firstChild;)e.removeChild(e.firstChild);for(;t.firstChild;)e.appendChild(t.firstChild)}});function xf(e,t){if(t){var n=e.firstChild;if(n&&n===e.lastChild&&n.nodeType===3){n.nodeValue=t;return}}e.textContent=t}var Jd={animationIterationCount:!0,aspectRatio:!0,borderImageOutset:!0,borderImageSlice:!0,borderImageWidth:!0,boxFlex:!0,boxFlexGroup:!0,boxOrdinalGroup:!0,columnCount:!0,columns:!0,flex:!0,flexGrow:!0,flexPositive:!0,flexShrink:!0,flexNegative:!0,flexOrder:!0,gridArea:!0,gridRow:!0,gridRowEnd:!0,gridRowSpan:!0,gridRowStart:!0,gridColumn:!0,gridColumnEnd:!0,gridColumnSpan:!0,gridColumnStart:!0,fontWeight:!0,lineClamp:!0,lineHeight:!0,opacity:!0,order:!0,orphans:!0,tabSize:!0,widows:!0,zIndex:!0,zoom:!0,fillOpacity:!0,floodOpacity:!0,stopOpacity:!0,strokeDasharray:!0,strokeDashoffset:!0,strokeMiterlimit:!0,strokeOpacity:!0,strokeWidth:!0},BB=["Webkit","ms","Moz","O"];Object.keys(Jd).forEach(function(e){BB.forEach(function(t){t=t+e.charAt(0).toUpperCase()+e.substring(1),Jd[t]=Jd[e]})});function hT(e,t,n){return t==null||typeof t=="boolean"||t===""?"":n||typeof t!="number"||t===0||Jd.hasOwnProperty(e)&&Jd[e]?(""+t).trim():t+"px"}function pT(e,t){e=e.style;for(var n in t)if(t.hasOwnProperty(n)){var r=n.indexOf("--")===0,s=hT(n,t[n],r);n==="float"&&(n="cssFloat"),r?e.setProperty(n,s):e[n]=s}}var zB=yn({menuitem:!0},{area:!0,base:!0,br:!0,col:!0,embed:!0,hr:!0,img:!0,input:!0,keygen:!0,link:!0,meta:!0,param:!0,source:!0,track:!0,wbr:!0});function hb(e,t){if(t){if(zB[e]&&(t.children!=null||t.dangerouslySetInnerHTML!=null))throw Error(Ne(137,e));if(t.dangerouslySetInnerHTML!=null){if(t.children!=null)throw Error(Ne(60));if(typeof t.dangerouslySetInnerHTML!="object"||!("__html"in t.dangerouslySetInnerHTML))throw Error(Ne(61))}if(t.style!=null&&typeof t.style!="object")throw Error(Ne(62))}}function pb(e,t){if(e.indexOf("-")===-1)return typeof t.is=="string";switch(e){case"annotation-xml":case"color-profile":case"font-face":case"font-face-src":case"font-face-uri":case"font-face-format":case"font-face-name":case"missing-glyph":return!1;default:return!0}}var mb=null;function Cj(e){return e=e.target||e.srcElement||window,e.correspondingUseElement&&(e=e.correspondingUseElement),e.nodeType===3?e.parentNode:e}var gb=null,kc=null,Tc=null;function aP(e){if(e=Zh(e)){if(typeof gb!="function")throw Error(Ne(280));var t=e.stateNode;t&&(t=Kv(t),gb(e.stateNode,e.type,t))}}function mT(e){kc?Tc?Tc.push(e):Tc=[e]:kc=e}function gT(){if(kc){var e=kc,t=Tc;if(Tc=kc=null,aP(e),t)for(e=0;e>>=0,e===0?32:31-(QB(e)/JB|0)|0}var Op=64,kp=4194304;function Wd(e){switch(e&-e){case 1:return 1;case 2:return 2;case 4:return 4;case 8:return 8;case 16:return 16;case 32:return 32;case 64: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 e&4194240;case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:return e&130023424;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 1073741824;default:return e}}function Lm(e,t){var n=e.pendingLanes;if(n===0)return 0;var r=0,s=e.suspendedLanes,a=e.pingedLanes,o=n&268435455;if(o!==0){var l=o&~s;l!==0?r=Wd(l):(a&=o,a!==0&&(r=Wd(a)))}else o=n&~s,o!==0?r=Wd(o):a!==0&&(r=Wd(a));if(r===0)return 0;if(t!==0&&t!==r&&!(t&s)&&(s=r&-r,a=t&-t,s>=a||s===16&&(a&4194240)!==0))return t;if(r&4&&(r|=n&16),t=e.entangledLanes,t!==0)for(e=e.entanglements,t&=r;0n;n++)t.push(e);return t}function Xh(e,t,n){e.pendingLanes|=t,t!==536870912&&(e.suspendedLanes=0,e.pingedLanes=0),e=e.eventTimes,t=31-Ks(t),e[t]=n}function rz(e,t){var n=e.pendingLanes&~t;e.pendingLanes=t,e.suspendedLanes=0,e.pingedLanes=0,e.expiredLanes&=t,e.mutableReadLanes&=t,e.entangledLanes&=t,t=e.entanglements;var r=e.eventTimes;for(e=e.expirationTimes;0=tf),pP=" ",mP=!1;function RT(e,t){switch(e){case"keyup":return kz.indexOf(t.keyCode)!==-1;case"keydown":return t.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function DT(e){return e=e.detail,typeof e=="object"&&"data"in e?e.data:null}var mc=!1;function $z(e,t){switch(e){case"compositionend":return DT(t);case"keypress":return t.which!==32?null:(mP=!0,pP);case"textInput":return e=t.data,e===pP&&mP?null:e;default:return null}}function Mz(e,t){if(mc)return e==="compositionend"||!Rj&&RT(e,t)?(e=MT(),mm=$j=Zi=null,mc=!1,e):null;switch(e){case"paste":return null;case"keypress":if(!(t.ctrlKey||t.altKey||t.metaKey)||t.ctrlKey&&t.altKey){if(t.char&&1=t)return{node:n,offset:t-e};e=r}e:{for(;n;){if(n.nextSibling){n=n.nextSibling;break e}n=n.parentNode}n=void 0}n=xP(n)}}function zT(e,t){return e&&t?e===t?!0:e&&e.nodeType===3?!1:t&&t.nodeType===3?zT(e,t.parentNode):"contains"in e?e.contains(t):e.compareDocumentPosition?!!(e.compareDocumentPosition(t)&16):!1:!1}function UT(){for(var e=window,t=Mm();t instanceof e.HTMLIFrameElement;){try{var n=typeof t.contentWindow.location.href=="string"}catch{n=!1}if(n)e=t.contentWindow;else break;t=Mm(e.document)}return t}function Dj(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t&&(t==="input"&&(e.type==="text"||e.type==="search"||e.type==="tel"||e.type==="url"||e.type==="password")||t==="textarea"||e.contentEditable==="true")}function Vz(e){var t=UT(),n=e.focusedElem,r=e.selectionRange;if(t!==n&&n&&n.ownerDocument&&zT(n.ownerDocument.documentElement,n)){if(r!==null&&Dj(n)){if(t=r.start,e=r.end,e===void 0&&(e=t),"selectionStart"in n)n.selectionStart=t,n.selectionEnd=Math.min(e,n.value.length);else if(e=(t=n.ownerDocument||document)&&t.defaultView||window,e.getSelection){e=e.getSelection();var s=n.textContent.length,a=Math.min(r.start,s);r=r.end===void 0?a:Math.min(r.end,s),!e.extend&&a>r&&(s=r,r=a,a=s),s=bP(n,a);var o=bP(n,r);s&&o&&(e.rangeCount!==1||e.anchorNode!==s.node||e.anchorOffset!==s.offset||e.focusNode!==o.node||e.focusOffset!==o.offset)&&(t=t.createRange(),t.setStart(s.node,s.offset),e.removeAllRanges(),a>r?(e.addRange(t),e.extend(o.node,o.offset)):(t.setEnd(o.node,o.offset),e.addRange(t)))}}for(t=[],e=n;e=e.parentNode;)e.nodeType===1&&t.push({element:e,left:e.scrollLeft,top:e.scrollTop});for(typeof n.focus=="function"&&n.focus(),n=0;n=document.documentMode,gc=null,jb=null,rf=null,Sb=!1;function wP(e,t,n){var r=n.window===n?n.document:n.nodeType===9?n:n.ownerDocument;Sb||gc==null||gc!==Mm(r)||(r=gc,"selectionStart"in r&&Dj(r)?r={start:r.selectionStart,end:r.selectionEnd}:(r=(r.ownerDocument&&r.ownerDocument.defaultView||window).getSelection(),r={anchorNode:r.anchorNode,anchorOffset:r.anchorOffset,focusNode:r.focusNode,focusOffset:r.focusOffset}),rf&&_f(rf,r)||(rf=r,r=zm(jb,"onSelect"),0xc||(e.current=Eb[xc],Eb[xc]=null,xc--)}function sn(e,t){xc++,Eb[xc]=e.current,e.current=t}var wo={},xr=Mo(wo),zr=Mo(!1),_l=wo;function nu(e,t){var n=e.type.contextTypes;if(!n)return wo;var r=e.stateNode;if(r&&r.__reactInternalMemoizedUnmaskedChildContext===t)return r.__reactInternalMemoizedMaskedChildContext;var s={},a;for(a in n)s[a]=t[a];return r&&(e=e.stateNode,e.__reactInternalMemoizedUnmaskedChildContext=t,e.__reactInternalMemoizedMaskedChildContext=s),s}function Ur(e){return e=e.childContextTypes,e!=null}function Vm(){dn(zr),dn(xr)}function CP(e,t,n){if(xr.current!==wo)throw Error(Ne(168));sn(xr,t),sn(zr,n)}function ZT(e,t,n){var r=e.stateNode;if(t=t.childContextTypes,typeof r.getChildContext!="function")return n;r=r.getChildContext();for(var s in r)if(!(s in t))throw Error(Ne(108,LB(e)||"Unknown",s));return yn({},n,r)}function Wm(e){return e=(e=e.stateNode)&&e.__reactInternalMemoizedMergedChildContext||wo,_l=xr.current,sn(xr,e),sn(zr,zr.current),!0}function EP(e,t,n){var r=e.stateNode;if(!r)throw Error(Ne(169));n?(e=ZT(e,t,_l),r.__reactInternalMemoizedMergedChildContext=e,dn(zr),dn(xr),sn(xr,e)):dn(zr),sn(zr,n)}var Ya=null,Xv=!1,Zx=!1;function QT(e){Ya===null?Ya=[e]:Ya.push(e)}function t8(e){Xv=!0,QT(e)}function Io(){if(!Zx&&Ya!==null){Zx=!0;var e=0,t=Zt;try{var n=Ya;for(Zt=1;e>=o,s-=o,Ja=1<<32-Ks(t)+s|n<P?(k=_,_=null):k=_.sibling;var O=h(b,_,w[P],j);if(O===null){_===null&&(_=k);break}e&&_&&O.alternate===null&&t(b,_),x=a(O,x,P),N===null?S=O:N.sibling=O,N=O,_=k}if(P===w.length)return n(b,_),hn&&Xo(b,P),S;if(_===null){for(;PP?(k=_,_=null):k=_.sibling;var M=h(b,_,O.value,j);if(M===null){_===null&&(_=k);break}e&&_&&M.alternate===null&&t(b,_),x=a(M,x,P),N===null?S=M:N.sibling=M,N=M,_=k}if(O.done)return n(b,_),hn&&Xo(b,P),S;if(_===null){for(;!O.done;P++,O=w.next())O=f(b,O.value,j),O!==null&&(x=a(O,x,P),N===null?S=O:N.sibling=O,N=O);return hn&&Xo(b,P),S}for(_=r(b,_);!O.done;P++,O=w.next())O=p(_,b,P,O.value,j),O!==null&&(e&&O.alternate!==null&&_.delete(O.key===null?P:O.key),x=a(O,x,P),N===null?S=O:N.sibling=O,N=O);return e&&_.forEach(function(A){return t(b,A)}),hn&&Xo(b,P),S}function y(b,x,w,j){if(typeof w=="object"&&w!==null&&w.type===pc&&w.key===null&&(w=w.props.children),typeof w=="object"&&w!==null){switch(w.$$typeof){case Ap:e:{for(var S=w.key,N=x;N!==null;){if(N.key===S){if(S=w.type,S===pc){if(N.tag===7){n(b,N.sibling),x=s(N,w.props.children),x.return=b,b=x;break e}}else if(N.elementType===S||typeof S=="object"&&S!==null&&S.$$typeof===Di&&TP(S)===N.type){n(b,N.sibling),x=s(N,w.props),x.ref=Sd(b,N,w),x.return=b,b=x;break e}n(b,N);break}else t(b,N);N=N.sibling}w.type===pc?(x=yl(w.props.children,b.mode,j,w.key),x.return=b,b=x):(j=Sm(w.type,w.key,w.props,null,b.mode,j),j.ref=Sd(b,x,w),j.return=b,b=j)}return o(b);case hc:e:{for(N=w.key;x!==null;){if(x.key===N)if(x.tag===4&&x.stateNode.containerInfo===w.containerInfo&&x.stateNode.implementation===w.implementation){n(b,x.sibling),x=s(x,w.children||[]),x.return=b,b=x;break e}else{n(b,x);break}else t(b,x);x=x.sibling}x=a0(w,b.mode,j),x.return=b,b=x}return o(b);case Di:return N=w._init,y(b,x,N(w._payload),j)}if(Vd(w))return g(b,x,w,j);if(yd(w))return m(b,x,w,j);Lp(b,w)}return typeof w=="string"&&w!==""||typeof w=="number"?(w=""+w,x!==null&&x.tag===6?(n(b,x.sibling),x=s(x,w),x.return=b,b=x):(n(b,x),x=s0(w,b.mode,j),x.return=b,b=x),o(b)):n(b,x)}return y}var su=n$(!0),r$=n$(!1),qm=Mo(null),Km=null,jc=null,zj=null;function Uj(){zj=jc=Km=null}function Vj(e){var t=qm.current;dn(qm),e._currentValue=t}function Tb(e,t,n){for(;e!==null;){var r=e.alternate;if((e.childLanes&t)!==t?(e.childLanes|=t,r!==null&&(r.childLanes|=t)):r!==null&&(r.childLanes&t)!==t&&(r.childLanes|=t),e===n)break;e=e.return}}function Mc(e,t){Km=e,zj=jc=null,e=e.dependencies,e!==null&&e.firstContext!==null&&(e.lanes&t&&(Fr=!0),e.firstContext=null)}function As(e){var t=e._currentValue;if(zj!==e)if(e={context:e,memoizedValue:t,next:null},jc===null){if(Km===null)throw Error(Ne(308));jc=e,Km.dependencies={lanes:0,firstContext:e}}else jc=jc.next=e;return t}var nl=null;function Wj(e){nl===null?nl=[e]:nl.push(e)}function s$(e,t,n,r){var s=t.interleaved;return s===null?(n.next=n,Wj(t)):(n.next=s.next,s.next=n),t.interleaved=n,hi(e,r)}function hi(e,t){e.lanes|=t;var n=e.alternate;for(n!==null&&(n.lanes|=t),n=e,e=e.return;e!==null;)e.childLanes|=t,n=e.alternate,n!==null&&(n.childLanes|=t),n=e,e=e.return;return n.tag===3?n.stateNode:null}var Li=!1;function Hj(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,interleaved:null,lanes:0},effects:null}}function a$(e,t){e=e.updateQueue,t.updateQueue===e&&(t.updateQueue={baseState:e.baseState,firstBaseUpdate:e.firstBaseUpdate,lastBaseUpdate:e.lastBaseUpdate,shared:e.shared,effects:e.effects})}function ai(e,t){return{eventTime:e,lane:t,tag:0,payload:null,callback:null,next:null}}function io(e,t,n){var r=e.updateQueue;if(r===null)return null;if(r=r.shared,zt&2){var s=r.pending;return s===null?t.next=t:(t.next=s.next,s.next=t),r.pending=t,hi(e,n)}return s=r.interleaved,s===null?(t.next=t,Wj(r)):(t.next=s.next,s.next=t),r.interleaved=t,hi(e,n)}function vm(e,t,n){if(t=t.updateQueue,t!==null&&(t=t.shared,(n&4194240)!==0)){var r=t.lanes;r&=e.pendingLanes,n|=r,t.lanes=n,Oj(e,n)}}function $P(e,t){var n=e.updateQueue,r=e.alternate;if(r!==null&&(r=r.updateQueue,n===r)){var s=null,a=null;if(n=n.firstBaseUpdate,n!==null){do{var o={eventTime:n.eventTime,lane:n.lane,tag:n.tag,payload:n.payload,callback:n.callback,next:null};a===null?s=a=o:a=a.next=o,n=n.next}while(n!==null);a===null?s=a=t:a=a.next=t}else s=a=t;n={baseState:r.baseState,firstBaseUpdate:s,lastBaseUpdate:a,shared:r.shared,effects:r.effects},e.updateQueue=n;return}e=n.lastBaseUpdate,e===null?n.firstBaseUpdate=t:e.next=t,n.lastBaseUpdate=t}function Xm(e,t,n,r){var s=e.updateQueue;Li=!1;var a=s.firstBaseUpdate,o=s.lastBaseUpdate,l=s.shared.pending;if(l!==null){s.shared.pending=null;var c=l,u=c.next;c.next=null,o===null?a=u:o.next=u,o=c;var d=e.alternate;d!==null&&(d=d.updateQueue,l=d.lastBaseUpdate,l!==o&&(l===null?d.firstBaseUpdate=u:l.next=u,d.lastBaseUpdate=c))}if(a!==null){var f=s.baseState;o=0,d=u=c=null,l=a;do{var h=l.lane,p=l.eventTime;if((r&h)===h){d!==null&&(d=d.next={eventTime:p,lane:0,tag:l.tag,payload:l.payload,callback:l.callback,next:null});e:{var g=e,m=l;switch(h=t,p=n,m.tag){case 1:if(g=m.payload,typeof g=="function"){f=g.call(p,f,h);break e}f=g;break e;case 3:g.flags=g.flags&-65537|128;case 0:if(g=m.payload,h=typeof g=="function"?g.call(p,f,h):g,h==null)break e;f=yn({},f,h);break e;case 2:Li=!0}}l.callback!==null&&l.lane!==0&&(e.flags|=64,h=s.effects,h===null?s.effects=[l]:h.push(l))}else p={eventTime:p,lane:h,tag:l.tag,payload:l.payload,callback:l.callback,next:null},d===null?(u=d=p,c=f):d=d.next=p,o|=h;if(l=l.next,l===null){if(l=s.shared.pending,l===null)break;h=l,l=h.next,h.next=null,s.lastBaseUpdate=h,s.shared.pending=null}}while(!0);if(d===null&&(c=f),s.baseState=c,s.firstBaseUpdate=u,s.lastBaseUpdate=d,t=s.shared.interleaved,t!==null){s=t;do o|=s.lane,s=s.next;while(s!==t)}else a===null&&(s.shared.lanes=0);Cl|=o,e.lanes=o,e.memoizedState=f}}function MP(e,t,n){if(e=t.effects,t.effects=null,e!==null)for(t=0;tn?n:4,e(!0);var r=Jx.transition;Jx.transition={};try{e(!1),t()}finally{Zt=n,Jx.transition=r}}function j$(){return Cs().memoizedState}function a8(e,t,n){var r=lo(e);if(n={lane:r,action:n,hasEagerState:!1,eagerState:null,next:null},S$(e))N$(t,n);else if(n=s$(e,t,n,r),n!==null){var s=Or();Xs(n,e,r,s),_$(n,t,r)}}function i8(e,t,n){var r=lo(e),s={lane:r,action:n,hasEagerState:!1,eagerState:null,next:null};if(S$(e))N$(t,s);else{var a=e.alternate;if(e.lanes===0&&(a===null||a.lanes===0)&&(a=t.lastRenderedReducer,a!==null))try{var o=t.lastRenderedState,l=a(o,n);if(s.hasEagerState=!0,s.eagerState=l,na(l,o)){var c=t.interleaved;c===null?(s.next=s,Wj(t)):(s.next=c.next,c.next=s),t.interleaved=s;return}}catch{}finally{}n=s$(e,t,s,r),n!==null&&(s=Or(),Xs(n,e,r,s),_$(n,t,r))}}function S$(e){var t=e.alternate;return e===vn||t!==null&&t===vn}function N$(e,t){sf=Zm=!0;var n=e.pending;n===null?t.next=t:(t.next=n.next,n.next=t),e.pending=t}function _$(e,t,n){if(n&4194240){var r=t.lanes;r&=e.pendingLanes,n|=r,t.lanes=n,Oj(e,n)}}var Qm={readContext:As,useCallback:ur,useContext:ur,useEffect:ur,useImperativeHandle:ur,useInsertionEffect:ur,useLayoutEffect:ur,useMemo:ur,useReducer:ur,useRef:ur,useState:ur,useDebugValue:ur,useDeferredValue:ur,useTransition:ur,useMutableSource:ur,useSyncExternalStore:ur,useId:ur,unstable_isNewReconciler:!1},o8={readContext:As,useCallback:function(e,t){return ma().memoizedState=[e,t===void 0?null:t],e},useContext:As,useEffect:RP,useImperativeHandle:function(e,t,n){return n=n!=null?n.concat([e]):null,xm(4194308,4,v$.bind(null,t,e),n)},useLayoutEffect:function(e,t){return xm(4194308,4,e,t)},useInsertionEffect:function(e,t){return xm(4,2,e,t)},useMemo:function(e,t){var n=ma();return t=t===void 0?null:t,e=e(),n.memoizedState=[e,t],e},useReducer:function(e,t,n){var r=ma();return t=n!==void 0?n(t):t,r.memoizedState=r.baseState=t,e={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:e,lastRenderedState:t},r.queue=e,e=e.dispatch=a8.bind(null,vn,e),[r.memoizedState,e]},useRef:function(e){var t=ma();return e={current:e},t.memoizedState=e},useState:IP,useDebugValue:Jj,useDeferredValue:function(e){return ma().memoizedState=e},useTransition:function(){var e=IP(!1),t=e[0];return e=s8.bind(null,e[1]),ma().memoizedState=e,[t,e]},useMutableSource:function(){},useSyncExternalStore:function(e,t,n){var r=vn,s=ma();if(hn){if(n===void 0)throw Error(Ne(407));n=n()}else{if(n=t(),er===null)throw Error(Ne(349));Al&30||c$(r,t,n)}s.memoizedState=n;var a={value:n,getSnapshot:t};return s.queue=a,RP(d$.bind(null,r,a,e),[e]),r.flags|=2048,$f(9,u$.bind(null,r,a,n,t),void 0,null),n},useId:function(){var e=ma(),t=er.identifierPrefix;if(hn){var n=ei,r=Ja;n=(r&~(1<<32-Ks(r)-1)).toString(32)+n,t=":"+t+"R"+n,n=kf++,0")&&(c=c.replace("",e.displayName)),c}while(1<=o&&0<=l);break}}}finally{Fx=!1,Error.prepareStackTrace=n}return(e=e?e.displayName||e.name:"")?Ud(e):""}function VB(e){switch(e.tag){case 5:return Ud(e.type);case 16:return Ud("Lazy");case 13:return Ud("Suspense");case 19:return Ud("SuspenseList");case 0:case 2:case 15:return e=Bx(e.type,!1),e;case 11:return e=Bx(e.type.render,!1),e;case 1:return e=Bx(e.type,!0),e;default:return""}}function ub(e){if(e==null)return null;if(typeof e=="function")return e.displayName||e.name||null;if(typeof e=="string")return e;switch(e){case pc:return"Fragment";case hc:return"Portal";case ob:return"Profiler";case Ej:return"StrictMode";case lb:return"Suspense";case cb:return"SuspenseList"}if(typeof e=="object")switch(e.$$typeof){case uT:return(e.displayName||"Context")+".Consumer";case cT:return(e._context.displayName||"Context")+".Provider";case Oj:var t=e.render;return e=e.displayName,e||(e=t.displayName||t.name||"",e=e!==""?"ForwardRef("+e+")":"ForwardRef"),e;case kj:return t=e.displayName||null,t!==null?t:ub(e.type)||"Memo";case Li:t=e._payload,e=e._init;try{return ub(e(t))}catch{}}return null}function WB(e){var t=e.type;switch(e.tag){case 24:return"Cache";case 9:return(t.displayName||"Context")+".Consumer";case 10:return(t._context.displayName||"Context")+".Provider";case 18:return"DehydratedFragment";case 11:return e=t.render,e=e.displayName||e.name||"",t.displayName||(e!==""?"ForwardRef("+e+")":"ForwardRef");case 7:return"Fragment";case 5:return t;case 4:return"Portal";case 3:return"Root";case 6:return"Text";case 16:return ub(t);case 8:return t===Ej?"StrictMode":"Mode";case 22:return"Offscreen";case 12:return"Profiler";case 21:return"Scope";case 13:return"Suspense";case 19:return"SuspenseList";case 25:return"TracingMarker";case 1:case 0:case 17:case 2:case 14:case 15:if(typeof t=="function")return t.displayName||t.name||null;if(typeof t=="string")return t}return null}function bo(e){switch(typeof e){case"boolean":case"number":case"string":case"undefined":return e;case"object":return e;default:return""}}function fT(e){var t=e.type;return(e=e.nodeName)&&e.toLowerCase()==="input"&&(t==="checkbox"||t==="radio")}function GB(e){var t=fT(e)?"checked":"value",n=Object.getOwnPropertyDescriptor(e.constructor.prototype,t),r=""+e[t];if(!e.hasOwnProperty(t)&&typeof n<"u"&&typeof n.get=="function"&&typeof n.set=="function"){var s=n.get,a=n.set;return Object.defineProperty(e,t,{configurable:!0,get:function(){return s.call(this)},set:function(o){r=""+o,a.call(this,o)}}),Object.defineProperty(e,t,{enumerable:n.enumerable}),{getValue:function(){return r},setValue:function(o){r=""+o},stopTracking:function(){e._valueTracker=null,delete e[t]}}}}function Ep(e){e._valueTracker||(e._valueTracker=GB(e))}function hT(e){if(!e)return!1;var t=e._valueTracker;if(!t)return!0;var n=t.getValue(),r="";return e&&(r=fT(e)?e.checked?"true":"false":e.value),e=r,e!==n?(t.setValue(e),!0):!1}function Rm(e){if(e=e||(typeof document<"u"?document:void 0),typeof e>"u")return null;try{return e.activeElement||e.body}catch{return e.body}}function db(e,t){var n=t.checked;return yn({},t,{defaultChecked:void 0,defaultValue:void 0,value:void 0,checked:n??e._wrapperState.initialChecked})}function iP(e,t){var n=t.defaultValue==null?"":t.defaultValue,r=t.checked!=null?t.checked:t.defaultChecked;n=bo(t.value!=null?t.value:n),e._wrapperState={initialChecked:r,initialValue:n,controlled:t.type==="checkbox"||t.type==="radio"?t.checked!=null:t.value!=null}}function pT(e,t){t=t.checked,t!=null&&Cj(e,"checked",t,!1)}function fb(e,t){pT(e,t);var n=bo(t.value),r=t.type;if(n!=null)r==="number"?(n===0&&e.value===""||e.value!=n)&&(e.value=""+n):e.value!==""+n&&(e.value=""+n);else if(r==="submit"||r==="reset"){e.removeAttribute("value");return}t.hasOwnProperty("value")?hb(e,t.type,n):t.hasOwnProperty("defaultValue")&&hb(e,t.type,bo(t.defaultValue)),t.checked==null&&t.defaultChecked!=null&&(e.defaultChecked=!!t.defaultChecked)}function oP(e,t,n){if(t.hasOwnProperty("value")||t.hasOwnProperty("defaultValue")){var r=t.type;if(!(r!=="submit"&&r!=="reset"||t.value!==void 0&&t.value!==null))return;t=""+e._wrapperState.initialValue,n||t===e.value||(e.value=t),e.defaultValue=t}n=e.name,n!==""&&(e.name=""),e.defaultChecked=!!e._wrapperState.initialChecked,n!==""&&(e.name=n)}function hb(e,t,n){(t!=="number"||Rm(e.ownerDocument)!==e)&&(n==null?e.defaultValue=""+e._wrapperState.initialValue:e.defaultValue!==""+n&&(e.defaultValue=""+n))}var Vd=Array.isArray;function Oc(e,t,n,r){if(e=e.options,t){t={};for(var s=0;s"+t.valueOf().toString()+"",t=Op.firstChild;e.firstChild;)e.removeChild(e.firstChild);for(;t.firstChild;)e.appendChild(t.firstChild)}});function xf(e,t){if(t){var n=e.firstChild;if(n&&n===e.lastChild&&n.nodeType===3){n.nodeValue=t;return}}e.textContent=t}var Jd={animationIterationCount:!0,aspectRatio:!0,borderImageOutset:!0,borderImageSlice:!0,borderImageWidth:!0,boxFlex:!0,boxFlexGroup:!0,boxOrdinalGroup:!0,columnCount:!0,columns:!0,flex:!0,flexGrow:!0,flexPositive:!0,flexShrink:!0,flexNegative:!0,flexOrder:!0,gridArea:!0,gridRow:!0,gridRowEnd:!0,gridRowSpan:!0,gridRowStart:!0,gridColumn:!0,gridColumnEnd:!0,gridColumnSpan:!0,gridColumnStart:!0,fontWeight:!0,lineClamp:!0,lineHeight:!0,opacity:!0,order:!0,orphans:!0,tabSize:!0,widows:!0,zIndex:!0,zoom:!0,fillOpacity:!0,floodOpacity:!0,stopOpacity:!0,strokeDasharray:!0,strokeDashoffset:!0,strokeMiterlimit:!0,strokeOpacity:!0,strokeWidth:!0},HB=["Webkit","ms","Moz","O"];Object.keys(Jd).forEach(function(e){HB.forEach(function(t){t=t+e.charAt(0).toUpperCase()+e.substring(1),Jd[t]=Jd[e]})});function yT(e,t,n){return t==null||typeof t=="boolean"||t===""?"":n||typeof t!="number"||t===0||Jd.hasOwnProperty(e)&&Jd[e]?(""+t).trim():t+"px"}function xT(e,t){e=e.style;for(var n in t)if(t.hasOwnProperty(n)){var r=n.indexOf("--")===0,s=yT(n,t[n],r);n==="float"&&(n="cssFloat"),r?e.setProperty(n,s):e[n]=s}}var qB=yn({menuitem:!0},{area:!0,base:!0,br:!0,col:!0,embed:!0,hr:!0,img:!0,input:!0,keygen:!0,link:!0,meta:!0,param:!0,source:!0,track:!0,wbr:!0});function gb(e,t){if(t){if(qB[e]&&(t.children!=null||t.dangerouslySetInnerHTML!=null))throw Error(Ne(137,e));if(t.dangerouslySetInnerHTML!=null){if(t.children!=null)throw Error(Ne(60));if(typeof t.dangerouslySetInnerHTML!="object"||!("__html"in t.dangerouslySetInnerHTML))throw Error(Ne(61))}if(t.style!=null&&typeof t.style!="object")throw Error(Ne(62))}}function vb(e,t){if(e.indexOf("-")===-1)return typeof t.is=="string";switch(e){case"annotation-xml":case"color-profile":case"font-face":case"font-face-src":case"font-face-uri":case"font-face-format":case"font-face-name":case"missing-glyph":return!1;default:return!0}}var yb=null;function Tj(e){return e=e.target||e.srcElement||window,e.correspondingUseElement&&(e=e.correspondingUseElement),e.nodeType===3?e.parentNode:e}var xb=null,kc=null,Tc=null;function uP(e){if(e=Qh(e)){if(typeof xb!="function")throw Error(Ne(280));var t=e.stateNode;t&&(t=Yv(t),xb(e.stateNode,e.type,t))}}function bT(e){kc?Tc?Tc.push(e):Tc=[e]:kc=e}function wT(){if(kc){var e=kc,t=Tc;if(Tc=kc=null,uP(e),t)for(e=0;e>>=0,e===0?32:31-(sz(e)/az|0)|0}var kp=64,Tp=4194304;function Wd(e){switch(e&-e){case 1:return 1;case 2:return 2;case 4:return 4;case 8:return 8;case 16:return 16;case 32:return 32;case 64: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 e&4194240;case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:return e&130023424;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 1073741824;default:return e}}function Bm(e,t){var n=e.pendingLanes;if(n===0)return 0;var r=0,s=e.suspendedLanes,a=e.pingedLanes,o=n&268435455;if(o!==0){var l=o&~s;l!==0?r=Wd(l):(a&=o,a!==0&&(r=Wd(a)))}else o=n&~s,o!==0?r=Wd(o):a!==0&&(r=Wd(a));if(r===0)return 0;if(t!==0&&t!==r&&!(t&s)&&(s=r&-r,a=t&-t,s>=a||s===16&&(a&4194240)!==0))return t;if(r&4&&(r|=n&16),t=e.entangledLanes,t!==0)for(e=e.entanglements,t&=r;0n;n++)t.push(e);return t}function Yh(e,t,n){e.pendingLanes|=t,t!==536870912&&(e.suspendedLanes=0,e.pingedLanes=0),e=e.eventTimes,t=31-Ks(t),e[t]=n}function cz(e,t){var n=e.pendingLanes&~t;e.pendingLanes=t,e.suspendedLanes=0,e.pingedLanes=0,e.expiredLanes&=t,e.mutableReadLanes&=t,e.entangledLanes&=t,t=e.entanglements;var r=e.eventTimes;for(e=e.expirationTimes;0=tf),xP=" ",bP=!1;function zT(e,t){switch(e){case"keyup":return Dz.indexOf(t.keyCode)!==-1;case"keydown":return t.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function UT(e){return e=e.detail,typeof e=="object"&&"data"in e?e.data:null}var mc=!1;function Fz(e,t){switch(e){case"compositionend":return UT(t);case"keypress":return t.which!==32?null:(bP=!0,xP);case"textInput":return e=t.data,e===xP&&bP?null:e;default:return null}}function Bz(e,t){if(mc)return e==="compositionend"||!Bj&&zT(e,t)?(e=FT(),gm=Dj=Qi=null,mc=!1,e):null;switch(e){case"paste":return null;case"keypress":if(!(t.ctrlKey||t.altKey||t.metaKey)||t.ctrlKey&&t.altKey){if(t.char&&1=t)return{node:n,offset:t-e};e=r}e:{for(;n;){if(n.nextSibling){n=n.nextSibling;break e}n=n.parentNode}n=void 0}n=NP(n)}}function HT(e,t){return e&&t?e===t?!0:e&&e.nodeType===3?!1:t&&t.nodeType===3?HT(e,t.parentNode):"contains"in e?e.contains(t):e.compareDocumentPosition?!!(e.compareDocumentPosition(t)&16):!1:!1}function qT(){for(var e=window,t=Rm();t instanceof e.HTMLIFrameElement;){try{var n=typeof t.contentWindow.location.href=="string"}catch{n=!1}if(n)e=t.contentWindow;else break;t=Rm(e.document)}return t}function zj(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t&&(t==="input"&&(e.type==="text"||e.type==="search"||e.type==="tel"||e.type==="url"||e.type==="password")||t==="textarea"||e.contentEditable==="true")}function Xz(e){var t=qT(),n=e.focusedElem,r=e.selectionRange;if(t!==n&&n&&n.ownerDocument&&HT(n.ownerDocument.documentElement,n)){if(r!==null&&zj(n)){if(t=r.start,e=r.end,e===void 0&&(e=t),"selectionStart"in n)n.selectionStart=t,n.selectionEnd=Math.min(e,n.value.length);else if(e=(t=n.ownerDocument||document)&&t.defaultView||window,e.getSelection){e=e.getSelection();var s=n.textContent.length,a=Math.min(r.start,s);r=r.end===void 0?a:Math.min(r.end,s),!e.extend&&a>r&&(s=r,r=a,a=s),s=_P(n,a);var o=_P(n,r);s&&o&&(e.rangeCount!==1||e.anchorNode!==s.node||e.anchorOffset!==s.offset||e.focusNode!==o.node||e.focusOffset!==o.offset)&&(t=t.createRange(),t.setStart(s.node,s.offset),e.removeAllRanges(),a>r?(e.addRange(t),e.extend(o.node,o.offset)):(t.setEnd(o.node,o.offset),e.addRange(t)))}}for(t=[],e=n;e=e.parentNode;)e.nodeType===1&&t.push({element:e,left:e.scrollLeft,top:e.scrollTop});for(typeof n.focus=="function"&&n.focus(),n=0;n=document.documentMode,gc=null,_b=null,rf=null,Pb=!1;function PP(e,t,n){var r=n.window===n?n.document:n.nodeType===9?n:n.ownerDocument;Pb||gc==null||gc!==Rm(r)||(r=gc,"selectionStart"in r&&zj(r)?r={start:r.selectionStart,end:r.selectionEnd}:(r=(r.ownerDocument&&r.ownerDocument.defaultView||window).getSelection(),r={anchorNode:r.anchorNode,anchorOffset:r.anchorOffset,focusNode:r.focusNode,focusOffset:r.focusOffset}),rf&&_f(rf,r)||(rf=r,r=Vm(_b,"onSelect"),0xc||(e.current=Tb[xc],Tb[xc]=null,xc--)}function sn(e,t){xc++,Tb[xc]=e.current,e.current=t}var wo={},xr=Mo(wo),zr=Mo(!1),_l=wo;function nu(e,t){var n=e.type.contextTypes;if(!n)return wo;var r=e.stateNode;if(r&&r.__reactInternalMemoizedUnmaskedChildContext===t)return r.__reactInternalMemoizedMaskedChildContext;var s={},a;for(a in n)s[a]=t[a];return r&&(e=e.stateNode,e.__reactInternalMemoizedUnmaskedChildContext=t,e.__reactInternalMemoizedMaskedChildContext=s),s}function Ur(e){return e=e.childContextTypes,e!=null}function Gm(){dn(zr),dn(xr)}function $P(e,t,n){if(xr.current!==wo)throw Error(Ne(168));sn(xr,t),sn(zr,n)}function n$(e,t,n){var r=e.stateNode;if(t=t.childContextTypes,typeof r.getChildContext!="function")return n;r=r.getChildContext();for(var s in r)if(!(s in t))throw Error(Ne(108,WB(e)||"Unknown",s));return yn({},n,r)}function Hm(e){return e=(e=e.stateNode)&&e.__reactInternalMemoizedMergedChildContext||wo,_l=xr.current,sn(xr,e),sn(zr,zr.current),!0}function MP(e,t,n){var r=e.stateNode;if(!r)throw Error(Ne(169));n?(e=n$(e,t,_l),r.__reactInternalMemoizedMergedChildContext=e,dn(zr),dn(xr),sn(xr,e)):dn(zr),sn(zr,n)}var Za=null,Zv=!1,e0=!1;function r$(e){Za===null?Za=[e]:Za.push(e)}function o8(e){Zv=!0,r$(e)}function Io(){if(!e0&&Za!==null){e0=!0;var e=0,t=Zt;try{var n=Za;for(Zt=1;e>=o,s-=o,ei=1<<32-Ks(t)+s|n<P?(k=_,_=null):k=_.sibling;var O=h(b,_,w[P],j);if(O===null){_===null&&(_=k);break}e&&_&&O.alternate===null&&t(b,_),x=a(O,x,P),N===null?S=O:N.sibling=O,N=O,_=k}if(P===w.length)return n(b,_),hn&&Xo(b,P),S;if(_===null){for(;PP?(k=_,_=null):k=_.sibling;var M=h(b,_,O.value,j);if(M===null){_===null&&(_=k);break}e&&_&&M.alternate===null&&t(b,_),x=a(M,x,P),N===null?S=M:N.sibling=M,N=M,_=k}if(O.done)return n(b,_),hn&&Xo(b,P),S;if(_===null){for(;!O.done;P++,O=w.next())O=f(b,O.value,j),O!==null&&(x=a(O,x,P),N===null?S=O:N.sibling=O,N=O);return hn&&Xo(b,P),S}for(_=r(b,_);!O.done;P++,O=w.next())O=p(_,b,P,O.value,j),O!==null&&(e&&O.alternate!==null&&_.delete(O.key===null?P:O.key),x=a(O,x,P),N===null?S=O:N.sibling=O,N=O);return e&&_.forEach(function(A){return t(b,A)}),hn&&Xo(b,P),S}function y(b,x,w,j){if(typeof w=="object"&&w!==null&&w.type===pc&&w.key===null&&(w=w.props.children),typeof w=="object"&&w!==null){switch(w.$$typeof){case Cp:e:{for(var S=w.key,N=x;N!==null;){if(N.key===S){if(S=w.type,S===pc){if(N.tag===7){n(b,N.sibling),x=s(N,w.props.children),x.return=b,b=x;break e}}else if(N.elementType===S||typeof S=="object"&&S!==null&&S.$$typeof===Li&&DP(S)===N.type){n(b,N.sibling),x=s(N,w.props),x.ref=Sd(b,N,w),x.return=b,b=x;break e}n(b,N);break}else t(b,N);N=N.sibling}w.type===pc?(x=yl(w.props.children,b.mode,j,w.key),x.return=b,b=x):(j=Nm(w.type,w.key,w.props,null,b.mode,j),j.ref=Sd(b,x,w),j.return=b,b=j)}return o(b);case hc:e:{for(N=w.key;x!==null;){if(x.key===N)if(x.tag===4&&x.stateNode.containerInfo===w.containerInfo&&x.stateNode.implementation===w.implementation){n(b,x.sibling),x=s(x,w.children||[]),x.return=b,b=x;break e}else{n(b,x);break}else t(b,x);x=x.sibling}x=l0(w,b.mode,j),x.return=b,b=x}return o(b);case Li:return N=w._init,y(b,x,N(w._payload),j)}if(Vd(w))return g(b,x,w,j);if(yd(w))return m(b,x,w,j);Fp(b,w)}return typeof w=="string"&&w!==""||typeof w=="number"?(w=""+w,x!==null&&x.tag===6?(n(b,x.sibling),x=s(x,w),x.return=b,b=x):(n(b,x),x=o0(w,b.mode,j),x.return=b,b=x),o(b)):n(b,x)}return y}var su=o$(!0),l$=o$(!1),Xm=Mo(null),Ym=null,jc=null,Gj=null;function Hj(){Gj=jc=Ym=null}function qj(e){var t=Xm.current;dn(Xm),e._currentValue=t}function Ib(e,t,n){for(;e!==null;){var r=e.alternate;if((e.childLanes&t)!==t?(e.childLanes|=t,r!==null&&(r.childLanes|=t)):r!==null&&(r.childLanes&t)!==t&&(r.childLanes|=t),e===n)break;e=e.return}}function Mc(e,t){Ym=e,Gj=jc=null,e=e.dependencies,e!==null&&e.firstContext!==null&&(e.lanes&t&&(Fr=!0),e.firstContext=null)}function Cs(e){var t=e._currentValue;if(Gj!==e)if(e={context:e,memoizedValue:t,next:null},jc===null){if(Ym===null)throw Error(Ne(308));jc=e,Ym.dependencies={lanes:0,firstContext:e}}else jc=jc.next=e;return t}var nl=null;function Kj(e){nl===null?nl=[e]:nl.push(e)}function c$(e,t,n,r){var s=t.interleaved;return s===null?(n.next=n,Kj(t)):(n.next=s.next,s.next=n),t.interleaved=n,mi(e,r)}function mi(e,t){e.lanes|=t;var n=e.alternate;for(n!==null&&(n.lanes|=t),n=e,e=e.return;e!==null;)e.childLanes|=t,n=e.alternate,n!==null&&(n.childLanes|=t),n=e,e=e.return;return n.tag===3?n.stateNode:null}var Fi=!1;function Xj(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,interleaved:null,lanes:0},effects:null}}function u$(e,t){e=e.updateQueue,t.updateQueue===e&&(t.updateQueue={baseState:e.baseState,firstBaseUpdate:e.firstBaseUpdate,lastBaseUpdate:e.lastBaseUpdate,shared:e.shared,effects:e.effects})}function oi(e,t){return{eventTime:e,lane:t,tag:0,payload:null,callback:null,next:null}}function oo(e,t,n){var r=e.updateQueue;if(r===null)return null;if(r=r.shared,zt&2){var s=r.pending;return s===null?t.next=t:(t.next=s.next,s.next=t),r.pending=t,mi(e,n)}return s=r.interleaved,s===null?(t.next=t,Kj(r)):(t.next=s.next,s.next=t),r.interleaved=t,mi(e,n)}function ym(e,t,n){if(t=t.updateQueue,t!==null&&(t=t.shared,(n&4194240)!==0)){var r=t.lanes;r&=e.pendingLanes,n|=r,t.lanes=n,Mj(e,n)}}function LP(e,t){var n=e.updateQueue,r=e.alternate;if(r!==null&&(r=r.updateQueue,n===r)){var s=null,a=null;if(n=n.firstBaseUpdate,n!==null){do{var o={eventTime:n.eventTime,lane:n.lane,tag:n.tag,payload:n.payload,callback:n.callback,next:null};a===null?s=a=o:a=a.next=o,n=n.next}while(n!==null);a===null?s=a=t:a=a.next=t}else s=a=t;n={baseState:r.baseState,firstBaseUpdate:s,lastBaseUpdate:a,shared:r.shared,effects:r.effects},e.updateQueue=n;return}e=n.lastBaseUpdate,e===null?n.firstBaseUpdate=t:e.next=t,n.lastBaseUpdate=t}function Zm(e,t,n,r){var s=e.updateQueue;Fi=!1;var a=s.firstBaseUpdate,o=s.lastBaseUpdate,l=s.shared.pending;if(l!==null){s.shared.pending=null;var c=l,u=c.next;c.next=null,o===null?a=u:o.next=u,o=c;var d=e.alternate;d!==null&&(d=d.updateQueue,l=d.lastBaseUpdate,l!==o&&(l===null?d.firstBaseUpdate=u:l.next=u,d.lastBaseUpdate=c))}if(a!==null){var f=s.baseState;o=0,d=u=c=null,l=a;do{var h=l.lane,p=l.eventTime;if((r&h)===h){d!==null&&(d=d.next={eventTime:p,lane:0,tag:l.tag,payload:l.payload,callback:l.callback,next:null});e:{var g=e,m=l;switch(h=t,p=n,m.tag){case 1:if(g=m.payload,typeof g=="function"){f=g.call(p,f,h);break e}f=g;break e;case 3:g.flags=g.flags&-65537|128;case 0:if(g=m.payload,h=typeof g=="function"?g.call(p,f,h):g,h==null)break e;f=yn({},f,h);break e;case 2:Fi=!0}}l.callback!==null&&l.lane!==0&&(e.flags|=64,h=s.effects,h===null?s.effects=[l]:h.push(l))}else p={eventTime:p,lane:h,tag:l.tag,payload:l.payload,callback:l.callback,next:null},d===null?(u=d=p,c=f):d=d.next=p,o|=h;if(l=l.next,l===null){if(l=s.shared.pending,l===null)break;h=l,l=h.next,h.next=null,s.lastBaseUpdate=h,s.shared.pending=null}}while(!0);if(d===null&&(c=f),s.baseState=c,s.firstBaseUpdate=u,s.lastBaseUpdate=d,t=s.shared.interleaved,t!==null){s=t;do o|=s.lane,s=s.next;while(s!==t)}else a===null&&(s.shared.lanes=0);Cl|=o,e.lanes=o,e.memoizedState=f}}function FP(e,t,n){if(e=t.effects,t.effects=null,e!==null)for(t=0;tn?n:4,e(!0);var r=n0.transition;n0.transition={};try{e(!1),t()}finally{Zt=n,n0.transition=r}}function A$(){return Es().memoizedState}function d8(e,t,n){var r=co(e);if(n={lane:r,action:n,hasEagerState:!1,eagerState:null,next:null},C$(e))E$(t,n);else if(n=c$(e,t,n,r),n!==null){var s=Or();Xs(n,e,r,s),O$(n,t,r)}}function f8(e,t,n){var r=co(e),s={lane:r,action:n,hasEagerState:!1,eagerState:null,next:null};if(C$(e))E$(t,s);else{var a=e.alternate;if(e.lanes===0&&(a===null||a.lanes===0)&&(a=t.lastRenderedReducer,a!==null))try{var o=t.lastRenderedState,l=a(o,n);if(s.hasEagerState=!0,s.eagerState=l,na(l,o)){var c=t.interleaved;c===null?(s.next=s,Kj(t)):(s.next=c.next,c.next=s),t.interleaved=s;return}}catch{}finally{}n=c$(e,t,s,r),n!==null&&(s=Or(),Xs(n,e,r,s),O$(n,t,r))}}function C$(e){var t=e.alternate;return e===vn||t!==null&&t===vn}function E$(e,t){sf=Jm=!0;var n=e.pending;n===null?t.next=t:(t.next=n.next,n.next=t),e.pending=t}function O$(e,t,n){if(n&4194240){var r=t.lanes;r&=e.pendingLanes,n|=r,t.lanes=n,Mj(e,n)}}var eg={readContext:Cs,useCallback:ur,useContext:ur,useEffect:ur,useImperativeHandle:ur,useInsertionEffect:ur,useLayoutEffect:ur,useMemo:ur,useReducer:ur,useRef:ur,useState:ur,useDebugValue:ur,useDeferredValue:ur,useTransition:ur,useMutableSource:ur,useSyncExternalStore:ur,useId:ur,unstable_isNewReconciler:!1},h8={readContext:Cs,useCallback:function(e,t){return ma().memoizedState=[e,t===void 0?null:t],e},useContext:Cs,useEffect:zP,useImperativeHandle:function(e,t,n){return n=n!=null?n.concat([e]):null,bm(4194308,4,j$.bind(null,t,e),n)},useLayoutEffect:function(e,t){return bm(4194308,4,e,t)},useInsertionEffect:function(e,t){return bm(4,2,e,t)},useMemo:function(e,t){var n=ma();return t=t===void 0?null:t,e=e(),n.memoizedState=[e,t],e},useReducer:function(e,t,n){var r=ma();return t=n!==void 0?n(t):t,r.memoizedState=r.baseState=t,e={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:e,lastRenderedState:t},r.queue=e,e=e.dispatch=d8.bind(null,vn,e),[r.memoizedState,e]},useRef:function(e){var t=ma();return e={current:e},t.memoizedState=e},useState:BP,useDebugValue:rS,useDeferredValue:function(e){return ma().memoizedState=e},useTransition:function(){var e=BP(!1),t=e[0];return e=u8.bind(null,e[1]),ma().memoizedState=e,[t,e]},useMutableSource:function(){},useSyncExternalStore:function(e,t,n){var r=vn,s=ma();if(hn){if(n===void 0)throw Error(Ne(407));n=n()}else{if(n=t(),er===null)throw Error(Ne(349));Al&30||p$(r,t,n)}s.memoizedState=n;var a={value:n,getSnapshot:t};return s.queue=a,zP(g$.bind(null,r,a,e),[e]),r.flags|=2048,$f(9,m$.bind(null,r,a,n,t),void 0,null),n},useId:function(){var e=ma(),t=er.identifierPrefix;if(hn){var n=ti,r=ei;n=(r&~(1<<32-Ks(r)-1)).toString(32)+n,t=":"+t+"R"+n,n=kf++,0<\/script>",e=e.removeChild(e.firstChild)):typeof r.is=="string"?e=o.createElement(n,{is:r.is}):(e=o.createElement(n),n==="select"&&(o=e,r.multiple?o.multiple=!0:r.size&&(o.size=r.size))):e=o.createElementNS(e,n),e[ba]=t,e[Cf]=r,I$(e,t,!1,!1),t.stateNode=e;e:{switch(o=pb(n,r),n){case"dialog":ln("cancel",e),ln("close",e),s=r;break;case"iframe":case"object":case"embed":ln("load",e),s=r;break;case"video":case"audio":for(s=0;sou&&(t.flags|=128,r=!0,Nd(a,!1),t.lanes=4194304)}else{if(!r)if(e=Ym(o),e!==null){if(t.flags|=128,r=!0,n=e.updateQueue,n!==null&&(t.updateQueue=n,t.flags|=4),Nd(a,!0),a.tail===null&&a.tailMode==="hidden"&&!o.alternate&&!hn)return dr(t),null}else 2*Cn()-a.renderingStartTime>ou&&n!==1073741824&&(t.flags|=128,r=!0,Nd(a,!1),t.lanes=4194304);a.isBackwards?(o.sibling=t.child,t.child=o):(n=a.last,n!==null?n.sibling=o:t.child=o,a.last=o)}return a.tail!==null?(t=a.tail,a.rendering=t,a.tail=t.sibling,a.renderingStartTime=Cn(),t.sibling=null,n=gn.current,sn(gn,r?n&1|2:n&1),t):(dr(t),null);case 22:case 23:return aS(),r=t.memoizedState!==null,e!==null&&e.memoizedState!==null!==r&&(t.flags|=8192),r&&t.mode&1?Jr&1073741824&&(dr(t),t.subtreeFlags&6&&(t.flags|=8192)):dr(t),null;case 24:return null;case 25:return null}throw Error(Ne(156,t.tag))}function m8(e,t){switch(Fj(t),t.tag){case 1:return Ur(t.type)&&Vm(),e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 3:return au(),dn(zr),dn(xr),Kj(),e=t.flags,e&65536&&!(e&128)?(t.flags=e&-65537|128,t):null;case 5:return qj(t),null;case 13:if(dn(gn),e=t.memoizedState,e!==null&&e.dehydrated!==null){if(t.alternate===null)throw Error(Ne(340));ru()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 19:return dn(gn),null;case 4:return au(),null;case 10:return Vj(t.type._context),null;case 22:case 23:return aS(),null;case 24:return null;default:return null}}var Bp=!1,gr=!1,g8=typeof WeakSet=="function"?WeakSet:Set,Ve=null;function Sc(e,t){var n=e.ref;if(n!==null)if(typeof n=="function")try{n(null)}catch(r){wn(e,t,r)}else n.current=null}function zb(e,t,n){try{n()}catch(r){wn(e,t,r)}}var qP=!1;function v8(e,t){if(Nb=Fm,e=UT(),Dj(e)){if("selectionStart"in e)var n={start:e.selectionStart,end:e.selectionEnd};else e:{n=(n=e.ownerDocument)&&n.defaultView||window;var r=n.getSelection&&n.getSelection();if(r&&r.rangeCount!==0){n=r.anchorNode;var s=r.anchorOffset,a=r.focusNode;r=r.focusOffset;try{n.nodeType,a.nodeType}catch{n=null;break e}var o=0,l=-1,c=-1,u=0,d=0,f=e,h=null;t:for(;;){for(var p;f!==n||s!==0&&f.nodeType!==3||(l=o+s),f!==a||r!==0&&f.nodeType!==3||(c=o+r),f.nodeType===3&&(o+=f.nodeValue.length),(p=f.firstChild)!==null;)h=f,f=p;for(;;){if(f===e)break t;if(h===n&&++u===s&&(l=o),h===a&&++d===r&&(c=o),(p=f.nextSibling)!==null)break;f=h,h=f.parentNode}f=p}n=l===-1||c===-1?null:{start:l,end:c}}else n=null}n=n||{start:0,end:0}}else n=null;for(_b={focusedElem:e,selectionRange:n},Fm=!1,Ve=t;Ve!==null;)if(t=Ve,e=t.child,(t.subtreeFlags&1028)!==0&&e!==null)e.return=t,Ve=e;else for(;Ve!==null;){t=Ve;try{var g=t.alternate;if(t.flags&1024)switch(t.tag){case 0:case 11:case 15:break;case 1:if(g!==null){var m=g.memoizedProps,y=g.memoizedState,b=t.stateNode,x=b.getSnapshotBeforeUpdate(t.elementType===t.type?m:Ds(t.type,m),y);b.__reactInternalSnapshotBeforeUpdate=x}break;case 3:var w=t.stateNode.containerInfo;w.nodeType===1?w.textContent="":w.nodeType===9&&w.documentElement&&w.removeChild(w.documentElement);break;case 5:case 6:case 4:case 17:break;default:throw Error(Ne(163))}}catch(j){wn(t,t.return,j)}if(e=t.sibling,e!==null){e.return=t.return,Ve=e;break}Ve=t.return}return g=qP,qP=!1,g}function af(e,t,n){var r=t.updateQueue;if(r=r!==null?r.lastEffect:null,r!==null){var s=r=r.next;do{if((s.tag&e)===e){var a=s.destroy;s.destroy=void 0,a!==void 0&&zb(t,n,a)}s=s.next}while(s!==r)}}function Qv(e,t){if(t=t.updateQueue,t=t!==null?t.lastEffect:null,t!==null){var n=t=t.next;do{if((n.tag&e)===e){var r=n.create;n.destroy=r()}n=n.next}while(n!==t)}}function Ub(e){var t=e.ref;if(t!==null){var n=e.stateNode;switch(e.tag){case 5:e=n;break;default:e=n}typeof t=="function"?t(e):t.current=e}}function L$(e){var t=e.alternate;t!==null&&(e.alternate=null,L$(t)),e.child=null,e.deletions=null,e.sibling=null,e.tag===5&&(t=e.stateNode,t!==null&&(delete t[ba],delete t[Cf],delete t[Cb],delete t[Jz],delete t[e8])),e.stateNode=null,e.return=null,e.dependencies=null,e.memoizedProps=null,e.memoizedState=null,e.pendingProps=null,e.stateNode=null,e.updateQueue=null}function F$(e){return e.tag===5||e.tag===3||e.tag===4}function KP(e){e:for(;;){for(;e.sibling===null;){if(e.return===null||F$(e.return))return null;e=e.return}for(e.sibling.return=e.return,e=e.sibling;e.tag!==5&&e.tag!==6&&e.tag!==18;){if(e.flags&2||e.child===null||e.tag===4)continue e;e.child.return=e,e=e.child}if(!(e.flags&2))return e.stateNode}}function Vb(e,t,n){var r=e.tag;if(r===5||r===6)e=e.stateNode,t?n.nodeType===8?n.parentNode.insertBefore(e,t):n.insertBefore(e,t):(n.nodeType===8?(t=n.parentNode,t.insertBefore(e,n)):(t=n,t.appendChild(e)),n=n._reactRootContainer,n!=null||t.onclick!==null||(t.onclick=Um));else if(r!==4&&(e=e.child,e!==null))for(Vb(e,t,n),e=e.sibling;e!==null;)Vb(e,t,n),e=e.sibling}function Wb(e,t,n){var r=e.tag;if(r===5||r===6)e=e.stateNode,t?n.insertBefore(e,t):n.appendChild(e);else if(r!==4&&(e=e.child,e!==null))for(Wb(e,t,n),e=e.sibling;e!==null;)Wb(e,t,n),e=e.sibling}var rr=null,Bs=!1;function ki(e,t,n){for(n=n.child;n!==null;)B$(e,t,n),n=n.sibling}function B$(e,t,n){if(_a&&typeof _a.onCommitFiberUnmount=="function")try{_a.onCommitFiberUnmount(Wv,n)}catch{}switch(n.tag){case 5:gr||Sc(n,t);case 6:var r=rr,s=Bs;rr=null,ki(e,t,n),rr=r,Bs=s,rr!==null&&(Bs?(e=rr,n=n.stateNode,e.nodeType===8?e.parentNode.removeChild(n):e.removeChild(n)):rr.removeChild(n.stateNode));break;case 18:rr!==null&&(Bs?(e=rr,n=n.stateNode,e.nodeType===8?Yx(e.parentNode,n):e.nodeType===1&&Yx(e,n),Sf(e)):Yx(rr,n.stateNode));break;case 4:r=rr,s=Bs,rr=n.stateNode.containerInfo,Bs=!0,ki(e,t,n),rr=r,Bs=s;break;case 0:case 11:case 14:case 15:if(!gr&&(r=n.updateQueue,r!==null&&(r=r.lastEffect,r!==null))){s=r=r.next;do{var a=s,o=a.destroy;a=a.tag,o!==void 0&&(a&2||a&4)&&zb(n,t,o),s=s.next}while(s!==r)}ki(e,t,n);break;case 1:if(!gr&&(Sc(n,t),r=n.stateNode,typeof r.componentWillUnmount=="function"))try{r.props=n.memoizedProps,r.state=n.memoizedState,r.componentWillUnmount()}catch(l){wn(n,t,l)}ki(e,t,n);break;case 21:ki(e,t,n);break;case 22:n.mode&1?(gr=(r=gr)||n.memoizedState!==null,ki(e,t,n),gr=r):ki(e,t,n);break;default:ki(e,t,n)}}function XP(e){var t=e.updateQueue;if(t!==null){e.updateQueue=null;var n=e.stateNode;n===null&&(n=e.stateNode=new g8),t.forEach(function(r){var s=P8.bind(null,e,r);n.has(r)||(n.add(r),r.then(s,s))})}}function $s(e,t){var n=t.deletions;if(n!==null)for(var r=0;rs&&(s=o),r&=~a}if(r=s,r=Cn()-r,r=(120>r?120:480>r?480:1080>r?1080:1920>r?1920:3e3>r?3e3:4320>r?4320:1960*x8(r/1960))-r,10e?16:e,Qi===null)var r=!1;else{if(e=Qi,Qi=null,tg=0,zt&6)throw Error(Ne(331));var s=zt;for(zt|=4,Ve=e.current;Ve!==null;){var a=Ve,o=a.child;if(Ve.flags&16){var l=a.deletions;if(l!==null){for(var c=0;cCn()-rS?vl(e,0):nS|=n),Vr(e,t)}function K$(e,t){t===0&&(e.mode&1?(t=kp,kp<<=1,!(kp&130023424)&&(kp=4194304)):t=1);var n=Or();e=hi(e,t),e!==null&&(Xh(e,t,n),Vr(e,n))}function _8(e){var t=e.memoizedState,n=0;t!==null&&(n=t.retryLane),K$(e,n)}function P8(e,t){var n=0;switch(e.tag){case 13:var r=e.stateNode,s=e.memoizedState;s!==null&&(n=s.retryLane);break;case 19:r=e.stateNode;break;default:throw Error(Ne(314))}r!==null&&r.delete(t),K$(e,n)}var X$;X$=function(e,t,n){if(e!==null)if(e.memoizedProps!==t.pendingProps||zr.current)Fr=!0;else{if(!(e.lanes&n)&&!(t.flags&128))return Fr=!1,h8(e,t,n);Fr=!!(e.flags&131072)}else Fr=!1,hn&&t.flags&1048576&&JT(t,Gm,t.index);switch(t.lanes=0,t.tag){case 2:var r=t.type;bm(e,t),e=t.pendingProps;var s=nu(t,xr.current);Mc(t,n),s=Yj(null,t,r,e,s,n);var a=Zj();return t.flags|=1,typeof s=="object"&&s!==null&&typeof s.render=="function"&&s.$$typeof===void 0?(t.tag=1,t.memoizedState=null,t.updateQueue=null,Ur(r)?(a=!0,Wm(t)):a=!1,t.memoizedState=s.state!==null&&s.state!==void 0?s.state:null,Hj(t),s.updater=Zv,t.stateNode=s,s._reactInternals=t,Mb(t,r,e,n),t=Db(null,t,r,!0,a,n)):(t.tag=0,hn&&a&&Lj(t),Nr(null,t,s,n),t=t.child),t;case 16:r=t.elementType;e:{switch(bm(e,t),e=t.pendingProps,s=r._init,r=s(r._payload),t.type=r,s=t.tag=C8(r),e=Ds(r,e),s){case 0:t=Rb(null,t,r,e,n);break e;case 1:t=WP(null,t,r,e,n);break e;case 11:t=UP(null,t,r,e,n);break e;case 14:t=VP(null,t,r,Ds(r.type,e),n);break e}throw Error(Ne(306,r,""))}return t;case 0:return r=t.type,s=t.pendingProps,s=t.elementType===r?s:Ds(r,s),Rb(e,t,r,s,n);case 1:return r=t.type,s=t.pendingProps,s=t.elementType===r?s:Ds(r,s),WP(e,t,r,s,n);case 3:e:{if(T$(t),e===null)throw Error(Ne(387));r=t.pendingProps,a=t.memoizedState,s=a.element,a$(e,t),Xm(t,r,null,n);var o=t.memoizedState;if(r=o.element,a.isDehydrated)if(a={element:r,isDehydrated:!1,cache:o.cache,pendingSuspenseBoundaries:o.pendingSuspenseBoundaries,transitions:o.transitions},t.updateQueue.baseState=a,t.memoizedState=a,t.flags&256){s=iu(Error(Ne(423)),t),t=HP(e,t,r,n,s);break e}else if(r!==s){s=iu(Error(Ne(424)),t),t=HP(e,t,r,n,s);break e}else for(ss=ao(t.stateNode.containerInfo.firstChild),as=t,hn=!0,Ws=null,n=r$(t,null,r,n),t.child=n;n;)n.flags=n.flags&-3|4096,n=n.sibling;else{if(ru(),r===s){t=pi(e,t,n);break e}Nr(e,t,r,n)}t=t.child}return t;case 5:return i$(t),e===null&&kb(t),r=t.type,s=t.pendingProps,a=e!==null?e.memoizedProps:null,o=s.children,Pb(r,s)?o=null:a!==null&&Pb(r,a)&&(t.flags|=32),k$(e,t),Nr(e,t,o,n),t.child;case 6:return e===null&&kb(t),null;case 13:return $$(e,t,n);case 4:return Gj(t,t.stateNode.containerInfo),r=t.pendingProps,e===null?t.child=su(t,null,r,n):Nr(e,t,r,n),t.child;case 11:return r=t.type,s=t.pendingProps,s=t.elementType===r?s:Ds(r,s),UP(e,t,r,s,n);case 7:return Nr(e,t,t.pendingProps,n),t.child;case 8:return Nr(e,t,t.pendingProps.children,n),t.child;case 12:return Nr(e,t,t.pendingProps.children,n),t.child;case 10:e:{if(r=t.type._context,s=t.pendingProps,a=t.memoizedProps,o=s.value,sn(qm,r._currentValue),r._currentValue=o,a!==null)if(na(a.value,o)){if(a.children===s.children&&!zr.current){t=pi(e,t,n);break e}}else for(a=t.child,a!==null&&(a.return=t);a!==null;){var l=a.dependencies;if(l!==null){o=a.child;for(var c=l.firstContext;c!==null;){if(c.context===r){if(a.tag===1){c=ai(-1,n&-n),c.tag=2;var u=a.updateQueue;if(u!==null){u=u.shared;var d=u.pending;d===null?c.next=c:(c.next=d.next,d.next=c),u.pending=c}}a.lanes|=n,c=a.alternate,c!==null&&(c.lanes|=n),Tb(a.return,n,t),l.lanes|=n;break}c=c.next}}else if(a.tag===10)o=a.type===t.type?null:a.child;else if(a.tag===18){if(o=a.return,o===null)throw Error(Ne(341));o.lanes|=n,l=o.alternate,l!==null&&(l.lanes|=n),Tb(o,n,t),o=a.sibling}else o=a.child;if(o!==null)o.return=a;else for(o=a;o!==null;){if(o===t){o=null;break}if(a=o.sibling,a!==null){a.return=o.return,o=a;break}o=o.return}a=o}Nr(e,t,s.children,n),t=t.child}return t;case 9:return s=t.type,r=t.pendingProps.children,Mc(t,n),s=As(s),r=r(s),t.flags|=1,Nr(e,t,r,n),t.child;case 14:return r=t.type,s=Ds(r,t.pendingProps),s=Ds(r.type,s),VP(e,t,r,s,n);case 15:return E$(e,t,t.type,t.pendingProps,n);case 17:return r=t.type,s=t.pendingProps,s=t.elementType===r?s:Ds(r,s),bm(e,t),t.tag=1,Ur(r)?(e=!0,Wm(t)):e=!1,Mc(t,n),P$(t,r,s),Mb(t,r,s,n),Db(null,t,r,!0,e,n);case 19:return M$(e,t,n);case 22:return O$(e,t,n)}throw Error(Ne(156,t.tag))};function Y$(e,t){return ST(e,t)}function A8(e,t,n,r){this.tag=e,this.key=n,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.ref=null,this.pendingProps=t,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=r,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function js(e,t,n,r){return new A8(e,t,n,r)}function oS(e){return e=e.prototype,!(!e||!e.isReactComponent)}function C8(e){if(typeof e=="function")return oS(e)?1:0;if(e!=null){if(e=e.$$typeof,e===Pj)return 11;if(e===Aj)return 14}return 2}function co(e,t){var n=e.alternate;return n===null?(n=js(e.tag,t,e.key,e.mode),n.elementType=e.elementType,n.type=e.type,n.stateNode=e.stateNode,n.alternate=e,e.alternate=n):(n.pendingProps=t,n.type=e.type,n.flags=0,n.subtreeFlags=0,n.deletions=null),n.flags=e.flags&14680064,n.childLanes=e.childLanes,n.lanes=e.lanes,n.child=e.child,n.memoizedProps=e.memoizedProps,n.memoizedState=e.memoizedState,n.updateQueue=e.updateQueue,t=e.dependencies,n.dependencies=t===null?null:{lanes:t.lanes,firstContext:t.firstContext},n.sibling=e.sibling,n.index=e.index,n.ref=e.ref,n}function Sm(e,t,n,r,s,a){var o=2;if(r=e,typeof e=="function")oS(e)&&(o=1);else if(typeof e=="string")o=5;else e:switch(e){case pc:return yl(n.children,s,a,t);case _j:o=8,s|=8;break;case sb:return e=js(12,n,t,s|2),e.elementType=sb,e.lanes=a,e;case ab:return e=js(13,n,t,s),e.elementType=ab,e.lanes=a,e;case ib:return e=js(19,n,t,s),e.elementType=ib,e.lanes=a,e;case iT:return ey(n,s,a,t);default:if(typeof e=="object"&&e!==null)switch(e.$$typeof){case sT:o=10;break e;case aT:o=9;break e;case Pj:o=11;break e;case Aj:o=14;break e;case Di:o=16,r=null;break e}throw Error(Ne(130,e==null?e:typeof e,""))}return t=js(o,n,t,s),t.elementType=e,t.type=r,t.lanes=a,t}function yl(e,t,n,r){return e=js(7,e,r,t),e.lanes=n,e}function ey(e,t,n,r){return e=js(22,e,r,t),e.elementType=iT,e.lanes=n,e.stateNode={isHidden:!1},e}function s0(e,t,n){return e=js(6,e,null,t),e.lanes=n,e}function a0(e,t,n){return t=js(4,e.children!==null?e.children:[],e.key,t),t.lanes=n,t.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},t}function E8(e,t,n,r,s){this.tag=t,this.containerInfo=e,this.finishedWork=this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.callbackNode=this.pendingContext=this.context=null,this.callbackPriority=0,this.eventTimes=Fx(0),this.expirationTimes=Fx(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=Fx(0),this.identifierPrefix=r,this.onRecoverableError=s,this.mutableSourceEagerHydrationData=null}function lS(e,t,n,r,s,a,o,l,c){return e=new E8(e,t,n,l,c),t===1?(t=1,a===!0&&(t|=8)):t=0,a=js(3,null,null,t),e.current=a,a.stateNode=e,a.memoizedState={element:r,isDehydrated:n,cache:null,transitions:null,pendingSuspenseBoundaries:null},Hj(a),e}function O8(e,t,n){var r=3"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(eM)}catch(e){console.error(e)}}eM(),eT.exports=us;var Vu=eT.exports;const tM=Gt(Vu);var nM,rA=Vu;nM=rA.createRoot,rA.hydrateRoot;var sA=["light","dark"],I8="(prefers-color-scheme: dark)",R8=v.createContext(void 0),D8={setTheme:e=>{},themes:[]},L8=()=>{var e;return(e=v.useContext(R8))!=null?e:D8};v.memo(({forcedTheme:e,storageKey:t,attribute:n,enableSystem:r,enableColorScheme:s,defaultTheme:a,value:o,attrs:l,nonce:c})=>{let u=a==="system",d=n==="class"?`var d=document.documentElement,c=d.classList;${`c.remove(${l.map(g=>`'${g}'`).join(",")})`};`:`var d=document.documentElement,n='${n}',s='setAttribute';`,f=s?sA.includes(a)&&a?`if(e==='light'||e==='dark'||!e)d.style.colorScheme=e||'${a}'`:"if(e==='light'||e==='dark')d.style.colorScheme=e":"",h=(g,m=!1,y=!0)=>{let b=o?o[g]:g,x=m?g+"|| ''":`'${b}'`,w="";return s&&y&&!m&&sA.includes(g)&&(w+=`d.style.colorScheme = '${g}';`),n==="class"?m||b?w+=`c.add(${x})`:w+="null":b&&(w+=`d[s](n,${x})`),w},p=e?`!function(){${d}${h(e)}}()`:r?`!function(){try{${d}var e=localStorage.getItem('${t}');if('system'===e||(!e&&${u})){var t='${I8}',m=window.matchMedia(t);if(m.media!==t||m.matches){${h("dark")}}else{${h("light")}}}else if(e){${o?`var x=${JSON.stringify(o)};`:""}${h(o?"x[e]":"e",!0)}}${u?"":"else{"+h(a,!1,!1)+"}"}${f}}catch(e){}}()`:`!function(){try{${d}var e=localStorage.getItem('${t}');if(e){${o?`var x=${JSON.stringify(o)};`:""}${h(o?"x[e]":"e",!0)}}else{${h(a,!1,!1)};}${f}}catch(t){}}();`;return v.createElement("script",{nonce:c,dangerouslySetInnerHTML:{__html:p}})});var F8=e=>{switch(e){case"success":return U8;case"info":return W8;case"warning":return V8;case"error":return H8;default:return null}},B8=Array(12).fill(0),z8=({visible:e})=>E.createElement("div",{className:"sonner-loading-wrapper","data-visible":e},E.createElement("div",{className:"sonner-spinner"},B8.map((t,n)=>E.createElement("div",{className:"sonner-loading-bar",key:`spinner-bar-${n}`})))),U8=E.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20"},E.createElement("path",{fillRule:"evenodd",d:"M10 18a8 8 0 100-16 8 8 0 000 16zm3.857-9.809a.75.75 0 00-1.214-.882l-3.483 4.79-1.88-1.88a.75.75 0 10-1.06 1.061l2.5 2.5a.75.75 0 001.137-.089l4-5.5z",clipRule:"evenodd"})),V8=E.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor",height:"20",width:"20"},E.createElement("path",{fillRule:"evenodd",d:"M9.401 3.003c1.155-2 4.043-2 5.197 0l7.355 12.748c1.154 2-.29 4.5-2.599 4.5H4.645c-2.309 0-3.752-2.5-2.598-4.5L9.4 3.003zM12 8.25a.75.75 0 01.75.75v3.75a.75.75 0 01-1.5 0V9a.75.75 0 01.75-.75zm0 8.25a.75.75 0 100-1.5.75.75 0 000 1.5z",clipRule:"evenodd"})),W8=E.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20"},E.createElement("path",{fillRule:"evenodd",d:"M18 10a8 8 0 11-16 0 8 8 0 0116 0zm-7-4a1 1 0 11-2 0 1 1 0 012 0zM9 9a.75.75 0 000 1.5h.253a.25.25 0 01.244.304l-.459 2.066A1.75 1.75 0 0010.747 15H11a.75.75 0 000-1.5h-.253a.25.25 0 01-.244-.304l.459-2.066A1.75 1.75 0 009.253 9H9z",clipRule:"evenodd"})),H8=E.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20"},E.createElement("path",{fillRule:"evenodd",d:"M18 10a8 8 0 11-16 0 8 8 0 0116 0zm-8-5a.75.75 0 01.75.75v4.5a.75.75 0 01-1.5 0v-4.5A.75.75 0 0110 5zm0 10a1 1 0 100-2 1 1 0 000 2z",clipRule:"evenodd"})),G8=()=>{let[e,t]=E.useState(document.hidden);return E.useEffect(()=>{let n=()=>{t(document.hidden)};return document.addEventListener("visibilitychange",n),()=>window.removeEventListener("visibilitychange",n)},[]),e},Xb=1,q8=class{constructor(){this.subscribe=e=>(this.subscribers.push(e),()=>{let t=this.subscribers.indexOf(e);this.subscribers.splice(t,1)}),this.publish=e=>{this.subscribers.forEach(t=>t(e))},this.addToast=e=>{this.publish(e),this.toasts=[...this.toasts,e]},this.create=e=>{var t;let{message:n,...r}=e,s=typeof(e==null?void 0:e.id)=="number"||((t=e.id)==null?void 0:t.length)>0?e.id:Xb++,a=this.toasts.find(l=>l.id===s),o=e.dismissible===void 0?!0:e.dismissible;return a?this.toasts=this.toasts.map(l=>l.id===s?(this.publish({...l,...e,id:s,title:n}),{...l,...e,id:s,dismissible:o,title:n}):l):this.addToast({title:n,...r,dismissible:o,id:s}),s},this.dismiss=e=>(e||this.toasts.forEach(t=>{this.subscribers.forEach(n=>n({id:t.id,dismiss:!0}))}),this.subscribers.forEach(t=>t({id:e,dismiss:!0})),e),this.message=(e,t)=>this.create({...t,message:e}),this.error=(e,t)=>this.create({...t,message:e,type:"error"}),this.success=(e,t)=>this.create({...t,type:"success",message:e}),this.info=(e,t)=>this.create({...t,type:"info",message:e}),this.warning=(e,t)=>this.create({...t,type:"warning",message:e}),this.loading=(e,t)=>this.create({...t,type:"loading",message:e}),this.promise=(e,t)=>{if(!t)return;let n;t.loading!==void 0&&(n=this.create({...t,promise:e,type:"loading",message:t.loading,description:typeof t.description!="function"?t.description:void 0}));let r=e instanceof Promise?e:e(),s=n!==void 0;return r.then(async a=>{if(X8(a)&&!a.ok){s=!1;let o=typeof t.error=="function"?await t.error(`HTTP error! status: ${a.status}`):t.error,l=typeof t.description=="function"?await t.description(`HTTP error! status: ${a.status}`):t.description;this.create({id:n,type:"error",message:o,description:l})}else if(t.success!==void 0){s=!1;let o=typeof t.success=="function"?await t.success(a):t.success,l=typeof t.description=="function"?await t.description(a):t.description;this.create({id:n,type:"success",message:o,description:l})}}).catch(async a=>{if(t.error!==void 0){s=!1;let o=typeof t.error=="function"?await t.error(a):t.error,l=typeof t.description=="function"?await t.description(a):t.description;this.create({id:n,type:"error",message:o,description:l})}}).finally(()=>{var a;s&&(this.dismiss(n),n=void 0),(a=t.finally)==null||a.call(t)}),n},this.custom=(e,t)=>{let n=(t==null?void 0:t.id)||Xb++;return this.create({jsx:e(n),id:n,...t}),n},this.subscribers=[],this.toasts=[]}},Qr=new q8,K8=(e,t)=>{let n=(t==null?void 0:t.id)||Xb++;return Qr.addToast({title:e,...t,id:n}),n},X8=e=>e&&typeof e=="object"&&"ok"in e&&typeof e.ok=="boolean"&&"status"in e&&typeof e.status=="number",Y8=K8,Z8=()=>Qr.toasts,oe=Object.assign(Y8,{success:Qr.success,info:Qr.info,warning:Qr.warning,error:Qr.error,custom:Qr.custom,message:Qr.message,promise:Qr.promise,dismiss:Qr.dismiss,loading:Qr.loading},{getHistory:Z8});function Q8(e,{insertAt:t}={}){if(typeof document>"u")return;let n=document.head||document.getElementsByTagName("head")[0],r=document.createElement("style");r.type="text/css",t==="top"&&n.firstChild?n.insertBefore(r,n.firstChild):n.appendChild(r),r.styleSheet?r.styleSheet.cssText=e:r.appendChild(document.createTextNode(e))}Q8(`:where(html[dir="ltr"]),:where([data-sonner-toaster][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%)}:where(html[dir="rtl"]),:where([data-sonner-toaster][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%)}:where([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:none;z-index:999999999}:where([data-sonner-toaster][data-x-position="right"]){right:max(var(--offset),env(safe-area-inset-right))}:where([data-sonner-toaster][data-x-position="left"]){left:max(var(--offset),env(safe-area-inset-left))}:where([data-sonner-toaster][data-x-position="center"]){left:50%;transform:translate(-50%)}:where([data-sonner-toaster][data-y-position="top"]){top:max(var(--offset),env(safe-area-inset-top))}:where([data-sonner-toaster][data-y-position="bottom"]){bottom:max(var(--offset),env(safe-area-inset-bottom))}:where([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);filter:blur(0);touch-action:none;transition:transform .4s,opacity .4s,height .4s,box-shadow .2s;box-sizing:border-box;outline:none;overflow-wrap:anywhere}:where([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 #0000001a;width:var(--width);font-size:13px;display:flex;align-items:center;gap:6px}:where([data-sonner-toast]:focus-visible){box-shadow:0 4px 12px #0000001a,0 0 0 2px #0003}:where([data-sonner-toast][data-y-position="top"]){top:0;--y: translateY(-100%);--lift: 1;--lift-amount: calc(1 * var(--gap))}:where([data-sonner-toast][data-y-position="bottom"]){bottom:0;--y: translateY(100%);--lift: -1;--lift-amount: calc(var(--lift) * var(--gap))}:where([data-sonner-toast]) :where([data-description]){font-weight:400;line-height:1.4;color:inherit}:where([data-sonner-toast]) :where([data-title]){font-weight:500;line-height:1.5;color:inherit}:where([data-sonner-toast]) :where([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)}:where([data-sonner-toast][data-promise="true"]) :where([data-icon])>svg{opacity:0;transform:scale(.8);transform-origin:center;animation:sonner-fade-in .3s ease forwards}:where([data-sonner-toast]) :where([data-icon])>*{flex-shrink:0}:where([data-sonner-toast]) :where([data-icon]) svg{margin-left:var(--toast-svg-margin-start);margin-right:var(--toast-svg-margin-end)}:where([data-sonner-toast]) :where([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;cursor:pointer;outline:none;display:flex;align-items:center;flex-shrink:0;transition:opacity .4s,box-shadow .2s}:where([data-sonner-toast]) :where([data-button]):focus-visible{box-shadow:0 0 0 2px #0006}:where([data-sonner-toast]) :where([data-button]):first-of-type{margin-left:var(--toast-button-margin-start);margin-right:var(--toast-button-margin-end)}:where([data-sonner-toast]) :where([data-cancel]){color:var(--normal-text);background:rgba(0,0,0,.08)}:where([data-sonner-toast][data-theme="dark"]) :where([data-cancel]){background:rgba(255,255,255,.3)}:where([data-sonner-toast]) :where([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;background:var(--gray1);color:var(--gray12);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}:where([data-sonner-toast]) :where([data-close-button]):focus-visible{box-shadow:0 4px 12px #0000001a,0 0 0 2px #0003}:where([data-sonner-toast]) :where([data-disabled="true"]){cursor:not-allowed}:where([data-sonner-toast]):hover :where([data-close-button]):hover{background:var(--gray2);border-color:var(--gray5)}:where([data-sonner-toast][data-swiping="true"]):before{content:"";position:absolute;left:0;right:0;height:100%;z-index:-1}:where([data-sonner-toast][data-y-position="top"][data-swiping="true"]):before{bottom:50%;transform:scaleY(3) translateY(50%)}:where([data-sonner-toast][data-y-position="bottom"][data-swiping="true"]):before{top:50%;transform:scaleY(3) translateY(-50%)}:where([data-sonner-toast][data-swiping="false"][data-removed="true"]):before{content:"";position:absolute;inset:0;transform:scaleY(2)}:where([data-sonner-toast]):after{content:"";position:absolute;left:0;height:calc(var(--gap) + 1px);bottom:100%;width:100%}:where([data-sonner-toast][data-mounted="true"]){--y: translateY(0);opacity:1}:where([data-sonner-toast][data-expanded="false"][data-front="false"]){--scale: var(--toasts-before) * .05 + 1;--y: translateY(calc(var(--lift-amount) * var(--toasts-before))) scale(calc(-1 * var(--scale)));height:var(--front-toast-height)}:where([data-sonner-toast])>*{transition:opacity .4s}:where([data-sonner-toast][data-expanded="false"][data-front="false"][data-styled="true"])>*{opacity:0}:where([data-sonner-toast][data-visible="false"]){opacity:0;pointer-events:none}:where([data-sonner-toast][data-mounted="true"][data-expanded="true"]){--y: translateY(calc(var(--lift) * var(--offset)));height:var(--initial-height)}:where([data-sonner-toast][data-removed="true"][data-front="true"][data-swipe-out="false"]){--y: translateY(calc(var(--lift) * -100%));opacity:0}:where([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}:where([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}:where([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, 0px));transition:none}[data-sonner-toast][data-swipe-out=true][data-y-position=bottom],[data-sonner-toast][data-swipe-out=true][data-y-position=top]{animation:swipe-out .2s ease-out forwards}@keyframes swipe-out{0%{transform:translateY(calc(var(--lift) * var(--offset) + var(--swipe-amount)));opacity:1}to{transform:translateY(calc(var(--lift) * var(--offset) + var(--swipe-amount) + var(--lift) * -100%));opacity:0}}@media (max-width: 600px){[data-sonner-toaster]{position:fixed;--mobile-offset: 16px;right:var(--mobile-offset);left:var(--mobile-offset);width:100%}[data-sonner-toaster] [data-sonner-toast]{left:0;right:0;width:calc(100% - var(--mobile-offset) * 2)}[data-sonner-toaster][data-x-position=left]{left:var(--mobile-offset)}[data-sonner-toaster][data-y-position=bottom]{bottom:20px}[data-sonner-toaster][data-y-position=top]{top:20px}[data-sonner-toaster][data-x-position=center]{left:var(--mobile-offset);right:var(--mobile-offset);transform:none}}[data-sonner-toaster][data-theme=light]{--normal-bg: #fff;--normal-border: var(--gray4);--normal-text: var(--gray12);--success-bg: hsl(143, 85%, 96%);--success-border: hsl(145, 92%, 91%);--success-text: hsl(140, 100%, 27%);--info-bg: hsl(208, 100%, 97%);--info-border: hsl(221, 91%, 91%);--info-text: hsl(210, 92%, 45%);--warning-bg: hsl(49, 100%, 97%);--warning-border: hsl(49, 91%, 91%);--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-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-theme=dark] [data-sonner-toast][data-invert=true]{--normal-bg: #fff;--normal-border: var(--gray3);--normal-text: var(--gray12)}[data-sonner-toaster][data-theme=dark]{--normal-bg: #000;--normal-border: hsl(0, 0%, 20%);--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, 100%, 12%);--info-text: hsl(216, 87%, 65%);--warning-bg: hsl(64, 100%, 6%);--warning-border: hsl(60, 100%, 12%);--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-rich-colors=true][data-sonner-toast][data-type=success],[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],[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],[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],[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:nth-child(1){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)}to{opacity:1;transform:scale(1)}}@keyframes sonner-fade-out{0%{opacity:1;transform:scale(1)}to{opacity:0;transform:scale(.8)}}@keyframes sonner-spin{0%{opacity:1}to{opacity:.15}}@media (prefers-reduced-motion){[data-sonner-toast],[data-sonner-toast]>*,.sonner-loading-bar{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%)} -`);function Vp(e){return e.label!==void 0}var J8=3,eU="32px",tU=4e3,nU=356,rU=14,sU=20,aU=200;function iU(...e){return e.filter(Boolean).join(" ")}var oU=e=>{var t,n,r,s,a,o,l,c,u,d;let{invert:f,toast:h,unstyled:p,interacting:g,setHeights:m,visibleToasts:y,heights:b,index:x,toasts:w,expanded:j,removeToast:S,defaultRichColors:N,closeButton:_,style:P,cancelButtonStyle:k,actionButtonStyle:O,className:M="",descriptionClassName:A="",duration:$,position:L,gap:H,loadingIcon:D,expandByDefault:V,classNames:T,icons:F,closeButtonAriaLabel:q="Close toast",pauseWhenPageIsHidden:Z,cn:re}=e,[ge,B]=E.useState(!1),[le,se]=E.useState(!1),[ce,De]=E.useState(!1),[de,be]=E.useState(!1),[Pe,ne]=E.useState(0),[Je,ve]=E.useState(0),at=E.useRef(null),st=E.useRef(null),Mt=x===0,C=x+1<=y,R=h.type,U=h.dismissible!==!1,X=h.className||"",Q=h.descriptionClassName||"",z=E.useMemo(()=>b.findIndex(pt=>pt.toastId===h.id)||0,[b,h.id]),ee=E.useMemo(()=>{var pt;return(pt=h.closeButton)!=null?pt:_},[h.closeButton,_]),me=E.useMemo(()=>h.duration||$||tU,[h.duration,$]),Se=E.useRef(0),Ie=E.useRef(0),we=E.useRef(0),ze=E.useRef(null),[gt,jt]=L.split("-"),Ge=E.useMemo(()=>b.reduce((pt,tt,it)=>it>=z?pt:pt+tt.height,0),[b,z]),Ze=G8(),kt=h.invert||f,Vt=R==="loading";Ie.current=E.useMemo(()=>z*H+Ge,[z,Ge]),E.useEffect(()=>{B(!0)},[]),E.useLayoutEffect(()=>{if(!ge)return;let pt=st.current,tt=pt.style.height;pt.style.height="auto";let it=pt.getBoundingClientRect().height;pt.style.height=tt,ve(it),m(Lt=>Lt.find(tn=>tn.toastId===h.id)?Lt.map(tn=>tn.toastId===h.id?{...tn,height:it}:tn):[{toastId:h.id,height:it,position:h.position},...Lt])},[ge,h.title,h.description,m,h.id]);let Xn=E.useCallback(()=>{se(!0),ne(Ie.current),m(pt=>pt.filter(tt=>tt.toastId!==h.id)),setTimeout(()=>{S(h)},aU)},[h,S,m,Ie]);E.useEffect(()=>{if(h.promise&&R==="loading"||h.duration===1/0||h.type==="loading")return;let pt,tt=me;return j||g||Z&&Ze?(()=>{if(we.current{var it;(it=h.onAutoClose)==null||it.call(h,h),Xn()},tt)),()=>clearTimeout(pt)},[j,g,V,h,me,Xn,h.promise,R,Z,Ze]),E.useEffect(()=>{let pt=st.current;if(pt){let tt=pt.getBoundingClientRect().height;return ve(tt),m(it=>[{toastId:h.id,height:tt,position:h.position},...it]),()=>m(it=>it.filter(Lt=>Lt.toastId!==h.id))}},[m,h.id]),E.useEffect(()=>{h.delete&&Xn()},[Xn,h.delete]);function an(){return F!=null&&F.loading?E.createElement("div",{className:"sonner-loader","data-visible":R==="loading"},F.loading):D?E.createElement("div",{className:"sonner-loader","data-visible":R==="loading"},D):E.createElement(z8,{visible:R==="loading"})}return E.createElement("li",{"aria-live":h.important?"assertive":"polite","aria-atomic":"true",role:"status",tabIndex:0,ref:st,className:re(M,X,T==null?void 0:T.toast,(t=h==null?void 0:h.classNames)==null?void 0:t.toast,T==null?void 0:T.default,T==null?void 0:T[R],(n=h==null?void 0:h.classNames)==null?void 0:n[R]),"data-sonner-toast":"","data-rich-colors":(r=h.richColors)!=null?r:N,"data-styled":!(h.jsx||h.unstyled||p),"data-mounted":ge,"data-promise":!!h.promise,"data-removed":le,"data-visible":C,"data-y-position":gt,"data-x-position":jt,"data-index":x,"data-front":Mt,"data-swiping":ce,"data-dismissible":U,"data-type":R,"data-invert":kt,"data-swipe-out":de,"data-expanded":!!(j||V&&ge),style:{"--index":x,"--toasts-before":x,"--z-index":w.length-x,"--offset":`${le?Pe:Ie.current}px`,"--initial-height":V?"auto":`${Je}px`,...P,...h.style},onPointerDown:pt=>{Vt||!U||(at.current=new Date,ne(Ie.current),pt.target.setPointerCapture(pt.pointerId),pt.target.tagName!=="BUTTON"&&(De(!0),ze.current={x:pt.clientX,y:pt.clientY}))},onPointerUp:()=>{var pt,tt,it,Lt;if(de||!U)return;ze.current=null;let tn=Number(((pt=st.current)==null?void 0:pt.style.getPropertyValue("--swipe-amount").replace("px",""))||0),Xr=new Date().getTime()-((tt=at.current)==null?void 0:tt.getTime()),za=Math.abs(tn)/Xr;if(Math.abs(tn)>=sU||za>.11){ne(Ie.current),(it=h.onDismiss)==null||it.call(h,h),Xn(),be(!0);return}(Lt=st.current)==null||Lt.style.setProperty("--swipe-amount","0px"),De(!1)},onPointerMove:pt=>{var tt;if(!ze.current||!U)return;let it=pt.clientY-ze.current.y,Lt=pt.clientX-ze.current.x,tn=(gt==="top"?Math.min:Math.max)(0,it),Xr=pt.pointerType==="touch"?10:2;Math.abs(tn)>Xr?(tt=st.current)==null||tt.style.setProperty("--swipe-amount",`${it}px`):Math.abs(Lt)>Xr&&(ze.current=null)}},ee&&!h.jsx?E.createElement("button",{"aria-label":q,"data-disabled":Vt,"data-close-button":!0,onClick:Vt||!U?()=>{}:()=>{var pt;Xn(),(pt=h.onDismiss)==null||pt.call(h,h)},className:re(T==null?void 0:T.closeButton,(s=h==null?void 0:h.classNames)==null?void 0:s.closeButton)},E.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",width:"12",height:"12",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"},E.createElement("line",{x1:"18",y1:"6",x2:"6",y2:"18"}),E.createElement("line",{x1:"6",y1:"6",x2:"18",y2:"18"}))):null,h.jsx||E.isValidElement(h.title)?h.jsx||h.title:E.createElement(E.Fragment,null,R||h.icon||h.promise?E.createElement("div",{"data-icon":"",className:re(T==null?void 0:T.icon,(a=h==null?void 0:h.classNames)==null?void 0:a.icon)},h.promise||h.type==="loading"&&!h.icon?h.icon||an():null,h.type!=="loading"?h.icon||(F==null?void 0:F[R])||F8(R):null):null,E.createElement("div",{"data-content":"",className:re(T==null?void 0:T.content,(o=h==null?void 0:h.classNames)==null?void 0:o.content)},E.createElement("div",{"data-title":"",className:re(T==null?void 0:T.title,(l=h==null?void 0:h.classNames)==null?void 0:l.title)},h.title),h.description?E.createElement("div",{"data-description":"",className:re(A,Q,T==null?void 0:T.description,(c=h==null?void 0:h.classNames)==null?void 0:c.description)},h.description):null),E.isValidElement(h.cancel)?h.cancel:h.cancel&&Vp(h.cancel)?E.createElement("button",{"data-button":!0,"data-cancel":!0,style:h.cancelButtonStyle||k,onClick:pt=>{var tt,it;Vp(h.cancel)&&U&&((it=(tt=h.cancel).onClick)==null||it.call(tt,pt),Xn())},className:re(T==null?void 0:T.cancelButton,(u=h==null?void 0:h.classNames)==null?void 0:u.cancelButton)},h.cancel.label):null,E.isValidElement(h.action)?h.action:h.action&&Vp(h.action)?E.createElement("button",{"data-button":!0,"data-action":!0,style:h.actionButtonStyle||O,onClick:pt=>{var tt,it;Vp(h.action)&&(pt.defaultPrevented||((it=(tt=h.action).onClick)==null||it.call(tt,pt),Xn()))},className:re(T==null?void 0:T.actionButton,(d=h==null?void 0:h.classNames)==null?void 0:d.actionButton)},h.action.label):null))};function aA(){if(typeof window>"u"||typeof document>"u")return"ltr";let e=document.documentElement.getAttribute("dir");return e==="auto"||!e?window.getComputedStyle(document.documentElement).direction:e}var lU=e=>{let{invert:t,position:n="bottom-right",hotkey:r=["altKey","KeyT"],expand:s,closeButton:a,className:o,offset:l,theme:c="light",richColors:u,duration:d,style:f,visibleToasts:h=J8,toastOptions:p,dir:g=aA(),gap:m=rU,loadingIcon:y,icons:b,containerAriaLabel:x="Notifications",pauseWhenPageIsHidden:w,cn:j=iU}=e,[S,N]=E.useState([]),_=E.useMemo(()=>Array.from(new Set([n].concat(S.filter(Z=>Z.position).map(Z=>Z.position)))),[S,n]),[P,k]=E.useState([]),[O,M]=E.useState(!1),[A,$]=E.useState(!1),[L,H]=E.useState(c!=="system"?c:typeof window<"u"&&window.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light"),D=E.useRef(null),V=r.join("+").replace(/Key/g,"").replace(/Digit/g,""),T=E.useRef(null),F=E.useRef(!1),q=E.useCallback(Z=>{var re;(re=S.find(ge=>ge.id===Z.id))!=null&&re.delete||Qr.dismiss(Z.id),N(ge=>ge.filter(({id:B})=>B!==Z.id))},[S]);return E.useEffect(()=>Qr.subscribe(Z=>{if(Z.dismiss){N(re=>re.map(ge=>ge.id===Z.id?{...ge,delete:!0}:ge));return}setTimeout(()=>{tM.flushSync(()=>{N(re=>{let ge=re.findIndex(B=>B.id===Z.id);return ge!==-1?[...re.slice(0,ge),{...re[ge],...Z},...re.slice(ge+1)]:[Z,...re]})})})}),[]),E.useEffect(()=>{if(c!=="system"){H(c);return}c==="system"&&(window.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)").matches?H("dark"):H("light")),typeof window<"u"&&window.matchMedia("(prefers-color-scheme: dark)").addEventListener("change",({matches:Z})=>{H(Z?"dark":"light")})},[c]),E.useEffect(()=>{S.length<=1&&M(!1)},[S]),E.useEffect(()=>{let Z=re=>{var ge,B;r.every(le=>re[le]||re.code===le)&&(M(!0),(ge=D.current)==null||ge.focus()),re.code==="Escape"&&(document.activeElement===D.current||(B=D.current)!=null&&B.contains(document.activeElement))&&M(!1)};return document.addEventListener("keydown",Z),()=>document.removeEventListener("keydown",Z)},[r]),E.useEffect(()=>{if(D.current)return()=>{T.current&&(T.current.focus({preventScroll:!0}),T.current=null,F.current=!1)}},[D.current]),S.length?E.createElement("section",{"aria-label":`${x} ${V}`,tabIndex:-1},_.map((Z,re)=>{var ge;let[B,le]=Z.split("-");return E.createElement("ol",{key:Z,dir:g==="auto"?aA():g,tabIndex:-1,ref:D,className:o,"data-sonner-toaster":!0,"data-theme":L,"data-y-position":B,"data-x-position":le,style:{"--front-toast-height":`${((ge=P[0])==null?void 0:ge.height)||0}px`,"--offset":typeof l=="number"?`${l}px`:l||eU,"--width":`${nU}px`,"--gap":`${m}px`,...f},onBlur:se=>{F.current&&!se.currentTarget.contains(se.relatedTarget)&&(F.current=!1,T.current&&(T.current.focus({preventScroll:!0}),T.current=null))},onFocus:se=>{se.target instanceof HTMLElement&&se.target.dataset.dismissible==="false"||F.current||(F.current=!0,T.current=se.relatedTarget)},onMouseEnter:()=>M(!0),onMouseMove:()=>M(!0),onMouseLeave:()=>{A||M(!1)},onPointerDown:se=>{se.target instanceof HTMLElement&&se.target.dataset.dismissible==="false"||$(!0)},onPointerUp:()=>$(!1)},S.filter(se=>!se.position&&re===0||se.position===Z).map((se,ce)=>{var De,de;return E.createElement(oU,{key:se.id,icons:b,index:ce,toast:se,defaultRichColors:u,duration:(De=p==null?void 0:p.duration)!=null?De:d,className:p==null?void 0:p.className,descriptionClassName:p==null?void 0:p.descriptionClassName,invert:t,visibleToasts:h,closeButton:(de=p==null?void 0:p.closeButton)!=null?de:a,interacting:A,position:Z,style:p==null?void 0:p.style,unstyled:p==null?void 0:p.unstyled,classNames:p==null?void 0:p.classNames,cancelButtonStyle:p==null?void 0:p.cancelButtonStyle,actionButtonStyle:p==null?void 0:p.actionButtonStyle,removeToast:q,toasts:S.filter(be=>be.position==se.position),heights:P.filter(be=>be.position==se.position),setHeights:k,expandByDefault:s,gap:m,loadingIcon:y,expanded:O,pauseWhenPageIsHidden:w,cn:j})}))})):null};const cU=({...e})=>{const{theme:t="system"}=L8();return i.jsx(lU,{theme:t,className:"toaster group",position:"bottom-right",visibleToasts:2,closeButton:!0,toastOptions:{classNames:{toast:"group toast group-[.toaster]:bg-background group-[.toaster]:text-foreground group-[.toaster]:border-border group-[.toaster]:shadow-lg group-[.toaster]:pr-8",description:"group-[.toast]:text-muted-foreground",actionButton:"group-[.toast]:bg-primary group-[.toast]:text-primary-foreground",cancelButton:"group-[.toast]:bg-muted group-[.toast]:text-muted-foreground",closeButton:"group-[.toast]:absolute group-[.toast]:left-3 group-[.toast]:top-3 group-[.toast]:h-5 group-[.toast]:w-5 group-[.toast]:rounded-md group-[.toast]:p-1 group-[.toast]:text-foreground/70 group-[.toast]:opacity-100 group-[.toast]:transition-opacity hover:group-[.toast]:text-foreground hover:group-[.toast]:bg-muted/50 focus:group-[.toast]:opacity-100 focus:group-[.toast]:outline-none focus:group-[.toast]:ring-1 focus:group-[.toast]:ring-ring"}},...e})};function Ee(e,t,{checkForDefaultPrevented:n=!0}={}){return function(s){if(e==null||e(s),n===!1||!s.defaultPrevented)return t==null?void 0:t(s)}}function uU(e,t){typeof e=="function"?e(t):e!=null&&(e.current=t)}function ay(...e){return t=>e.forEach(n=>uU(n,t))}function xt(...e){return v.useCallback(ay(...e),e)}function dU(e,t){const n=v.createContext(t),r=a=>{const{children:o,...l}=a,c=v.useMemo(()=>l,Object.values(l));return i.jsx(n.Provider,{value:c,children:o})};r.displayName=e+"Provider";function s(a){const o=v.useContext(n);if(o)return o;if(t!==void 0)return t;throw new Error(`\`${a}\` must be used within \`${e}\``)}return[r,s]}function Gr(e,t=[]){let n=[];function r(a,o){const l=v.createContext(o),c=n.length;n=[...n,o];const u=f=>{var b;const{scope:h,children:p,...g}=f,m=((b=h==null?void 0:h[e])==null?void 0:b[c])||l,y=v.useMemo(()=>g,Object.values(g));return i.jsx(m.Provider,{value:y,children:p})};u.displayName=a+"Provider";function d(f,h){var m;const p=((m=h==null?void 0:h[e])==null?void 0:m[c])||l,g=v.useContext(p);if(g)return g;if(o!==void 0)return o;throw new Error(`\`${f}\` must be used within \`${a}\``)}return[u,d]}const s=()=>{const a=n.map(o=>v.createContext(o));return function(l){const c=(l==null?void 0:l[e])||a;return v.useMemo(()=>({[`__scope${e}`]:{...l,[e]:c}}),[l,c])}};return s.scopeName=e,[r,fU(s,...t)]}function fU(...e){const t=e[0];if(e.length===1)return t;const n=()=>{const r=e.map(s=>({useScope:s(),scopeName:s.scopeName}));return function(a){const o=r.reduce((l,{useScope:c,scopeName:u})=>{const f=c(a)[`__scope${u}`];return{...l,...f}},{});return v.useMemo(()=>({[`__scope${t.scopeName}`]:o}),[o])}};return n.scopeName=t.scopeName,n}var mi=v.forwardRef((e,t)=>{const{children:n,...r}=e,s=v.Children.toArray(n),a=s.find(hU);if(a){const o=a.props.children,l=s.map(c=>c===a?v.Children.count(o)>1?v.Children.only(null):v.isValidElement(o)?o.props.children:null:c);return i.jsx(Yb,{...r,ref:t,children:v.isValidElement(o)?v.cloneElement(o,void 0,l):null})}return i.jsx(Yb,{...r,ref:t,children:n})});mi.displayName="Slot";var Yb=v.forwardRef((e,t)=>{const{children:n,...r}=e;if(v.isValidElement(n)){const s=mU(n);return v.cloneElement(n,{...pU(r,n.props),ref:t?ay(t,s):s})}return v.Children.count(n)>1?v.Children.only(null):null});Yb.displayName="SlotClone";var fS=({children:e})=>i.jsx(i.Fragment,{children:e});function hU(e){return v.isValidElement(e)&&e.type===fS}function pU(e,t){const n={...t};for(const r in t){const s=e[r],a=t[r];/^on[A-Z]/.test(r)?s&&a?n[r]=(...l)=>{a(...l),s(...l)}:s&&(n[r]=s):r==="style"?n[r]={...s,...a}:r==="className"&&(n[r]=[s,a].filter(Boolean).join(" "))}return{...e,...n}}function mU(e){var r,s;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=(s=Object.getOwnPropertyDescriptor(e,"ref"))==null?void 0:s.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}var gU=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","span","svg","ul"],Ye=gU.reduce((e,t)=>{const n=v.forwardRef((r,s)=>{const{asChild:a,...o}=r,l=a?mi:t;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),i.jsx(l,{...o,ref:s})});return n.displayName=`Primitive.${t}`,{...e,[t]:n}},{});function rM(e,t){e&&Vu.flushSync(()=>e.dispatchEvent(t))}function Hn(e){const t=v.useRef(e);return v.useEffect(()=>{t.current=e}),v.useMemo(()=>(...n)=>{var r;return(r=t.current)==null?void 0:r.call(t,...n)},[])}function vU(e,t=globalThis==null?void 0:globalThis.document){const n=Hn(e);v.useEffect(()=>{const r=s=>{s.key==="Escape"&&n(s)};return t.addEventListener("keydown",r,{capture:!0}),()=>t.removeEventListener("keydown",r,{capture:!0})},[n,t])}var yU="DismissableLayer",Zb="dismissableLayer.update",xU="dismissableLayer.pointerDownOutside",bU="dismissableLayer.focusOutside",iA,sM=v.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set}),Jh=v.forwardRef((e,t)=>{const{disableOutsidePointerEvents:n=!1,onEscapeKeyDown:r,onPointerDownOutside:s,onFocusOutside:a,onInteractOutside:o,onDismiss:l,...c}=e,u=v.useContext(sM),[d,f]=v.useState(null),h=(d==null?void 0:d.ownerDocument)??(globalThis==null?void 0:globalThis.document),[,p]=v.useState({}),g=xt(t,_=>f(_)),m=Array.from(u.layers),[y]=[...u.layersWithOutsidePointerEventsDisabled].slice(-1),b=m.indexOf(y),x=d?m.indexOf(d):-1,w=u.layersWithOutsidePointerEventsDisabled.size>0,j=x>=b,S=SU(_=>{const P=_.target,k=[...u.branches].some(O=>O.contains(P));!j||k||(s==null||s(_),o==null||o(_),_.defaultPrevented||l==null||l())},h),N=NU(_=>{const P=_.target;[...u.branches].some(O=>O.contains(P))||(a==null||a(_),o==null||o(_),_.defaultPrevented||l==null||l())},h);return vU(_=>{x===u.layers.size-1&&(r==null||r(_),!_.defaultPrevented&&l&&(_.preventDefault(),l()))},h),v.useEffect(()=>{if(d)return n&&(u.layersWithOutsidePointerEventsDisabled.size===0&&(iA=h.body.style.pointerEvents,h.body.style.pointerEvents="none"),u.layersWithOutsidePointerEventsDisabled.add(d)),u.layers.add(d),oA(),()=>{n&&u.layersWithOutsidePointerEventsDisabled.size===1&&(h.body.style.pointerEvents=iA)}},[d,h,n,u]),v.useEffect(()=>()=>{d&&(u.layers.delete(d),u.layersWithOutsidePointerEventsDisabled.delete(d),oA())},[d,u]),v.useEffect(()=>{const _=()=>p({});return document.addEventListener(Zb,_),()=>document.removeEventListener(Zb,_)},[]),i.jsx(Ye.div,{...c,ref:g,style:{pointerEvents:w?j?"auto":"none":void 0,...e.style},onFocusCapture:Ee(e.onFocusCapture,N.onFocusCapture),onBlurCapture:Ee(e.onBlurCapture,N.onBlurCapture),onPointerDownCapture:Ee(e.onPointerDownCapture,S.onPointerDownCapture)})});Jh.displayName=yU;var wU="DismissableLayerBranch",jU=v.forwardRef((e,t)=>{const n=v.useContext(sM),r=v.useRef(null),s=xt(t,r);return v.useEffect(()=>{const a=r.current;if(a)return n.branches.add(a),()=>{n.branches.delete(a)}},[n.branches]),i.jsx(Ye.div,{...e,ref:s})});jU.displayName=wU;function SU(e,t=globalThis==null?void 0:globalThis.document){const n=Hn(e),r=v.useRef(!1),s=v.useRef(()=>{});return v.useEffect(()=>{const a=l=>{if(l.target&&!r.current){let c=function(){aM(xU,n,u,{discrete:!0})};const u={originalEvent:l};l.pointerType==="touch"?(t.removeEventListener("click",s.current),s.current=c,t.addEventListener("click",s.current,{once:!0})):c()}else t.removeEventListener("click",s.current);r.current=!1},o=window.setTimeout(()=>{t.addEventListener("pointerdown",a)},0);return()=>{window.clearTimeout(o),t.removeEventListener("pointerdown",a),t.removeEventListener("click",s.current)}},[t,n]),{onPointerDownCapture:()=>r.current=!0}}function NU(e,t=globalThis==null?void 0:globalThis.document){const n=Hn(e),r=v.useRef(!1);return v.useEffect(()=>{const s=a=>{a.target&&!r.current&&aM(bU,n,{originalEvent:a},{discrete:!1})};return t.addEventListener("focusin",s),()=>t.removeEventListener("focusin",s)},[t,n]),{onFocusCapture:()=>r.current=!0,onBlurCapture:()=>r.current=!1}}function oA(){const e=new CustomEvent(Zb);document.dispatchEvent(e)}function aM(e,t,n,{discrete:r}){const s=n.originalEvent.target,a=new CustomEvent(e,{bubbles:!1,cancelable:!0,detail:n});t&&s.addEventListener(e,t,{once:!0}),r?rM(s,a):s.dispatchEvent(a)}var ir=globalThis!=null&&globalThis.document?v.useLayoutEffect:()=>{},_U=Qk.useId||(()=>{}),PU=0;function Ys(e){const[t,n]=v.useState(_U());return ir(()=>{n(r=>r??String(PU++))},[e]),t?`radix-${t}`:""}const AU=["top","right","bottom","left"],jo=Math.min,ns=Math.max,sg=Math.round,Wp=Math.floor,So=e=>({x:e,y:e}),CU={left:"right",right:"left",bottom:"top",top:"bottom"},EU={start:"end",end:"start"};function Qb(e,t,n){return ns(e,jo(t,n))}function gi(e,t){return typeof e=="function"?e(t):e}function vi(e){return e.split("-")[0]}function Wu(e){return e.split("-")[1]}function hS(e){return e==="x"?"y":"x"}function pS(e){return e==="y"?"height":"width"}function No(e){return["top","bottom"].includes(vi(e))?"y":"x"}function mS(e){return hS(No(e))}function OU(e,t,n){n===void 0&&(n=!1);const r=Wu(e),s=mS(e),a=pS(s);let o=s==="x"?r===(n?"end":"start")?"right":"left":r==="start"?"bottom":"top";return t.reference[a]>t.floating[a]&&(o=ag(o)),[o,ag(o)]}function kU(e){const t=ag(e);return[Jb(e),t,Jb(t)]}function Jb(e){return e.replace(/start|end/g,t=>EU[t])}function TU(e,t,n){const r=["left","right"],s=["right","left"],a=["top","bottom"],o=["bottom","top"];switch(e){case"top":case"bottom":return n?t?s:r:t?r:s;case"left":case"right":return t?a:o;default:return[]}}function $U(e,t,n,r){const s=Wu(e);let a=TU(vi(e),n==="start",r);return s&&(a=a.map(o=>o+"-"+s),t&&(a=a.concat(a.map(Jb)))),a}function ag(e){return e.replace(/left|right|bottom|top/g,t=>CU[t])}function MU(e){return{top:0,right:0,bottom:0,left:0,...e}}function iM(e){return typeof e!="number"?MU(e):{top:e,right:e,bottom:e,left:e}}function ig(e){const{x:t,y:n,width:r,height:s}=e;return{width:r,height:s,top:n,left:t,right:t+r,bottom:n+s,x:t,y:n}}function lA(e,t,n){let{reference:r,floating:s}=e;const a=No(t),o=mS(t),l=pS(o),c=vi(t),u=a==="y",d=r.x+r.width/2-s.width/2,f=r.y+r.height/2-s.height/2,h=r[l]/2-s[l]/2;let p;switch(c){case"top":p={x:d,y:r.y-s.height};break;case"bottom":p={x:d,y:r.y+r.height};break;case"right":p={x:r.x+r.width,y:f};break;case"left":p={x:r.x-s.width,y:f};break;default:p={x:r.x,y:r.y}}switch(Wu(t)){case"start":p[o]-=h*(n&&u?-1:1);break;case"end":p[o]+=h*(n&&u?-1:1);break}return p}const IU=async(e,t,n)=>{const{placement:r="bottom",strategy:s="absolute",middleware:a=[],platform:o}=n,l=a.filter(Boolean),c=await(o.isRTL==null?void 0:o.isRTL(t));let u=await o.getElementRects({reference:e,floating:t,strategy:s}),{x:d,y:f}=lA(u,r,c),h=r,p={},g=0;for(let m=0;m({name:"arrow",options:e,async fn(t){const{x:n,y:r,placement:s,rects:a,platform:o,elements:l,middlewareData:c}=t,{element:u,padding:d=0}=gi(e,t)||{};if(u==null)return{};const f=iM(d),h={x:n,y:r},p=mS(s),g=pS(p),m=await o.getDimensions(u),y=p==="y",b=y?"top":"left",x=y?"bottom":"right",w=y?"clientHeight":"clientWidth",j=a.reference[g]+a.reference[p]-h[p]-a.floating[g],S=h[p]-a.reference[p],N=await(o.getOffsetParent==null?void 0:o.getOffsetParent(u));let _=N?N[w]:0;(!_||!await(o.isElement==null?void 0:o.isElement(N)))&&(_=l.floating[w]||a.floating[g]);const P=j/2-S/2,k=_/2-m[g]/2-1,O=jo(f[b],k),M=jo(f[x],k),A=O,$=_-m[g]-M,L=_/2-m[g]/2+P,H=Qb(A,L,$),D=!c.arrow&&Wu(s)!=null&&L!==H&&a.reference[g]/2-(LL<=0)){var M,A;const L=(((M=a.flip)==null?void 0:M.index)||0)+1,H=_[L];if(H)return{data:{index:L,overflows:O},reset:{placement:H}};let D=(A=O.filter(V=>V.overflows[0]<=0).sort((V,T)=>V.overflows[1]-T.overflows[1])[0])==null?void 0:A.placement;if(!D)switch(p){case"bestFit":{var $;const V=($=O.filter(T=>{if(N){const F=No(T.placement);return F===x||F==="y"}return!0}).map(T=>[T.placement,T.overflows.filter(F=>F>0).reduce((F,q)=>F+q,0)]).sort((T,F)=>T[1]-F[1])[0])==null?void 0:$[0];V&&(D=V);break}case"initialPlacement":D=l;break}if(s!==D)return{reset:{placement:D}}}return{}}}};function cA(e,t){return{top:e.top-t.height,right:e.right-t.width,bottom:e.bottom-t.height,left:e.left-t.width}}function uA(e){return AU.some(t=>e[t]>=0)}const LU=function(e){return e===void 0&&(e={}),{name:"hide",options:e,async fn(t){const{rects:n}=t,{strategy:r="referenceHidden",...s}=gi(e,t);switch(r){case"referenceHidden":{const a=await If(t,{...s,elementContext:"reference"}),o=cA(a,n.reference);return{data:{referenceHiddenOffsets:o,referenceHidden:uA(o)}}}case"escaped":{const a=await If(t,{...s,altBoundary:!0}),o=cA(a,n.floating);return{data:{escapedOffsets:o,escaped:uA(o)}}}default:return{}}}}};async function FU(e,t){const{placement:n,platform:r,elements:s}=e,a=await(r.isRTL==null?void 0:r.isRTL(s.floating)),o=vi(n),l=Wu(n),c=No(n)==="y",u=["left","top"].includes(o)?-1:1,d=a&&c?-1:1,f=gi(t,e);let{mainAxis:h,crossAxis:p,alignmentAxis:g}=typeof f=="number"?{mainAxis:f,crossAxis:0,alignmentAxis:null}:{mainAxis:f.mainAxis||0,crossAxis:f.crossAxis||0,alignmentAxis:f.alignmentAxis};return l&&typeof g=="number"&&(p=l==="end"?g*-1:g),c?{x:p*d,y:h*u}:{x:h*u,y:p*d}}const BU=function(e){return e===void 0&&(e=0),{name:"offset",options:e,async fn(t){var n,r;const{x:s,y:a,placement:o,middlewareData:l}=t,c=await FU(t,e);return o===((n=l.offset)==null?void 0:n.placement)&&(r=l.arrow)!=null&&r.alignmentOffset?{}:{x:s+c.x,y:a+c.y,data:{...c,placement:o}}}}},zU=function(e){return e===void 0&&(e={}),{name:"shift",options:e,async fn(t){const{x:n,y:r,placement:s}=t,{mainAxis:a=!0,crossAxis:o=!1,limiter:l={fn:y=>{let{x:b,y:x}=y;return{x:b,y:x}}},...c}=gi(e,t),u={x:n,y:r},d=await If(t,c),f=No(vi(s)),h=hS(f);let p=u[h],g=u[f];if(a){const y=h==="y"?"top":"left",b=h==="y"?"bottom":"right",x=p+d[y],w=p-d[b];p=Qb(x,p,w)}if(o){const y=f==="y"?"top":"left",b=f==="y"?"bottom":"right",x=g+d[y],w=g-d[b];g=Qb(x,g,w)}const m=l.fn({...t,[h]:p,[f]:g});return{...m,data:{x:m.x-n,y:m.y-r,enabled:{[h]:a,[f]:o}}}}}},UU=function(e){return e===void 0&&(e={}),{options:e,fn(t){const{x:n,y:r,placement:s,rects:a,middlewareData:o}=t,{offset:l=0,mainAxis:c=!0,crossAxis:u=!0}=gi(e,t),d={x:n,y:r},f=No(s),h=hS(f);let p=d[h],g=d[f];const m=gi(l,t),y=typeof m=="number"?{mainAxis:m,crossAxis:0}:{mainAxis:0,crossAxis:0,...m};if(c){const w=h==="y"?"height":"width",j=a.reference[h]-a.floating[w]+y.mainAxis,S=a.reference[h]+a.reference[w]-y.mainAxis;pS&&(p=S)}if(u){var b,x;const w=h==="y"?"width":"height",j=["top","left"].includes(vi(s)),S=a.reference[f]-a.floating[w]+(j&&((b=o.offset)==null?void 0:b[f])||0)+(j?0:y.crossAxis),N=a.reference[f]+a.reference[w]+(j?0:((x=o.offset)==null?void 0:x[f])||0)-(j?y.crossAxis:0);gN&&(g=N)}return{[h]:p,[f]:g}}}},VU=function(e){return e===void 0&&(e={}),{name:"size",options:e,async fn(t){var n,r;const{placement:s,rects:a,platform:o,elements:l}=t,{apply:c=()=>{},...u}=gi(e,t),d=await If(t,u),f=vi(s),h=Wu(s),p=No(s)==="y",{width:g,height:m}=a.floating;let y,b;f==="top"||f==="bottom"?(y=f,b=h===(await(o.isRTL==null?void 0:o.isRTL(l.floating))?"start":"end")?"left":"right"):(b=f,y=h==="end"?"top":"bottom");const x=m-d.top-d.bottom,w=g-d.left-d.right,j=jo(m-d[y],x),S=jo(g-d[b],w),N=!t.middlewareData.shift;let _=j,P=S;if((n=t.middlewareData.shift)!=null&&n.enabled.x&&(P=w),(r=t.middlewareData.shift)!=null&&r.enabled.y&&(_=x),N&&!h){const O=ns(d.left,0),M=ns(d.right,0),A=ns(d.top,0),$=ns(d.bottom,0);p?P=g-2*(O!==0||M!==0?O+M:ns(d.left,d.right)):_=m-2*(A!==0||$!==0?A+$:ns(d.top,d.bottom))}await c({...t,availableWidth:P,availableHeight:_});const k=await o.getDimensions(l.floating);return g!==k.width||m!==k.height?{reset:{rects:!0}}:{}}}};function iy(){return typeof window<"u"}function Hu(e){return oM(e)?(e.nodeName||"").toLowerCase():"#document"}function is(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function Da(e){var t;return(t=(oM(e)?e.ownerDocument:e.document)||window.document)==null?void 0:t.documentElement}function oM(e){return iy()?e instanceof Node||e instanceof is(e).Node:!1}function ra(e){return iy()?e instanceof Element||e instanceof is(e).Element:!1}function ka(e){return iy()?e instanceof HTMLElement||e instanceof is(e).HTMLElement:!1}function dA(e){return!iy()||typeof ShadowRoot>"u"?!1:e instanceof ShadowRoot||e instanceof is(e).ShadowRoot}function ep(e){const{overflow:t,overflowX:n,overflowY:r,display:s}=sa(e);return/auto|scroll|overlay|hidden|clip/.test(t+r+n)&&!["inline","contents"].includes(s)}function WU(e){return["table","td","th"].includes(Hu(e))}function oy(e){return[":popover-open",":modal"].some(t=>{try{return e.matches(t)}catch{return!1}})}function gS(e){const t=vS(),n=ra(e)?sa(e):e;return n.transform!=="none"||n.perspective!=="none"||(n.containerType?n.containerType!=="normal":!1)||!t&&(n.backdropFilter?n.backdropFilter!=="none":!1)||!t&&(n.filter?n.filter!=="none":!1)||["transform","perspective","filter"].some(r=>(n.willChange||"").includes(r))||["paint","layout","strict","content"].some(r=>(n.contain||"").includes(r))}function HU(e){let t=_o(e);for(;ka(t)&&!lu(t);){if(gS(t))return t;if(oy(t))return null;t=_o(t)}return null}function vS(){return typeof CSS>"u"||!CSS.supports?!1:CSS.supports("-webkit-backdrop-filter","none")}function lu(e){return["html","body","#document"].includes(Hu(e))}function sa(e){return is(e).getComputedStyle(e)}function ly(e){return ra(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function _o(e){if(Hu(e)==="html")return e;const t=e.assignedSlot||e.parentNode||dA(e)&&e.host||Da(e);return dA(t)?t.host:t}function lM(e){const t=_o(e);return lu(t)?e.ownerDocument?e.ownerDocument.body:e.body:ka(t)&&ep(t)?t:lM(t)}function Rf(e,t,n){var r;t===void 0&&(t=[]),n===void 0&&(n=!0);const s=lM(e),a=s===((r=e.ownerDocument)==null?void 0:r.body),o=is(s);if(a){const l=ew(o);return t.concat(o,o.visualViewport||[],ep(s)?s:[],l&&n?Rf(l):[])}return t.concat(s,Rf(s,[],n))}function ew(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}function cM(e){const t=sa(e);let n=parseFloat(t.width)||0,r=parseFloat(t.height)||0;const s=ka(e),a=s?e.offsetWidth:n,o=s?e.offsetHeight:r,l=sg(n)!==a||sg(r)!==o;return l&&(n=a,r=o),{width:n,height:r,$:l}}function yS(e){return ra(e)?e:e.contextElement}function Rc(e){const t=yS(e);if(!ka(t))return So(1);const n=t.getBoundingClientRect(),{width:r,height:s,$:a}=cM(t);let o=(a?sg(n.width):n.width)/r,l=(a?sg(n.height):n.height)/s;return(!o||!Number.isFinite(o))&&(o=1),(!l||!Number.isFinite(l))&&(l=1),{x:o,y:l}}const GU=So(0);function uM(e){const t=is(e);return!vS()||!t.visualViewport?GU:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function qU(e,t,n){return t===void 0&&(t=!1),!n||t&&n!==is(e)?!1:t}function Ol(e,t,n,r){t===void 0&&(t=!1),n===void 0&&(n=!1);const s=e.getBoundingClientRect(),a=yS(e);let o=So(1);t&&(r?ra(r)&&(o=Rc(r)):o=Rc(e));const l=qU(a,n,r)?uM(a):So(0);let c=(s.left+l.x)/o.x,u=(s.top+l.y)/o.y,d=s.width/o.x,f=s.height/o.y;if(a){const h=is(a),p=r&&ra(r)?is(r):r;let g=h,m=ew(g);for(;m&&r&&p!==g;){const y=Rc(m),b=m.getBoundingClientRect(),x=sa(m),w=b.left+(m.clientLeft+parseFloat(x.paddingLeft))*y.x,j=b.top+(m.clientTop+parseFloat(x.paddingTop))*y.y;c*=y.x,u*=y.y,d*=y.x,f*=y.y,c+=w,u+=j,g=is(m),m=ew(g)}}return ig({width:d,height:f,x:c,y:u})}function KU(e){let{elements:t,rect:n,offsetParent:r,strategy:s}=e;const a=s==="fixed",o=Da(r),l=t?oy(t.floating):!1;if(r===o||l&&a)return n;let c={scrollLeft:0,scrollTop:0},u=So(1);const d=So(0),f=ka(r);if((f||!f&&!a)&&((Hu(r)!=="body"||ep(o))&&(c=ly(r)),ka(r))){const h=Ol(r);u=Rc(r),d.x=h.x+r.clientLeft,d.y=h.y+r.clientTop}return{width:n.width*u.x,height:n.height*u.y,x:n.x*u.x-c.scrollLeft*u.x+d.x,y:n.y*u.y-c.scrollTop*u.y+d.y}}function XU(e){return Array.from(e.getClientRects())}function tw(e,t){const n=ly(e).scrollLeft;return t?t.left+n:Ol(Da(e)).left+n}function YU(e){const t=Da(e),n=ly(e),r=e.ownerDocument.body,s=ns(t.scrollWidth,t.clientWidth,r.scrollWidth,r.clientWidth),a=ns(t.scrollHeight,t.clientHeight,r.scrollHeight,r.clientHeight);let o=-n.scrollLeft+tw(e);const l=-n.scrollTop;return sa(r).direction==="rtl"&&(o+=ns(t.clientWidth,r.clientWidth)-s),{width:s,height:a,x:o,y:l}}function ZU(e,t){const n=is(e),r=Da(e),s=n.visualViewport;let a=r.clientWidth,o=r.clientHeight,l=0,c=0;if(s){a=s.width,o=s.height;const u=vS();(!u||u&&t==="fixed")&&(l=s.offsetLeft,c=s.offsetTop)}return{width:a,height:o,x:l,y:c}}function QU(e,t){const n=Ol(e,!0,t==="fixed"),r=n.top+e.clientTop,s=n.left+e.clientLeft,a=ka(e)?Rc(e):So(1),o=e.clientWidth*a.x,l=e.clientHeight*a.y,c=s*a.x,u=r*a.y;return{width:o,height:l,x:c,y:u}}function fA(e,t,n){let r;if(t==="viewport")r=ZU(e,n);else if(t==="document")r=YU(Da(e));else if(ra(t))r=QU(t,n);else{const s=uM(e);r={...t,x:t.x-s.x,y:t.y-s.y}}return ig(r)}function dM(e,t){const n=_o(e);return n===t||!ra(n)||lu(n)?!1:sa(n).position==="fixed"||dM(n,t)}function JU(e,t){const n=t.get(e);if(n)return n;let r=Rf(e,[],!1).filter(l=>ra(l)&&Hu(l)!=="body"),s=null;const a=sa(e).position==="fixed";let o=a?_o(e):e;for(;ra(o)&&!lu(o);){const l=sa(o),c=gS(o);!c&&l.position==="fixed"&&(s=null),(a?!c&&!s:!c&&l.position==="static"&&!!s&&["absolute","fixed"].includes(s.position)||ep(o)&&!c&&dM(e,o))?r=r.filter(d=>d!==o):s=l,o=_o(o)}return t.set(e,r),r}function eV(e){let{element:t,boundary:n,rootBoundary:r,strategy:s}=e;const o=[...n==="clippingAncestors"?oy(t)?[]:JU(t,this._c):[].concat(n),r],l=o[0],c=o.reduce((u,d)=>{const f=fA(t,d,s);return u.top=ns(f.top,u.top),u.right=jo(f.right,u.right),u.bottom=jo(f.bottom,u.bottom),u.left=ns(f.left,u.left),u},fA(t,l,s));return{width:c.right-c.left,height:c.bottom-c.top,x:c.left,y:c.top}}function tV(e){const{width:t,height:n}=cM(e);return{width:t,height:n}}function nV(e,t,n){const r=ka(t),s=Da(t),a=n==="fixed",o=Ol(e,!0,a,t);let l={scrollLeft:0,scrollTop:0};const c=So(0);if(r||!r&&!a)if((Hu(t)!=="body"||ep(s))&&(l=ly(t)),r){const p=Ol(t,!0,a,t);c.x=p.x+t.clientLeft,c.y=p.y+t.clientTop}else s&&(c.x=tw(s));let u=0,d=0;if(s&&!r&&!a){const p=s.getBoundingClientRect();d=p.top+l.scrollTop,u=p.left+l.scrollLeft-tw(s,p)}const f=o.left+l.scrollLeft-c.x-u,h=o.top+l.scrollTop-c.y-d;return{x:f,y:h,width:o.width,height:o.height}}function i0(e){return sa(e).position==="static"}function hA(e,t){if(!ka(e)||sa(e).position==="fixed")return null;if(t)return t(e);let n=e.offsetParent;return Da(e)===n&&(n=n.ownerDocument.body),n}function fM(e,t){const n=is(e);if(oy(e))return n;if(!ka(e)){let s=_o(e);for(;s&&!lu(s);){if(ra(s)&&!i0(s))return s;s=_o(s)}return n}let r=hA(e,t);for(;r&&WU(r)&&i0(r);)r=hA(r,t);return r&&lu(r)&&i0(r)&&!gS(r)?n:r||HU(e)||n}const rV=async function(e){const t=this.getOffsetParent||fM,n=this.getDimensions,r=await n(e.floating);return{reference:nV(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:r.width,height:r.height}}};function sV(e){return sa(e).direction==="rtl"}const aV={convertOffsetParentRelativeRectToViewportRelativeRect:KU,getDocumentElement:Da,getClippingRect:eV,getOffsetParent:fM,getElementRects:rV,getClientRects:XU,getDimensions:tV,getScale:Rc,isElement:ra,isRTL:sV};function iV(e,t){let n=null,r;const s=Da(e);function a(){var l;clearTimeout(r),(l=n)==null||l.disconnect(),n=null}function o(l,c){l===void 0&&(l=!1),c===void 0&&(c=1),a();const{left:u,top:d,width:f,height:h}=e.getBoundingClientRect();if(l||t(),!f||!h)return;const p=Wp(d),g=Wp(s.clientWidth-(u+f)),m=Wp(s.clientHeight-(d+h)),y=Wp(u),x={rootMargin:-p+"px "+-g+"px "+-m+"px "+-y+"px",threshold:ns(0,jo(1,c))||1};let w=!0;function j(S){const N=S[0].intersectionRatio;if(N!==c){if(!w)return o();N?o(!1,N):r=setTimeout(()=>{o(!1,1e-7)},1e3)}w=!1}try{n=new IntersectionObserver(j,{...x,root:s.ownerDocument})}catch{n=new IntersectionObserver(j,x)}n.observe(e)}return o(!0),a}function oV(e,t,n,r){r===void 0&&(r={});const{ancestorScroll:s=!0,ancestorResize:a=!0,elementResize:o=typeof ResizeObserver=="function",layoutShift:l=typeof IntersectionObserver=="function",animationFrame:c=!1}=r,u=yS(e),d=s||a?[...u?Rf(u):[],...Rf(t)]:[];d.forEach(b=>{s&&b.addEventListener("scroll",n,{passive:!0}),a&&b.addEventListener("resize",n)});const f=u&&l?iV(u,n):null;let h=-1,p=null;o&&(p=new ResizeObserver(b=>{let[x]=b;x&&x.target===u&&p&&(p.unobserve(t),cancelAnimationFrame(h),h=requestAnimationFrame(()=>{var w;(w=p)==null||w.observe(t)})),n()}),u&&!c&&p.observe(u),p.observe(t));let g,m=c?Ol(e):null;c&&y();function y(){const b=Ol(e);m&&(b.x!==m.x||b.y!==m.y||b.width!==m.width||b.height!==m.height)&&n(),m=b,g=requestAnimationFrame(y)}return n(),()=>{var b;d.forEach(x=>{s&&x.removeEventListener("scroll",n),a&&x.removeEventListener("resize",n)}),f==null||f(),(b=p)==null||b.disconnect(),p=null,c&&cancelAnimationFrame(g)}}const lV=BU,cV=zU,uV=DU,dV=VU,fV=LU,pA=RU,hV=UU,pV=(e,t,n)=>{const r=new Map,s={platform:aV,...n},a={...s.platform,_c:r};return IU(e,t,{...s,platform:a})};var Nm=typeof document<"u"?v.useLayoutEffect:v.useEffect;function og(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,s;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(!og(e[r],t[r]))return!1;return!0}if(s=Object.keys(e),n=s.length,n!==Object.keys(t).length)return!1;for(r=n;r--!==0;)if(!{}.hasOwnProperty.call(t,s[r]))return!1;for(r=n;r--!==0;){const a=s[r];if(!(a==="_owner"&&e.$$typeof)&&!og(e[a],t[a]))return!1}return!0}return e!==e&&t!==t}function hM(e){return typeof window>"u"?1:(e.ownerDocument.defaultView||window).devicePixelRatio||1}function mA(e,t){const n=hM(e);return Math.round(t*n)/n}function o0(e){const t=v.useRef(e);return Nm(()=>{t.current=e}),t}function mV(e){e===void 0&&(e={});const{placement:t="bottom",strategy:n="absolute",middleware:r=[],platform:s,elements:{reference:a,floating:o}={},transform:l=!0,whileElementsMounted:c,open:u}=e,[d,f]=v.useState({x:0,y:0,strategy:n,placement:t,middlewareData:{},isPositioned:!1}),[h,p]=v.useState(r);og(h,r)||p(r);const[g,m]=v.useState(null),[y,b]=v.useState(null),x=v.useCallback(T=>{T!==N.current&&(N.current=T,m(T))},[]),w=v.useCallback(T=>{T!==_.current&&(_.current=T,b(T))},[]),j=a||g,S=o||y,N=v.useRef(null),_=v.useRef(null),P=v.useRef(d),k=c!=null,O=o0(c),M=o0(s),A=o0(u),$=v.useCallback(()=>{if(!N.current||!_.current)return;const T={placement:t,strategy:n,middleware:h};M.current&&(T.platform=M.current),pV(N.current,_.current,T).then(F=>{const q={...F,isPositioned:A.current!==!1};L.current&&!og(P.current,q)&&(P.current=q,Vu.flushSync(()=>{f(q)}))})},[h,t,n,M,A]);Nm(()=>{u===!1&&P.current.isPositioned&&(P.current.isPositioned=!1,f(T=>({...T,isPositioned:!1})))},[u]);const L=v.useRef(!1);Nm(()=>(L.current=!0,()=>{L.current=!1}),[]),Nm(()=>{if(j&&(N.current=j),S&&(_.current=S),j&&S){if(O.current)return O.current(j,S,$);$()}},[j,S,$,O,k]);const H=v.useMemo(()=>({reference:N,floating:_,setReference:x,setFloating:w}),[x,w]),D=v.useMemo(()=>({reference:j,floating:S}),[j,S]),V=v.useMemo(()=>{const T={position:n,left:0,top:0};if(!D.floating)return T;const F=mA(D.floating,d.x),q=mA(D.floating,d.y);return l?{...T,transform:"translate("+F+"px, "+q+"px)",...hM(D.floating)>=1.5&&{willChange:"transform"}}:{position:n,left:F,top:q}},[n,l,D.floating,d.x,d.y]);return v.useMemo(()=>({...d,update:$,refs:H,elements:D,floatingStyles:V}),[d,$,H,D,V])}const gV=e=>{function t(n){return{}.hasOwnProperty.call(n,"current")}return{name:"arrow",options:e,fn(n){const{element:r,padding:s}=typeof e=="function"?e(n):e;return r&&t(r)?r.current!=null?pA({element:r.current,padding:s}).fn(n):{}:r?pA({element:r,padding:s}).fn(n):{}}}},vV=(e,t)=>({...lV(e),options:[e,t]}),yV=(e,t)=>({...cV(e),options:[e,t]}),xV=(e,t)=>({...hV(e),options:[e,t]}),bV=(e,t)=>({...uV(e),options:[e,t]}),wV=(e,t)=>({...dV(e),options:[e,t]}),jV=(e,t)=>({...fV(e),options:[e,t]}),SV=(e,t)=>({...gV(e),options:[e,t]});var NV="Arrow",pM=v.forwardRef((e,t)=>{const{children:n,width:r=10,height:s=5,...a}=e;return i.jsx(Ye.svg,{...a,ref:t,width:r,height:s,viewBox:"0 0 30 10",preserveAspectRatio:"none",children:e.asChild?n:i.jsx("polygon",{points:"0,0 30,0 15,10"})})});pM.displayName=NV;var _V=pM;function PV(e,t=[]){let n=[];function r(a,o){const l=v.createContext(o),c=n.length;n=[...n,o];function u(f){const{scope:h,children:p,...g}=f,m=(h==null?void 0:h[e][c])||l,y=v.useMemo(()=>g,Object.values(g));return i.jsx(m.Provider,{value:y,children:p})}function d(f,h){const p=(h==null?void 0:h[e][c])||l,g=v.useContext(p);if(g)return g;if(o!==void 0)return o;throw new Error(`\`${f}\` must be used within \`${a}\``)}return u.displayName=a+"Provider",[u,d]}const s=()=>{const a=n.map(o=>v.createContext(o));return function(l){const c=(l==null?void 0:l[e])||a;return v.useMemo(()=>({[`__scope${e}`]:{...l,[e]:c}}),[l,c])}};return s.scopeName=e,[r,AV(s,...t)]}function AV(...e){const t=e[0];if(e.length===1)return t;const n=()=>{const r=e.map(s=>({useScope:s(),scopeName:s.scopeName}));return function(a){const o=r.reduce((l,{useScope:c,scopeName:u})=>{const f=c(a)[`__scope${u}`];return{...l,...f}},{});return v.useMemo(()=>({[`__scope${t.scopeName}`]:o}),[o])}};return n.scopeName=t.scopeName,n}function tp(e){const[t,n]=v.useState(void 0);return ir(()=>{if(e){n({width:e.offsetWidth,height:e.offsetHeight});const r=new ResizeObserver(s=>{if(!Array.isArray(s)||!s.length)return;const a=s[0];let o,l;if("borderBoxSize"in a){const c=a.borderBoxSize,u=Array.isArray(c)?c[0]:c;o=u.inlineSize,l=u.blockSize}else o=e.offsetWidth,l=e.offsetHeight;n({width:o,height:l})});return r.observe(e,{box:"border-box"}),()=>r.unobserve(e)}else n(void 0)},[e]),t}var xS="Popper",[mM,Gu]=PV(xS),[CV,gM]=mM(xS),vM=e=>{const{__scopePopper:t,children:n}=e,[r,s]=v.useState(null);return i.jsx(CV,{scope:t,anchor:r,onAnchorChange:s,children:n})};vM.displayName=xS;var yM="PopperAnchor",xM=v.forwardRef((e,t)=>{const{__scopePopper:n,virtualRef:r,...s}=e,a=gM(yM,n),o=v.useRef(null),l=xt(t,o);return v.useEffect(()=>{a.onAnchorChange((r==null?void 0:r.current)||o.current)}),r?null:i.jsx(Ye.div,{...s,ref:l})});xM.displayName=yM;var bS="PopperContent",[EV,OV]=mM(bS),bM=v.forwardRef((e,t)=>{var ce,De,de,be,Pe,ne;const{__scopePopper:n,side:r="bottom",sideOffset:s=0,align:a="center",alignOffset:o=0,arrowPadding:l=0,avoidCollisions:c=!0,collisionBoundary:u=[],collisionPadding:d=0,sticky:f="partial",hideWhenDetached:h=!1,updatePositionStrategy:p="optimized",onPlaced:g,...m}=e,y=gM(bS,n),[b,x]=v.useState(null),w=xt(t,Je=>x(Je)),[j,S]=v.useState(null),N=tp(j),_=(N==null?void 0:N.width)??0,P=(N==null?void 0:N.height)??0,k=r+(a!=="center"?"-"+a:""),O=typeof d=="number"?d:{top:0,right:0,bottom:0,left:0,...d},M=Array.isArray(u)?u:[u],A=M.length>0,$={padding:O,boundary:M.filter(TV),altBoundary:A},{refs:L,floatingStyles:H,placement:D,isPositioned:V,middlewareData:T}=mV({strategy:"fixed",placement:k,whileElementsMounted:(...Je)=>oV(...Je,{animationFrame:p==="always"}),elements:{reference:y.anchor},middleware:[vV({mainAxis:s+P,alignmentAxis:o}),c&&yV({mainAxis:!0,crossAxis:!1,limiter:f==="partial"?xV():void 0,...$}),c&&bV({...$}),wV({...$,apply:({elements:Je,rects:ve,availableWidth:at,availableHeight:st})=>{const{width:Mt,height:C}=ve.reference,R=Je.floating.style;R.setProperty("--radix-popper-available-width",`${at}px`),R.setProperty("--radix-popper-available-height",`${st}px`),R.setProperty("--radix-popper-anchor-width",`${Mt}px`),R.setProperty("--radix-popper-anchor-height",`${C}px`)}}),j&&SV({element:j,padding:l}),$V({arrowWidth:_,arrowHeight:P}),h&&jV({strategy:"referenceHidden",...$})]}),[F,q]=SM(D),Z=Hn(g);ir(()=>{V&&(Z==null||Z())},[V,Z]);const re=(ce=T.arrow)==null?void 0:ce.x,ge=(De=T.arrow)==null?void 0:De.y,B=((de=T.arrow)==null?void 0:de.centerOffset)!==0,[le,se]=v.useState();return ir(()=>{b&&se(window.getComputedStyle(b).zIndex)},[b]),i.jsx("div",{ref:L.setFloating,"data-radix-popper-content-wrapper":"",style:{...H,transform:V?H.transform:"translate(0, -200%)",minWidth:"max-content",zIndex:le,"--radix-popper-transform-origin":[(be=T.transformOrigin)==null?void 0:be.x,(Pe=T.transformOrigin)==null?void 0:Pe.y].join(" "),...((ne=T.hide)==null?void 0:ne.referenceHidden)&&{visibility:"hidden",pointerEvents:"none"}},dir:e.dir,children:i.jsx(EV,{scope:n,placedSide:F,onArrowChange:S,arrowX:re,arrowY:ge,shouldHideArrow:B,children:i.jsx(Ye.div,{"data-side":F,"data-align":q,...m,ref:w,style:{...m.style,animation:V?void 0:"none"}})})})});bM.displayName=bS;var wM="PopperArrow",kV={top:"bottom",right:"left",bottom:"top",left:"right"},jM=v.forwardRef(function(t,n){const{__scopePopper:r,...s}=t,a=OV(wM,r),o=kV[a.placedSide];return i.jsx("span",{ref:a.onArrowChange,style:{position:"absolute",left:a.arrowX,top:a.arrowY,[o]:0,transformOrigin:{top:"",right:"0 0",bottom:"center 0",left:"100% 0"}[a.placedSide],transform:{top:"translateY(100%)",right:"translateY(50%) rotate(90deg) translateX(-50%)",bottom:"rotate(180deg)",left:"translateY(50%) rotate(-90deg) translateX(50%)"}[a.placedSide],visibility:a.shouldHideArrow?"hidden":void 0},children:i.jsx(_V,{...s,ref:n,style:{...s.style,display:"block"}})})});jM.displayName=wM;function TV(e){return e!==null}var $V=e=>({name:"transformOrigin",options:e,fn(t){var y,b,x;const{placement:n,rects:r,middlewareData:s}=t,o=((y=s.arrow)==null?void 0:y.centerOffset)!==0,l=o?0:e.arrowWidth,c=o?0:e.arrowHeight,[u,d]=SM(n),f={start:"0%",center:"50%",end:"100%"}[d],h=(((b=s.arrow)==null?void 0:b.x)??0)+l/2,p=(((x=s.arrow)==null?void 0:x.y)??0)+c/2;let g="",m="";return u==="bottom"?(g=o?f:`${h}px`,m=`${-c}px`):u==="top"?(g=o?f:`${h}px`,m=`${r.floating.height+c}px`):u==="right"?(g=`${-c}px`,m=o?f:`${p}px`):u==="left"&&(g=`${r.floating.width+c}px`,m=o?f:`${p}px`),{data:{x:g,y:m}}}});function SM(e){const[t,n="center"]=e.split("-");return[t,n]}var NM=vM,wS=xM,jS=bM,SS=jM,MV="Portal",cy=v.forwardRef((e,t)=>{var l;const{container:n,...r}=e,[s,a]=v.useState(!1);ir(()=>a(!0),[]);const o=n||s&&((l=globalThis==null?void 0:globalThis.document)==null?void 0:l.body);return o?tM.createPortal(i.jsx(Ye.div,{...r,ref:t}),o):null});cy.displayName=MV;function IV(e,t){return v.useReducer((n,r)=>t[n][r]??n,e)}var lr=e=>{const{present:t,children:n}=e,r=RV(t),s=typeof n=="function"?n({present:r.isPresent}):v.Children.only(n),a=xt(r.ref,DV(s));return typeof n=="function"||r.isPresent?v.cloneElement(s,{ref:a}):null};lr.displayName="Presence";function RV(e){const[t,n]=v.useState(),r=v.useRef({}),s=v.useRef(e),a=v.useRef("none"),o=e?"mounted":"unmounted",[l,c]=IV(o,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return v.useEffect(()=>{const u=Hp(r.current);a.current=l==="mounted"?u:"none"},[l]),ir(()=>{const u=r.current,d=s.current;if(d!==e){const h=a.current,p=Hp(u);e?c("MOUNT"):p==="none"||(u==null?void 0:u.display)==="none"?c("UNMOUNT"):c(d&&h!==p?"ANIMATION_OUT":"UNMOUNT"),s.current=e}},[e,c]),ir(()=>{if(t){let u;const d=t.ownerDocument.defaultView??window,f=p=>{const m=Hp(r.current).includes(p.animationName);if(p.target===t&&m&&(c("ANIMATION_END"),!s.current)){const y=t.style.animationFillMode;t.style.animationFillMode="forwards",u=d.setTimeout(()=>{t.style.animationFillMode==="forwards"&&(t.style.animationFillMode=y)})}},h=p=>{p.target===t&&(a.current=Hp(r.current))};return t.addEventListener("animationstart",h),t.addEventListener("animationcancel",f),t.addEventListener("animationend",f),()=>{d.clearTimeout(u),t.removeEventListener("animationstart",h),t.removeEventListener("animationcancel",f),t.removeEventListener("animationend",f)}}else c("ANIMATION_END")},[t,c]),{isPresent:["mounted","unmountSuspended"].includes(l),ref:v.useCallback(u=>{u&&(r.current=getComputedStyle(u)),n(u)},[])}}function Hp(e){return(e==null?void 0:e.animationName)||"none"}function DV(e){var r,s;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=(s=Object.getOwnPropertyDescriptor(e,"ref"))==null?void 0:s.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}function aa({prop:e,defaultProp:t,onChange:n=()=>{}}){const[r,s]=LV({defaultProp:t,onChange:n}),a=e!==void 0,o=a?e:r,l=Hn(n),c=v.useCallback(u=>{if(a){const f=typeof u=="function"?u(e):u;f!==e&&l(f)}else s(u)},[a,e,s,l]);return[o,c]}function LV({defaultProp:e,onChange:t}){const n=v.useState(e),[r]=n,s=v.useRef(r),a=Hn(t);return v.useEffect(()=>{s.current!==r&&(a(r),s.current=r)},[r,s,a]),n}var FV="VisuallyHidden",NS=v.forwardRef((e,t)=>i.jsx(Ye.span,{...e,ref:t,style:{position:"absolute",border:0,width:1,height:1,padding:0,margin:-1,overflow:"hidden",clip:"rect(0, 0, 0, 0)",whiteSpace:"nowrap",wordWrap:"normal",...e.style}}));NS.displayName=FV;var BV=NS,[uy,jPe]=Gr("Tooltip",[Gu]),_S=Gu(),_M="TooltipProvider",zV=700,gA="tooltip.open",[UV,PM]=uy(_M),AM=e=>{const{__scopeTooltip:t,delayDuration:n=zV,skipDelayDuration:r=300,disableHoverableContent:s=!1,children:a}=e,[o,l]=v.useState(!0),c=v.useRef(!1),u=v.useRef(0);return v.useEffect(()=>{const d=u.current;return()=>window.clearTimeout(d)},[]),i.jsx(UV,{scope:t,isOpenDelayed:o,delayDuration:n,onOpen:v.useCallback(()=>{window.clearTimeout(u.current),l(!1)},[]),onClose:v.useCallback(()=>{window.clearTimeout(u.current),u.current=window.setTimeout(()=>l(!0),r)},[r]),isPointerInTransitRef:c,onPointerInTransitChange:v.useCallback(d=>{c.current=d},[]),disableHoverableContent:s,children:a})};AM.displayName=_M;var CM="Tooltip",[SPe,dy]=uy(CM),nw="TooltipTrigger",VV=v.forwardRef((e,t)=>{const{__scopeTooltip:n,...r}=e,s=dy(nw,n),a=PM(nw,n),o=_S(n),l=v.useRef(null),c=xt(t,l,s.onTriggerChange),u=v.useRef(!1),d=v.useRef(!1),f=v.useCallback(()=>u.current=!1,[]);return v.useEffect(()=>()=>document.removeEventListener("pointerup",f),[f]),i.jsx(wS,{asChild:!0,...o,children:i.jsx(Ye.button,{"aria-describedby":s.open?s.contentId:void 0,"data-state":s.stateAttribute,...r,ref:c,onPointerMove:Ee(e.onPointerMove,h=>{h.pointerType!=="touch"&&!d.current&&!a.isPointerInTransitRef.current&&(s.onTriggerEnter(),d.current=!0)}),onPointerLeave:Ee(e.onPointerLeave,()=>{s.onTriggerLeave(),d.current=!1}),onPointerDown:Ee(e.onPointerDown,()=>{u.current=!0,document.addEventListener("pointerup",f,{once:!0})}),onFocus:Ee(e.onFocus,()=>{u.current||s.onOpen()}),onBlur:Ee(e.onBlur,s.onClose),onClick:Ee(e.onClick,s.onClose)})})});VV.displayName=nw;var WV="TooltipPortal",[NPe,HV]=uy(WV,{forceMount:void 0}),cu="TooltipContent",EM=v.forwardRef((e,t)=>{const n=HV(cu,e.__scopeTooltip),{forceMount:r=n.forceMount,side:s="top",...a}=e,o=dy(cu,e.__scopeTooltip);return i.jsx(lr,{present:r||o.open,children:o.disableHoverableContent?i.jsx(OM,{side:s,...a,ref:t}):i.jsx(GV,{side:s,...a,ref:t})})}),GV=v.forwardRef((e,t)=>{const n=dy(cu,e.__scopeTooltip),r=PM(cu,e.__scopeTooltip),s=v.useRef(null),a=xt(t,s),[o,l]=v.useState(null),{trigger:c,onClose:u}=n,d=s.current,{onPointerInTransitChange:f}=r,h=v.useCallback(()=>{l(null),f(!1)},[f]),p=v.useCallback((g,m)=>{const y=g.currentTarget,b={x:g.clientX,y:g.clientY},x=YV(b,y.getBoundingClientRect()),w=ZV(b,x),j=QV(m.getBoundingClientRect()),S=e7([...w,...j]);l(S),f(!0)},[f]);return v.useEffect(()=>()=>h(),[h]),v.useEffect(()=>{if(c&&d){const g=y=>p(y,d),m=y=>p(y,c);return c.addEventListener("pointerleave",g),d.addEventListener("pointerleave",m),()=>{c.removeEventListener("pointerleave",g),d.removeEventListener("pointerleave",m)}}},[c,d,p,h]),v.useEffect(()=>{if(o){const g=m=>{const y=m.target,b={x:m.clientX,y:m.clientY},x=(c==null?void 0:c.contains(y))||(d==null?void 0:d.contains(y)),w=!JV(b,o);x?h():w&&(h(),u())};return document.addEventListener("pointermove",g),()=>document.removeEventListener("pointermove",g)}},[c,d,o,u,h]),i.jsx(OM,{...e,ref:a})}),[qV,KV]=uy(CM,{isInside:!1}),OM=v.forwardRef((e,t)=>{const{__scopeTooltip:n,children:r,"aria-label":s,onEscapeKeyDown:a,onPointerDownOutside:o,...l}=e,c=dy(cu,n),u=_S(n),{onClose:d}=c;return v.useEffect(()=>(document.addEventListener(gA,d),()=>document.removeEventListener(gA,d)),[d]),v.useEffect(()=>{if(c.trigger){const f=h=>{const p=h.target;p!=null&&p.contains(c.trigger)&&d()};return window.addEventListener("scroll",f,{capture:!0}),()=>window.removeEventListener("scroll",f,{capture:!0})}},[c.trigger,d]),i.jsx(Jh,{asChild:!0,disableOutsidePointerEvents:!1,onEscapeKeyDown:a,onPointerDownOutside:o,onFocusOutside:f=>f.preventDefault(),onDismiss:d,children:i.jsxs(jS,{"data-state":c.stateAttribute,...u,...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:[i.jsx(fS,{children:r}),i.jsx(qV,{scope:n,isInside:!0,children:i.jsx(BV,{id:c.contentId,role:"tooltip",children:s||r})})]})})});EM.displayName=cu;var kM="TooltipArrow",XV=v.forwardRef((e,t)=>{const{__scopeTooltip:n,...r}=e,s=_S(n);return KV(kM,n).isInside?null:i.jsx(SS,{...s,...r,ref:t})});XV.displayName=kM;function YV(e,t){const n=Math.abs(t.top-e.y),r=Math.abs(t.bottom-e.y),s=Math.abs(t.right-e.x),a=Math.abs(t.left-e.x);switch(Math.min(n,r,s,a)){case a:return"left";case s:return"right";case n:return"top";case r:return"bottom";default:throw new Error("unreachable")}}function ZV(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 QV(e){const{top:t,right:n,bottom:r,left:s}=e;return[{x:s,y:t},{x:n,y:t},{x:n,y:r},{x:s,y:r}]}function JV(e,t){const{x:n,y:r}=e;let s=!1;for(let a=0,o=t.length-1;ar!=d>r&&n<(u-l)*(r-c)/(d-c)+l&&(s=!s)}return s}function e7(e){const t=e.slice();return t.sort((n,r)=>n.xr.x?1:n.yr.y?1:0),t7(t)}function t7(e){if(e.length<=1)return e.slice();const t=[];for(let r=0;r=2;){const a=t[t.length-1],o=t[t.length-2];if((a.x-o.x)*(s.y-o.y)>=(a.y-o.y)*(s.x-o.x))t.pop();else break}t.push(s)}t.pop();const n=[];for(let r=e.length-1;r>=0;r--){const s=e[r];for(;n.length>=2;){const a=n[n.length-1],o=n[n.length-2];if((a.x-o.x)*(s.y-o.y)>=(a.y-o.y)*(s.x-o.x))n.pop();else break}n.push(s)}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 n7=AM,TM=EM;function $M(e){var t,n,r="";if(typeof e=="string"||typeof e=="number")r+=e;else if(typeof e=="object")if(Array.isArray(e)){var s=e.length;for(t=0;t{const t=a7(e),{conflictingClassGroups:n,conflictingClassGroupModifiers:r}=e;return{getClassGroupId:o=>{const l=o.split(PS);return l[0]===""&&l.length!==1&&l.shift(),MM(l,t)||s7(o)},getConflictingClassGroupIds:(o,l)=>{const c=n[o]||[];return l&&r[o]?[...c,...r[o]]:c}}},MM=(e,t)=>{var o;if(e.length===0)return t.classGroupId;const n=e[0],r=t.nextPart.get(n),s=r?MM(e.slice(1),r):void 0;if(s)return s;if(t.validators.length===0)return;const a=e.join(PS);return(o=t.validators.find(({validator:l})=>l(a)))==null?void 0:o.classGroupId},vA=/^\[(.+)\]$/,s7=e=>{if(vA.test(e)){const t=vA.exec(e)[1],n=t==null?void 0:t.substring(0,t.indexOf(":"));if(n)return"arbitrary.."+n}},a7=e=>{const{theme:t,prefix:n}=e,r={nextPart:new Map,validators:[]};return o7(Object.entries(e.classGroups),n).forEach(([a,o])=>{rw(o,r,a,t)}),r},rw=(e,t,n,r)=>{e.forEach(s=>{if(typeof s=="string"){const a=s===""?t:yA(t,s);a.classGroupId=n;return}if(typeof s=="function"){if(i7(s)){rw(s(r),t,n,r);return}t.validators.push({validator:s,classGroupId:n});return}Object.entries(s).forEach(([a,o])=>{rw(o,yA(t,a),n,r)})})},yA=(e,t)=>{let n=e;return t.split(PS).forEach(r=>{n.nextPart.has(r)||n.nextPart.set(r,{nextPart:new Map,validators:[]}),n=n.nextPart.get(r)}),n},i7=e=>e.isThemeGetter,o7=(e,t)=>t?e.map(([n,r])=>{const s=r.map(a=>typeof a=="string"?t+a:typeof a=="object"?Object.fromEntries(Object.entries(a).map(([o,l])=>[t+o,l])):a);return[n,s]}):e,l7=e=>{if(e<1)return{get:()=>{},set:()=>{}};let t=0,n=new Map,r=new Map;const s=(a,o)=>{n.set(a,o),t++,t>e&&(t=0,r=n,n=new Map)};return{get(a){let o=n.get(a);if(o!==void 0)return o;if((o=r.get(a))!==void 0)return s(a,o),o},set(a,o){n.has(a)?n.set(a,o):s(a,o)}}},IM="!",c7=e=>{const{separator:t,experimentalParseClassName:n}=e,r=t.length===1,s=t[0],a=t.length,o=l=>{const c=[];let u=0,d=0,f;for(let y=0;yd?f-d:void 0;return{modifiers:c,hasImportantModifier:p,baseClassName:g,maybePostfixModifierPosition:m}};return n?l=>n({className:l,parseClassName:o}):o},u7=e=>{if(e.length<=1)return e;const t=[];let n=[];return e.forEach(r=>{r[0]==="["?(t.push(...n.sort(),r),n=[]):n.push(r)}),t.push(...n.sort()),t},d7=e=>({cache:l7(e.cacheSize),parseClassName:c7(e),...r7(e)}),f7=/\s+/,h7=(e,t)=>{const{parseClassName:n,getClassGroupId:r,getConflictingClassGroupIds:s}=t,a=[],o=e.trim().split(f7);let l="";for(let c=o.length-1;c>=0;c-=1){const u=o[c],{modifiers:d,hasImportantModifier:f,baseClassName:h,maybePostfixModifierPosition:p}=n(u);let g=!!p,m=r(g?h.substring(0,p):h);if(!m){if(!g){l=u+(l.length>0?" "+l:l);continue}if(m=r(h),!m){l=u+(l.length>0?" "+l:l);continue}g=!1}const y=u7(d).join(":"),b=f?y+IM:y,x=b+m;if(a.includes(x))continue;a.push(x);const w=s(m,g);for(let j=0;j0?" "+l:l)}return l};function p7(){let e=0,t,n,r="";for(;e{if(typeof e=="string")return e;let t,n="";for(let r=0;rf(d),e());return n=d7(u),r=n.cache.get,s=n.cache.set,a=l,l(c)}function l(c){const u=r(c);if(u)return u;const d=h7(c,n);return s(c,d),d}return function(){return a(p7.apply(null,arguments))}}const on=e=>{const t=n=>n[e]||[];return t.isThemeGetter=!0,t},DM=/^\[(?:([a-z-]+):)?(.+)\]$/i,g7=/^\d+\/\d+$/,v7=new Set(["px","full","screen"]),y7=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,x7=/\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$/,b7=/^(rgba?|hsla?|hwb|(ok)?(lab|lch))\(.+\)$/,w7=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,j7=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,Ua=e=>Dc(e)||v7.has(e)||g7.test(e),Ti=e=>qu(e,"length",O7),Dc=e=>!!e&&!Number.isNaN(Number(e)),l0=e=>qu(e,"number",Dc),Pd=e=>!!e&&Number.isInteger(Number(e)),S7=e=>e.endsWith("%")&&Dc(e.slice(0,-1)),At=e=>DM.test(e),$i=e=>y7.test(e),N7=new Set(["length","size","percentage"]),_7=e=>qu(e,N7,LM),P7=e=>qu(e,"position",LM),A7=new Set(["image","url"]),C7=e=>qu(e,A7,T7),E7=e=>qu(e,"",k7),Ad=()=>!0,qu=(e,t,n)=>{const r=DM.exec(e);return r?r[1]?typeof t=="string"?r[1]===t:t.has(r[1]):n(r[2]):!1},O7=e=>x7.test(e)&&!b7.test(e),LM=()=>!1,k7=e=>w7.test(e),T7=e=>j7.test(e),$7=()=>{const e=on("colors"),t=on("spacing"),n=on("blur"),r=on("brightness"),s=on("borderColor"),a=on("borderRadius"),o=on("borderSpacing"),l=on("borderWidth"),c=on("contrast"),u=on("grayscale"),d=on("hueRotate"),f=on("invert"),h=on("gap"),p=on("gradientColorStops"),g=on("gradientColorStopPositions"),m=on("inset"),y=on("margin"),b=on("opacity"),x=on("padding"),w=on("saturate"),j=on("scale"),S=on("sepia"),N=on("skew"),_=on("space"),P=on("translate"),k=()=>["auto","contain","none"],O=()=>["auto","hidden","clip","visible","scroll"],M=()=>["auto",At,t],A=()=>[At,t],$=()=>["",Ua,Ti],L=()=>["auto",Dc,At],H=()=>["bottom","center","left","left-bottom","left-top","right","right-bottom","right-top","top"],D=()=>["solid","dashed","dotted","double","none"],V=()=>["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity"],T=()=>["start","end","center","between","around","evenly","stretch"],F=()=>["","0",At],q=()=>["auto","avoid","all","avoid-page","page","left","right","column"],Z=()=>[Dc,At];return{cacheSize:500,separator:":",theme:{colors:[Ad],spacing:[Ua,Ti],blur:["none","",$i,At],brightness:Z(),borderColor:[e],borderRadius:["none","","full",$i,At],borderSpacing:A(),borderWidth:$(),contrast:Z(),grayscale:F(),hueRotate:Z(),invert:F(),gap:A(),gradientColorStops:[e],gradientColorStopPositions:[S7,Ti],inset:M(),margin:M(),opacity:Z(),padding:A(),saturate:Z(),scale:Z(),sepia:F(),skew:Z(),space:A(),translate:A()},classGroups:{aspect:[{aspect:["auto","square","video",At]}],container:["container"],columns:[{columns:[$i]}],"break-after":[{"break-after":q()}],"break-before":[{"break-before":q()}],"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"],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:[...H(),At]}],overflow:[{overflow:O()}],"overflow-x":[{"overflow-x":O()}],"overflow-y":[{"overflow-y":O()}],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:["auto",Pd,At]}],basis:[{basis:M()}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["wrap","wrap-reverse","nowrap"]}],flex:[{flex:["1","auto","initial","none",At]}],grow:[{grow:F()}],shrink:[{shrink:F()}],order:[{order:["first","last","none",Pd,At]}],"grid-cols":[{"grid-cols":[Ad]}],"col-start-end":[{col:["auto",{span:["full",Pd,At]},At]}],"col-start":[{"col-start":L()}],"col-end":[{"col-end":L()}],"grid-rows":[{"grid-rows":[Ad]}],"row-start-end":[{row:["auto",{span:[Pd,At]},At]}],"row-start":[{"row-start":L()}],"row-end":[{"row-end":L()}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":["auto","min","max","fr",At]}],"auto-rows":[{"auto-rows":["auto","min","max","fr",At]}],gap:[{gap:[h]}],"gap-x":[{"gap-x":[h]}],"gap-y":[{"gap-y":[h]}],"justify-content":[{justify:["normal",...T()]}],"justify-items":[{"justify-items":["start","end","center","stretch"]}],"justify-self":[{"justify-self":["auto","start","end","center","stretch"]}],"align-content":[{content:["normal",...T(),"baseline"]}],"align-items":[{items:["start","end","center","baseline","stretch"]}],"align-self":[{self:["auto","start","end","center","stretch","baseline"]}],"place-content":[{"place-content":[...T(),"baseline"]}],"place-items":[{"place-items":["start","end","center","baseline","stretch"]}],"place-self":[{"place-self":["auto","start","end","center","stretch"]}],p:[{p:[x]}],px:[{px:[x]}],py:[{py:[x]}],ps:[{ps:[x]}],pe:[{pe:[x]}],pt:[{pt:[x]}],pr:[{pr:[x]}],pb:[{pb:[x]}],pl:[{pl:[x]}],m:[{m:[y]}],mx:[{mx:[y]}],my:[{my:[y]}],ms:[{ms:[y]}],me:[{me:[y]}],mt:[{mt:[y]}],mr:[{mr:[y]}],mb:[{mb:[y]}],ml:[{ml:[y]}],"space-x":[{"space-x":[_]}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":[_]}],"space-y-reverse":["space-y-reverse"],w:[{w:["auto","min","max","fit","svw","lvw","dvw",At,t]}],"min-w":[{"min-w":[At,t,"min","max","fit"]}],"max-w":[{"max-w":[At,t,"none","full","min","max","fit","prose",{screen:[$i]},$i]}],h:[{h:[At,t,"auto","min","max","fit","svh","lvh","dvh"]}],"min-h":[{"min-h":[At,t,"min","max","fit","svh","lvh","dvh"]}],"max-h":[{"max-h":[At,t,"min","max","fit","svh","lvh","dvh"]}],size:[{size:[At,t,"auto","min","max","fit"]}],"font-size":[{text:["base",$i,Ti]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:["thin","extralight","light","normal","medium","semibold","bold","extrabold","black",l0]}],"font-family":[{font:[Ad]}],"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-fractons"],tracking:[{tracking:["tighter","tight","normal","wide","wider","widest",At]}],"line-clamp":[{"line-clamp":["none",Dc,l0]}],leading:[{leading:["none","tight","snug","normal","relaxed","loose",Ua,At]}],"list-image":[{"list-image":["none",At]}],"list-style-type":[{list:["none","disc","decimal",At]}],"list-style-position":[{list:["inside","outside"]}],"placeholder-color":[{placeholder:[e]}],"placeholder-opacity":[{"placeholder-opacity":[b]}],"text-alignment":[{text:["left","center","right","justify","start","end"]}],"text-color":[{text:[e]}],"text-opacity":[{"text-opacity":[b]}],"text-decoration":["underline","overline","line-through","no-underline"],"text-decoration-style":[{decoration:[...D(),"wavy"]}],"text-decoration-thickness":[{decoration:["auto","from-font",Ua,Ti]}],"underline-offset":[{"underline-offset":["auto",Ua,At]}],"text-decoration-color":[{decoration:[e]}],"text-transform":["uppercase","lowercase","capitalize","normal-case"],"text-overflow":["truncate","text-ellipsis","text-clip"],"text-wrap":[{text:["wrap","nowrap","balance","pretty"]}],indent:[{indent:A()}],"vertical-align":[{align:["baseline","top","middle","bottom","text-top","text-bottom","sub","super",At]}],whitespace:[{whitespace:["normal","nowrap","pre","pre-line","pre-wrap","break-spaces"]}],break:[{break:["normal","words","all","keep"]}],hyphens:[{hyphens:["none","manual","auto"]}],content:[{content:["none",At]}],"bg-attachment":[{bg:["fixed","local","scroll"]}],"bg-clip":[{"bg-clip":["border","padding","content","text"]}],"bg-opacity":[{"bg-opacity":[b]}],"bg-origin":[{"bg-origin":["border","padding","content"]}],"bg-position":[{bg:[...H(),P7]}],"bg-repeat":[{bg:["no-repeat",{repeat:["","x","y","round","space"]}]}],"bg-size":[{bg:["auto","cover","contain",_7]}],"bg-image":[{bg:["none",{"gradient-to":["t","tr","r","br","b","bl","l","tl"]},C7]}],"bg-color":[{bg:[e]}],"gradient-from-pos":[{from:[g]}],"gradient-via-pos":[{via:[g]}],"gradient-to-pos":[{to:[g]}],"gradient-from":[{from:[p]}],"gradient-via":[{via:[p]}],"gradient-to":[{to:[p]}],rounded:[{rounded:[a]}],"rounded-s":[{"rounded-s":[a]}],"rounded-e":[{"rounded-e":[a]}],"rounded-t":[{"rounded-t":[a]}],"rounded-r":[{"rounded-r":[a]}],"rounded-b":[{"rounded-b":[a]}],"rounded-l":[{"rounded-l":[a]}],"rounded-ss":[{"rounded-ss":[a]}],"rounded-se":[{"rounded-se":[a]}],"rounded-ee":[{"rounded-ee":[a]}],"rounded-es":[{"rounded-es":[a]}],"rounded-tl":[{"rounded-tl":[a]}],"rounded-tr":[{"rounded-tr":[a]}],"rounded-br":[{"rounded-br":[a]}],"rounded-bl":[{"rounded-bl":[a]}],"border-w":[{border:[l]}],"border-w-x":[{"border-x":[l]}],"border-w-y":[{"border-y":[l]}],"border-w-s":[{"border-s":[l]}],"border-w-e":[{"border-e":[l]}],"border-w-t":[{"border-t":[l]}],"border-w-r":[{"border-r":[l]}],"border-w-b":[{"border-b":[l]}],"border-w-l":[{"border-l":[l]}],"border-opacity":[{"border-opacity":[b]}],"border-style":[{border:[...D(),"hidden"]}],"divide-x":[{"divide-x":[l]}],"divide-x-reverse":["divide-x-reverse"],"divide-y":[{"divide-y":[l]}],"divide-y-reverse":["divide-y-reverse"],"divide-opacity":[{"divide-opacity":[b]}],"divide-style":[{divide:D()}],"border-color":[{border:[s]}],"border-color-x":[{"border-x":[s]}],"border-color-y":[{"border-y":[s]}],"border-color-s":[{"border-s":[s]}],"border-color-e":[{"border-e":[s]}],"border-color-t":[{"border-t":[s]}],"border-color-r":[{"border-r":[s]}],"border-color-b":[{"border-b":[s]}],"border-color-l":[{"border-l":[s]}],"divide-color":[{divide:[s]}],"outline-style":[{outline:["",...D()]}],"outline-offset":[{"outline-offset":[Ua,At]}],"outline-w":[{outline:[Ua,Ti]}],"outline-color":[{outline:[e]}],"ring-w":[{ring:$()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:[e]}],"ring-opacity":[{"ring-opacity":[b]}],"ring-offset-w":[{"ring-offset":[Ua,Ti]}],"ring-offset-color":[{"ring-offset":[e]}],shadow:[{shadow:["","inner","none",$i,E7]}],"shadow-color":[{shadow:[Ad]}],opacity:[{opacity:[b]}],"mix-blend":[{"mix-blend":[...V(),"plus-lighter","plus-darker"]}],"bg-blend":[{"bg-blend":V()}],filter:[{filter:["","none"]}],blur:[{blur:[n]}],brightness:[{brightness:[r]}],contrast:[{contrast:[c]}],"drop-shadow":[{"drop-shadow":["","none",$i,At]}],grayscale:[{grayscale:[u]}],"hue-rotate":[{"hue-rotate":[d]}],invert:[{invert:[f]}],saturate:[{saturate:[w]}],sepia:[{sepia:[S]}],"backdrop-filter":[{"backdrop-filter":["","none"]}],"backdrop-blur":[{"backdrop-blur":[n]}],"backdrop-brightness":[{"backdrop-brightness":[r]}],"backdrop-contrast":[{"backdrop-contrast":[c]}],"backdrop-grayscale":[{"backdrop-grayscale":[u]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[d]}],"backdrop-invert":[{"backdrop-invert":[f]}],"backdrop-opacity":[{"backdrop-opacity":[b]}],"backdrop-saturate":[{"backdrop-saturate":[w]}],"backdrop-sepia":[{"backdrop-sepia":[S]}],"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:["none","all","","colors","opacity","shadow","transform",At]}],duration:[{duration:Z()}],ease:[{ease:["linear","in","out","in-out",At]}],delay:[{delay:Z()}],animate:[{animate:["none","spin","ping","pulse","bounce",At]}],transform:[{transform:["","gpu","none"]}],scale:[{scale:[j]}],"scale-x":[{"scale-x":[j]}],"scale-y":[{"scale-y":[j]}],rotate:[{rotate:[Pd,At]}],"translate-x":[{"translate-x":[P]}],"translate-y":[{"translate-y":[P]}],"skew-x":[{"skew-x":[N]}],"skew-y":[{"skew-y":[N]}],"transform-origin":[{origin:["center","top","top-right","right","bottom-right","bottom","bottom-left","left","top-left",At]}],accent:[{accent:["auto",e]}],appearance:[{appearance:["none","auto"]}],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",At]}],"caret-color":[{caret:[e]}],"pointer-events":[{"pointer-events":["none","auto"]}],resize:[{resize:["none","y","x",""]}],"scroll-behavior":[{scroll:["auto","smooth"]}],"scroll-m":[{"scroll-m":A()}],"scroll-mx":[{"scroll-mx":A()}],"scroll-my":[{"scroll-my":A()}],"scroll-ms":[{"scroll-ms":A()}],"scroll-me":[{"scroll-me":A()}],"scroll-mt":[{"scroll-mt":A()}],"scroll-mr":[{"scroll-mr":A()}],"scroll-mb":[{"scroll-mb":A()}],"scroll-ml":[{"scroll-ml":A()}],"scroll-p":[{"scroll-p":A()}],"scroll-px":[{"scroll-px":A()}],"scroll-py":[{"scroll-py":A()}],"scroll-ps":[{"scroll-ps":A()}],"scroll-pe":[{"scroll-pe":A()}],"scroll-pt":[{"scroll-pt":A()}],"scroll-pr":[{"scroll-pr":A()}],"scroll-pb":[{"scroll-pb":A()}],"scroll-pl":[{"scroll-pl":A()}],"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",At]}],fill:[{fill:[e,"none"]}],"stroke-w":[{stroke:[Ua,Ti,l0]}],stroke:[{stroke:[e,"none"]}],sr:["sr-only","not-sr-only"],"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-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-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"],"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"]}}},M7=m7($7);function Me(...e){return M7(wt(e))}const I7=n7,R7=v.forwardRef(({className:e,sideOffset:t=4,...n},r)=>i.jsx(TM,{ref:r,sideOffset:t,className:Me("z-50 overflow-hidden rounded-md border bg-popover px-3 py-1.5 text-sm text-popover-foreground shadow-md 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}));R7.displayName=TM.displayName;var fy=class{constructor(){this.listeners=new Set,this.subscribe=this.subscribe.bind(this)}subscribe(e){return this.listeners.add(e),this.onSubscribe(),()=>{this.listeners.delete(e),this.onUnsubscribe()}}hasListeners(){return this.listeners.size>0}onSubscribe(){}onUnsubscribe(){}},hy=typeof window>"u"||"Deno"in globalThis;function Ls(){}function D7(e,t){return typeof e=="function"?e(t):e}function L7(e){return typeof e=="number"&&e>=0&&e!==1/0}function F7(e,t){return Math.max(e+(t||0)-Date.now(),0)}function xA(e,t){return typeof e=="function"?e(t):e}function B7(e,t){return typeof e=="function"?e(t):e}function bA(e,t){const{type:n="all",exact:r,fetchStatus:s,predicate:a,queryKey:o,stale:l}=e;if(o){if(r){if(t.queryHash!==AS(o,t.options))return!1}else if(!Lf(t.queryKey,o))return!1}if(n!=="all"){const c=t.isActive();if(n==="active"&&!c||n==="inactive"&&c)return!1}return!(typeof l=="boolean"&&t.isStale()!==l||s&&s!==t.state.fetchStatus||a&&!a(t))}function wA(e,t){const{exact:n,status:r,predicate:s,mutationKey:a}=e;if(a){if(!t.options.mutationKey)return!1;if(n){if(Df(t.options.mutationKey)!==Df(a))return!1}else if(!Lf(t.options.mutationKey,a))return!1}return!(r&&t.state.status!==r||s&&!s(t))}function AS(e,t){return((t==null?void 0:t.queryKeyHashFn)||Df)(e)}function Df(e){return JSON.stringify(e,(t,n)=>sw(n)?Object.keys(n).sort().reduce((r,s)=>(r[s]=n[s],r),{}):n)}function Lf(e,t){return e===t?!0:typeof e!=typeof t?!1:e&&t&&typeof e=="object"&&typeof t=="object"?!Object.keys(t).some(n=>!Lf(e[n],t[n])):!1}function FM(e,t){if(e===t)return e;const n=jA(e)&&jA(t);if(n||sw(e)&&sw(t)){const r=n?e:Object.keys(e),s=r.length,a=n?t:Object.keys(t),o=a.length,l=n?[]:{};let c=0;for(let u=0;u{setTimeout(t,e)})}function U7(e,t,n){return typeof n.structuralSharing=="function"?n.structuralSharing(e,t):n.structuralSharing!==!1?FM(e,t):t}function V7(e,t,n=0){const r=[...e,t];return n&&r.length>n?r.slice(1):r}function W7(e,t,n=0){const r=[t,...e];return n&&r.length>n?r.slice(0,-1):r}var CS=Symbol();function BM(e,t){return!e.queryFn&&(t!=null&&t.initialPromise)?()=>t.initialPromise:!e.queryFn||e.queryFn===CS?()=>Promise.reject(new Error(`Missing queryFn: '${e.queryHash}'`)):e.queryFn}var hl,Gi,Gc,Mk,H7=(Mk=class extends fy{constructor(){super();qt(this,hl);qt(this,Gi);qt(this,Gc);Tt(this,Gc,t=>{if(!hy&&window.addEventListener){const n=()=>t();return window.addEventListener("visibilitychange",n,!1),()=>{window.removeEventListener("visibilitychange",n)}}})}onSubscribe(){pe(this,Gi)||this.setEventListener(pe(this,Gc))}onUnsubscribe(){var t;this.hasListeners()||((t=pe(this,Gi))==null||t.call(this),Tt(this,Gi,void 0))}setEventListener(t){var n;Tt(this,Gc,t),(n=pe(this,Gi))==null||n.call(this),Tt(this,Gi,t(r=>{typeof r=="boolean"?this.setFocused(r):this.onFocus()}))}setFocused(t){pe(this,hl)!==t&&(Tt(this,hl,t),this.onFocus())}onFocus(){const t=this.isFocused();this.listeners.forEach(n=>{n(t)})}isFocused(){var t;return typeof pe(this,hl)=="boolean"?pe(this,hl):((t=globalThis.document)==null?void 0:t.visibilityState)!=="hidden"}},hl=new WeakMap,Gi=new WeakMap,Gc=new WeakMap,Mk),zM=new H7,qc,qi,Kc,Ik,G7=(Ik=class extends fy{constructor(){super();qt(this,qc,!0);qt(this,qi);qt(this,Kc);Tt(this,Kc,t=>{if(!hy&&window.addEventListener){const n=()=>t(!0),r=()=>t(!1);return window.addEventListener("online",n,!1),window.addEventListener("offline",r,!1),()=>{window.removeEventListener("online",n),window.removeEventListener("offline",r)}}})}onSubscribe(){pe(this,qi)||this.setEventListener(pe(this,Kc))}onUnsubscribe(){var t;this.hasListeners()||((t=pe(this,qi))==null||t.call(this),Tt(this,qi,void 0))}setEventListener(t){var n;Tt(this,Kc,t),(n=pe(this,qi))==null||n.call(this),Tt(this,qi,t(this.setOnline.bind(this)))}setOnline(t){pe(this,qc)!==t&&(Tt(this,qc,t),this.listeners.forEach(r=>{r(t)}))}isOnline(){return pe(this,qc)}},qc=new WeakMap,qi=new WeakMap,Kc=new WeakMap,Ik),lg=new G7;function q7(){let e,t;const n=new Promise((s,a)=>{e=s,t=a});n.status="pending",n.catch(()=>{});function r(s){Object.assign(n,s),delete n.resolve,delete n.reject}return n.resolve=s=>{r({status:"fulfilled",value:s}),e(s)},n.reject=s=>{r({status:"rejected",reason:s}),t(s)},n}function K7(e){return Math.min(1e3*2**e,3e4)}function UM(e){return(e??"online")==="online"?lg.isOnline():!0}var VM=class extends Error{constructor(e){super("CancelledError"),this.revert=e==null?void 0:e.revert,this.silent=e==null?void 0:e.silent}};function c0(e){return e instanceof VM}function WM(e){let t=!1,n=0,r=!1,s;const a=q7(),o=m=>{var y;r||(h(new VM(m)),(y=e.abort)==null||y.call(e))},l=()=>{t=!0},c=()=>{t=!1},u=()=>zM.isFocused()&&(e.networkMode==="always"||lg.isOnline())&&e.canRun(),d=()=>UM(e.networkMode)&&e.canRun(),f=m=>{var y;r||(r=!0,(y=e.onSuccess)==null||y.call(e,m),s==null||s(),a.resolve(m))},h=m=>{var y;r||(r=!0,(y=e.onError)==null||y.call(e,m),s==null||s(),a.reject(m))},p=()=>new Promise(m=>{var y;s=b=>{(r||u())&&m(b)},(y=e.onPause)==null||y.call(e)}).then(()=>{var m;s=void 0,r||(m=e.onContinue)==null||m.call(e)}),g=()=>{if(r)return;let m;const y=n===0?e.initialPromise:void 0;try{m=y??e.fn()}catch(b){m=Promise.reject(b)}Promise.resolve(m).then(f).catch(b=>{var N;if(r)return;const x=e.retry??(hy?0:3),w=e.retryDelay??K7,j=typeof w=="function"?w(n,b):w,S=x===!0||typeof x=="number"&&nu()?void 0:p()).then(()=>{t?h(b):g()})})};return{promise:a,cancel:o,continue:()=>(s==null||s(),a),cancelRetry:l,continueRetry:c,canStart:d,start:()=>(d()?g():p().then(g),a)}}function X7(){let e=[],t=0,n=l=>{l()},r=l=>{l()},s=l=>setTimeout(l,0);const a=l=>{t?e.push(l):s(()=>{n(l)})},o=()=>{const l=e;e=[],l.length&&s(()=>{r(()=>{l.forEach(c=>{n(c)})})})};return{batch:l=>{let c;t++;try{c=l()}finally{t--,t||o()}return c},batchCalls:l=>(...c)=>{a(()=>{l(...c)})},schedule:a,setNotifyFunction:l=>{n=l},setBatchNotifyFunction:l=>{r=l},setScheduler:l=>{s=l}}}var Pr=X7(),pl,Rk,HM=(Rk=class{constructor(){qt(this,pl)}destroy(){this.clearGcTimeout()}scheduleGc(){this.clearGcTimeout(),L7(this.gcTime)&&Tt(this,pl,setTimeout(()=>{this.optionalRemove()},this.gcTime))}updateGcTime(e){this.gcTime=Math.max(this.gcTime||0,e??(hy?1/0:5*60*1e3))}clearGcTimeout(){pe(this,pl)&&(clearTimeout(pe(this,pl)),Tt(this,pl,void 0))}},pl=new WeakMap,Rk),Xc,Yc,ms,fr,Gh,ml,Fs,Ha,Dk,Y7=(Dk=class extends HM{constructor(t){super();qt(this,Fs);qt(this,Xc);qt(this,Yc);qt(this,ms);qt(this,fr);qt(this,Gh);qt(this,ml);Tt(this,ml,!1),Tt(this,Gh,t.defaultOptions),this.setOptions(t.options),this.observers=[],Tt(this,ms,t.cache),this.queryKey=t.queryKey,this.queryHash=t.queryHash,Tt(this,Xc,Q7(this.options)),this.state=t.state??pe(this,Xc),this.scheduleGc()}get meta(){return this.options.meta}get promise(){var t;return(t=pe(this,fr))==null?void 0:t.promise}setOptions(t){this.options={...pe(this,Gh),...t},this.updateGcTime(this.options.gcTime)}optionalRemove(){!this.observers.length&&this.state.fetchStatus==="idle"&&pe(this,ms).remove(this)}setData(t,n){const r=U7(this.state.data,t,this.options);return cr(this,Fs,Ha).call(this,{data:r,type:"success",dataUpdatedAt:n==null?void 0:n.updatedAt,manual:n==null?void 0:n.manual}),r}setState(t,n){cr(this,Fs,Ha).call(this,{type:"setState",state:t,setStateOptions:n})}cancel(t){var r,s;const n=(r=pe(this,fr))==null?void 0:r.promise;return(s=pe(this,fr))==null||s.cancel(t),n?n.then(Ls).catch(Ls):Promise.resolve()}destroy(){super.destroy(),this.cancel({silent:!0})}reset(){this.destroy(),this.setState(pe(this,Xc))}isActive(){return this.observers.some(t=>B7(t.options.enabled,this)!==!1)}isDisabled(){return this.getObserversCount()>0?!this.isActive():this.options.queryFn===CS||this.state.dataUpdateCount+this.state.errorUpdateCount===0}isStale(){return this.state.isInvalidated?!0:this.getObserversCount()>0?this.observers.some(t=>t.getCurrentResult().isStale):this.state.data===void 0}isStaleByTime(t=0){return this.state.isInvalidated||this.state.data===void 0||!F7(this.state.dataUpdatedAt,t)}onFocus(){var n;const t=this.observers.find(r=>r.shouldFetchOnWindowFocus());t==null||t.refetch({cancelRefetch:!1}),(n=pe(this,fr))==null||n.continue()}onOnline(){var n;const t=this.observers.find(r=>r.shouldFetchOnReconnect());t==null||t.refetch({cancelRefetch:!1}),(n=pe(this,fr))==null||n.continue()}addObserver(t){this.observers.includes(t)||(this.observers.push(t),this.clearGcTimeout(),pe(this,ms).notify({type:"observerAdded",query:this,observer:t}))}removeObserver(t){this.observers.includes(t)&&(this.observers=this.observers.filter(n=>n!==t),this.observers.length||(pe(this,fr)&&(pe(this,ml)?pe(this,fr).cancel({revert:!0}):pe(this,fr).cancelRetry()),this.scheduleGc()),pe(this,ms).notify({type:"observerRemoved",query:this,observer:t}))}getObserversCount(){return this.observers.length}invalidate(){this.state.isInvalidated||cr(this,Fs,Ha).call(this,{type:"invalidate"})}fetch(t,n){var c,u,d;if(this.state.fetchStatus!=="idle"){if(this.state.data!==void 0&&(n!=null&&n.cancelRefetch))this.cancel({silent:!0});else if(pe(this,fr))return pe(this,fr).continueRetry(),pe(this,fr).promise}if(t&&this.setOptions(t),!this.options.queryFn){const f=this.observers.find(h=>h.options.queryFn);f&&this.setOptions(f.options)}const r=new AbortController,s=f=>{Object.defineProperty(f,"signal",{enumerable:!0,get:()=>(Tt(this,ml,!0),r.signal)})},a=()=>{const f=BM(this.options,n),h={queryKey:this.queryKey,meta:this.meta};return s(h),Tt(this,ml,!1),this.options.persister?this.options.persister(f,h,this):f(h)},o={fetchOptions:n,options:this.options,queryKey:this.queryKey,state:this.state,fetchFn:a};s(o),(c=this.options.behavior)==null||c.onFetch(o,this),Tt(this,Yc,this.state),(this.state.fetchStatus==="idle"||this.state.fetchMeta!==((u=o.fetchOptions)==null?void 0:u.meta))&&cr(this,Fs,Ha).call(this,{type:"fetch",meta:(d=o.fetchOptions)==null?void 0:d.meta});const l=f=>{var h,p,g,m;c0(f)&&f.silent||cr(this,Fs,Ha).call(this,{type:"error",error:f}),c0(f)||((p=(h=pe(this,ms).config).onError)==null||p.call(h,f,this),(m=(g=pe(this,ms).config).onSettled)==null||m.call(g,this.state.data,f,this)),this.scheduleGc()};return Tt(this,fr,WM({initialPromise:n==null?void 0:n.initialPromise,fn:o.fetchFn,abort:r.abort.bind(r),onSuccess:f=>{var h,p,g,m;if(f===void 0){l(new Error(`${this.queryHash} data is undefined`));return}try{this.setData(f)}catch(y){l(y);return}(p=(h=pe(this,ms).config).onSuccess)==null||p.call(h,f,this),(m=(g=pe(this,ms).config).onSettled)==null||m.call(g,f,this.state.error,this),this.scheduleGc()},onError:l,onFail:(f,h)=>{cr(this,Fs,Ha).call(this,{type:"failed",failureCount:f,error:h})},onPause:()=>{cr(this,Fs,Ha).call(this,{type:"pause"})},onContinue:()=>{cr(this,Fs,Ha).call(this,{type:"continue"})},retry:o.options.retry,retryDelay:o.options.retryDelay,networkMode:o.options.networkMode,canRun:()=>!0})),pe(this,fr).start()}},Xc=new WeakMap,Yc=new WeakMap,ms=new WeakMap,fr=new WeakMap,Gh=new WeakMap,ml=new WeakMap,Fs=new WeakSet,Ha=function(t){const n=r=>{switch(t.type){case"failed":return{...r,fetchFailureCount:t.failureCount,fetchFailureReason:t.error};case"pause":return{...r,fetchStatus:"paused"};case"continue":return{...r,fetchStatus:"fetching"};case"fetch":return{...r,...Z7(r.data,this.options),fetchMeta:t.meta??null};case"success":return{...r,data:t.data,dataUpdateCount:r.dataUpdateCount+1,dataUpdatedAt:t.dataUpdatedAt??Date.now(),error:null,isInvalidated:!1,status:"success",...!t.manual&&{fetchStatus:"idle",fetchFailureCount:0,fetchFailureReason:null}};case"error":const s=t.error;return c0(s)&&s.revert&&pe(this,Yc)?{...pe(this,Yc),fetchStatus:"idle"}:{...r,error:s,errorUpdateCount:r.errorUpdateCount+1,errorUpdatedAt:Date.now(),fetchFailureCount:r.fetchFailureCount+1,fetchFailureReason:s,fetchStatus:"idle",status:"error"};case"invalidate":return{...r,isInvalidated:!0};case"setState":return{...r,...t.state}}};this.state=n(this.state),Pr.batch(()=>{this.observers.forEach(r=>{r.onQueryUpdate()}),pe(this,ms).notify({query:this,type:"updated",action:t})})},Dk);function Z7(e,t){return{fetchFailureCount:0,fetchFailureReason:null,fetchStatus:UM(t.networkMode)?"fetching":"paused",...e===void 0&&{error:null,status:"pending"}}}function Q7(e){const t=typeof e.initialData=="function"?e.initialData():e.initialData,n=t!==void 0,r=n?typeof e.initialDataUpdatedAt=="function"?e.initialDataUpdatedAt():e.initialDataUpdatedAt:0;return{data:t,dataUpdateCount:0,dataUpdatedAt:n?r??Date.now():0,error:null,errorUpdateCount:0,errorUpdatedAt:0,fetchFailureCount:0,fetchFailureReason:null,fetchMeta:null,isInvalidated:!1,status:n?"success":"pending",fetchStatus:"idle"}}var ga,Lk,J7=(Lk=class extends fy{constructor(t={}){super();qt(this,ga);this.config=t,Tt(this,ga,new Map)}build(t,n,r){const s=n.queryKey,a=n.queryHash??AS(s,n);let o=this.get(a);return o||(o=new Y7({cache:this,queryKey:s,queryHash:a,options:t.defaultQueryOptions(n),state:r,defaultOptions:t.getQueryDefaults(s)}),this.add(o)),o}add(t){pe(this,ga).has(t.queryHash)||(pe(this,ga).set(t.queryHash,t),this.notify({type:"added",query:t}))}remove(t){const n=pe(this,ga).get(t.queryHash);n&&(t.destroy(),n===t&&pe(this,ga).delete(t.queryHash),this.notify({type:"removed",query:t}))}clear(){Pr.batch(()=>{this.getAll().forEach(t=>{this.remove(t)})})}get(t){return pe(this,ga).get(t)}getAll(){return[...pe(this,ga).values()]}find(t){const n={exact:!0,...t};return this.getAll().find(r=>bA(n,r))}findAll(t={}){const n=this.getAll();return Object.keys(t).length>0?n.filter(r=>bA(t,r)):n}notify(t){Pr.batch(()=>{this.listeners.forEach(n=>{n(t)})})}onFocus(){Pr.batch(()=>{this.getAll().forEach(t=>{t.onFocus()})})}onOnline(){Pr.batch(()=>{this.getAll().forEach(t=>{t.onOnline()})})}},ga=new WeakMap,Lk),va,jr,gl,ya,Mi,Fk,e9=(Fk=class extends HM{constructor(t){super();qt(this,ya);qt(this,va);qt(this,jr);qt(this,gl);this.mutationId=t.mutationId,Tt(this,jr,t.mutationCache),Tt(this,va,[]),this.state=t.state||t9(),this.setOptions(t.options),this.scheduleGc()}setOptions(t){this.options=t,this.updateGcTime(this.options.gcTime)}get meta(){return this.options.meta}addObserver(t){pe(this,va).includes(t)||(pe(this,va).push(t),this.clearGcTimeout(),pe(this,jr).notify({type:"observerAdded",mutation:this,observer:t}))}removeObserver(t){Tt(this,va,pe(this,va).filter(n=>n!==t)),this.scheduleGc(),pe(this,jr).notify({type:"observerRemoved",mutation:this,observer:t})}optionalRemove(){pe(this,va).length||(this.state.status==="pending"?this.scheduleGc():pe(this,jr).remove(this))}continue(){var t;return((t=pe(this,gl))==null?void 0:t.continue())??this.execute(this.state.variables)}async execute(t){var s,a,o,l,c,u,d,f,h,p,g,m,y,b,x,w,j,S,N,_;Tt(this,gl,WM({fn:()=>this.options.mutationFn?this.options.mutationFn(t):Promise.reject(new Error("No mutationFn found")),onFail:(P,k)=>{cr(this,ya,Mi).call(this,{type:"failed",failureCount:P,error:k})},onPause:()=>{cr(this,ya,Mi).call(this,{type:"pause"})},onContinue:()=>{cr(this,ya,Mi).call(this,{type:"continue"})},retry:this.options.retry??0,retryDelay:this.options.retryDelay,networkMode:this.options.networkMode,canRun:()=>pe(this,jr).canRun(this)}));const n=this.state.status==="pending",r=!pe(this,gl).canStart();try{if(!n){cr(this,ya,Mi).call(this,{type:"pending",variables:t,isPaused:r}),await((a=(s=pe(this,jr).config).onMutate)==null?void 0:a.call(s,t,this));const k=await((l=(o=this.options).onMutate)==null?void 0:l.call(o,t));k!==this.state.context&&cr(this,ya,Mi).call(this,{type:"pending",context:k,variables:t,isPaused:r})}const P=await pe(this,gl).start();return await((u=(c=pe(this,jr).config).onSuccess)==null?void 0:u.call(c,P,t,this.state.context,this)),await((f=(d=this.options).onSuccess)==null?void 0:f.call(d,P,t,this.state.context)),await((p=(h=pe(this,jr).config).onSettled)==null?void 0:p.call(h,P,null,this.state.variables,this.state.context,this)),await((m=(g=this.options).onSettled)==null?void 0:m.call(g,P,null,t,this.state.context)),cr(this,ya,Mi).call(this,{type:"success",data:P}),P}catch(P){try{throw await((b=(y=pe(this,jr).config).onError)==null?void 0:b.call(y,P,t,this.state.context,this)),await((w=(x=this.options).onError)==null?void 0:w.call(x,P,t,this.state.context)),await((S=(j=pe(this,jr).config).onSettled)==null?void 0:S.call(j,void 0,P,this.state.variables,this.state.context,this)),await((_=(N=this.options).onSettled)==null?void 0:_.call(N,void 0,P,t,this.state.context)),P}finally{cr(this,ya,Mi).call(this,{type:"error",error:P})}}finally{pe(this,jr).runNext(this)}}},va=new WeakMap,jr=new WeakMap,gl=new WeakMap,ya=new WeakSet,Mi=function(t){const n=r=>{switch(t.type){case"failed":return{...r,failureCount:t.failureCount,failureReason:t.error};case"pause":return{...r,isPaused:!0};case"continue":return{...r,isPaused:!1};case"pending":return{...r,context:t.context,data:void 0,failureCount:0,failureReason:null,error:null,isPaused:t.isPaused,status:"pending",variables:t.variables,submittedAt:Date.now()};case"success":return{...r,data:t.data,failureCount:0,failureReason:null,error:null,status:"success",isPaused:!1};case"error":return{...r,data:void 0,error:t.error,failureCount:r.failureCount+1,failureReason:t.error,isPaused:!1,status:"error"}}};this.state=n(this.state),Pr.batch(()=>{pe(this,va).forEach(r=>{r.onMutationUpdate(t)}),pe(this,jr).notify({mutation:this,type:"updated",action:t})})},Fk);function t9(){return{context:void 0,data:void 0,error:null,failureCount:0,failureReason:null,isPaused:!1,status:"idle",variables:void 0,submittedAt:0}}var Zr,qh,Bk,n9=(Bk=class extends fy{constructor(t={}){super();qt(this,Zr);qt(this,qh);this.config=t,Tt(this,Zr,new Map),Tt(this,qh,Date.now())}build(t,n,r){const s=new e9({mutationCache:this,mutationId:++Np(this,qh)._,options:t.defaultMutationOptions(n),state:r});return this.add(s),s}add(t){const n=Gp(t),r=pe(this,Zr).get(n)??[];r.push(t),pe(this,Zr).set(n,r),this.notify({type:"added",mutation:t})}remove(t){var r;const n=Gp(t);if(pe(this,Zr).has(n)){const s=(r=pe(this,Zr).get(n))==null?void 0:r.filter(a=>a!==t);s&&(s.length===0?pe(this,Zr).delete(n):pe(this,Zr).set(n,s))}this.notify({type:"removed",mutation:t})}canRun(t){var r;const n=(r=pe(this,Zr).get(Gp(t)))==null?void 0:r.find(s=>s.state.status==="pending");return!n||n===t}runNext(t){var r;const n=(r=pe(this,Zr).get(Gp(t)))==null?void 0:r.find(s=>s!==t&&s.state.isPaused);return(n==null?void 0:n.continue())??Promise.resolve()}clear(){Pr.batch(()=>{this.getAll().forEach(t=>{this.remove(t)})})}getAll(){return[...pe(this,Zr).values()].flat()}find(t){const n={exact:!0,...t};return this.getAll().find(r=>wA(n,r))}findAll(t={}){return this.getAll().filter(n=>wA(t,n))}notify(t){Pr.batch(()=>{this.listeners.forEach(n=>{n(t)})})}resumePausedMutations(){const t=this.getAll().filter(n=>n.state.isPaused);return Pr.batch(()=>Promise.all(t.map(n=>n.continue().catch(Ls))))}},Zr=new WeakMap,qh=new WeakMap,Bk);function Gp(e){var t;return((t=e.options.scope)==null?void 0:t.id)??String(e.mutationId)}function NA(e){return{onFetch:(t,n)=>{var d,f,h,p,g;const r=t.options,s=(h=(f=(d=t.fetchOptions)==null?void 0:d.meta)==null?void 0:f.fetchMore)==null?void 0:h.direction,a=((p=t.state.data)==null?void 0:p.pages)||[],o=((g=t.state.data)==null?void 0:g.pageParams)||[];let l={pages:[],pageParams:[]},c=0;const u=async()=>{let m=!1;const y=w=>{Object.defineProperty(w,"signal",{enumerable:!0,get:()=>(t.signal.aborted?m=!0:t.signal.addEventListener("abort",()=>{m=!0}),t.signal)})},b=BM(t.options,t.fetchOptions),x=async(w,j,S)=>{if(m)return Promise.reject();if(j==null&&w.pages.length)return Promise.resolve(w);const N={queryKey:t.queryKey,pageParam:j,direction:S?"backward":"forward",meta:t.options.meta};y(N);const _=await b(N),{maxPages:P}=t.options,k=S?W7:V7;return{pages:k(w.pages,_,P),pageParams:k(w.pageParams,j,P)}};if(s&&a.length){const w=s==="backward",j=w?r9:_A,S={pages:a,pageParams:o},N=j(r,S);l=await x(S,N,w)}else{const w=e??a.length;do{const j=c===0?o[0]??r.initialPageParam:_A(r,l);if(c>0&&j==null)break;l=await x(l,j),c++}while(c{var m,y;return(y=(m=t.options).persister)==null?void 0:y.call(m,u,{queryKey:t.queryKey,meta:t.options.meta,signal:t.signal},n)}:t.fetchFn=u}}}function _A(e,{pages:t,pageParams:n}){const r=t.length-1;return t.length>0?e.getNextPageParam(t[r],t,n[r],n):void 0}function r9(e,{pages:t,pageParams:n}){var r;return t.length>0?(r=e.getPreviousPageParam)==null?void 0:r.call(e,t[0],t,n[0],n):void 0}var bn,Ki,Xi,Zc,Qc,Yi,Jc,eu,zk,s9=(zk=class{constructor(e={}){qt(this,bn);qt(this,Ki);qt(this,Xi);qt(this,Zc);qt(this,Qc);qt(this,Yi);qt(this,Jc);qt(this,eu);Tt(this,bn,e.queryCache||new J7),Tt(this,Ki,e.mutationCache||new n9),Tt(this,Xi,e.defaultOptions||{}),Tt(this,Zc,new Map),Tt(this,Qc,new Map),Tt(this,Yi,0)}mount(){Np(this,Yi)._++,pe(this,Yi)===1&&(Tt(this,Jc,zM.subscribe(async e=>{e&&(await this.resumePausedMutations(),pe(this,bn).onFocus())})),Tt(this,eu,lg.subscribe(async e=>{e&&(await this.resumePausedMutations(),pe(this,bn).onOnline())})))}unmount(){var e,t;Np(this,Yi)._--,pe(this,Yi)===0&&((e=pe(this,Jc))==null||e.call(this),Tt(this,Jc,void 0),(t=pe(this,eu))==null||t.call(this),Tt(this,eu,void 0))}isFetching(e){return pe(this,bn).findAll({...e,fetchStatus:"fetching"}).length}isMutating(e){return pe(this,Ki).findAll({...e,status:"pending"}).length}getQueryData(e){var n;const t=this.defaultQueryOptions({queryKey:e});return(n=pe(this,bn).get(t.queryHash))==null?void 0:n.state.data}ensureQueryData(e){const t=this.getQueryData(e.queryKey);if(t===void 0)return this.fetchQuery(e);{const n=this.defaultQueryOptions(e),r=pe(this,bn).build(this,n);return e.revalidateIfStale&&r.isStaleByTime(xA(n.staleTime,r))&&this.prefetchQuery(n),Promise.resolve(t)}}getQueriesData(e){return pe(this,bn).findAll(e).map(({queryKey:t,state:n})=>{const r=n.data;return[t,r]})}setQueryData(e,t,n){const r=this.defaultQueryOptions({queryKey:e}),s=pe(this,bn).get(r.queryHash),a=s==null?void 0:s.state.data,o=D7(t,a);if(o!==void 0)return pe(this,bn).build(this,r).setData(o,{...n,manual:!0})}setQueriesData(e,t,n){return Pr.batch(()=>pe(this,bn).findAll(e).map(({queryKey:r})=>[r,this.setQueryData(r,t,n)]))}getQueryState(e){var n;const t=this.defaultQueryOptions({queryKey:e});return(n=pe(this,bn).get(t.queryHash))==null?void 0:n.state}removeQueries(e){const t=pe(this,bn);Pr.batch(()=>{t.findAll(e).forEach(n=>{t.remove(n)})})}resetQueries(e,t){const n=pe(this,bn),r={type:"active",...e};return Pr.batch(()=>(n.findAll(e).forEach(s=>{s.reset()}),this.refetchQueries(r,t)))}cancelQueries(e={},t={}){const n={revert:!0,...t},r=Pr.batch(()=>pe(this,bn).findAll(e).map(s=>s.cancel(n)));return Promise.all(r).then(Ls).catch(Ls)}invalidateQueries(e={},t={}){return Pr.batch(()=>{if(pe(this,bn).findAll(e).forEach(r=>{r.invalidate()}),e.refetchType==="none")return Promise.resolve();const n={...e,type:e.refetchType??e.type??"active"};return this.refetchQueries(n,t)})}refetchQueries(e={},t){const n={...t,cancelRefetch:(t==null?void 0:t.cancelRefetch)??!0},r=Pr.batch(()=>pe(this,bn).findAll(e).filter(s=>!s.isDisabled()).map(s=>{let a=s.fetch(void 0,n);return n.throwOnError||(a=a.catch(Ls)),s.state.fetchStatus==="paused"?Promise.resolve():a}));return Promise.all(r).then(Ls)}fetchQuery(e){const t=this.defaultQueryOptions(e);t.retry===void 0&&(t.retry=!1);const n=pe(this,bn).build(this,t);return n.isStaleByTime(xA(t.staleTime,n))?n.fetch(t):Promise.resolve(n.state.data)}prefetchQuery(e){return this.fetchQuery(e).then(Ls).catch(Ls)}fetchInfiniteQuery(e){return e.behavior=NA(e.pages),this.fetchQuery(e)}prefetchInfiniteQuery(e){return this.fetchInfiniteQuery(e).then(Ls).catch(Ls)}ensureInfiniteQueryData(e){return e.behavior=NA(e.pages),this.ensureQueryData(e)}resumePausedMutations(){return lg.isOnline()?pe(this,Ki).resumePausedMutations():Promise.resolve()}getQueryCache(){return pe(this,bn)}getMutationCache(){return pe(this,Ki)}getDefaultOptions(){return pe(this,Xi)}setDefaultOptions(e){Tt(this,Xi,e)}setQueryDefaults(e,t){pe(this,Zc).set(Df(e),{queryKey:e,defaultOptions:t})}getQueryDefaults(e){const t=[...pe(this,Zc).values()];let n={};return t.forEach(r=>{Lf(e,r.queryKey)&&(n={...n,...r.defaultOptions})}),n}setMutationDefaults(e,t){pe(this,Qc).set(Df(e),{mutationKey:e,defaultOptions:t})}getMutationDefaults(e){const t=[...pe(this,Qc).values()];let n={};return t.forEach(r=>{Lf(e,r.mutationKey)&&(n={...n,...r.defaultOptions})}),n}defaultQueryOptions(e){if(e._defaulted)return e;const t={...pe(this,Xi).queries,...this.getQueryDefaults(e.queryKey),...e,_defaulted:!0};return t.queryHash||(t.queryHash=AS(t.queryKey,t)),t.refetchOnReconnect===void 0&&(t.refetchOnReconnect=t.networkMode!=="always"),t.throwOnError===void 0&&(t.throwOnError=!!t.suspense),!t.networkMode&&t.persister&&(t.networkMode="offlineFirst"),t.enabled!==!0&&t.queryFn===CS&&(t.enabled=!1),t}defaultMutationOptions(e){return e!=null&&e._defaulted?e:{...pe(this,Xi).mutations,...(e==null?void 0:e.mutationKey)&&this.getMutationDefaults(e.mutationKey),...e,_defaulted:!0}}clear(){pe(this,bn).clear(),pe(this,Ki).clear()}},bn=new WeakMap,Ki=new WeakMap,Xi=new WeakMap,Zc=new WeakMap,Qc=new WeakMap,Yi=new WeakMap,Jc=new WeakMap,eu=new WeakMap,zk),a9=v.createContext(void 0),i9=({client:e,children:t})=>(v.useEffect(()=>(e.mount(),()=>{e.unmount()}),[e]),i.jsx(a9.Provider,{value:e,children:t}));/** +`+a.stack}return{value:e,source:t,stack:s,digest:null}}function a0(e,t,n){return{value:e,source:null,stack:n??null,digest:t??null}}function Lb(e,t){try{console.error(t.value)}catch(n){setTimeout(function(){throw n})}}var g8=typeof WeakMap=="function"?WeakMap:Map;function T$(e,t,n){n=oi(-1,n),n.tag=3,n.payload={element:null};var r=t.value;return n.callback=function(){ng||(ng=!0,Kb=r),Lb(e,t)},n}function $$(e,t,n){n=oi(-1,n),n.tag=3;var r=e.type.getDerivedStateFromError;if(typeof r=="function"){var s=t.value;n.payload=function(){return r(s)},n.callback=function(){Lb(e,t)}}var a=e.stateNode;return a!==null&&typeof a.componentDidCatch=="function"&&(n.callback=function(){Lb(e,t),typeof r!="function"&&(lo===null?lo=new Set([this]):lo.add(this));var o=t.stack;this.componentDidCatch(t.value,{componentStack:o!==null?o:""})}),n}function WP(e,t,n){var r=e.pingCache;if(r===null){r=e.pingCache=new g8;var s=new Set;r.set(t,s)}else s=r.get(t),s===void 0&&(s=new Set,r.set(t,s));s.has(n)||(s.add(n),e=O8.bind(null,e,t,n),t.then(e,e))}function GP(e){do{var t;if((t=e.tag===13)&&(t=e.memoizedState,t=t!==null?t.dehydrated!==null:!0),t)return e;e=e.return}while(e!==null);return null}function HP(e,t,n,r,s){return e.mode&1?(e.flags|=65536,e.lanes=s,e):(e===t?e.flags|=65536:(e.flags|=128,n.flags|=131072,n.flags&=-52805,n.tag===1&&(n.alternate===null?n.tag=17:(t=oi(-1,1),t.tag=2,oo(n,t,1))),n.lanes|=1),e)}var v8=_i.ReactCurrentOwner,Fr=!1;function Nr(e,t,n,r){t.child=e===null?l$(t,null,n,r):su(t,e.child,n,r)}function qP(e,t,n,r,s){n=n.render;var a=t.ref;return Mc(t,s),r=eS(e,t,n,r,a,s),n=tS(),e!==null&&!Fr?(t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~s,gi(e,t,s)):(hn&&n&&Uj(t),t.flags|=1,Nr(e,t,r,s),t.child)}function KP(e,t,n,r,s){if(e===null){var a=n.type;return typeof a=="function"&&!dS(a)&&a.defaultProps===void 0&&n.compare===null&&n.defaultProps===void 0?(t.tag=15,t.type=a,M$(e,t,a,r,s)):(e=Nm(n.type,null,r,t,t.mode,s),e.ref=t.ref,e.return=t,t.child=e)}if(a=e.child,!(e.lanes&s)){var o=a.memoizedProps;if(n=n.compare,n=n!==null?n:_f,n(o,r)&&e.ref===t.ref)return gi(e,t,s)}return t.flags|=1,e=uo(a,r),e.ref=t.ref,e.return=t,t.child=e}function M$(e,t,n,r,s){if(e!==null){var a=e.memoizedProps;if(_f(a,r)&&e.ref===t.ref)if(Fr=!1,t.pendingProps=r=a,(e.lanes&s)!==0)e.flags&131072&&(Fr=!0);else return t.lanes=e.lanes,gi(e,t,s)}return Fb(e,t,n,r,s)}function I$(e,t,n){var r=t.pendingProps,s=r.children,a=e!==null?e.memoizedState:null;if(r.mode==="hidden")if(!(t.mode&1))t.memoizedState={baseLanes:0,cachePool:null,transitions:null},sn(Nc,Jr),Jr|=n;else{if(!(n&1073741824))return e=a!==null?a.baseLanes|n:n,t.lanes=t.childLanes=1073741824,t.memoizedState={baseLanes:e,cachePool:null,transitions:null},t.updateQueue=null,sn(Nc,Jr),Jr|=e,null;t.memoizedState={baseLanes:0,cachePool:null,transitions:null},r=a!==null?a.baseLanes:n,sn(Nc,Jr),Jr|=r}else a!==null?(r=a.baseLanes|n,t.memoizedState=null):r=n,sn(Nc,Jr),Jr|=r;return Nr(e,t,s,n),t.child}function R$(e,t){var n=t.ref;(e===null&&n!==null||e!==null&&e.ref!==n)&&(t.flags|=512,t.flags|=2097152)}function Fb(e,t,n,r,s){var a=Ur(n)?_l:xr.current;return a=nu(t,a),Mc(t,s),n=eS(e,t,n,r,a,s),r=tS(),e!==null&&!Fr?(t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~s,gi(e,t,s)):(hn&&r&&Uj(t),t.flags|=1,Nr(e,t,n,s),t.child)}function XP(e,t,n,r,s){if(Ur(n)){var a=!0;Hm(t)}else a=!1;if(Mc(t,s),t.stateNode===null)wm(e,t),k$(t,n,r),Db(t,n,r,s),r=!0;else if(e===null){var o=t.stateNode,l=t.memoizedProps;o.props=l;var c=o.context,u=n.contextType;typeof u=="object"&&u!==null?u=Cs(u):(u=Ur(n)?_l:xr.current,u=nu(t,u));var d=n.getDerivedStateFromProps,f=typeof d=="function"||typeof o.getSnapshotBeforeUpdate=="function";f||typeof o.UNSAFE_componentWillReceiveProps!="function"&&typeof o.componentWillReceiveProps!="function"||(l!==r||c!==u)&&VP(t,o,r,u),Fi=!1;var h=t.memoizedState;o.state=h,Zm(t,r,o,s),c=t.memoizedState,l!==r||h!==c||zr.current||Fi?(typeof d=="function"&&(Rb(t,n,d,r),c=t.memoizedState),(l=Fi||UP(t,n,l,r,h,c,u))?(f||typeof o.UNSAFE_componentWillMount!="function"&&typeof o.componentWillMount!="function"||(typeof o.componentWillMount=="function"&&o.componentWillMount(),typeof o.UNSAFE_componentWillMount=="function"&&o.UNSAFE_componentWillMount()),typeof o.componentDidMount=="function"&&(t.flags|=4194308)):(typeof o.componentDidMount=="function"&&(t.flags|=4194308),t.memoizedProps=r,t.memoizedState=c),o.props=r,o.state=c,o.context=u,r=l):(typeof o.componentDidMount=="function"&&(t.flags|=4194308),r=!1)}else{o=t.stateNode,u$(e,t),l=t.memoizedProps,u=t.type===t.elementType?l:Ls(t.type,l),o.props=u,f=t.pendingProps,h=o.context,c=n.contextType,typeof c=="object"&&c!==null?c=Cs(c):(c=Ur(n)?_l:xr.current,c=nu(t,c));var p=n.getDerivedStateFromProps;(d=typeof p=="function"||typeof o.getSnapshotBeforeUpdate=="function")||typeof o.UNSAFE_componentWillReceiveProps!="function"&&typeof o.componentWillReceiveProps!="function"||(l!==f||h!==c)&&VP(t,o,r,c),Fi=!1,h=t.memoizedState,o.state=h,Zm(t,r,o,s);var g=t.memoizedState;l!==f||h!==g||zr.current||Fi?(typeof p=="function"&&(Rb(t,n,p,r),g=t.memoizedState),(u=Fi||UP(t,n,u,r,h,g,c)||!1)?(d||typeof o.UNSAFE_componentWillUpdate!="function"&&typeof o.componentWillUpdate!="function"||(typeof o.componentWillUpdate=="function"&&o.componentWillUpdate(r,g,c),typeof o.UNSAFE_componentWillUpdate=="function"&&o.UNSAFE_componentWillUpdate(r,g,c)),typeof o.componentDidUpdate=="function"&&(t.flags|=4),typeof o.getSnapshotBeforeUpdate=="function"&&(t.flags|=1024)):(typeof o.componentDidUpdate!="function"||l===e.memoizedProps&&h===e.memoizedState||(t.flags|=4),typeof o.getSnapshotBeforeUpdate!="function"||l===e.memoizedProps&&h===e.memoizedState||(t.flags|=1024),t.memoizedProps=r,t.memoizedState=g),o.props=r,o.state=g,o.context=c,r=u):(typeof o.componentDidUpdate!="function"||l===e.memoizedProps&&h===e.memoizedState||(t.flags|=4),typeof o.getSnapshotBeforeUpdate!="function"||l===e.memoizedProps&&h===e.memoizedState||(t.flags|=1024),r=!1)}return Bb(e,t,n,r,a,s)}function Bb(e,t,n,r,s,a){R$(e,t);var o=(t.flags&128)!==0;if(!r&&!o)return s&&MP(t,n,!1),gi(e,t,a);r=t.stateNode,v8.current=t;var l=o&&typeof n.getDerivedStateFromError!="function"?null:r.render();return t.flags|=1,e!==null&&o?(t.child=su(t,e.child,null,a),t.child=su(t,null,l,a)):Nr(e,t,l,a),t.memoizedState=r.state,s&&MP(t,n,!0),t.child}function D$(e){var t=e.stateNode;t.pendingContext?$P(e,t.pendingContext,t.pendingContext!==t.context):t.context&&$P(e,t.context,!1),Yj(e,t.containerInfo)}function YP(e,t,n,r,s){return ru(),Wj(s),t.flags|=256,Nr(e,t,n,r),t.child}var zb={dehydrated:null,treeContext:null,retryLane:0};function Ub(e){return{baseLanes:e,cachePool:null,transitions:null}}function L$(e,t,n){var r=t.pendingProps,s=gn.current,a=!1,o=(t.flags&128)!==0,l;if((l=o)||(l=e!==null&&e.memoizedState===null?!1:(s&2)!==0),l?(a=!0,t.flags&=-129):(e===null||e.memoizedState!==null)&&(s|=1),sn(gn,s&1),e===null)return Mb(t),e=t.memoizedState,e!==null&&(e=e.dehydrated,e!==null)?(t.mode&1?e.data==="$!"?t.lanes=8:t.lanes=1073741824:t.lanes=1,null):(o=r.children,e=r.fallback,a?(r=t.mode,a=t.child,o={mode:"hidden",children:o},!(r&1)&&a!==null?(a.childLanes=0,a.pendingProps=o):a=ny(o,r,0,null),e=yl(e,r,n,null),a.return=t,e.return=t,a.sibling=e,t.child=a,t.child.memoizedState=Ub(n),t.memoizedState=zb,e):sS(t,o));if(s=e.memoizedState,s!==null&&(l=s.dehydrated,l!==null))return y8(e,t,o,r,l,s,n);if(a){a=r.fallback,o=t.mode,s=e.child,l=s.sibling;var c={mode:"hidden",children:r.children};return!(o&1)&&t.child!==s?(r=t.child,r.childLanes=0,r.pendingProps=c,t.deletions=null):(r=uo(s,c),r.subtreeFlags=s.subtreeFlags&14680064),l!==null?a=uo(l,a):(a=yl(a,o,n,null),a.flags|=2),a.return=t,r.return=t,r.sibling=a,t.child=r,r=a,a=t.child,o=e.child.memoizedState,o=o===null?Ub(n):{baseLanes:o.baseLanes|n,cachePool:null,transitions:o.transitions},a.memoizedState=o,a.childLanes=e.childLanes&~n,t.memoizedState=zb,r}return a=e.child,e=a.sibling,r=uo(a,{mode:"visible",children:r.children}),!(t.mode&1)&&(r.lanes=n),r.return=t,r.sibling=null,e!==null&&(n=t.deletions,n===null?(t.deletions=[e],t.flags|=16):n.push(e)),t.child=r,t.memoizedState=null,r}function sS(e,t){return t=ny({mode:"visible",children:t},e.mode,0,null),t.return=e,e.child=t}function Bp(e,t,n,r){return r!==null&&Wj(r),su(t,e.child,null,n),e=sS(t,t.pendingProps.children),e.flags|=2,t.memoizedState=null,e}function y8(e,t,n,r,s,a,o){if(n)return t.flags&256?(t.flags&=-257,r=a0(Error(Ne(422))),Bp(e,t,o,r)):t.memoizedState!==null?(t.child=e.child,t.flags|=128,null):(a=r.fallback,s=t.mode,r=ny({mode:"visible",children:r.children},s,0,null),a=yl(a,s,o,null),a.flags|=2,r.return=t,a.return=t,r.sibling=a,t.child=r,t.mode&1&&su(t,e.child,null,o),t.child.memoizedState=Ub(o),t.memoizedState=zb,a);if(!(t.mode&1))return Bp(e,t,o,null);if(s.data==="$!"){if(r=s.nextSibling&&s.nextSibling.dataset,r)var l=r.dgst;return r=l,a=Error(Ne(419)),r=a0(a,r,void 0),Bp(e,t,o,r)}if(l=(o&e.childLanes)!==0,Fr||l){if(r=er,r!==null){switch(o&-o){case 4:s=2;break;case 16:s=8;break;case 64: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:case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:s=32;break;case 536870912:s=268435456;break;default:s=0}s=s&(r.suspendedLanes|o)?0:s,s!==0&&s!==a.retryLane&&(a.retryLane=s,mi(e,s),Xs(r,e,s,-1))}return uS(),r=a0(Error(Ne(421))),Bp(e,t,o,r)}return s.data==="$?"?(t.flags|=128,t.child=e.child,t=k8.bind(null,e),s._reactRetry=t,null):(e=a.treeContext,ss=io(s.nextSibling),as=t,hn=!0,Ws=null,e!==null&&(xs[bs++]=ei,xs[bs++]=ti,xs[bs++]=Pl,ei=e.id,ti=e.overflow,Pl=t),t=sS(t,r.children),t.flags|=4096,t)}function ZP(e,t,n){e.lanes|=t;var r=e.alternate;r!==null&&(r.lanes|=t),Ib(e.return,t,n)}function i0(e,t,n,r,s){var a=e.memoizedState;a===null?e.memoizedState={isBackwards:t,rendering:null,renderingStartTime:0,last:r,tail:n,tailMode:s}:(a.isBackwards=t,a.rendering=null,a.renderingStartTime=0,a.last=r,a.tail=n,a.tailMode=s)}function F$(e,t,n){var r=t.pendingProps,s=r.revealOrder,a=r.tail;if(Nr(e,t,r.children,n),r=gn.current,r&2)r=r&1|2,t.flags|=128;else{if(e!==null&&e.flags&128)e:for(e=t.child;e!==null;){if(e.tag===13)e.memoizedState!==null&&ZP(e,n,t);else if(e.tag===19)ZP(e,n,t);else if(e.child!==null){e.child.return=e,e=e.child;continue}if(e===t)break e;for(;e.sibling===null;){if(e.return===null||e.return===t)break e;e=e.return}e.sibling.return=e.return,e=e.sibling}r&=1}if(sn(gn,r),!(t.mode&1))t.memoizedState=null;else switch(s){case"forwards":for(n=t.child,s=null;n!==null;)e=n.alternate,e!==null&&Qm(e)===null&&(s=n),n=n.sibling;n=s,n===null?(s=t.child,t.child=null):(s=n.sibling,n.sibling=null),i0(t,!1,s,n,a);break;case"backwards":for(n=null,s=t.child,t.child=null;s!==null;){if(e=s.alternate,e!==null&&Qm(e)===null){t.child=s;break}e=s.sibling,s.sibling=n,n=s,s=e}i0(t,!0,n,null,a);break;case"together":i0(t,!1,null,null,void 0);break;default:t.memoizedState=null}return t.child}function wm(e,t){!(t.mode&1)&&e!==null&&(e.alternate=null,t.alternate=null,t.flags|=2)}function gi(e,t,n){if(e!==null&&(t.dependencies=e.dependencies),Cl|=t.lanes,!(n&t.childLanes))return null;if(e!==null&&t.child!==e.child)throw Error(Ne(153));if(t.child!==null){for(e=t.child,n=uo(e,e.pendingProps),t.child=n,n.return=t;e.sibling!==null;)e=e.sibling,n=n.sibling=uo(e,e.pendingProps),n.return=t;n.sibling=null}return t.child}function x8(e,t,n){switch(t.tag){case 3:D$(t),ru();break;case 5:d$(t);break;case 1:Ur(t.type)&&Hm(t);break;case 4:Yj(t,t.stateNode.containerInfo);break;case 10:var r=t.type._context,s=t.memoizedProps.value;sn(Xm,r._currentValue),r._currentValue=s;break;case 13:if(r=t.memoizedState,r!==null)return r.dehydrated!==null?(sn(gn,gn.current&1),t.flags|=128,null):n&t.child.childLanes?L$(e,t,n):(sn(gn,gn.current&1),e=gi(e,t,n),e!==null?e.sibling:null);sn(gn,gn.current&1);break;case 19:if(r=(n&t.childLanes)!==0,e.flags&128){if(r)return F$(e,t,n);t.flags|=128}if(s=t.memoizedState,s!==null&&(s.rendering=null,s.tail=null,s.lastEffect=null),sn(gn,gn.current),r)break;return null;case 22:case 23:return t.lanes=0,I$(e,t,n)}return gi(e,t,n)}var B$,Vb,z$,U$;B$=function(e,t){for(var n=t.child;n!==null;){if(n.tag===5||n.tag===6)e.appendChild(n.stateNode);else if(n.tag!==4&&n.child!==null){n.child.return=n,n=n.child;continue}if(n===t)break;for(;n.sibling===null;){if(n.return===null||n.return===t)return;n=n.return}n.sibling.return=n.return,n=n.sibling}};Vb=function(){};z$=function(e,t,n,r){var s=e.memoizedProps;if(s!==r){e=t.stateNode,rl(Pa.current);var a=null;switch(n){case"input":s=db(e,s),r=db(e,r),a=[];break;case"select":s=yn({},s,{value:void 0}),r=yn({},r,{value:void 0}),a=[];break;case"textarea":s=pb(e,s),r=pb(e,r),a=[];break;default:typeof s.onClick!="function"&&typeof r.onClick=="function"&&(e.onclick=Wm)}gb(n,r);var o;n=null;for(u in s)if(!r.hasOwnProperty(u)&&s.hasOwnProperty(u)&&s[u]!=null)if(u==="style"){var l=s[u];for(o in l)l.hasOwnProperty(o)&&(n||(n={}),n[o]="")}else u!=="dangerouslySetInnerHTML"&&u!=="children"&&u!=="suppressContentEditableWarning"&&u!=="suppressHydrationWarning"&&u!=="autoFocus"&&(yf.hasOwnProperty(u)?a||(a=[]):(a=a||[]).push(u,null));for(u in r){var c=r[u];if(l=s!=null?s[u]:void 0,r.hasOwnProperty(u)&&c!==l&&(c!=null||l!=null))if(u==="style")if(l){for(o in l)!l.hasOwnProperty(o)||c&&c.hasOwnProperty(o)||(n||(n={}),n[o]="");for(o in c)c.hasOwnProperty(o)&&l[o]!==c[o]&&(n||(n={}),n[o]=c[o])}else n||(a||(a=[]),a.push(u,n)),n=c;else u==="dangerouslySetInnerHTML"?(c=c?c.__html:void 0,l=l?l.__html:void 0,c!=null&&l!==c&&(a=a||[]).push(u,c)):u==="children"?typeof c!="string"&&typeof c!="number"||(a=a||[]).push(u,""+c):u!=="suppressContentEditableWarning"&&u!=="suppressHydrationWarning"&&(yf.hasOwnProperty(u)?(c!=null&&u==="onScroll"&&ln("scroll",e),a||l===c||(a=[])):(a=a||[]).push(u,c))}n&&(a=a||[]).push("style",n);var u=a;(t.updateQueue=u)&&(t.flags|=4)}};U$=function(e,t,n,r){n!==r&&(t.flags|=4)};function Nd(e,t){if(!hn)switch(e.tailMode){case"hidden":t=e.tail;for(var n=null;t!==null;)t.alternate!==null&&(n=t),t=t.sibling;n===null?e.tail=null:n.sibling=null;break;case"collapsed":n=e.tail;for(var r=null;n!==null;)n.alternate!==null&&(r=n),n=n.sibling;r===null?t||e.tail===null?e.tail=null:e.tail.sibling=null:r.sibling=null}}function dr(e){var t=e.alternate!==null&&e.alternate.child===e.child,n=0,r=0;if(t)for(var s=e.child;s!==null;)n|=s.lanes|s.childLanes,r|=s.subtreeFlags&14680064,r|=s.flags&14680064,s.return=e,s=s.sibling;else for(s=e.child;s!==null;)n|=s.lanes|s.childLanes,r|=s.subtreeFlags,r|=s.flags,s.return=e,s=s.sibling;return e.subtreeFlags|=r,e.childLanes=n,t}function b8(e,t,n){var r=t.pendingProps;switch(Vj(t),t.tag){case 2:case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return dr(t),null;case 1:return Ur(t.type)&&Gm(),dr(t),null;case 3:return r=t.stateNode,au(),dn(zr),dn(xr),Qj(),r.pendingContext&&(r.context=r.pendingContext,r.pendingContext=null),(e===null||e.child===null)&&(Lp(t)?t.flags|=4:e===null||e.memoizedState.isDehydrated&&!(t.flags&256)||(t.flags|=1024,Ws!==null&&(Zb(Ws),Ws=null))),Vb(e,t),dr(t),null;case 5:Zj(t);var s=rl(Of.current);if(n=t.type,e!==null&&t.stateNode!=null)z$(e,t,n,r,s),e.ref!==t.ref&&(t.flags|=512,t.flags|=2097152);else{if(!r){if(t.stateNode===null)throw Error(Ne(166));return dr(t),null}if(e=rl(Pa.current),Lp(t)){r=t.stateNode,n=t.type;var a=t.memoizedProps;switch(r[ba]=t,r[Cf]=a,e=(t.mode&1)!==0,n){case"dialog":ln("cancel",r),ln("close",r);break;case"iframe":case"object":case"embed":ln("load",r);break;case"video":case"audio":for(s=0;s<\/script>",e=e.removeChild(e.firstChild)):typeof r.is=="string"?e=o.createElement(n,{is:r.is}):(e=o.createElement(n),n==="select"&&(o=e,r.multiple?o.multiple=!0:r.size&&(o.size=r.size))):e=o.createElementNS(e,n),e[ba]=t,e[Cf]=r,B$(e,t,!1,!1),t.stateNode=e;e:{switch(o=vb(n,r),n){case"dialog":ln("cancel",e),ln("close",e),s=r;break;case"iframe":case"object":case"embed":ln("load",e),s=r;break;case"video":case"audio":for(s=0;sou&&(t.flags|=128,r=!0,Nd(a,!1),t.lanes=4194304)}else{if(!r)if(e=Qm(o),e!==null){if(t.flags|=128,r=!0,n=e.updateQueue,n!==null&&(t.updateQueue=n,t.flags|=4),Nd(a,!0),a.tail===null&&a.tailMode==="hidden"&&!o.alternate&&!hn)return dr(t),null}else 2*Cn()-a.renderingStartTime>ou&&n!==1073741824&&(t.flags|=128,r=!0,Nd(a,!1),t.lanes=4194304);a.isBackwards?(o.sibling=t.child,t.child=o):(n=a.last,n!==null?n.sibling=o:t.child=o,a.last=o)}return a.tail!==null?(t=a.tail,a.rendering=t,a.tail=t.sibling,a.renderingStartTime=Cn(),t.sibling=null,n=gn.current,sn(gn,r?n&1|2:n&1),t):(dr(t),null);case 22:case 23:return cS(),r=t.memoizedState!==null,e!==null&&e.memoizedState!==null!==r&&(t.flags|=8192),r&&t.mode&1?Jr&1073741824&&(dr(t),t.subtreeFlags&6&&(t.flags|=8192)):dr(t),null;case 24:return null;case 25:return null}throw Error(Ne(156,t.tag))}function w8(e,t){switch(Vj(t),t.tag){case 1:return Ur(t.type)&&Gm(),e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 3:return au(),dn(zr),dn(xr),Qj(),e=t.flags,e&65536&&!(e&128)?(t.flags=e&-65537|128,t):null;case 5:return Zj(t),null;case 13:if(dn(gn),e=t.memoizedState,e!==null&&e.dehydrated!==null){if(t.alternate===null)throw Error(Ne(340));ru()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 19:return dn(gn),null;case 4:return au(),null;case 10:return qj(t.type._context),null;case 22:case 23:return cS(),null;case 24:return null;default:return null}}var zp=!1,gr=!1,j8=typeof WeakSet=="function"?WeakSet:Set,Ve=null;function Sc(e,t){var n=e.ref;if(n!==null)if(typeof n=="function")try{n(null)}catch(r){wn(e,t,r)}else n.current=null}function Wb(e,t,n){try{n()}catch(r){wn(e,t,r)}}var QP=!1;function S8(e,t){if(Ab=zm,e=qT(),zj(e)){if("selectionStart"in e)var n={start:e.selectionStart,end:e.selectionEnd};else e:{n=(n=e.ownerDocument)&&n.defaultView||window;var r=n.getSelection&&n.getSelection();if(r&&r.rangeCount!==0){n=r.anchorNode;var s=r.anchorOffset,a=r.focusNode;r=r.focusOffset;try{n.nodeType,a.nodeType}catch{n=null;break e}var o=0,l=-1,c=-1,u=0,d=0,f=e,h=null;t:for(;;){for(var p;f!==n||s!==0&&f.nodeType!==3||(l=o+s),f!==a||r!==0&&f.nodeType!==3||(c=o+r),f.nodeType===3&&(o+=f.nodeValue.length),(p=f.firstChild)!==null;)h=f,f=p;for(;;){if(f===e)break t;if(h===n&&++u===s&&(l=o),h===a&&++d===r&&(c=o),(p=f.nextSibling)!==null)break;f=h,h=f.parentNode}f=p}n=l===-1||c===-1?null:{start:l,end:c}}else n=null}n=n||{start:0,end:0}}else n=null;for(Cb={focusedElem:e,selectionRange:n},zm=!1,Ve=t;Ve!==null;)if(t=Ve,e=t.child,(t.subtreeFlags&1028)!==0&&e!==null)e.return=t,Ve=e;else for(;Ve!==null;){t=Ve;try{var g=t.alternate;if(t.flags&1024)switch(t.tag){case 0:case 11:case 15:break;case 1:if(g!==null){var m=g.memoizedProps,y=g.memoizedState,b=t.stateNode,x=b.getSnapshotBeforeUpdate(t.elementType===t.type?m:Ls(t.type,m),y);b.__reactInternalSnapshotBeforeUpdate=x}break;case 3:var w=t.stateNode.containerInfo;w.nodeType===1?w.textContent="":w.nodeType===9&&w.documentElement&&w.removeChild(w.documentElement);break;case 5:case 6:case 4:case 17:break;default:throw Error(Ne(163))}}catch(j){wn(t,t.return,j)}if(e=t.sibling,e!==null){e.return=t.return,Ve=e;break}Ve=t.return}return g=QP,QP=!1,g}function af(e,t,n){var r=t.updateQueue;if(r=r!==null?r.lastEffect:null,r!==null){var s=r=r.next;do{if((s.tag&e)===e){var a=s.destroy;s.destroy=void 0,a!==void 0&&Wb(t,n,a)}s=s.next}while(s!==r)}}function ey(e,t){if(t=t.updateQueue,t=t!==null?t.lastEffect:null,t!==null){var n=t=t.next;do{if((n.tag&e)===e){var r=n.create;n.destroy=r()}n=n.next}while(n!==t)}}function Gb(e){var t=e.ref;if(t!==null){var n=e.stateNode;switch(e.tag){case 5:e=n;break;default:e=n}typeof t=="function"?t(e):t.current=e}}function V$(e){var t=e.alternate;t!==null&&(e.alternate=null,V$(t)),e.child=null,e.deletions=null,e.sibling=null,e.tag===5&&(t=e.stateNode,t!==null&&(delete t[ba],delete t[Cf],delete t[kb],delete t[a8],delete t[i8])),e.stateNode=null,e.return=null,e.dependencies=null,e.memoizedProps=null,e.memoizedState=null,e.pendingProps=null,e.stateNode=null,e.updateQueue=null}function W$(e){return e.tag===5||e.tag===3||e.tag===4}function JP(e){e:for(;;){for(;e.sibling===null;){if(e.return===null||W$(e.return))return null;e=e.return}for(e.sibling.return=e.return,e=e.sibling;e.tag!==5&&e.tag!==6&&e.tag!==18;){if(e.flags&2||e.child===null||e.tag===4)continue e;e.child.return=e,e=e.child}if(!(e.flags&2))return e.stateNode}}function Hb(e,t,n){var r=e.tag;if(r===5||r===6)e=e.stateNode,t?n.nodeType===8?n.parentNode.insertBefore(e,t):n.insertBefore(e,t):(n.nodeType===8?(t=n.parentNode,t.insertBefore(e,n)):(t=n,t.appendChild(e)),n=n._reactRootContainer,n!=null||t.onclick!==null||(t.onclick=Wm));else if(r!==4&&(e=e.child,e!==null))for(Hb(e,t,n),e=e.sibling;e!==null;)Hb(e,t,n),e=e.sibling}function qb(e,t,n){var r=e.tag;if(r===5||r===6)e=e.stateNode,t?n.insertBefore(e,t):n.appendChild(e);else if(r!==4&&(e=e.child,e!==null))for(qb(e,t,n),e=e.sibling;e!==null;)qb(e,t,n),e=e.sibling}var sr=null,zs=!1;function Ti(e,t,n){for(n=n.child;n!==null;)G$(e,t,n),n=n.sibling}function G$(e,t,n){if(_a&&typeof _a.onCommitFiberUnmount=="function")try{_a.onCommitFiberUnmount(Hv,n)}catch{}switch(n.tag){case 5:gr||Sc(n,t);case 6:var r=sr,s=zs;sr=null,Ti(e,t,n),sr=r,zs=s,sr!==null&&(zs?(e=sr,n=n.stateNode,e.nodeType===8?e.parentNode.removeChild(n):e.removeChild(n)):sr.removeChild(n.stateNode));break;case 18:sr!==null&&(zs?(e=sr,n=n.stateNode,e.nodeType===8?Jx(e.parentNode,n):e.nodeType===1&&Jx(e,n),Sf(e)):Jx(sr,n.stateNode));break;case 4:r=sr,s=zs,sr=n.stateNode.containerInfo,zs=!0,Ti(e,t,n),sr=r,zs=s;break;case 0:case 11:case 14:case 15:if(!gr&&(r=n.updateQueue,r!==null&&(r=r.lastEffect,r!==null))){s=r=r.next;do{var a=s,o=a.destroy;a=a.tag,o!==void 0&&(a&2||a&4)&&Wb(n,t,o),s=s.next}while(s!==r)}Ti(e,t,n);break;case 1:if(!gr&&(Sc(n,t),r=n.stateNode,typeof r.componentWillUnmount=="function"))try{r.props=n.memoizedProps,r.state=n.memoizedState,r.componentWillUnmount()}catch(l){wn(n,t,l)}Ti(e,t,n);break;case 21:Ti(e,t,n);break;case 22:n.mode&1?(gr=(r=gr)||n.memoizedState!==null,Ti(e,t,n),gr=r):Ti(e,t,n);break;default:Ti(e,t,n)}}function eA(e){var t=e.updateQueue;if(t!==null){e.updateQueue=null;var n=e.stateNode;n===null&&(n=e.stateNode=new j8),t.forEach(function(r){var s=T8.bind(null,e,r);n.has(r)||(n.add(r),r.then(s,s))})}}function Ms(e,t){var n=t.deletions;if(n!==null)for(var r=0;rs&&(s=o),r&=~a}if(r=s,r=Cn()-r,r=(120>r?120:480>r?480:1080>r?1080:1920>r?1920:3e3>r?3e3:4320>r?4320:1960*_8(r/1960))-r,10e?16:e,Ji===null)var r=!1;else{if(e=Ji,Ji=null,rg=0,zt&6)throw Error(Ne(331));var s=zt;for(zt|=4,Ve=e.current;Ve!==null;){var a=Ve,o=a.child;if(Ve.flags&16){var l=a.deletions;if(l!==null){for(var c=0;cCn()-oS?vl(e,0):iS|=n),Vr(e,t)}function J$(e,t){t===0&&(e.mode&1?(t=Tp,Tp<<=1,!(Tp&130023424)&&(Tp=4194304)):t=1);var n=Or();e=mi(e,t),e!==null&&(Yh(e,t,n),Vr(e,n))}function k8(e){var t=e.memoizedState,n=0;t!==null&&(n=t.retryLane),J$(e,n)}function T8(e,t){var n=0;switch(e.tag){case 13:var r=e.stateNode,s=e.memoizedState;s!==null&&(n=s.retryLane);break;case 19:r=e.stateNode;break;default:throw Error(Ne(314))}r!==null&&r.delete(t),J$(e,n)}var eM;eM=function(e,t,n){if(e!==null)if(e.memoizedProps!==t.pendingProps||zr.current)Fr=!0;else{if(!(e.lanes&n)&&!(t.flags&128))return Fr=!1,x8(e,t,n);Fr=!!(e.flags&131072)}else Fr=!1,hn&&t.flags&1048576&&s$(t,Km,t.index);switch(t.lanes=0,t.tag){case 2:var r=t.type;wm(e,t),e=t.pendingProps;var s=nu(t,xr.current);Mc(t,n),s=eS(null,t,r,e,s,n);var a=tS();return t.flags|=1,typeof s=="object"&&s!==null&&typeof s.render=="function"&&s.$$typeof===void 0?(t.tag=1,t.memoizedState=null,t.updateQueue=null,Ur(r)?(a=!0,Hm(t)):a=!1,t.memoizedState=s.state!==null&&s.state!==void 0?s.state:null,Xj(t),s.updater=Jv,t.stateNode=s,s._reactInternals=t,Db(t,r,e,n),t=Bb(null,t,r,!0,a,n)):(t.tag=0,hn&&a&&Uj(t),Nr(null,t,s,n),t=t.child),t;case 16:r=t.elementType;e:{switch(wm(e,t),e=t.pendingProps,s=r._init,r=s(r._payload),t.type=r,s=t.tag=M8(r),e=Ls(r,e),s){case 0:t=Fb(null,t,r,e,n);break e;case 1:t=XP(null,t,r,e,n);break e;case 11:t=qP(null,t,r,e,n);break e;case 14:t=KP(null,t,r,Ls(r.type,e),n);break e}throw Error(Ne(306,r,""))}return t;case 0:return r=t.type,s=t.pendingProps,s=t.elementType===r?s:Ls(r,s),Fb(e,t,r,s,n);case 1:return r=t.type,s=t.pendingProps,s=t.elementType===r?s:Ls(r,s),XP(e,t,r,s,n);case 3:e:{if(D$(t),e===null)throw Error(Ne(387));r=t.pendingProps,a=t.memoizedState,s=a.element,u$(e,t),Zm(t,r,null,n);var o=t.memoizedState;if(r=o.element,a.isDehydrated)if(a={element:r,isDehydrated:!1,cache:o.cache,pendingSuspenseBoundaries:o.pendingSuspenseBoundaries,transitions:o.transitions},t.updateQueue.baseState=a,t.memoizedState=a,t.flags&256){s=iu(Error(Ne(423)),t),t=YP(e,t,r,n,s);break e}else if(r!==s){s=iu(Error(Ne(424)),t),t=YP(e,t,r,n,s);break e}else for(ss=io(t.stateNode.containerInfo.firstChild),as=t,hn=!0,Ws=null,n=l$(t,null,r,n),t.child=n;n;)n.flags=n.flags&-3|4096,n=n.sibling;else{if(ru(),r===s){t=gi(e,t,n);break e}Nr(e,t,r,n)}t=t.child}return t;case 5:return d$(t),e===null&&Mb(t),r=t.type,s=t.pendingProps,a=e!==null?e.memoizedProps:null,o=s.children,Eb(r,s)?o=null:a!==null&&Eb(r,a)&&(t.flags|=32),R$(e,t),Nr(e,t,o,n),t.child;case 6:return e===null&&Mb(t),null;case 13:return L$(e,t,n);case 4:return Yj(t,t.stateNode.containerInfo),r=t.pendingProps,e===null?t.child=su(t,null,r,n):Nr(e,t,r,n),t.child;case 11:return r=t.type,s=t.pendingProps,s=t.elementType===r?s:Ls(r,s),qP(e,t,r,s,n);case 7:return Nr(e,t,t.pendingProps,n),t.child;case 8:return Nr(e,t,t.pendingProps.children,n),t.child;case 12:return Nr(e,t,t.pendingProps.children,n),t.child;case 10:e:{if(r=t.type._context,s=t.pendingProps,a=t.memoizedProps,o=s.value,sn(Xm,r._currentValue),r._currentValue=o,a!==null)if(na(a.value,o)){if(a.children===s.children&&!zr.current){t=gi(e,t,n);break e}}else for(a=t.child,a!==null&&(a.return=t);a!==null;){var l=a.dependencies;if(l!==null){o=a.child;for(var c=l.firstContext;c!==null;){if(c.context===r){if(a.tag===1){c=oi(-1,n&-n),c.tag=2;var u=a.updateQueue;if(u!==null){u=u.shared;var d=u.pending;d===null?c.next=c:(c.next=d.next,d.next=c),u.pending=c}}a.lanes|=n,c=a.alternate,c!==null&&(c.lanes|=n),Ib(a.return,n,t),l.lanes|=n;break}c=c.next}}else if(a.tag===10)o=a.type===t.type?null:a.child;else if(a.tag===18){if(o=a.return,o===null)throw Error(Ne(341));o.lanes|=n,l=o.alternate,l!==null&&(l.lanes|=n),Ib(o,n,t),o=a.sibling}else o=a.child;if(o!==null)o.return=a;else for(o=a;o!==null;){if(o===t){o=null;break}if(a=o.sibling,a!==null){a.return=o.return,o=a;break}o=o.return}a=o}Nr(e,t,s.children,n),t=t.child}return t;case 9:return s=t.type,r=t.pendingProps.children,Mc(t,n),s=Cs(s),r=r(s),t.flags|=1,Nr(e,t,r,n),t.child;case 14:return r=t.type,s=Ls(r,t.pendingProps),s=Ls(r.type,s),KP(e,t,r,s,n);case 15:return M$(e,t,t.type,t.pendingProps,n);case 17:return r=t.type,s=t.pendingProps,s=t.elementType===r?s:Ls(r,s),wm(e,t),t.tag=1,Ur(r)?(e=!0,Hm(t)):e=!1,Mc(t,n),k$(t,r,s),Db(t,r,s,n),Bb(null,t,r,!0,e,n);case 19:return F$(e,t,n);case 22:return I$(e,t,n)}throw Error(Ne(156,t.tag))};function tM(e,t){return CT(e,t)}function $8(e,t,n,r){this.tag=e,this.key=n,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.ref=null,this.pendingProps=t,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=r,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function Ss(e,t,n,r){return new $8(e,t,n,r)}function dS(e){return e=e.prototype,!(!e||!e.isReactComponent)}function M8(e){if(typeof e=="function")return dS(e)?1:0;if(e!=null){if(e=e.$$typeof,e===Oj)return 11;if(e===kj)return 14}return 2}function uo(e,t){var n=e.alternate;return n===null?(n=Ss(e.tag,t,e.key,e.mode),n.elementType=e.elementType,n.type=e.type,n.stateNode=e.stateNode,n.alternate=e,e.alternate=n):(n.pendingProps=t,n.type=e.type,n.flags=0,n.subtreeFlags=0,n.deletions=null),n.flags=e.flags&14680064,n.childLanes=e.childLanes,n.lanes=e.lanes,n.child=e.child,n.memoizedProps=e.memoizedProps,n.memoizedState=e.memoizedState,n.updateQueue=e.updateQueue,t=e.dependencies,n.dependencies=t===null?null:{lanes:t.lanes,firstContext:t.firstContext},n.sibling=e.sibling,n.index=e.index,n.ref=e.ref,n}function Nm(e,t,n,r,s,a){var o=2;if(r=e,typeof e=="function")dS(e)&&(o=1);else if(typeof e=="string")o=5;else e:switch(e){case pc:return yl(n.children,s,a,t);case Ej:o=8,s|=8;break;case ob:return e=Ss(12,n,t,s|2),e.elementType=ob,e.lanes=a,e;case lb:return e=Ss(13,n,t,s),e.elementType=lb,e.lanes=a,e;case cb:return e=Ss(19,n,t,s),e.elementType=cb,e.lanes=a,e;case dT:return ny(n,s,a,t);default:if(typeof e=="object"&&e!==null)switch(e.$$typeof){case cT:o=10;break e;case uT:o=9;break e;case Oj:o=11;break e;case kj:o=14;break e;case Li:o=16,r=null;break e}throw Error(Ne(130,e==null?e:typeof e,""))}return t=Ss(o,n,t,s),t.elementType=e,t.type=r,t.lanes=a,t}function yl(e,t,n,r){return e=Ss(7,e,r,t),e.lanes=n,e}function ny(e,t,n,r){return e=Ss(22,e,r,t),e.elementType=dT,e.lanes=n,e.stateNode={isHidden:!1},e}function o0(e,t,n){return e=Ss(6,e,null,t),e.lanes=n,e}function l0(e,t,n){return t=Ss(4,e.children!==null?e.children:[],e.key,t),t.lanes=n,t.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},t}function I8(e,t,n,r,s){this.tag=t,this.containerInfo=e,this.finishedWork=this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.callbackNode=this.pendingContext=this.context=null,this.callbackPriority=0,this.eventTimes=Ux(0),this.expirationTimes=Ux(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=Ux(0),this.identifierPrefix=r,this.onRecoverableError=s,this.mutableSourceEagerHydrationData=null}function fS(e,t,n,r,s,a,o,l,c){return e=new I8(e,t,n,l,c),t===1?(t=1,a===!0&&(t|=8)):t=0,a=Ss(3,null,null,t),e.current=a,a.stateNode=e,a.memoizedState={element:r,isDehydrated:n,cache:null,transitions:null,pendingSuspenseBoundaries:null},Xj(a),e}function R8(e,t,n){var r=3"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(aM)}catch(e){console.error(e)}}aM(),aT.exports=us;var Vu=aT.exports;const iM=Ht(Vu);var oM,lA=Vu;oM=lA.createRoot,lA.hydrateRoot;var cA=["light","dark"],z8="(prefers-color-scheme: dark)",U8=v.createContext(void 0),V8={setTheme:e=>{},themes:[]},W8=()=>{var e;return(e=v.useContext(U8))!=null?e:V8};v.memo(({forcedTheme:e,storageKey:t,attribute:n,enableSystem:r,enableColorScheme:s,defaultTheme:a,value:o,attrs:l,nonce:c})=>{let u=a==="system",d=n==="class"?`var d=document.documentElement,c=d.classList;${`c.remove(${l.map(g=>`'${g}'`).join(",")})`};`:`var d=document.documentElement,n='${n}',s='setAttribute';`,f=s?cA.includes(a)&&a?`if(e==='light'||e==='dark'||!e)d.style.colorScheme=e||'${a}'`:"if(e==='light'||e==='dark')d.style.colorScheme=e":"",h=(g,m=!1,y=!0)=>{let b=o?o[g]:g,x=m?g+"|| ''":`'${b}'`,w="";return s&&y&&!m&&cA.includes(g)&&(w+=`d.style.colorScheme = '${g}';`),n==="class"?m||b?w+=`c.add(${x})`:w+="null":b&&(w+=`d[s](n,${x})`),w},p=e?`!function(){${d}${h(e)}}()`:r?`!function(){try{${d}var e=localStorage.getItem('${t}');if('system'===e||(!e&&${u})){var t='${z8}',m=window.matchMedia(t);if(m.media!==t||m.matches){${h("dark")}}else{${h("light")}}}else if(e){${o?`var x=${JSON.stringify(o)};`:""}${h(o?"x[e]":"e",!0)}}${u?"":"else{"+h(a,!1,!1)+"}"}${f}}catch(e){}}()`:`!function(){try{${d}var e=localStorage.getItem('${t}');if(e){${o?`var x=${JSON.stringify(o)};`:""}${h(o?"x[e]":"e",!0)}}else{${h(a,!1,!1)};}${f}}catch(t){}}();`;return v.createElement("script",{nonce:c,dangerouslySetInnerHTML:{__html:p}})});var G8=e=>{switch(e){case"success":return K8;case"info":return Y8;case"warning":return X8;case"error":return Z8;default:return null}},H8=Array(12).fill(0),q8=({visible:e})=>E.createElement("div",{className:"sonner-loading-wrapper","data-visible":e},E.createElement("div",{className:"sonner-spinner"},H8.map((t,n)=>E.createElement("div",{className:"sonner-loading-bar",key:`spinner-bar-${n}`})))),K8=E.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20"},E.createElement("path",{fillRule:"evenodd",d:"M10 18a8 8 0 100-16 8 8 0 000 16zm3.857-9.809a.75.75 0 00-1.214-.882l-3.483 4.79-1.88-1.88a.75.75 0 10-1.06 1.061l2.5 2.5a.75.75 0 001.137-.089l4-5.5z",clipRule:"evenodd"})),X8=E.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor",height:"20",width:"20"},E.createElement("path",{fillRule:"evenodd",d:"M9.401 3.003c1.155-2 4.043-2 5.197 0l7.355 12.748c1.154 2-.29 4.5-2.599 4.5H4.645c-2.309 0-3.752-2.5-2.598-4.5L9.4 3.003zM12 8.25a.75.75 0 01.75.75v3.75a.75.75 0 01-1.5 0V9a.75.75 0 01.75-.75zm0 8.25a.75.75 0 100-1.5.75.75 0 000 1.5z",clipRule:"evenodd"})),Y8=E.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20"},E.createElement("path",{fillRule:"evenodd",d:"M18 10a8 8 0 11-16 0 8 8 0 0116 0zm-7-4a1 1 0 11-2 0 1 1 0 012 0zM9 9a.75.75 0 000 1.5h.253a.25.25 0 01.244.304l-.459 2.066A1.75 1.75 0 0010.747 15H11a.75.75 0 000-1.5h-.253a.25.25 0 01-.244-.304l.459-2.066A1.75 1.75 0 009.253 9H9z",clipRule:"evenodd"})),Z8=E.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20"},E.createElement("path",{fillRule:"evenodd",d:"M18 10a8 8 0 11-16 0 8 8 0 0116 0zm-8-5a.75.75 0 01.75.75v4.5a.75.75 0 01-1.5 0v-4.5A.75.75 0 0110 5zm0 10a1 1 0 100-2 1 1 0 000 2z",clipRule:"evenodd"})),Q8=()=>{let[e,t]=E.useState(document.hidden);return E.useEffect(()=>{let n=()=>{t(document.hidden)};return document.addEventListener("visibilitychange",n),()=>window.removeEventListener("visibilitychange",n)},[]),e},Qb=1,J8=class{constructor(){this.subscribe=e=>(this.subscribers.push(e),()=>{let t=this.subscribers.indexOf(e);this.subscribers.splice(t,1)}),this.publish=e=>{this.subscribers.forEach(t=>t(e))},this.addToast=e=>{this.publish(e),this.toasts=[...this.toasts,e]},this.create=e=>{var t;let{message:n,...r}=e,s=typeof(e==null?void 0:e.id)=="number"||((t=e.id)==null?void 0:t.length)>0?e.id:Qb++,a=this.toasts.find(l=>l.id===s),o=e.dismissible===void 0?!0:e.dismissible;return a?this.toasts=this.toasts.map(l=>l.id===s?(this.publish({...l,...e,id:s,title:n}),{...l,...e,id:s,dismissible:o,title:n}):l):this.addToast({title:n,...r,dismissible:o,id:s}),s},this.dismiss=e=>(e||this.toasts.forEach(t=>{this.subscribers.forEach(n=>n({id:t.id,dismiss:!0}))}),this.subscribers.forEach(t=>t({id:e,dismiss:!0})),e),this.message=(e,t)=>this.create({...t,message:e}),this.error=(e,t)=>this.create({...t,message:e,type:"error"}),this.success=(e,t)=>this.create({...t,type:"success",message:e}),this.info=(e,t)=>this.create({...t,type:"info",message:e}),this.warning=(e,t)=>this.create({...t,type:"warning",message:e}),this.loading=(e,t)=>this.create({...t,type:"loading",message:e}),this.promise=(e,t)=>{if(!t)return;let n;t.loading!==void 0&&(n=this.create({...t,promise:e,type:"loading",message:t.loading,description:typeof t.description!="function"?t.description:void 0}));let r=e instanceof Promise?e:e(),s=n!==void 0;return r.then(async a=>{if(tU(a)&&!a.ok){s=!1;let o=typeof t.error=="function"?await t.error(`HTTP error! status: ${a.status}`):t.error,l=typeof t.description=="function"?await t.description(`HTTP error! status: ${a.status}`):t.description;this.create({id:n,type:"error",message:o,description:l})}else if(t.success!==void 0){s=!1;let o=typeof t.success=="function"?await t.success(a):t.success,l=typeof t.description=="function"?await t.description(a):t.description;this.create({id:n,type:"success",message:o,description:l})}}).catch(async a=>{if(t.error!==void 0){s=!1;let o=typeof t.error=="function"?await t.error(a):t.error,l=typeof t.description=="function"?await t.description(a):t.description;this.create({id:n,type:"error",message:o,description:l})}}).finally(()=>{var a;s&&(this.dismiss(n),n=void 0),(a=t.finally)==null||a.call(t)}),n},this.custom=(e,t)=>{let n=(t==null?void 0:t.id)||Qb++;return this.create({jsx:e(n),id:n,...t}),n},this.subscribers=[],this.toasts=[]}},Qr=new J8,eU=(e,t)=>{let n=(t==null?void 0:t.id)||Qb++;return Qr.addToast({title:e,...t,id:n}),n},tU=e=>e&&typeof e=="object"&&"ok"in e&&typeof e.ok=="boolean"&&"status"in e&&typeof e.status=="number",nU=eU,rU=()=>Qr.toasts,oe=Object.assign(nU,{success:Qr.success,info:Qr.info,warning:Qr.warning,error:Qr.error,custom:Qr.custom,message:Qr.message,promise:Qr.promise,dismiss:Qr.dismiss,loading:Qr.loading},{getHistory:rU});function sU(e,{insertAt:t}={}){if(typeof document>"u")return;let n=document.head||document.getElementsByTagName("head")[0],r=document.createElement("style");r.type="text/css",t==="top"&&n.firstChild?n.insertBefore(r,n.firstChild):n.appendChild(r),r.styleSheet?r.styleSheet.cssText=e:r.appendChild(document.createTextNode(e))}sU(`:where(html[dir="ltr"]),:where([data-sonner-toaster][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%)}:where(html[dir="rtl"]),:where([data-sonner-toaster][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%)}:where([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:none;z-index:999999999}:where([data-sonner-toaster][data-x-position="right"]){right:max(var(--offset),env(safe-area-inset-right))}:where([data-sonner-toaster][data-x-position="left"]){left:max(var(--offset),env(safe-area-inset-left))}:where([data-sonner-toaster][data-x-position="center"]){left:50%;transform:translate(-50%)}:where([data-sonner-toaster][data-y-position="top"]){top:max(var(--offset),env(safe-area-inset-top))}:where([data-sonner-toaster][data-y-position="bottom"]){bottom:max(var(--offset),env(safe-area-inset-bottom))}:where([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);filter:blur(0);touch-action:none;transition:transform .4s,opacity .4s,height .4s,box-shadow .2s;box-sizing:border-box;outline:none;overflow-wrap:anywhere}:where([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 #0000001a;width:var(--width);font-size:13px;display:flex;align-items:center;gap:6px}:where([data-sonner-toast]:focus-visible){box-shadow:0 4px 12px #0000001a,0 0 0 2px #0003}:where([data-sonner-toast][data-y-position="top"]){top:0;--y: translateY(-100%);--lift: 1;--lift-amount: calc(1 * var(--gap))}:where([data-sonner-toast][data-y-position="bottom"]){bottom:0;--y: translateY(100%);--lift: -1;--lift-amount: calc(var(--lift) * var(--gap))}:where([data-sonner-toast]) :where([data-description]){font-weight:400;line-height:1.4;color:inherit}:where([data-sonner-toast]) :where([data-title]){font-weight:500;line-height:1.5;color:inherit}:where([data-sonner-toast]) :where([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)}:where([data-sonner-toast][data-promise="true"]) :where([data-icon])>svg{opacity:0;transform:scale(.8);transform-origin:center;animation:sonner-fade-in .3s ease forwards}:where([data-sonner-toast]) :where([data-icon])>*{flex-shrink:0}:where([data-sonner-toast]) :where([data-icon]) svg{margin-left:var(--toast-svg-margin-start);margin-right:var(--toast-svg-margin-end)}:where([data-sonner-toast]) :where([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;cursor:pointer;outline:none;display:flex;align-items:center;flex-shrink:0;transition:opacity .4s,box-shadow .2s}:where([data-sonner-toast]) :where([data-button]):focus-visible{box-shadow:0 0 0 2px #0006}:where([data-sonner-toast]) :where([data-button]):first-of-type{margin-left:var(--toast-button-margin-start);margin-right:var(--toast-button-margin-end)}:where([data-sonner-toast]) :where([data-cancel]){color:var(--normal-text);background:rgba(0,0,0,.08)}:where([data-sonner-toast][data-theme="dark"]) :where([data-cancel]){background:rgba(255,255,255,.3)}:where([data-sonner-toast]) :where([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;background:var(--gray1);color:var(--gray12);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}:where([data-sonner-toast]) :where([data-close-button]):focus-visible{box-shadow:0 4px 12px #0000001a,0 0 0 2px #0003}:where([data-sonner-toast]) :where([data-disabled="true"]){cursor:not-allowed}:where([data-sonner-toast]):hover :where([data-close-button]):hover{background:var(--gray2);border-color:var(--gray5)}:where([data-sonner-toast][data-swiping="true"]):before{content:"";position:absolute;left:0;right:0;height:100%;z-index:-1}:where([data-sonner-toast][data-y-position="top"][data-swiping="true"]):before{bottom:50%;transform:scaleY(3) translateY(50%)}:where([data-sonner-toast][data-y-position="bottom"][data-swiping="true"]):before{top:50%;transform:scaleY(3) translateY(-50%)}:where([data-sonner-toast][data-swiping="false"][data-removed="true"]):before{content:"";position:absolute;inset:0;transform:scaleY(2)}:where([data-sonner-toast]):after{content:"";position:absolute;left:0;height:calc(var(--gap) + 1px);bottom:100%;width:100%}:where([data-sonner-toast][data-mounted="true"]){--y: translateY(0);opacity:1}:where([data-sonner-toast][data-expanded="false"][data-front="false"]){--scale: var(--toasts-before) * .05 + 1;--y: translateY(calc(var(--lift-amount) * var(--toasts-before))) scale(calc(-1 * var(--scale)));height:var(--front-toast-height)}:where([data-sonner-toast])>*{transition:opacity .4s}:where([data-sonner-toast][data-expanded="false"][data-front="false"][data-styled="true"])>*{opacity:0}:where([data-sonner-toast][data-visible="false"]){opacity:0;pointer-events:none}:where([data-sonner-toast][data-mounted="true"][data-expanded="true"]){--y: translateY(calc(var(--lift) * var(--offset)));height:var(--initial-height)}:where([data-sonner-toast][data-removed="true"][data-front="true"][data-swipe-out="false"]){--y: translateY(calc(var(--lift) * -100%));opacity:0}:where([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}:where([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}:where([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, 0px));transition:none}[data-sonner-toast][data-swipe-out=true][data-y-position=bottom],[data-sonner-toast][data-swipe-out=true][data-y-position=top]{animation:swipe-out .2s ease-out forwards}@keyframes swipe-out{0%{transform:translateY(calc(var(--lift) * var(--offset) + var(--swipe-amount)));opacity:1}to{transform:translateY(calc(var(--lift) * var(--offset) + var(--swipe-amount) + var(--lift) * -100%));opacity:0}}@media (max-width: 600px){[data-sonner-toaster]{position:fixed;--mobile-offset: 16px;right:var(--mobile-offset);left:var(--mobile-offset);width:100%}[data-sonner-toaster] [data-sonner-toast]{left:0;right:0;width:calc(100% - var(--mobile-offset) * 2)}[data-sonner-toaster][data-x-position=left]{left:var(--mobile-offset)}[data-sonner-toaster][data-y-position=bottom]{bottom:20px}[data-sonner-toaster][data-y-position=top]{top:20px}[data-sonner-toaster][data-x-position=center]{left:var(--mobile-offset);right:var(--mobile-offset);transform:none}}[data-sonner-toaster][data-theme=light]{--normal-bg: #fff;--normal-border: var(--gray4);--normal-text: var(--gray12);--success-bg: hsl(143, 85%, 96%);--success-border: hsl(145, 92%, 91%);--success-text: hsl(140, 100%, 27%);--info-bg: hsl(208, 100%, 97%);--info-border: hsl(221, 91%, 91%);--info-text: hsl(210, 92%, 45%);--warning-bg: hsl(49, 100%, 97%);--warning-border: hsl(49, 91%, 91%);--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-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-theme=dark] [data-sonner-toast][data-invert=true]{--normal-bg: #fff;--normal-border: var(--gray3);--normal-text: var(--gray12)}[data-sonner-toaster][data-theme=dark]{--normal-bg: #000;--normal-border: hsl(0, 0%, 20%);--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, 100%, 12%);--info-text: hsl(216, 87%, 65%);--warning-bg: hsl(64, 100%, 6%);--warning-border: hsl(60, 100%, 12%);--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-rich-colors=true][data-sonner-toast][data-type=success],[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],[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],[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],[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:nth-child(1){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)}to{opacity:1;transform:scale(1)}}@keyframes sonner-fade-out{0%{opacity:1;transform:scale(1)}to{opacity:0;transform:scale(.8)}}@keyframes sonner-spin{0%{opacity:1}to{opacity:.15}}@media (prefers-reduced-motion){[data-sonner-toast],[data-sonner-toast]>*,.sonner-loading-bar{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%)} +`);function Wp(e){return e.label!==void 0}var aU=3,iU="32px",oU=4e3,lU=356,cU=14,uU=20,dU=200;function fU(...e){return e.filter(Boolean).join(" ")}var hU=e=>{var t,n,r,s,a,o,l,c,u,d;let{invert:f,toast:h,unstyled:p,interacting:g,setHeights:m,visibleToasts:y,heights:b,index:x,toasts:w,expanded:j,removeToast:S,defaultRichColors:N,closeButton:_,style:P,cancelButtonStyle:k,actionButtonStyle:O,className:M="",descriptionClassName:A="",duration:$,position:L,gap:G,loadingIcon:D,expandByDefault:V,classNames:T,icons:F,closeButtonAriaLabel:q="Close toast",pauseWhenPageIsHidden:Z,cn:re}=e,[ge,B]=E.useState(!1),[le,se]=E.useState(!1),[ce,De]=E.useState(!1),[de,be]=E.useState(!1),[Pe,ne]=E.useState(0),[Je,ve]=E.useState(0),at=E.useRef(null),st=E.useRef(null),Mt=x===0,C=x+1<=y,R=h.type,U=h.dismissible!==!1,X=h.className||"",Q=h.descriptionClassName||"",z=E.useMemo(()=>b.findIndex(pt=>pt.toastId===h.id)||0,[b,h.id]),ee=E.useMemo(()=>{var pt;return(pt=h.closeButton)!=null?pt:_},[h.closeButton,_]),me=E.useMemo(()=>h.duration||$||oU,[h.duration,$]),Se=E.useRef(0),Ie=E.useRef(0),we=E.useRef(0),ze=E.useRef(null),[gt,St]=L.split("-"),He=E.useMemo(()=>b.reduce((pt,tt,it)=>it>=z?pt:pt+tt.height,0),[b,z]),Ze=Q8(),kt=h.invert||f,Vt=R==="loading";Ie.current=E.useMemo(()=>z*G+He,[z,He]),E.useEffect(()=>{B(!0)},[]),E.useLayoutEffect(()=>{if(!ge)return;let pt=st.current,tt=pt.style.height;pt.style.height="auto";let it=pt.getBoundingClientRect().height;pt.style.height=tt,ve(it),m(Lt=>Lt.find(tn=>tn.toastId===h.id)?Lt.map(tn=>tn.toastId===h.id?{...tn,height:it}:tn):[{toastId:h.id,height:it,position:h.position},...Lt])},[ge,h.title,h.description,m,h.id]);let Xn=E.useCallback(()=>{se(!0),ne(Ie.current),m(pt=>pt.filter(tt=>tt.toastId!==h.id)),setTimeout(()=>{S(h)},dU)},[h,S,m,Ie]);E.useEffect(()=>{if(h.promise&&R==="loading"||h.duration===1/0||h.type==="loading")return;let pt,tt=me;return j||g||Z&&Ze?(()=>{if(we.current{var it;(it=h.onAutoClose)==null||it.call(h,h),Xn()},tt)),()=>clearTimeout(pt)},[j,g,V,h,me,Xn,h.promise,R,Z,Ze]),E.useEffect(()=>{let pt=st.current;if(pt){let tt=pt.getBoundingClientRect().height;return ve(tt),m(it=>[{toastId:h.id,height:tt,position:h.position},...it]),()=>m(it=>it.filter(Lt=>Lt.toastId!==h.id))}},[m,h.id]),E.useEffect(()=>{h.delete&&Xn()},[Xn,h.delete]);function an(){return F!=null&&F.loading?E.createElement("div",{className:"sonner-loader","data-visible":R==="loading"},F.loading):D?E.createElement("div",{className:"sonner-loader","data-visible":R==="loading"},D):E.createElement(q8,{visible:R==="loading"})}return E.createElement("li",{"aria-live":h.important?"assertive":"polite","aria-atomic":"true",role:"status",tabIndex:0,ref:st,className:re(M,X,T==null?void 0:T.toast,(t=h==null?void 0:h.classNames)==null?void 0:t.toast,T==null?void 0:T.default,T==null?void 0:T[R],(n=h==null?void 0:h.classNames)==null?void 0:n[R]),"data-sonner-toast":"","data-rich-colors":(r=h.richColors)!=null?r:N,"data-styled":!(h.jsx||h.unstyled||p),"data-mounted":ge,"data-promise":!!h.promise,"data-removed":le,"data-visible":C,"data-y-position":gt,"data-x-position":St,"data-index":x,"data-front":Mt,"data-swiping":ce,"data-dismissible":U,"data-type":R,"data-invert":kt,"data-swipe-out":de,"data-expanded":!!(j||V&&ge),style:{"--index":x,"--toasts-before":x,"--z-index":w.length-x,"--offset":`${le?Pe:Ie.current}px`,"--initial-height":V?"auto":`${Je}px`,...P,...h.style},onPointerDown:pt=>{Vt||!U||(at.current=new Date,ne(Ie.current),pt.target.setPointerCapture(pt.pointerId),pt.target.tagName!=="BUTTON"&&(De(!0),ze.current={x:pt.clientX,y:pt.clientY}))},onPointerUp:()=>{var pt,tt,it,Lt;if(de||!U)return;ze.current=null;let tn=Number(((pt=st.current)==null?void 0:pt.style.getPropertyValue("--swipe-amount").replace("px",""))||0),Xr=new Date().getTime()-((tt=at.current)==null?void 0:tt.getTime()),Ua=Math.abs(tn)/Xr;if(Math.abs(tn)>=uU||Ua>.11){ne(Ie.current),(it=h.onDismiss)==null||it.call(h,h),Xn(),be(!0);return}(Lt=st.current)==null||Lt.style.setProperty("--swipe-amount","0px"),De(!1)},onPointerMove:pt=>{var tt;if(!ze.current||!U)return;let it=pt.clientY-ze.current.y,Lt=pt.clientX-ze.current.x,tn=(gt==="top"?Math.min:Math.max)(0,it),Xr=pt.pointerType==="touch"?10:2;Math.abs(tn)>Xr?(tt=st.current)==null||tt.style.setProperty("--swipe-amount",`${it}px`):Math.abs(Lt)>Xr&&(ze.current=null)}},ee&&!h.jsx?E.createElement("button",{"aria-label":q,"data-disabled":Vt,"data-close-button":!0,onClick:Vt||!U?()=>{}:()=>{var pt;Xn(),(pt=h.onDismiss)==null||pt.call(h,h)},className:re(T==null?void 0:T.closeButton,(s=h==null?void 0:h.classNames)==null?void 0:s.closeButton)},E.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",width:"12",height:"12",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"},E.createElement("line",{x1:"18",y1:"6",x2:"6",y2:"18"}),E.createElement("line",{x1:"6",y1:"6",x2:"18",y2:"18"}))):null,h.jsx||E.isValidElement(h.title)?h.jsx||h.title:E.createElement(E.Fragment,null,R||h.icon||h.promise?E.createElement("div",{"data-icon":"",className:re(T==null?void 0:T.icon,(a=h==null?void 0:h.classNames)==null?void 0:a.icon)},h.promise||h.type==="loading"&&!h.icon?h.icon||an():null,h.type!=="loading"?h.icon||(F==null?void 0:F[R])||G8(R):null):null,E.createElement("div",{"data-content":"",className:re(T==null?void 0:T.content,(o=h==null?void 0:h.classNames)==null?void 0:o.content)},E.createElement("div",{"data-title":"",className:re(T==null?void 0:T.title,(l=h==null?void 0:h.classNames)==null?void 0:l.title)},h.title),h.description?E.createElement("div",{"data-description":"",className:re(A,Q,T==null?void 0:T.description,(c=h==null?void 0:h.classNames)==null?void 0:c.description)},h.description):null),E.isValidElement(h.cancel)?h.cancel:h.cancel&&Wp(h.cancel)?E.createElement("button",{"data-button":!0,"data-cancel":!0,style:h.cancelButtonStyle||k,onClick:pt=>{var tt,it;Wp(h.cancel)&&U&&((it=(tt=h.cancel).onClick)==null||it.call(tt,pt),Xn())},className:re(T==null?void 0:T.cancelButton,(u=h==null?void 0:h.classNames)==null?void 0:u.cancelButton)},h.cancel.label):null,E.isValidElement(h.action)?h.action:h.action&&Wp(h.action)?E.createElement("button",{"data-button":!0,"data-action":!0,style:h.actionButtonStyle||O,onClick:pt=>{var tt,it;Wp(h.action)&&(pt.defaultPrevented||((it=(tt=h.action).onClick)==null||it.call(tt,pt),Xn()))},className:re(T==null?void 0:T.actionButton,(d=h==null?void 0:h.classNames)==null?void 0:d.actionButton)},h.action.label):null))};function uA(){if(typeof window>"u"||typeof document>"u")return"ltr";let e=document.documentElement.getAttribute("dir");return e==="auto"||!e?window.getComputedStyle(document.documentElement).direction:e}var pU=e=>{let{invert:t,position:n="bottom-right",hotkey:r=["altKey","KeyT"],expand:s,closeButton:a,className:o,offset:l,theme:c="light",richColors:u,duration:d,style:f,visibleToasts:h=aU,toastOptions:p,dir:g=uA(),gap:m=cU,loadingIcon:y,icons:b,containerAriaLabel:x="Notifications",pauseWhenPageIsHidden:w,cn:j=fU}=e,[S,N]=E.useState([]),_=E.useMemo(()=>Array.from(new Set([n].concat(S.filter(Z=>Z.position).map(Z=>Z.position)))),[S,n]),[P,k]=E.useState([]),[O,M]=E.useState(!1),[A,$]=E.useState(!1),[L,G]=E.useState(c!=="system"?c:typeof window<"u"&&window.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light"),D=E.useRef(null),V=r.join("+").replace(/Key/g,"").replace(/Digit/g,""),T=E.useRef(null),F=E.useRef(!1),q=E.useCallback(Z=>{var re;(re=S.find(ge=>ge.id===Z.id))!=null&&re.delete||Qr.dismiss(Z.id),N(ge=>ge.filter(({id:B})=>B!==Z.id))},[S]);return E.useEffect(()=>Qr.subscribe(Z=>{if(Z.dismiss){N(re=>re.map(ge=>ge.id===Z.id?{...ge,delete:!0}:ge));return}setTimeout(()=>{iM.flushSync(()=>{N(re=>{let ge=re.findIndex(B=>B.id===Z.id);return ge!==-1?[...re.slice(0,ge),{...re[ge],...Z},...re.slice(ge+1)]:[Z,...re]})})})}),[]),E.useEffect(()=>{if(c!=="system"){G(c);return}c==="system"&&(window.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)").matches?G("dark"):G("light")),typeof window<"u"&&window.matchMedia("(prefers-color-scheme: dark)").addEventListener("change",({matches:Z})=>{G(Z?"dark":"light")})},[c]),E.useEffect(()=>{S.length<=1&&M(!1)},[S]),E.useEffect(()=>{let Z=re=>{var ge,B;r.every(le=>re[le]||re.code===le)&&(M(!0),(ge=D.current)==null||ge.focus()),re.code==="Escape"&&(document.activeElement===D.current||(B=D.current)!=null&&B.contains(document.activeElement))&&M(!1)};return document.addEventListener("keydown",Z),()=>document.removeEventListener("keydown",Z)},[r]),E.useEffect(()=>{if(D.current)return()=>{T.current&&(T.current.focus({preventScroll:!0}),T.current=null,F.current=!1)}},[D.current]),S.length?E.createElement("section",{"aria-label":`${x} ${V}`,tabIndex:-1},_.map((Z,re)=>{var ge;let[B,le]=Z.split("-");return E.createElement("ol",{key:Z,dir:g==="auto"?uA():g,tabIndex:-1,ref:D,className:o,"data-sonner-toaster":!0,"data-theme":L,"data-y-position":B,"data-x-position":le,style:{"--front-toast-height":`${((ge=P[0])==null?void 0:ge.height)||0}px`,"--offset":typeof l=="number"?`${l}px`:l||iU,"--width":`${lU}px`,"--gap":`${m}px`,...f},onBlur:se=>{F.current&&!se.currentTarget.contains(se.relatedTarget)&&(F.current=!1,T.current&&(T.current.focus({preventScroll:!0}),T.current=null))},onFocus:se=>{se.target instanceof HTMLElement&&se.target.dataset.dismissible==="false"||F.current||(F.current=!0,T.current=se.relatedTarget)},onMouseEnter:()=>M(!0),onMouseMove:()=>M(!0),onMouseLeave:()=>{A||M(!1)},onPointerDown:se=>{se.target instanceof HTMLElement&&se.target.dataset.dismissible==="false"||$(!0)},onPointerUp:()=>$(!1)},S.filter(se=>!se.position&&re===0||se.position===Z).map((se,ce)=>{var De,de;return E.createElement(hU,{key:se.id,icons:b,index:ce,toast:se,defaultRichColors:u,duration:(De=p==null?void 0:p.duration)!=null?De:d,className:p==null?void 0:p.className,descriptionClassName:p==null?void 0:p.descriptionClassName,invert:t,visibleToasts:h,closeButton:(de=p==null?void 0:p.closeButton)!=null?de:a,interacting:A,position:Z,style:p==null?void 0:p.style,unstyled:p==null?void 0:p.unstyled,classNames:p==null?void 0:p.classNames,cancelButtonStyle:p==null?void 0:p.cancelButtonStyle,actionButtonStyle:p==null?void 0:p.actionButtonStyle,removeToast:q,toasts:S.filter(be=>be.position==se.position),heights:P.filter(be=>be.position==se.position),setHeights:k,expandByDefault:s,gap:m,loadingIcon:y,expanded:O,pauseWhenPageIsHidden:w,cn:j})}))})):null};const mU=({...e})=>{const{theme:t="system"}=W8();return i.jsx(pU,{theme:t,className:"toaster group",position:"bottom-right",visibleToasts:2,closeButton:!0,toastOptions:{classNames:{toast:"group toast group-[.toaster]:bg-background group-[.toaster]:text-foreground group-[.toaster]:border-border group-[.toaster]:shadow-lg group-[.toaster]:pr-8",description:"group-[.toast]:text-muted-foreground",actionButton:"group-[.toast]:bg-primary group-[.toast]:text-primary-foreground",cancelButton:"group-[.toast]:bg-muted group-[.toast]:text-muted-foreground",closeButton:"group-[.toast]:absolute group-[.toast]:left-3 group-[.toast]:top-3 group-[.toast]:h-5 group-[.toast]:w-5 group-[.toast]:rounded-md group-[.toast]:p-1 group-[.toast]:text-foreground/70 group-[.toast]:opacity-100 group-[.toast]:transition-opacity hover:group-[.toast]:text-foreground hover:group-[.toast]:bg-muted/50 focus:group-[.toast]:opacity-100 focus:group-[.toast]:outline-none focus:group-[.toast]:ring-1 focus:group-[.toast]:ring-ring"}},...e})};function Ee(e,t,{checkForDefaultPrevented:n=!0}={}){return function(s){if(e==null||e(s),n===!1||!s.defaultPrevented)return t==null?void 0:t(s)}}function gU(e,t){typeof e=="function"?e(t):e!=null&&(e.current=t)}function oy(...e){return t=>e.forEach(n=>gU(n,t))}function xt(...e){return v.useCallback(oy(...e),e)}function vU(e,t){const n=v.createContext(t),r=a=>{const{children:o,...l}=a,c=v.useMemo(()=>l,Object.values(l));return i.jsx(n.Provider,{value:c,children:o})};r.displayName=e+"Provider";function s(a){const o=v.useContext(n);if(o)return o;if(t!==void 0)return t;throw new Error(`\`${a}\` must be used within \`${e}\``)}return[r,s]}function Hr(e,t=[]){let n=[];function r(a,o){const l=v.createContext(o),c=n.length;n=[...n,o];const u=f=>{var b;const{scope:h,children:p,...g}=f,m=((b=h==null?void 0:h[e])==null?void 0:b[c])||l,y=v.useMemo(()=>g,Object.values(g));return i.jsx(m.Provider,{value:y,children:p})};u.displayName=a+"Provider";function d(f,h){var m;const p=((m=h==null?void 0:h[e])==null?void 0:m[c])||l,g=v.useContext(p);if(g)return g;if(o!==void 0)return o;throw new Error(`\`${f}\` must be used within \`${a}\``)}return[u,d]}const s=()=>{const a=n.map(o=>v.createContext(o));return function(l){const c=(l==null?void 0:l[e])||a;return v.useMemo(()=>({[`__scope${e}`]:{...l,[e]:c}}),[l,c])}};return s.scopeName=e,[r,yU(s,...t)]}function yU(...e){const t=e[0];if(e.length===1)return t;const n=()=>{const r=e.map(s=>({useScope:s(),scopeName:s.scopeName}));return function(a){const o=r.reduce((l,{useScope:c,scopeName:u})=>{const f=c(a)[`__scope${u}`];return{...l,...f}},{});return v.useMemo(()=>({[`__scope${t.scopeName}`]:o}),[o])}};return n.scopeName=t.scopeName,n}var ka=v.forwardRef((e,t)=>{const{children:n,...r}=e,s=v.Children.toArray(n),a=s.find(xU);if(a){const o=a.props.children,l=s.map(c=>c===a?v.Children.count(o)>1?v.Children.only(null):v.isValidElement(o)?o.props.children:null:c);return i.jsx(Jb,{...r,ref:t,children:v.isValidElement(o)?v.cloneElement(o,void 0,l):null})}return i.jsx(Jb,{...r,ref:t,children:n})});ka.displayName="Slot";var Jb=v.forwardRef((e,t)=>{const{children:n,...r}=e;if(v.isValidElement(n)){const s=wU(n);return v.cloneElement(n,{...bU(r,n.props),ref:t?oy(t,s):s})}return v.Children.count(n)>1?v.Children.only(null):null});Jb.displayName="SlotClone";var gS=({children:e})=>i.jsx(i.Fragment,{children:e});function xU(e){return v.isValidElement(e)&&e.type===gS}function bU(e,t){const n={...t};for(const r in t){const s=e[r],a=t[r];/^on[A-Z]/.test(r)?s&&a?n[r]=(...l)=>{a(...l),s(...l)}:s&&(n[r]=s):r==="style"?n[r]={...s,...a}:r==="className"&&(n[r]=[s,a].filter(Boolean).join(" "))}return{...e,...n}}function wU(e){var r,s;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=(s=Object.getOwnPropertyDescriptor(e,"ref"))==null?void 0:s.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}var jU=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","span","svg","ul"],Ye=jU.reduce((e,t)=>{const n=v.forwardRef((r,s)=>{const{asChild:a,...o}=r,l=a?ka:t;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),i.jsx(l,{...o,ref:s})});return n.displayName=`Primitive.${t}`,{...e,[t]:n}},{});function lM(e,t){e&&Vu.flushSync(()=>e.dispatchEvent(t))}function Gn(e){const t=v.useRef(e);return v.useEffect(()=>{t.current=e}),v.useMemo(()=>(...n)=>{var r;return(r=t.current)==null?void 0:r.call(t,...n)},[])}function SU(e,t=globalThis==null?void 0:globalThis.document){const n=Gn(e);v.useEffect(()=>{const r=s=>{s.key==="Escape"&&n(s)};return t.addEventListener("keydown",r,{capture:!0}),()=>t.removeEventListener("keydown",r,{capture:!0})},[n,t])}var NU="DismissableLayer",ew="dismissableLayer.update",_U="dismissableLayer.pointerDownOutside",PU="dismissableLayer.focusOutside",dA,cM=v.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set}),ep=v.forwardRef((e,t)=>{const{disableOutsidePointerEvents:n=!1,onEscapeKeyDown:r,onPointerDownOutside:s,onFocusOutside:a,onInteractOutside:o,onDismiss:l,...c}=e,u=v.useContext(cM),[d,f]=v.useState(null),h=(d==null?void 0:d.ownerDocument)??(globalThis==null?void 0:globalThis.document),[,p]=v.useState({}),g=xt(t,_=>f(_)),m=Array.from(u.layers),[y]=[...u.layersWithOutsidePointerEventsDisabled].slice(-1),b=m.indexOf(y),x=d?m.indexOf(d):-1,w=u.layersWithOutsidePointerEventsDisabled.size>0,j=x>=b,S=EU(_=>{const P=_.target,k=[...u.branches].some(O=>O.contains(P));!j||k||(s==null||s(_),o==null||o(_),_.defaultPrevented||l==null||l())},h),N=OU(_=>{const P=_.target;[...u.branches].some(O=>O.contains(P))||(a==null||a(_),o==null||o(_),_.defaultPrevented||l==null||l())},h);return SU(_=>{x===u.layers.size-1&&(r==null||r(_),!_.defaultPrevented&&l&&(_.preventDefault(),l()))},h),v.useEffect(()=>{if(d)return n&&(u.layersWithOutsidePointerEventsDisabled.size===0&&(dA=h.body.style.pointerEvents,h.body.style.pointerEvents="none"),u.layersWithOutsidePointerEventsDisabled.add(d)),u.layers.add(d),fA(),()=>{n&&u.layersWithOutsidePointerEventsDisabled.size===1&&(h.body.style.pointerEvents=dA)}},[d,h,n,u]),v.useEffect(()=>()=>{d&&(u.layers.delete(d),u.layersWithOutsidePointerEventsDisabled.delete(d),fA())},[d,u]),v.useEffect(()=>{const _=()=>p({});return document.addEventListener(ew,_),()=>document.removeEventListener(ew,_)},[]),i.jsx(Ye.div,{...c,ref:g,style:{pointerEvents:w?j?"auto":"none":void 0,...e.style},onFocusCapture:Ee(e.onFocusCapture,N.onFocusCapture),onBlurCapture:Ee(e.onBlurCapture,N.onBlurCapture),onPointerDownCapture:Ee(e.onPointerDownCapture,S.onPointerDownCapture)})});ep.displayName=NU;var AU="DismissableLayerBranch",CU=v.forwardRef((e,t)=>{const n=v.useContext(cM),r=v.useRef(null),s=xt(t,r);return v.useEffect(()=>{const a=r.current;if(a)return n.branches.add(a),()=>{n.branches.delete(a)}},[n.branches]),i.jsx(Ye.div,{...e,ref:s})});CU.displayName=AU;function EU(e,t=globalThis==null?void 0:globalThis.document){const n=Gn(e),r=v.useRef(!1),s=v.useRef(()=>{});return v.useEffect(()=>{const a=l=>{if(l.target&&!r.current){let c=function(){uM(_U,n,u,{discrete:!0})};const u={originalEvent:l};l.pointerType==="touch"?(t.removeEventListener("click",s.current),s.current=c,t.addEventListener("click",s.current,{once:!0})):c()}else t.removeEventListener("click",s.current);r.current=!1},o=window.setTimeout(()=>{t.addEventListener("pointerdown",a)},0);return()=>{window.clearTimeout(o),t.removeEventListener("pointerdown",a),t.removeEventListener("click",s.current)}},[t,n]),{onPointerDownCapture:()=>r.current=!0}}function OU(e,t=globalThis==null?void 0:globalThis.document){const n=Gn(e),r=v.useRef(!1);return v.useEffect(()=>{const s=a=>{a.target&&!r.current&&uM(PU,n,{originalEvent:a},{discrete:!1})};return t.addEventListener("focusin",s),()=>t.removeEventListener("focusin",s)},[t,n]),{onFocusCapture:()=>r.current=!0,onBlurCapture:()=>r.current=!1}}function fA(){const e=new CustomEvent(ew);document.dispatchEvent(e)}function uM(e,t,n,{discrete:r}){const s=n.originalEvent.target,a=new CustomEvent(e,{bubbles:!1,cancelable:!0,detail:n});t&&s.addEventListener(e,t,{once:!0}),r?lM(s,a):s.dispatchEvent(a)}var or=globalThis!=null&&globalThis.document?v.useLayoutEffect:()=>{},kU=rT.useId||(()=>{}),TU=0;function Ys(e){const[t,n]=v.useState(kU());return or(()=>{n(r=>r??String(TU++))},[e]),t?`radix-${t}`:""}const $U=["top","right","bottom","left"],jo=Math.min,ns=Math.max,ig=Math.round,Gp=Math.floor,So=e=>({x:e,y:e}),MU={left:"right",right:"left",bottom:"top",top:"bottom"},IU={start:"end",end:"start"};function tw(e,t,n){return ns(e,jo(t,n))}function vi(e,t){return typeof e=="function"?e(t):e}function yi(e){return e.split("-")[0]}function Wu(e){return e.split("-")[1]}function vS(e){return e==="x"?"y":"x"}function yS(e){return e==="y"?"height":"width"}function No(e){return["top","bottom"].includes(yi(e))?"y":"x"}function xS(e){return vS(No(e))}function RU(e,t,n){n===void 0&&(n=!1);const r=Wu(e),s=xS(e),a=yS(s);let o=s==="x"?r===(n?"end":"start")?"right":"left":r==="start"?"bottom":"top";return t.reference[a]>t.floating[a]&&(o=og(o)),[o,og(o)]}function DU(e){const t=og(e);return[nw(e),t,nw(t)]}function nw(e){return e.replace(/start|end/g,t=>IU[t])}function LU(e,t,n){const r=["left","right"],s=["right","left"],a=["top","bottom"],o=["bottom","top"];switch(e){case"top":case"bottom":return n?t?s:r:t?r:s;case"left":case"right":return t?a:o;default:return[]}}function FU(e,t,n,r){const s=Wu(e);let a=LU(yi(e),n==="start",r);return s&&(a=a.map(o=>o+"-"+s),t&&(a=a.concat(a.map(nw)))),a}function og(e){return e.replace(/left|right|bottom|top/g,t=>MU[t])}function BU(e){return{top:0,right:0,bottom:0,left:0,...e}}function dM(e){return typeof e!="number"?BU(e):{top:e,right:e,bottom:e,left:e}}function lg(e){const{x:t,y:n,width:r,height:s}=e;return{width:r,height:s,top:n,left:t,right:t+r,bottom:n+s,x:t,y:n}}function hA(e,t,n){let{reference:r,floating:s}=e;const a=No(t),o=xS(t),l=yS(o),c=yi(t),u=a==="y",d=r.x+r.width/2-s.width/2,f=r.y+r.height/2-s.height/2,h=r[l]/2-s[l]/2;let p;switch(c){case"top":p={x:d,y:r.y-s.height};break;case"bottom":p={x:d,y:r.y+r.height};break;case"right":p={x:r.x+r.width,y:f};break;case"left":p={x:r.x-s.width,y:f};break;default:p={x:r.x,y:r.y}}switch(Wu(t)){case"start":p[o]-=h*(n&&u?-1:1);break;case"end":p[o]+=h*(n&&u?-1:1);break}return p}const zU=async(e,t,n)=>{const{placement:r="bottom",strategy:s="absolute",middleware:a=[],platform:o}=n,l=a.filter(Boolean),c=await(o.isRTL==null?void 0:o.isRTL(t));let u=await o.getElementRects({reference:e,floating:t,strategy:s}),{x:d,y:f}=hA(u,r,c),h=r,p={},g=0;for(let m=0;m({name:"arrow",options:e,async fn(t){const{x:n,y:r,placement:s,rects:a,platform:o,elements:l,middlewareData:c}=t,{element:u,padding:d=0}=vi(e,t)||{};if(u==null)return{};const f=dM(d),h={x:n,y:r},p=xS(s),g=yS(p),m=await o.getDimensions(u),y=p==="y",b=y?"top":"left",x=y?"bottom":"right",w=y?"clientHeight":"clientWidth",j=a.reference[g]+a.reference[p]-h[p]-a.floating[g],S=h[p]-a.reference[p],N=await(o.getOffsetParent==null?void 0:o.getOffsetParent(u));let _=N?N[w]:0;(!_||!await(o.isElement==null?void 0:o.isElement(N)))&&(_=l.floating[w]||a.floating[g]);const P=j/2-S/2,k=_/2-m[g]/2-1,O=jo(f[b],k),M=jo(f[x],k),A=O,$=_-m[g]-M,L=_/2-m[g]/2+P,G=tw(A,L,$),D=!c.arrow&&Wu(s)!=null&&L!==G&&a.reference[g]/2-(LL<=0)){var M,A;const L=(((M=a.flip)==null?void 0:M.index)||0)+1,G=_[L];if(G)return{data:{index:L,overflows:O},reset:{placement:G}};let D=(A=O.filter(V=>V.overflows[0]<=0).sort((V,T)=>V.overflows[1]-T.overflows[1])[0])==null?void 0:A.placement;if(!D)switch(p){case"bestFit":{var $;const V=($=O.filter(T=>{if(N){const F=No(T.placement);return F===x||F==="y"}return!0}).map(T=>[T.placement,T.overflows.filter(F=>F>0).reduce((F,q)=>F+q,0)]).sort((T,F)=>T[1]-F[1])[0])==null?void 0:$[0];V&&(D=V);break}case"initialPlacement":D=l;break}if(s!==D)return{reset:{placement:D}}}return{}}}};function pA(e,t){return{top:e.top-t.height,right:e.right-t.width,bottom:e.bottom-t.height,left:e.left-t.width}}function mA(e){return $U.some(t=>e[t]>=0)}const WU=function(e){return e===void 0&&(e={}),{name:"hide",options:e,async fn(t){const{rects:n}=t,{strategy:r="referenceHidden",...s}=vi(e,t);switch(r){case"referenceHidden":{const a=await If(t,{...s,elementContext:"reference"}),o=pA(a,n.reference);return{data:{referenceHiddenOffsets:o,referenceHidden:mA(o)}}}case"escaped":{const a=await If(t,{...s,altBoundary:!0}),o=pA(a,n.floating);return{data:{escapedOffsets:o,escaped:mA(o)}}}default:return{}}}}};async function GU(e,t){const{placement:n,platform:r,elements:s}=e,a=await(r.isRTL==null?void 0:r.isRTL(s.floating)),o=yi(n),l=Wu(n),c=No(n)==="y",u=["left","top"].includes(o)?-1:1,d=a&&c?-1:1,f=vi(t,e);let{mainAxis:h,crossAxis:p,alignmentAxis:g}=typeof f=="number"?{mainAxis:f,crossAxis:0,alignmentAxis:null}:{mainAxis:f.mainAxis||0,crossAxis:f.crossAxis||0,alignmentAxis:f.alignmentAxis};return l&&typeof g=="number"&&(p=l==="end"?g*-1:g),c?{x:p*d,y:h*u}:{x:h*u,y:p*d}}const HU=function(e){return e===void 0&&(e=0),{name:"offset",options:e,async fn(t){var n,r;const{x:s,y:a,placement:o,middlewareData:l}=t,c=await GU(t,e);return o===((n=l.offset)==null?void 0:n.placement)&&(r=l.arrow)!=null&&r.alignmentOffset?{}:{x:s+c.x,y:a+c.y,data:{...c,placement:o}}}}},qU=function(e){return e===void 0&&(e={}),{name:"shift",options:e,async fn(t){const{x:n,y:r,placement:s}=t,{mainAxis:a=!0,crossAxis:o=!1,limiter:l={fn:y=>{let{x:b,y:x}=y;return{x:b,y:x}}},...c}=vi(e,t),u={x:n,y:r},d=await If(t,c),f=No(yi(s)),h=vS(f);let p=u[h],g=u[f];if(a){const y=h==="y"?"top":"left",b=h==="y"?"bottom":"right",x=p+d[y],w=p-d[b];p=tw(x,p,w)}if(o){const y=f==="y"?"top":"left",b=f==="y"?"bottom":"right",x=g+d[y],w=g-d[b];g=tw(x,g,w)}const m=l.fn({...t,[h]:p,[f]:g});return{...m,data:{x:m.x-n,y:m.y-r,enabled:{[h]:a,[f]:o}}}}}},KU=function(e){return e===void 0&&(e={}),{options:e,fn(t){const{x:n,y:r,placement:s,rects:a,middlewareData:o}=t,{offset:l=0,mainAxis:c=!0,crossAxis:u=!0}=vi(e,t),d={x:n,y:r},f=No(s),h=vS(f);let p=d[h],g=d[f];const m=vi(l,t),y=typeof m=="number"?{mainAxis:m,crossAxis:0}:{mainAxis:0,crossAxis:0,...m};if(c){const w=h==="y"?"height":"width",j=a.reference[h]-a.floating[w]+y.mainAxis,S=a.reference[h]+a.reference[w]-y.mainAxis;pS&&(p=S)}if(u){var b,x;const w=h==="y"?"width":"height",j=["top","left"].includes(yi(s)),S=a.reference[f]-a.floating[w]+(j&&((b=o.offset)==null?void 0:b[f])||0)+(j?0:y.crossAxis),N=a.reference[f]+a.reference[w]+(j?0:((x=o.offset)==null?void 0:x[f])||0)-(j?y.crossAxis:0);gN&&(g=N)}return{[h]:p,[f]:g}}}},XU=function(e){return e===void 0&&(e={}),{name:"size",options:e,async fn(t){var n,r;const{placement:s,rects:a,platform:o,elements:l}=t,{apply:c=()=>{},...u}=vi(e,t),d=await If(t,u),f=yi(s),h=Wu(s),p=No(s)==="y",{width:g,height:m}=a.floating;let y,b;f==="top"||f==="bottom"?(y=f,b=h===(await(o.isRTL==null?void 0:o.isRTL(l.floating))?"start":"end")?"left":"right"):(b=f,y=h==="end"?"top":"bottom");const x=m-d.top-d.bottom,w=g-d.left-d.right,j=jo(m-d[y],x),S=jo(g-d[b],w),N=!t.middlewareData.shift;let _=j,P=S;if((n=t.middlewareData.shift)!=null&&n.enabled.x&&(P=w),(r=t.middlewareData.shift)!=null&&r.enabled.y&&(_=x),N&&!h){const O=ns(d.left,0),M=ns(d.right,0),A=ns(d.top,0),$=ns(d.bottom,0);p?P=g-2*(O!==0||M!==0?O+M:ns(d.left,d.right)):_=m-2*(A!==0||$!==0?A+$:ns(d.top,d.bottom))}await c({...t,availableWidth:P,availableHeight:_});const k=await o.getDimensions(l.floating);return g!==k.width||m!==k.height?{reset:{rects:!0}}:{}}}};function ly(){return typeof window<"u"}function Gu(e){return fM(e)?(e.nodeName||"").toLowerCase():"#document"}function is(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function La(e){var t;return(t=(fM(e)?e.ownerDocument:e.document)||window.document)==null?void 0:t.documentElement}function fM(e){return ly()?e instanceof Node||e instanceof is(e).Node:!1}function ra(e){return ly()?e instanceof Element||e instanceof is(e).Element:!1}function Ta(e){return ly()?e instanceof HTMLElement||e instanceof is(e).HTMLElement:!1}function gA(e){return!ly()||typeof ShadowRoot>"u"?!1:e instanceof ShadowRoot||e instanceof is(e).ShadowRoot}function tp(e){const{overflow:t,overflowX:n,overflowY:r,display:s}=sa(e);return/auto|scroll|overlay|hidden|clip/.test(t+r+n)&&!["inline","contents"].includes(s)}function YU(e){return["table","td","th"].includes(Gu(e))}function cy(e){return[":popover-open",":modal"].some(t=>{try{return e.matches(t)}catch{return!1}})}function bS(e){const t=wS(),n=ra(e)?sa(e):e;return n.transform!=="none"||n.perspective!=="none"||(n.containerType?n.containerType!=="normal":!1)||!t&&(n.backdropFilter?n.backdropFilter!=="none":!1)||!t&&(n.filter?n.filter!=="none":!1)||["transform","perspective","filter"].some(r=>(n.willChange||"").includes(r))||["paint","layout","strict","content"].some(r=>(n.contain||"").includes(r))}function ZU(e){let t=_o(e);for(;Ta(t)&&!lu(t);){if(bS(t))return t;if(cy(t))return null;t=_o(t)}return null}function wS(){return typeof CSS>"u"||!CSS.supports?!1:CSS.supports("-webkit-backdrop-filter","none")}function lu(e){return["html","body","#document"].includes(Gu(e))}function sa(e){return is(e).getComputedStyle(e)}function uy(e){return ra(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function _o(e){if(Gu(e)==="html")return e;const t=e.assignedSlot||e.parentNode||gA(e)&&e.host||La(e);return gA(t)?t.host:t}function hM(e){const t=_o(e);return lu(t)?e.ownerDocument?e.ownerDocument.body:e.body:Ta(t)&&tp(t)?t:hM(t)}function Rf(e,t,n){var r;t===void 0&&(t=[]),n===void 0&&(n=!0);const s=hM(e),a=s===((r=e.ownerDocument)==null?void 0:r.body),o=is(s);if(a){const l=rw(o);return t.concat(o,o.visualViewport||[],tp(s)?s:[],l&&n?Rf(l):[])}return t.concat(s,Rf(s,[],n))}function rw(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}function pM(e){const t=sa(e);let n=parseFloat(t.width)||0,r=parseFloat(t.height)||0;const s=Ta(e),a=s?e.offsetWidth:n,o=s?e.offsetHeight:r,l=ig(n)!==a||ig(r)!==o;return l&&(n=a,r=o),{width:n,height:r,$:l}}function jS(e){return ra(e)?e:e.contextElement}function Rc(e){const t=jS(e);if(!Ta(t))return So(1);const n=t.getBoundingClientRect(),{width:r,height:s,$:a}=pM(t);let o=(a?ig(n.width):n.width)/r,l=(a?ig(n.height):n.height)/s;return(!o||!Number.isFinite(o))&&(o=1),(!l||!Number.isFinite(l))&&(l=1),{x:o,y:l}}const QU=So(0);function mM(e){const t=is(e);return!wS()||!t.visualViewport?QU:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function JU(e,t,n){return t===void 0&&(t=!1),!n||t&&n!==is(e)?!1:t}function Ol(e,t,n,r){t===void 0&&(t=!1),n===void 0&&(n=!1);const s=e.getBoundingClientRect(),a=jS(e);let o=So(1);t&&(r?ra(r)&&(o=Rc(r)):o=Rc(e));const l=JU(a,n,r)?mM(a):So(0);let c=(s.left+l.x)/o.x,u=(s.top+l.y)/o.y,d=s.width/o.x,f=s.height/o.y;if(a){const h=is(a),p=r&&ra(r)?is(r):r;let g=h,m=rw(g);for(;m&&r&&p!==g;){const y=Rc(m),b=m.getBoundingClientRect(),x=sa(m),w=b.left+(m.clientLeft+parseFloat(x.paddingLeft))*y.x,j=b.top+(m.clientTop+parseFloat(x.paddingTop))*y.y;c*=y.x,u*=y.y,d*=y.x,f*=y.y,c+=w,u+=j,g=is(m),m=rw(g)}}return lg({width:d,height:f,x:c,y:u})}function eV(e){let{elements:t,rect:n,offsetParent:r,strategy:s}=e;const a=s==="fixed",o=La(r),l=t?cy(t.floating):!1;if(r===o||l&&a)return n;let c={scrollLeft:0,scrollTop:0},u=So(1);const d=So(0),f=Ta(r);if((f||!f&&!a)&&((Gu(r)!=="body"||tp(o))&&(c=uy(r)),Ta(r))){const h=Ol(r);u=Rc(r),d.x=h.x+r.clientLeft,d.y=h.y+r.clientTop}return{width:n.width*u.x,height:n.height*u.y,x:n.x*u.x-c.scrollLeft*u.x+d.x,y:n.y*u.y-c.scrollTop*u.y+d.y}}function tV(e){return Array.from(e.getClientRects())}function sw(e,t){const n=uy(e).scrollLeft;return t?t.left+n:Ol(La(e)).left+n}function nV(e){const t=La(e),n=uy(e),r=e.ownerDocument.body,s=ns(t.scrollWidth,t.clientWidth,r.scrollWidth,r.clientWidth),a=ns(t.scrollHeight,t.clientHeight,r.scrollHeight,r.clientHeight);let o=-n.scrollLeft+sw(e);const l=-n.scrollTop;return sa(r).direction==="rtl"&&(o+=ns(t.clientWidth,r.clientWidth)-s),{width:s,height:a,x:o,y:l}}function rV(e,t){const n=is(e),r=La(e),s=n.visualViewport;let a=r.clientWidth,o=r.clientHeight,l=0,c=0;if(s){a=s.width,o=s.height;const u=wS();(!u||u&&t==="fixed")&&(l=s.offsetLeft,c=s.offsetTop)}return{width:a,height:o,x:l,y:c}}function sV(e,t){const n=Ol(e,!0,t==="fixed"),r=n.top+e.clientTop,s=n.left+e.clientLeft,a=Ta(e)?Rc(e):So(1),o=e.clientWidth*a.x,l=e.clientHeight*a.y,c=s*a.x,u=r*a.y;return{width:o,height:l,x:c,y:u}}function vA(e,t,n){let r;if(t==="viewport")r=rV(e,n);else if(t==="document")r=nV(La(e));else if(ra(t))r=sV(t,n);else{const s=mM(e);r={...t,x:t.x-s.x,y:t.y-s.y}}return lg(r)}function gM(e,t){const n=_o(e);return n===t||!ra(n)||lu(n)?!1:sa(n).position==="fixed"||gM(n,t)}function aV(e,t){const n=t.get(e);if(n)return n;let r=Rf(e,[],!1).filter(l=>ra(l)&&Gu(l)!=="body"),s=null;const a=sa(e).position==="fixed";let o=a?_o(e):e;for(;ra(o)&&!lu(o);){const l=sa(o),c=bS(o);!c&&l.position==="fixed"&&(s=null),(a?!c&&!s:!c&&l.position==="static"&&!!s&&["absolute","fixed"].includes(s.position)||tp(o)&&!c&&gM(e,o))?r=r.filter(d=>d!==o):s=l,o=_o(o)}return t.set(e,r),r}function iV(e){let{element:t,boundary:n,rootBoundary:r,strategy:s}=e;const o=[...n==="clippingAncestors"?cy(t)?[]:aV(t,this._c):[].concat(n),r],l=o[0],c=o.reduce((u,d)=>{const f=vA(t,d,s);return u.top=ns(f.top,u.top),u.right=jo(f.right,u.right),u.bottom=jo(f.bottom,u.bottom),u.left=ns(f.left,u.left),u},vA(t,l,s));return{width:c.right-c.left,height:c.bottom-c.top,x:c.left,y:c.top}}function oV(e){const{width:t,height:n}=pM(e);return{width:t,height:n}}function lV(e,t,n){const r=Ta(t),s=La(t),a=n==="fixed",o=Ol(e,!0,a,t);let l={scrollLeft:0,scrollTop:0};const c=So(0);if(r||!r&&!a)if((Gu(t)!=="body"||tp(s))&&(l=uy(t)),r){const p=Ol(t,!0,a,t);c.x=p.x+t.clientLeft,c.y=p.y+t.clientTop}else s&&(c.x=sw(s));let u=0,d=0;if(s&&!r&&!a){const p=s.getBoundingClientRect();d=p.top+l.scrollTop,u=p.left+l.scrollLeft-sw(s,p)}const f=o.left+l.scrollLeft-c.x-u,h=o.top+l.scrollTop-c.y-d;return{x:f,y:h,width:o.width,height:o.height}}function c0(e){return sa(e).position==="static"}function yA(e,t){if(!Ta(e)||sa(e).position==="fixed")return null;if(t)return t(e);let n=e.offsetParent;return La(e)===n&&(n=n.ownerDocument.body),n}function vM(e,t){const n=is(e);if(cy(e))return n;if(!Ta(e)){let s=_o(e);for(;s&&!lu(s);){if(ra(s)&&!c0(s))return s;s=_o(s)}return n}let r=yA(e,t);for(;r&&YU(r)&&c0(r);)r=yA(r,t);return r&&lu(r)&&c0(r)&&!bS(r)?n:r||ZU(e)||n}const cV=async function(e){const t=this.getOffsetParent||vM,n=this.getDimensions,r=await n(e.floating);return{reference:lV(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:r.width,height:r.height}}};function uV(e){return sa(e).direction==="rtl"}const dV={convertOffsetParentRelativeRectToViewportRelativeRect:eV,getDocumentElement:La,getClippingRect:iV,getOffsetParent:vM,getElementRects:cV,getClientRects:tV,getDimensions:oV,getScale:Rc,isElement:ra,isRTL:uV};function fV(e,t){let n=null,r;const s=La(e);function a(){var l;clearTimeout(r),(l=n)==null||l.disconnect(),n=null}function o(l,c){l===void 0&&(l=!1),c===void 0&&(c=1),a();const{left:u,top:d,width:f,height:h}=e.getBoundingClientRect();if(l||t(),!f||!h)return;const p=Gp(d),g=Gp(s.clientWidth-(u+f)),m=Gp(s.clientHeight-(d+h)),y=Gp(u),x={rootMargin:-p+"px "+-g+"px "+-m+"px "+-y+"px",threshold:ns(0,jo(1,c))||1};let w=!0;function j(S){const N=S[0].intersectionRatio;if(N!==c){if(!w)return o();N?o(!1,N):r=setTimeout(()=>{o(!1,1e-7)},1e3)}w=!1}try{n=new IntersectionObserver(j,{...x,root:s.ownerDocument})}catch{n=new IntersectionObserver(j,x)}n.observe(e)}return o(!0),a}function hV(e,t,n,r){r===void 0&&(r={});const{ancestorScroll:s=!0,ancestorResize:a=!0,elementResize:o=typeof ResizeObserver=="function",layoutShift:l=typeof IntersectionObserver=="function",animationFrame:c=!1}=r,u=jS(e),d=s||a?[...u?Rf(u):[],...Rf(t)]:[];d.forEach(b=>{s&&b.addEventListener("scroll",n,{passive:!0}),a&&b.addEventListener("resize",n)});const f=u&&l?fV(u,n):null;let h=-1,p=null;o&&(p=new ResizeObserver(b=>{let[x]=b;x&&x.target===u&&p&&(p.unobserve(t),cancelAnimationFrame(h),h=requestAnimationFrame(()=>{var w;(w=p)==null||w.observe(t)})),n()}),u&&!c&&p.observe(u),p.observe(t));let g,m=c?Ol(e):null;c&&y();function y(){const b=Ol(e);m&&(b.x!==m.x||b.y!==m.y||b.width!==m.width||b.height!==m.height)&&n(),m=b,g=requestAnimationFrame(y)}return n(),()=>{var b;d.forEach(x=>{s&&x.removeEventListener("scroll",n),a&&x.removeEventListener("resize",n)}),f==null||f(),(b=p)==null||b.disconnect(),p=null,c&&cancelAnimationFrame(g)}}const pV=HU,mV=qU,gV=VU,vV=XU,yV=WU,xA=UU,xV=KU,bV=(e,t,n)=>{const r=new Map,s={platform:dV,...n},a={...s.platform,_c:r};return zU(e,t,{...s,platform:a})};var _m=typeof document<"u"?v.useLayoutEffect:v.useEffect;function cg(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,s;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(!cg(e[r],t[r]))return!1;return!0}if(s=Object.keys(e),n=s.length,n!==Object.keys(t).length)return!1;for(r=n;r--!==0;)if(!{}.hasOwnProperty.call(t,s[r]))return!1;for(r=n;r--!==0;){const a=s[r];if(!(a==="_owner"&&e.$$typeof)&&!cg(e[a],t[a]))return!1}return!0}return e!==e&&t!==t}function yM(e){return typeof window>"u"?1:(e.ownerDocument.defaultView||window).devicePixelRatio||1}function bA(e,t){const n=yM(e);return Math.round(t*n)/n}function u0(e){const t=v.useRef(e);return _m(()=>{t.current=e}),t}function wV(e){e===void 0&&(e={});const{placement:t="bottom",strategy:n="absolute",middleware:r=[],platform:s,elements:{reference:a,floating:o}={},transform:l=!0,whileElementsMounted:c,open:u}=e,[d,f]=v.useState({x:0,y:0,strategy:n,placement:t,middlewareData:{},isPositioned:!1}),[h,p]=v.useState(r);cg(h,r)||p(r);const[g,m]=v.useState(null),[y,b]=v.useState(null),x=v.useCallback(T=>{T!==N.current&&(N.current=T,m(T))},[]),w=v.useCallback(T=>{T!==_.current&&(_.current=T,b(T))},[]),j=a||g,S=o||y,N=v.useRef(null),_=v.useRef(null),P=v.useRef(d),k=c!=null,O=u0(c),M=u0(s),A=u0(u),$=v.useCallback(()=>{if(!N.current||!_.current)return;const T={placement:t,strategy:n,middleware:h};M.current&&(T.platform=M.current),bV(N.current,_.current,T).then(F=>{const q={...F,isPositioned:A.current!==!1};L.current&&!cg(P.current,q)&&(P.current=q,Vu.flushSync(()=>{f(q)}))})},[h,t,n,M,A]);_m(()=>{u===!1&&P.current.isPositioned&&(P.current.isPositioned=!1,f(T=>({...T,isPositioned:!1})))},[u]);const L=v.useRef(!1);_m(()=>(L.current=!0,()=>{L.current=!1}),[]),_m(()=>{if(j&&(N.current=j),S&&(_.current=S),j&&S){if(O.current)return O.current(j,S,$);$()}},[j,S,$,O,k]);const G=v.useMemo(()=>({reference:N,floating:_,setReference:x,setFloating:w}),[x,w]),D=v.useMemo(()=>({reference:j,floating:S}),[j,S]),V=v.useMemo(()=>{const T={position:n,left:0,top:0};if(!D.floating)return T;const F=bA(D.floating,d.x),q=bA(D.floating,d.y);return l?{...T,transform:"translate("+F+"px, "+q+"px)",...yM(D.floating)>=1.5&&{willChange:"transform"}}:{position:n,left:F,top:q}},[n,l,D.floating,d.x,d.y]);return v.useMemo(()=>({...d,update:$,refs:G,elements:D,floatingStyles:V}),[d,$,G,D,V])}const jV=e=>{function t(n){return{}.hasOwnProperty.call(n,"current")}return{name:"arrow",options:e,fn(n){const{element:r,padding:s}=typeof e=="function"?e(n):e;return r&&t(r)?r.current!=null?xA({element:r.current,padding:s}).fn(n):{}:r?xA({element:r,padding:s}).fn(n):{}}}},SV=(e,t)=>({...pV(e),options:[e,t]}),NV=(e,t)=>({...mV(e),options:[e,t]}),_V=(e,t)=>({...xV(e),options:[e,t]}),PV=(e,t)=>({...gV(e),options:[e,t]}),AV=(e,t)=>({...vV(e),options:[e,t]}),CV=(e,t)=>({...yV(e),options:[e,t]}),EV=(e,t)=>({...jV(e),options:[e,t]});var OV="Arrow",xM=v.forwardRef((e,t)=>{const{children:n,width:r=10,height:s=5,...a}=e;return i.jsx(Ye.svg,{...a,ref:t,width:r,height:s,viewBox:"0 0 30 10",preserveAspectRatio:"none",children:e.asChild?n:i.jsx("polygon",{points:"0,0 30,0 15,10"})})});xM.displayName=OV;var kV=xM;function TV(e,t=[]){let n=[];function r(a,o){const l=v.createContext(o),c=n.length;n=[...n,o];function u(f){const{scope:h,children:p,...g}=f,m=(h==null?void 0:h[e][c])||l,y=v.useMemo(()=>g,Object.values(g));return i.jsx(m.Provider,{value:y,children:p})}function d(f,h){const p=(h==null?void 0:h[e][c])||l,g=v.useContext(p);if(g)return g;if(o!==void 0)return o;throw new Error(`\`${f}\` must be used within \`${a}\``)}return u.displayName=a+"Provider",[u,d]}const s=()=>{const a=n.map(o=>v.createContext(o));return function(l){const c=(l==null?void 0:l[e])||a;return v.useMemo(()=>({[`__scope${e}`]:{...l,[e]:c}}),[l,c])}};return s.scopeName=e,[r,$V(s,...t)]}function $V(...e){const t=e[0];if(e.length===1)return t;const n=()=>{const r=e.map(s=>({useScope:s(),scopeName:s.scopeName}));return function(a){const o=r.reduce((l,{useScope:c,scopeName:u})=>{const f=c(a)[`__scope${u}`];return{...l,...f}},{});return v.useMemo(()=>({[`__scope${t.scopeName}`]:o}),[o])}};return n.scopeName=t.scopeName,n}function np(e){const[t,n]=v.useState(void 0);return or(()=>{if(e){n({width:e.offsetWidth,height:e.offsetHeight});const r=new ResizeObserver(s=>{if(!Array.isArray(s)||!s.length)return;const a=s[0];let o,l;if("borderBoxSize"in a){const c=a.borderBoxSize,u=Array.isArray(c)?c[0]:c;o=u.inlineSize,l=u.blockSize}else o=e.offsetWidth,l=e.offsetHeight;n({width:o,height:l})});return r.observe(e,{box:"border-box"}),()=>r.unobserve(e)}else n(void 0)},[e]),t}var SS="Popper",[bM,Hu]=TV(SS),[MV,wM]=bM(SS),jM=e=>{const{__scopePopper:t,children:n}=e,[r,s]=v.useState(null);return i.jsx(MV,{scope:t,anchor:r,onAnchorChange:s,children:n})};jM.displayName=SS;var SM="PopperAnchor",NM=v.forwardRef((e,t)=>{const{__scopePopper:n,virtualRef:r,...s}=e,a=wM(SM,n),o=v.useRef(null),l=xt(t,o);return v.useEffect(()=>{a.onAnchorChange((r==null?void 0:r.current)||o.current)}),r?null:i.jsx(Ye.div,{...s,ref:l})});NM.displayName=SM;var NS="PopperContent",[IV,RV]=bM(NS),_M=v.forwardRef((e,t)=>{var ce,De,de,be,Pe,ne;const{__scopePopper:n,side:r="bottom",sideOffset:s=0,align:a="center",alignOffset:o=0,arrowPadding:l=0,avoidCollisions:c=!0,collisionBoundary:u=[],collisionPadding:d=0,sticky:f="partial",hideWhenDetached:h=!1,updatePositionStrategy:p="optimized",onPlaced:g,...m}=e,y=wM(NS,n),[b,x]=v.useState(null),w=xt(t,Je=>x(Je)),[j,S]=v.useState(null),N=np(j),_=(N==null?void 0:N.width)??0,P=(N==null?void 0:N.height)??0,k=r+(a!=="center"?"-"+a:""),O=typeof d=="number"?d:{top:0,right:0,bottom:0,left:0,...d},M=Array.isArray(u)?u:[u],A=M.length>0,$={padding:O,boundary:M.filter(LV),altBoundary:A},{refs:L,floatingStyles:G,placement:D,isPositioned:V,middlewareData:T}=wV({strategy:"fixed",placement:k,whileElementsMounted:(...Je)=>hV(...Je,{animationFrame:p==="always"}),elements:{reference:y.anchor},middleware:[SV({mainAxis:s+P,alignmentAxis:o}),c&&NV({mainAxis:!0,crossAxis:!1,limiter:f==="partial"?_V():void 0,...$}),c&&PV({...$}),AV({...$,apply:({elements:Je,rects:ve,availableWidth:at,availableHeight:st})=>{const{width:Mt,height:C}=ve.reference,R=Je.floating.style;R.setProperty("--radix-popper-available-width",`${at}px`),R.setProperty("--radix-popper-available-height",`${st}px`),R.setProperty("--radix-popper-anchor-width",`${Mt}px`),R.setProperty("--radix-popper-anchor-height",`${C}px`)}}),j&&EV({element:j,padding:l}),FV({arrowWidth:_,arrowHeight:P}),h&&CV({strategy:"referenceHidden",...$})]}),[F,q]=CM(D),Z=Gn(g);or(()=>{V&&(Z==null||Z())},[V,Z]);const re=(ce=T.arrow)==null?void 0:ce.x,ge=(De=T.arrow)==null?void 0:De.y,B=((de=T.arrow)==null?void 0:de.centerOffset)!==0,[le,se]=v.useState();return or(()=>{b&&se(window.getComputedStyle(b).zIndex)},[b]),i.jsx("div",{ref:L.setFloating,"data-radix-popper-content-wrapper":"",style:{...G,transform:V?G.transform:"translate(0, -200%)",minWidth:"max-content",zIndex:le,"--radix-popper-transform-origin":[(be=T.transformOrigin)==null?void 0:be.x,(Pe=T.transformOrigin)==null?void 0:Pe.y].join(" "),...((ne=T.hide)==null?void 0:ne.referenceHidden)&&{visibility:"hidden",pointerEvents:"none"}},dir:e.dir,children:i.jsx(IV,{scope:n,placedSide:F,onArrowChange:S,arrowX:re,arrowY:ge,shouldHideArrow:B,children:i.jsx(Ye.div,{"data-side":F,"data-align":q,...m,ref:w,style:{...m.style,animation:V?void 0:"none"}})})})});_M.displayName=NS;var PM="PopperArrow",DV={top:"bottom",right:"left",bottom:"top",left:"right"},AM=v.forwardRef(function(t,n){const{__scopePopper:r,...s}=t,a=RV(PM,r),o=DV[a.placedSide];return i.jsx("span",{ref:a.onArrowChange,style:{position:"absolute",left:a.arrowX,top:a.arrowY,[o]:0,transformOrigin:{top:"",right:"0 0",bottom:"center 0",left:"100% 0"}[a.placedSide],transform:{top:"translateY(100%)",right:"translateY(50%) rotate(90deg) translateX(-50%)",bottom:"rotate(180deg)",left:"translateY(50%) rotate(-90deg) translateX(50%)"}[a.placedSide],visibility:a.shouldHideArrow?"hidden":void 0},children:i.jsx(kV,{...s,ref:n,style:{...s.style,display:"block"}})})});AM.displayName=PM;function LV(e){return e!==null}var FV=e=>({name:"transformOrigin",options:e,fn(t){var y,b,x;const{placement:n,rects:r,middlewareData:s}=t,o=((y=s.arrow)==null?void 0:y.centerOffset)!==0,l=o?0:e.arrowWidth,c=o?0:e.arrowHeight,[u,d]=CM(n),f={start:"0%",center:"50%",end:"100%"}[d],h=(((b=s.arrow)==null?void 0:b.x)??0)+l/2,p=(((x=s.arrow)==null?void 0:x.y)??0)+c/2;let g="",m="";return u==="bottom"?(g=o?f:`${h}px`,m=`${-c}px`):u==="top"?(g=o?f:`${h}px`,m=`${r.floating.height+c}px`):u==="right"?(g=`${-c}px`,m=o?f:`${p}px`):u==="left"&&(g=`${r.floating.width+c}px`,m=o?f:`${p}px`),{data:{x:g,y:m}}}});function CM(e){const[t,n="center"]=e.split("-");return[t,n]}var EM=jM,_S=NM,PS=_M,AS=AM,BV="Portal",dy=v.forwardRef((e,t)=>{var l;const{container:n,...r}=e,[s,a]=v.useState(!1);or(()=>a(!0),[]);const o=n||s&&((l=globalThis==null?void 0:globalThis.document)==null?void 0:l.body);return o?iM.createPortal(i.jsx(Ye.div,{...r,ref:t}),o):null});dy.displayName=BV;function zV(e,t){return v.useReducer((n,r)=>t[n][r]??n,e)}var lr=e=>{const{present:t,children:n}=e,r=UV(t),s=typeof n=="function"?n({present:r.isPresent}):v.Children.only(n),a=xt(r.ref,VV(s));return typeof n=="function"||r.isPresent?v.cloneElement(s,{ref:a}):null};lr.displayName="Presence";function UV(e){const[t,n]=v.useState(),r=v.useRef({}),s=v.useRef(e),a=v.useRef("none"),o=e?"mounted":"unmounted",[l,c]=zV(o,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return v.useEffect(()=>{const u=Hp(r.current);a.current=l==="mounted"?u:"none"},[l]),or(()=>{const u=r.current,d=s.current;if(d!==e){const h=a.current,p=Hp(u);e?c("MOUNT"):p==="none"||(u==null?void 0:u.display)==="none"?c("UNMOUNT"):c(d&&h!==p?"ANIMATION_OUT":"UNMOUNT"),s.current=e}},[e,c]),or(()=>{if(t){let u;const d=t.ownerDocument.defaultView??window,f=p=>{const m=Hp(r.current).includes(p.animationName);if(p.target===t&&m&&(c("ANIMATION_END"),!s.current)){const y=t.style.animationFillMode;t.style.animationFillMode="forwards",u=d.setTimeout(()=>{t.style.animationFillMode==="forwards"&&(t.style.animationFillMode=y)})}},h=p=>{p.target===t&&(a.current=Hp(r.current))};return t.addEventListener("animationstart",h),t.addEventListener("animationcancel",f),t.addEventListener("animationend",f),()=>{d.clearTimeout(u),t.removeEventListener("animationstart",h),t.removeEventListener("animationcancel",f),t.removeEventListener("animationend",f)}}else c("ANIMATION_END")},[t,c]),{isPresent:["mounted","unmountSuspended"].includes(l),ref:v.useCallback(u=>{u&&(r.current=getComputedStyle(u)),n(u)},[])}}function Hp(e){return(e==null?void 0:e.animationName)||"none"}function VV(e){var r,s;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=(s=Object.getOwnPropertyDescriptor(e,"ref"))==null?void 0:s.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}function aa({prop:e,defaultProp:t,onChange:n=()=>{}}){const[r,s]=WV({defaultProp:t,onChange:n}),a=e!==void 0,o=a?e:r,l=Gn(n),c=v.useCallback(u=>{if(a){const f=typeof u=="function"?u(e):u;f!==e&&l(f)}else s(u)},[a,e,s,l]);return[o,c]}function WV({defaultProp:e,onChange:t}){const n=v.useState(e),[r]=n,s=v.useRef(r),a=Gn(t);return v.useEffect(()=>{s.current!==r&&(a(r),s.current=r)},[r,s,a]),n}var GV="VisuallyHidden",CS=v.forwardRef((e,t)=>i.jsx(Ye.span,{...e,ref:t,style:{position:"absolute",border:0,width:1,height:1,padding:0,margin:-1,overflow:"hidden",clip:"rect(0, 0, 0, 0)",whiteSpace:"nowrap",wordWrap:"normal",...e.style}}));CS.displayName=GV;var HV=CS,[fy,CPe]=Hr("Tooltip",[Hu]),ES=Hu(),OM="TooltipProvider",qV=700,wA="tooltip.open",[KV,kM]=fy(OM),TM=e=>{const{__scopeTooltip:t,delayDuration:n=qV,skipDelayDuration:r=300,disableHoverableContent:s=!1,children:a}=e,[o,l]=v.useState(!0),c=v.useRef(!1),u=v.useRef(0);return v.useEffect(()=>{const d=u.current;return()=>window.clearTimeout(d)},[]),i.jsx(KV,{scope:t,isOpenDelayed:o,delayDuration:n,onOpen:v.useCallback(()=>{window.clearTimeout(u.current),l(!1)},[]),onClose:v.useCallback(()=>{window.clearTimeout(u.current),u.current=window.setTimeout(()=>l(!0),r)},[r]),isPointerInTransitRef:c,onPointerInTransitChange:v.useCallback(d=>{c.current=d},[]),disableHoverableContent:s,children:a})};TM.displayName=OM;var $M="Tooltip",[EPe,hy]=fy($M),aw="TooltipTrigger",XV=v.forwardRef((e,t)=>{const{__scopeTooltip:n,...r}=e,s=hy(aw,n),a=kM(aw,n),o=ES(n),l=v.useRef(null),c=xt(t,l,s.onTriggerChange),u=v.useRef(!1),d=v.useRef(!1),f=v.useCallback(()=>u.current=!1,[]);return v.useEffect(()=>()=>document.removeEventListener("pointerup",f),[f]),i.jsx(_S,{asChild:!0,...o,children:i.jsx(Ye.button,{"aria-describedby":s.open?s.contentId:void 0,"data-state":s.stateAttribute,...r,ref:c,onPointerMove:Ee(e.onPointerMove,h=>{h.pointerType!=="touch"&&!d.current&&!a.isPointerInTransitRef.current&&(s.onTriggerEnter(),d.current=!0)}),onPointerLeave:Ee(e.onPointerLeave,()=>{s.onTriggerLeave(),d.current=!1}),onPointerDown:Ee(e.onPointerDown,()=>{u.current=!0,document.addEventListener("pointerup",f,{once:!0})}),onFocus:Ee(e.onFocus,()=>{u.current||s.onOpen()}),onBlur:Ee(e.onBlur,s.onClose),onClick:Ee(e.onClick,s.onClose)})})});XV.displayName=aw;var YV="TooltipPortal",[OPe,ZV]=fy(YV,{forceMount:void 0}),cu="TooltipContent",MM=v.forwardRef((e,t)=>{const n=ZV(cu,e.__scopeTooltip),{forceMount:r=n.forceMount,side:s="top",...a}=e,o=hy(cu,e.__scopeTooltip);return i.jsx(lr,{present:r||o.open,children:o.disableHoverableContent?i.jsx(IM,{side:s,...a,ref:t}):i.jsx(QV,{side:s,...a,ref:t})})}),QV=v.forwardRef((e,t)=>{const n=hy(cu,e.__scopeTooltip),r=kM(cu,e.__scopeTooltip),s=v.useRef(null),a=xt(t,s),[o,l]=v.useState(null),{trigger:c,onClose:u}=n,d=s.current,{onPointerInTransitChange:f}=r,h=v.useCallback(()=>{l(null),f(!1)},[f]),p=v.useCallback((g,m)=>{const y=g.currentTarget,b={x:g.clientX,y:g.clientY},x=n7(b,y.getBoundingClientRect()),w=r7(b,x),j=s7(m.getBoundingClientRect()),S=i7([...w,...j]);l(S),f(!0)},[f]);return v.useEffect(()=>()=>h(),[h]),v.useEffect(()=>{if(c&&d){const g=y=>p(y,d),m=y=>p(y,c);return c.addEventListener("pointerleave",g),d.addEventListener("pointerleave",m),()=>{c.removeEventListener("pointerleave",g),d.removeEventListener("pointerleave",m)}}},[c,d,p,h]),v.useEffect(()=>{if(o){const g=m=>{const y=m.target,b={x:m.clientX,y:m.clientY},x=(c==null?void 0:c.contains(y))||(d==null?void 0:d.contains(y)),w=!a7(b,o);x?h():w&&(h(),u())};return document.addEventListener("pointermove",g),()=>document.removeEventListener("pointermove",g)}},[c,d,o,u,h]),i.jsx(IM,{...e,ref:a})}),[JV,e7]=fy($M,{isInside:!1}),IM=v.forwardRef((e,t)=>{const{__scopeTooltip:n,children:r,"aria-label":s,onEscapeKeyDown:a,onPointerDownOutside:o,...l}=e,c=hy(cu,n),u=ES(n),{onClose:d}=c;return v.useEffect(()=>(document.addEventListener(wA,d),()=>document.removeEventListener(wA,d)),[d]),v.useEffect(()=>{if(c.trigger){const f=h=>{const p=h.target;p!=null&&p.contains(c.trigger)&&d()};return window.addEventListener("scroll",f,{capture:!0}),()=>window.removeEventListener("scroll",f,{capture:!0})}},[c.trigger,d]),i.jsx(ep,{asChild:!0,disableOutsidePointerEvents:!1,onEscapeKeyDown:a,onPointerDownOutside:o,onFocusOutside:f=>f.preventDefault(),onDismiss:d,children:i.jsxs(PS,{"data-state":c.stateAttribute,...u,...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:[i.jsx(gS,{children:r}),i.jsx(JV,{scope:n,isInside:!0,children:i.jsx(HV,{id:c.contentId,role:"tooltip",children:s||r})})]})})});MM.displayName=cu;var RM="TooltipArrow",t7=v.forwardRef((e,t)=>{const{__scopeTooltip:n,...r}=e,s=ES(n);return e7(RM,n).isInside?null:i.jsx(AS,{...s,...r,ref:t})});t7.displayName=RM;function n7(e,t){const n=Math.abs(t.top-e.y),r=Math.abs(t.bottom-e.y),s=Math.abs(t.right-e.x),a=Math.abs(t.left-e.x);switch(Math.min(n,r,s,a)){case a:return"left";case s:return"right";case n:return"top";case r:return"bottom";default:throw new Error("unreachable")}}function r7(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 s7(e){const{top:t,right:n,bottom:r,left:s}=e;return[{x:s,y:t},{x:n,y:t},{x:n,y:r},{x:s,y:r}]}function a7(e,t){const{x:n,y:r}=e;let s=!1;for(let a=0,o=t.length-1;ar!=d>r&&n<(u-l)*(r-c)/(d-c)+l&&(s=!s)}return s}function i7(e){const t=e.slice();return t.sort((n,r)=>n.xr.x?1:n.yr.y?1:0),o7(t)}function o7(e){if(e.length<=1)return e.slice();const t=[];for(let r=0;r=2;){const a=t[t.length-1],o=t[t.length-2];if((a.x-o.x)*(s.y-o.y)>=(a.y-o.y)*(s.x-o.x))t.pop();else break}t.push(s)}t.pop();const n=[];for(let r=e.length-1;r>=0;r--){const s=e[r];for(;n.length>=2;){const a=n[n.length-1],o=n[n.length-2];if((a.x-o.x)*(s.y-o.y)>=(a.y-o.y)*(s.x-o.x))n.pop();else break}n.push(s)}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 l7=TM,DM=MM;function LM(e){var t,n,r="";if(typeof e=="string"||typeof e=="number")r+=e;else if(typeof e=="object")if(Array.isArray(e)){var s=e.length;for(t=0;t{const t=d7(e),{conflictingClassGroups:n,conflictingClassGroupModifiers:r}=e;return{getClassGroupId:o=>{const l=o.split(OS);return l[0]===""&&l.length!==1&&l.shift(),FM(l,t)||u7(o)},getConflictingClassGroupIds:(o,l)=>{const c=n[o]||[];return l&&r[o]?[...c,...r[o]]:c}}},FM=(e,t)=>{var o;if(e.length===0)return t.classGroupId;const n=e[0],r=t.nextPart.get(n),s=r?FM(e.slice(1),r):void 0;if(s)return s;if(t.validators.length===0)return;const a=e.join(OS);return(o=t.validators.find(({validator:l})=>l(a)))==null?void 0:o.classGroupId},jA=/^\[(.+)\]$/,u7=e=>{if(jA.test(e)){const t=jA.exec(e)[1],n=t==null?void 0:t.substring(0,t.indexOf(":"));if(n)return"arbitrary.."+n}},d7=e=>{const{theme:t,prefix:n}=e,r={nextPart:new Map,validators:[]};return h7(Object.entries(e.classGroups),n).forEach(([a,o])=>{iw(o,r,a,t)}),r},iw=(e,t,n,r)=>{e.forEach(s=>{if(typeof s=="string"){const a=s===""?t:SA(t,s);a.classGroupId=n;return}if(typeof s=="function"){if(f7(s)){iw(s(r),t,n,r);return}t.validators.push({validator:s,classGroupId:n});return}Object.entries(s).forEach(([a,o])=>{iw(o,SA(t,a),n,r)})})},SA=(e,t)=>{let n=e;return t.split(OS).forEach(r=>{n.nextPart.has(r)||n.nextPart.set(r,{nextPart:new Map,validators:[]}),n=n.nextPart.get(r)}),n},f7=e=>e.isThemeGetter,h7=(e,t)=>t?e.map(([n,r])=>{const s=r.map(a=>typeof a=="string"?t+a:typeof a=="object"?Object.fromEntries(Object.entries(a).map(([o,l])=>[t+o,l])):a);return[n,s]}):e,p7=e=>{if(e<1)return{get:()=>{},set:()=>{}};let t=0,n=new Map,r=new Map;const s=(a,o)=>{n.set(a,o),t++,t>e&&(t=0,r=n,n=new Map)};return{get(a){let o=n.get(a);if(o!==void 0)return o;if((o=r.get(a))!==void 0)return s(a,o),o},set(a,o){n.has(a)?n.set(a,o):s(a,o)}}},BM="!",m7=e=>{const{separator:t,experimentalParseClassName:n}=e,r=t.length===1,s=t[0],a=t.length,o=l=>{const c=[];let u=0,d=0,f;for(let y=0;yd?f-d:void 0;return{modifiers:c,hasImportantModifier:p,baseClassName:g,maybePostfixModifierPosition:m}};return n?l=>n({className:l,parseClassName:o}):o},g7=e=>{if(e.length<=1)return e;const t=[];let n=[];return e.forEach(r=>{r[0]==="["?(t.push(...n.sort(),r),n=[]):n.push(r)}),t.push(...n.sort()),t},v7=e=>({cache:p7(e.cacheSize),parseClassName:m7(e),...c7(e)}),y7=/\s+/,x7=(e,t)=>{const{parseClassName:n,getClassGroupId:r,getConflictingClassGroupIds:s}=t,a=[],o=e.trim().split(y7);let l="";for(let c=o.length-1;c>=0;c-=1){const u=o[c],{modifiers:d,hasImportantModifier:f,baseClassName:h,maybePostfixModifierPosition:p}=n(u);let g=!!p,m=r(g?h.substring(0,p):h);if(!m){if(!g){l=u+(l.length>0?" "+l:l);continue}if(m=r(h),!m){l=u+(l.length>0?" "+l:l);continue}g=!1}const y=g7(d).join(":"),b=f?y+BM:y,x=b+m;if(a.includes(x))continue;a.push(x);const w=s(m,g);for(let j=0;j0?" "+l:l)}return l};function b7(){let e=0,t,n,r="";for(;e{if(typeof e=="string")return e;let t,n="";for(let r=0;rf(d),e());return n=v7(u),r=n.cache.get,s=n.cache.set,a=l,l(c)}function l(c){const u=r(c);if(u)return u;const d=x7(c,n);return s(c,d),d}return function(){return a(b7.apply(null,arguments))}}const on=e=>{const t=n=>n[e]||[];return t.isThemeGetter=!0,t},UM=/^\[(?:([a-z-]+):)?(.+)\]$/i,j7=/^\d+\/\d+$/,S7=new Set(["px","full","screen"]),N7=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,_7=/\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$/,P7=/^(rgba?|hsla?|hwb|(ok)?(lab|lch))\(.+\)$/,A7=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,C7=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,Va=e=>Dc(e)||S7.has(e)||j7.test(e),$i=e=>qu(e,"length",R7),Dc=e=>!!e&&!Number.isNaN(Number(e)),d0=e=>qu(e,"number",Dc),Pd=e=>!!e&&Number.isInteger(Number(e)),E7=e=>e.endsWith("%")&&Dc(e.slice(0,-1)),At=e=>UM.test(e),Mi=e=>N7.test(e),O7=new Set(["length","size","percentage"]),k7=e=>qu(e,O7,VM),T7=e=>qu(e,"position",VM),$7=new Set(["image","url"]),M7=e=>qu(e,$7,L7),I7=e=>qu(e,"",D7),Ad=()=>!0,qu=(e,t,n)=>{const r=UM.exec(e);return r?r[1]?typeof t=="string"?r[1]===t:t.has(r[1]):n(r[2]):!1},R7=e=>_7.test(e)&&!P7.test(e),VM=()=>!1,D7=e=>A7.test(e),L7=e=>C7.test(e),F7=()=>{const e=on("colors"),t=on("spacing"),n=on("blur"),r=on("brightness"),s=on("borderColor"),a=on("borderRadius"),o=on("borderSpacing"),l=on("borderWidth"),c=on("contrast"),u=on("grayscale"),d=on("hueRotate"),f=on("invert"),h=on("gap"),p=on("gradientColorStops"),g=on("gradientColorStopPositions"),m=on("inset"),y=on("margin"),b=on("opacity"),x=on("padding"),w=on("saturate"),j=on("scale"),S=on("sepia"),N=on("skew"),_=on("space"),P=on("translate"),k=()=>["auto","contain","none"],O=()=>["auto","hidden","clip","visible","scroll"],M=()=>["auto",At,t],A=()=>[At,t],$=()=>["",Va,$i],L=()=>["auto",Dc,At],G=()=>["bottom","center","left","left-bottom","left-top","right","right-bottom","right-top","top"],D=()=>["solid","dashed","dotted","double","none"],V=()=>["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity"],T=()=>["start","end","center","between","around","evenly","stretch"],F=()=>["","0",At],q=()=>["auto","avoid","all","avoid-page","page","left","right","column"],Z=()=>[Dc,At];return{cacheSize:500,separator:":",theme:{colors:[Ad],spacing:[Va,$i],blur:["none","",Mi,At],brightness:Z(),borderColor:[e],borderRadius:["none","","full",Mi,At],borderSpacing:A(),borderWidth:$(),contrast:Z(),grayscale:F(),hueRotate:Z(),invert:F(),gap:A(),gradientColorStops:[e],gradientColorStopPositions:[E7,$i],inset:M(),margin:M(),opacity:Z(),padding:A(),saturate:Z(),scale:Z(),sepia:F(),skew:Z(),space:A(),translate:A()},classGroups:{aspect:[{aspect:["auto","square","video",At]}],container:["container"],columns:[{columns:[Mi]}],"break-after":[{"break-after":q()}],"break-before":[{"break-before":q()}],"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"],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:[...G(),At]}],overflow:[{overflow:O()}],"overflow-x":[{"overflow-x":O()}],"overflow-y":[{"overflow-y":O()}],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:["auto",Pd,At]}],basis:[{basis:M()}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["wrap","wrap-reverse","nowrap"]}],flex:[{flex:["1","auto","initial","none",At]}],grow:[{grow:F()}],shrink:[{shrink:F()}],order:[{order:["first","last","none",Pd,At]}],"grid-cols":[{"grid-cols":[Ad]}],"col-start-end":[{col:["auto",{span:["full",Pd,At]},At]}],"col-start":[{"col-start":L()}],"col-end":[{"col-end":L()}],"grid-rows":[{"grid-rows":[Ad]}],"row-start-end":[{row:["auto",{span:[Pd,At]},At]}],"row-start":[{"row-start":L()}],"row-end":[{"row-end":L()}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":["auto","min","max","fr",At]}],"auto-rows":[{"auto-rows":["auto","min","max","fr",At]}],gap:[{gap:[h]}],"gap-x":[{"gap-x":[h]}],"gap-y":[{"gap-y":[h]}],"justify-content":[{justify:["normal",...T()]}],"justify-items":[{"justify-items":["start","end","center","stretch"]}],"justify-self":[{"justify-self":["auto","start","end","center","stretch"]}],"align-content":[{content:["normal",...T(),"baseline"]}],"align-items":[{items:["start","end","center","baseline","stretch"]}],"align-self":[{self:["auto","start","end","center","stretch","baseline"]}],"place-content":[{"place-content":[...T(),"baseline"]}],"place-items":[{"place-items":["start","end","center","baseline","stretch"]}],"place-self":[{"place-self":["auto","start","end","center","stretch"]}],p:[{p:[x]}],px:[{px:[x]}],py:[{py:[x]}],ps:[{ps:[x]}],pe:[{pe:[x]}],pt:[{pt:[x]}],pr:[{pr:[x]}],pb:[{pb:[x]}],pl:[{pl:[x]}],m:[{m:[y]}],mx:[{mx:[y]}],my:[{my:[y]}],ms:[{ms:[y]}],me:[{me:[y]}],mt:[{mt:[y]}],mr:[{mr:[y]}],mb:[{mb:[y]}],ml:[{ml:[y]}],"space-x":[{"space-x":[_]}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":[_]}],"space-y-reverse":["space-y-reverse"],w:[{w:["auto","min","max","fit","svw","lvw","dvw",At,t]}],"min-w":[{"min-w":[At,t,"min","max","fit"]}],"max-w":[{"max-w":[At,t,"none","full","min","max","fit","prose",{screen:[Mi]},Mi]}],h:[{h:[At,t,"auto","min","max","fit","svh","lvh","dvh"]}],"min-h":[{"min-h":[At,t,"min","max","fit","svh","lvh","dvh"]}],"max-h":[{"max-h":[At,t,"min","max","fit","svh","lvh","dvh"]}],size:[{size:[At,t,"auto","min","max","fit"]}],"font-size":[{text:["base",Mi,$i]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:["thin","extralight","light","normal","medium","semibold","bold","extrabold","black",d0]}],"font-family":[{font:[Ad]}],"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-fractons"],tracking:[{tracking:["tighter","tight","normal","wide","wider","widest",At]}],"line-clamp":[{"line-clamp":["none",Dc,d0]}],leading:[{leading:["none","tight","snug","normal","relaxed","loose",Va,At]}],"list-image":[{"list-image":["none",At]}],"list-style-type":[{list:["none","disc","decimal",At]}],"list-style-position":[{list:["inside","outside"]}],"placeholder-color":[{placeholder:[e]}],"placeholder-opacity":[{"placeholder-opacity":[b]}],"text-alignment":[{text:["left","center","right","justify","start","end"]}],"text-color":[{text:[e]}],"text-opacity":[{"text-opacity":[b]}],"text-decoration":["underline","overline","line-through","no-underline"],"text-decoration-style":[{decoration:[...D(),"wavy"]}],"text-decoration-thickness":[{decoration:["auto","from-font",Va,$i]}],"underline-offset":[{"underline-offset":["auto",Va,At]}],"text-decoration-color":[{decoration:[e]}],"text-transform":["uppercase","lowercase","capitalize","normal-case"],"text-overflow":["truncate","text-ellipsis","text-clip"],"text-wrap":[{text:["wrap","nowrap","balance","pretty"]}],indent:[{indent:A()}],"vertical-align":[{align:["baseline","top","middle","bottom","text-top","text-bottom","sub","super",At]}],whitespace:[{whitespace:["normal","nowrap","pre","pre-line","pre-wrap","break-spaces"]}],break:[{break:["normal","words","all","keep"]}],hyphens:[{hyphens:["none","manual","auto"]}],content:[{content:["none",At]}],"bg-attachment":[{bg:["fixed","local","scroll"]}],"bg-clip":[{"bg-clip":["border","padding","content","text"]}],"bg-opacity":[{"bg-opacity":[b]}],"bg-origin":[{"bg-origin":["border","padding","content"]}],"bg-position":[{bg:[...G(),T7]}],"bg-repeat":[{bg:["no-repeat",{repeat:["","x","y","round","space"]}]}],"bg-size":[{bg:["auto","cover","contain",k7]}],"bg-image":[{bg:["none",{"gradient-to":["t","tr","r","br","b","bl","l","tl"]},M7]}],"bg-color":[{bg:[e]}],"gradient-from-pos":[{from:[g]}],"gradient-via-pos":[{via:[g]}],"gradient-to-pos":[{to:[g]}],"gradient-from":[{from:[p]}],"gradient-via":[{via:[p]}],"gradient-to":[{to:[p]}],rounded:[{rounded:[a]}],"rounded-s":[{"rounded-s":[a]}],"rounded-e":[{"rounded-e":[a]}],"rounded-t":[{"rounded-t":[a]}],"rounded-r":[{"rounded-r":[a]}],"rounded-b":[{"rounded-b":[a]}],"rounded-l":[{"rounded-l":[a]}],"rounded-ss":[{"rounded-ss":[a]}],"rounded-se":[{"rounded-se":[a]}],"rounded-ee":[{"rounded-ee":[a]}],"rounded-es":[{"rounded-es":[a]}],"rounded-tl":[{"rounded-tl":[a]}],"rounded-tr":[{"rounded-tr":[a]}],"rounded-br":[{"rounded-br":[a]}],"rounded-bl":[{"rounded-bl":[a]}],"border-w":[{border:[l]}],"border-w-x":[{"border-x":[l]}],"border-w-y":[{"border-y":[l]}],"border-w-s":[{"border-s":[l]}],"border-w-e":[{"border-e":[l]}],"border-w-t":[{"border-t":[l]}],"border-w-r":[{"border-r":[l]}],"border-w-b":[{"border-b":[l]}],"border-w-l":[{"border-l":[l]}],"border-opacity":[{"border-opacity":[b]}],"border-style":[{border:[...D(),"hidden"]}],"divide-x":[{"divide-x":[l]}],"divide-x-reverse":["divide-x-reverse"],"divide-y":[{"divide-y":[l]}],"divide-y-reverse":["divide-y-reverse"],"divide-opacity":[{"divide-opacity":[b]}],"divide-style":[{divide:D()}],"border-color":[{border:[s]}],"border-color-x":[{"border-x":[s]}],"border-color-y":[{"border-y":[s]}],"border-color-s":[{"border-s":[s]}],"border-color-e":[{"border-e":[s]}],"border-color-t":[{"border-t":[s]}],"border-color-r":[{"border-r":[s]}],"border-color-b":[{"border-b":[s]}],"border-color-l":[{"border-l":[s]}],"divide-color":[{divide:[s]}],"outline-style":[{outline:["",...D()]}],"outline-offset":[{"outline-offset":[Va,At]}],"outline-w":[{outline:[Va,$i]}],"outline-color":[{outline:[e]}],"ring-w":[{ring:$()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:[e]}],"ring-opacity":[{"ring-opacity":[b]}],"ring-offset-w":[{"ring-offset":[Va,$i]}],"ring-offset-color":[{"ring-offset":[e]}],shadow:[{shadow:["","inner","none",Mi,I7]}],"shadow-color":[{shadow:[Ad]}],opacity:[{opacity:[b]}],"mix-blend":[{"mix-blend":[...V(),"plus-lighter","plus-darker"]}],"bg-blend":[{"bg-blend":V()}],filter:[{filter:["","none"]}],blur:[{blur:[n]}],brightness:[{brightness:[r]}],contrast:[{contrast:[c]}],"drop-shadow":[{"drop-shadow":["","none",Mi,At]}],grayscale:[{grayscale:[u]}],"hue-rotate":[{"hue-rotate":[d]}],invert:[{invert:[f]}],saturate:[{saturate:[w]}],sepia:[{sepia:[S]}],"backdrop-filter":[{"backdrop-filter":["","none"]}],"backdrop-blur":[{"backdrop-blur":[n]}],"backdrop-brightness":[{"backdrop-brightness":[r]}],"backdrop-contrast":[{"backdrop-contrast":[c]}],"backdrop-grayscale":[{"backdrop-grayscale":[u]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[d]}],"backdrop-invert":[{"backdrop-invert":[f]}],"backdrop-opacity":[{"backdrop-opacity":[b]}],"backdrop-saturate":[{"backdrop-saturate":[w]}],"backdrop-sepia":[{"backdrop-sepia":[S]}],"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:["none","all","","colors","opacity","shadow","transform",At]}],duration:[{duration:Z()}],ease:[{ease:["linear","in","out","in-out",At]}],delay:[{delay:Z()}],animate:[{animate:["none","spin","ping","pulse","bounce",At]}],transform:[{transform:["","gpu","none"]}],scale:[{scale:[j]}],"scale-x":[{"scale-x":[j]}],"scale-y":[{"scale-y":[j]}],rotate:[{rotate:[Pd,At]}],"translate-x":[{"translate-x":[P]}],"translate-y":[{"translate-y":[P]}],"skew-x":[{"skew-x":[N]}],"skew-y":[{"skew-y":[N]}],"transform-origin":[{origin:["center","top","top-right","right","bottom-right","bottom","bottom-left","left","top-left",At]}],accent:[{accent:["auto",e]}],appearance:[{appearance:["none","auto"]}],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",At]}],"caret-color":[{caret:[e]}],"pointer-events":[{"pointer-events":["none","auto"]}],resize:[{resize:["none","y","x",""]}],"scroll-behavior":[{scroll:["auto","smooth"]}],"scroll-m":[{"scroll-m":A()}],"scroll-mx":[{"scroll-mx":A()}],"scroll-my":[{"scroll-my":A()}],"scroll-ms":[{"scroll-ms":A()}],"scroll-me":[{"scroll-me":A()}],"scroll-mt":[{"scroll-mt":A()}],"scroll-mr":[{"scroll-mr":A()}],"scroll-mb":[{"scroll-mb":A()}],"scroll-ml":[{"scroll-ml":A()}],"scroll-p":[{"scroll-p":A()}],"scroll-px":[{"scroll-px":A()}],"scroll-py":[{"scroll-py":A()}],"scroll-ps":[{"scroll-ps":A()}],"scroll-pe":[{"scroll-pe":A()}],"scroll-pt":[{"scroll-pt":A()}],"scroll-pr":[{"scroll-pr":A()}],"scroll-pb":[{"scroll-pb":A()}],"scroll-pl":[{"scroll-pl":A()}],"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",At]}],fill:[{fill:[e,"none"]}],"stroke-w":[{stroke:[Va,$i,d0]}],stroke:[{stroke:[e,"none"]}],sr:["sr-only","not-sr-only"],"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-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-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"],"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"]}}},B7=w7(F7);function Oe(...e){return B7(jt(e))}const z7=l7,U7=v.forwardRef(({className:e,sideOffset:t=4,...n},r)=>i.jsx(DM,{ref:r,sideOffset:t,className:Oe("z-50 overflow-hidden rounded-md border bg-popover px-3 py-1.5 text-sm text-popover-foreground shadow-md 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}));U7.displayName=DM.displayName;var py=class{constructor(){this.listeners=new Set,this.subscribe=this.subscribe.bind(this)}subscribe(e){return this.listeners.add(e),this.onSubscribe(),()=>{this.listeners.delete(e),this.onUnsubscribe()}}hasListeners(){return this.listeners.size>0}onSubscribe(){}onUnsubscribe(){}},my=typeof window>"u"||"Deno"in globalThis;function Fs(){}function V7(e,t){return typeof e=="function"?e(t):e}function W7(e){return typeof e=="number"&&e>=0&&e!==1/0}function G7(e,t){return Math.max(e+(t||0)-Date.now(),0)}function NA(e,t){return typeof e=="function"?e(t):e}function H7(e,t){return typeof e=="function"?e(t):e}function _A(e,t){const{type:n="all",exact:r,fetchStatus:s,predicate:a,queryKey:o,stale:l}=e;if(o){if(r){if(t.queryHash!==kS(o,t.options))return!1}else if(!Lf(t.queryKey,o))return!1}if(n!=="all"){const c=t.isActive();if(n==="active"&&!c||n==="inactive"&&c)return!1}return!(typeof l=="boolean"&&t.isStale()!==l||s&&s!==t.state.fetchStatus||a&&!a(t))}function PA(e,t){const{exact:n,status:r,predicate:s,mutationKey:a}=e;if(a){if(!t.options.mutationKey)return!1;if(n){if(Df(t.options.mutationKey)!==Df(a))return!1}else if(!Lf(t.options.mutationKey,a))return!1}return!(r&&t.state.status!==r||s&&!s(t))}function kS(e,t){return((t==null?void 0:t.queryKeyHashFn)||Df)(e)}function Df(e){return JSON.stringify(e,(t,n)=>ow(n)?Object.keys(n).sort().reduce((r,s)=>(r[s]=n[s],r),{}):n)}function Lf(e,t){return e===t?!0:typeof e!=typeof t?!1:e&&t&&typeof e=="object"&&typeof t=="object"?!Object.keys(t).some(n=>!Lf(e[n],t[n])):!1}function WM(e,t){if(e===t)return e;const n=AA(e)&&AA(t);if(n||ow(e)&&ow(t)){const r=n?e:Object.keys(e),s=r.length,a=n?t:Object.keys(t),o=a.length,l=n?[]:{};let c=0;for(let u=0;u{setTimeout(t,e)})}function K7(e,t,n){return typeof n.structuralSharing=="function"?n.structuralSharing(e,t):n.structuralSharing!==!1?WM(e,t):t}function X7(e,t,n=0){const r=[...e,t];return n&&r.length>n?r.slice(1):r}function Y7(e,t,n=0){const r=[t,...e];return n&&r.length>n?r.slice(0,-1):r}var TS=Symbol();function GM(e,t){return!e.queryFn&&(t!=null&&t.initialPromise)?()=>t.initialPromise:!e.queryFn||e.queryFn===TS?()=>Promise.reject(new Error(`Missing queryFn: '${e.queryHash}'`)):e.queryFn}var hl,qi,Hc,Fk,Z7=(Fk=class extends py{constructor(){super();qt(this,hl);qt(this,qi);qt(this,Hc);Tt(this,Hc,t=>{if(!my&&window.addEventListener){const n=()=>t();return window.addEventListener("visibilitychange",n,!1),()=>{window.removeEventListener("visibilitychange",n)}}})}onSubscribe(){pe(this,qi)||this.setEventListener(pe(this,Hc))}onUnsubscribe(){var t;this.hasListeners()||((t=pe(this,qi))==null||t.call(this),Tt(this,qi,void 0))}setEventListener(t){var n;Tt(this,Hc,t),(n=pe(this,qi))==null||n.call(this),Tt(this,qi,t(r=>{typeof r=="boolean"?this.setFocused(r):this.onFocus()}))}setFocused(t){pe(this,hl)!==t&&(Tt(this,hl,t),this.onFocus())}onFocus(){const t=this.isFocused();this.listeners.forEach(n=>{n(t)})}isFocused(){var t;return typeof pe(this,hl)=="boolean"?pe(this,hl):((t=globalThis.document)==null?void 0:t.visibilityState)!=="hidden"}},hl=new WeakMap,qi=new WeakMap,Hc=new WeakMap,Fk),HM=new Z7,qc,Ki,Kc,Bk,Q7=(Bk=class extends py{constructor(){super();qt(this,qc,!0);qt(this,Ki);qt(this,Kc);Tt(this,Kc,t=>{if(!my&&window.addEventListener){const n=()=>t(!0),r=()=>t(!1);return window.addEventListener("online",n,!1),window.addEventListener("offline",r,!1),()=>{window.removeEventListener("online",n),window.removeEventListener("offline",r)}}})}onSubscribe(){pe(this,Ki)||this.setEventListener(pe(this,Kc))}onUnsubscribe(){var t;this.hasListeners()||((t=pe(this,Ki))==null||t.call(this),Tt(this,Ki,void 0))}setEventListener(t){var n;Tt(this,Kc,t),(n=pe(this,Ki))==null||n.call(this),Tt(this,Ki,t(this.setOnline.bind(this)))}setOnline(t){pe(this,qc)!==t&&(Tt(this,qc,t),this.listeners.forEach(r=>{r(t)}))}isOnline(){return pe(this,qc)}},qc=new WeakMap,Ki=new WeakMap,Kc=new WeakMap,Bk),ug=new Q7;function J7(){let e,t;const n=new Promise((s,a)=>{e=s,t=a});n.status="pending",n.catch(()=>{});function r(s){Object.assign(n,s),delete n.resolve,delete n.reject}return n.resolve=s=>{r({status:"fulfilled",value:s}),e(s)},n.reject=s=>{r({status:"rejected",reason:s}),t(s)},n}function e9(e){return Math.min(1e3*2**e,3e4)}function qM(e){return(e??"online")==="online"?ug.isOnline():!0}var KM=class extends Error{constructor(e){super("CancelledError"),this.revert=e==null?void 0:e.revert,this.silent=e==null?void 0:e.silent}};function f0(e){return e instanceof KM}function XM(e){let t=!1,n=0,r=!1,s;const a=J7(),o=m=>{var y;r||(h(new KM(m)),(y=e.abort)==null||y.call(e))},l=()=>{t=!0},c=()=>{t=!1},u=()=>HM.isFocused()&&(e.networkMode==="always"||ug.isOnline())&&e.canRun(),d=()=>qM(e.networkMode)&&e.canRun(),f=m=>{var y;r||(r=!0,(y=e.onSuccess)==null||y.call(e,m),s==null||s(),a.resolve(m))},h=m=>{var y;r||(r=!0,(y=e.onError)==null||y.call(e,m),s==null||s(),a.reject(m))},p=()=>new Promise(m=>{var y;s=b=>{(r||u())&&m(b)},(y=e.onPause)==null||y.call(e)}).then(()=>{var m;s=void 0,r||(m=e.onContinue)==null||m.call(e)}),g=()=>{if(r)return;let m;const y=n===0?e.initialPromise:void 0;try{m=y??e.fn()}catch(b){m=Promise.reject(b)}Promise.resolve(m).then(f).catch(b=>{var N;if(r)return;const x=e.retry??(my?0:3),w=e.retryDelay??e9,j=typeof w=="function"?w(n,b):w,S=x===!0||typeof x=="number"&&nu()?void 0:p()).then(()=>{t?h(b):g()})})};return{promise:a,cancel:o,continue:()=>(s==null||s(),a),cancelRetry:l,continueRetry:c,canStart:d,start:()=>(d()?g():p().then(g),a)}}function t9(){let e=[],t=0,n=l=>{l()},r=l=>{l()},s=l=>setTimeout(l,0);const a=l=>{t?e.push(l):s(()=>{n(l)})},o=()=>{const l=e;e=[],l.length&&s(()=>{r(()=>{l.forEach(c=>{n(c)})})})};return{batch:l=>{let c;t++;try{c=l()}finally{t--,t||o()}return c},batchCalls:l=>(...c)=>{a(()=>{l(...c)})},schedule:a,setNotifyFunction:l=>{n=l},setBatchNotifyFunction:l=>{r=l},setScheduler:l=>{s=l}}}var Pr=t9(),pl,zk,YM=(zk=class{constructor(){qt(this,pl)}destroy(){this.clearGcTimeout()}scheduleGc(){this.clearGcTimeout(),W7(this.gcTime)&&Tt(this,pl,setTimeout(()=>{this.optionalRemove()},this.gcTime))}updateGcTime(e){this.gcTime=Math.max(this.gcTime||0,e??(my?1/0:5*60*1e3))}clearGcTimeout(){pe(this,pl)&&(clearTimeout(pe(this,pl)),Tt(this,pl,void 0))}},pl=new WeakMap,zk),Xc,Yc,ms,fr,qh,ml,Bs,Ha,Uk,n9=(Uk=class extends YM{constructor(t){super();qt(this,Bs);qt(this,Xc);qt(this,Yc);qt(this,ms);qt(this,fr);qt(this,qh);qt(this,ml);Tt(this,ml,!1),Tt(this,qh,t.defaultOptions),this.setOptions(t.options),this.observers=[],Tt(this,ms,t.cache),this.queryKey=t.queryKey,this.queryHash=t.queryHash,Tt(this,Xc,s9(this.options)),this.state=t.state??pe(this,Xc),this.scheduleGc()}get meta(){return this.options.meta}get promise(){var t;return(t=pe(this,fr))==null?void 0:t.promise}setOptions(t){this.options={...pe(this,qh),...t},this.updateGcTime(this.options.gcTime)}optionalRemove(){!this.observers.length&&this.state.fetchStatus==="idle"&&pe(this,ms).remove(this)}setData(t,n){const r=K7(this.state.data,t,this.options);return cr(this,Bs,Ha).call(this,{data:r,type:"success",dataUpdatedAt:n==null?void 0:n.updatedAt,manual:n==null?void 0:n.manual}),r}setState(t,n){cr(this,Bs,Ha).call(this,{type:"setState",state:t,setStateOptions:n})}cancel(t){var r,s;const n=(r=pe(this,fr))==null?void 0:r.promise;return(s=pe(this,fr))==null||s.cancel(t),n?n.then(Fs).catch(Fs):Promise.resolve()}destroy(){super.destroy(),this.cancel({silent:!0})}reset(){this.destroy(),this.setState(pe(this,Xc))}isActive(){return this.observers.some(t=>H7(t.options.enabled,this)!==!1)}isDisabled(){return this.getObserversCount()>0?!this.isActive():this.options.queryFn===TS||this.state.dataUpdateCount+this.state.errorUpdateCount===0}isStale(){return this.state.isInvalidated?!0:this.getObserversCount()>0?this.observers.some(t=>t.getCurrentResult().isStale):this.state.data===void 0}isStaleByTime(t=0){return this.state.isInvalidated||this.state.data===void 0||!G7(this.state.dataUpdatedAt,t)}onFocus(){var n;const t=this.observers.find(r=>r.shouldFetchOnWindowFocus());t==null||t.refetch({cancelRefetch:!1}),(n=pe(this,fr))==null||n.continue()}onOnline(){var n;const t=this.observers.find(r=>r.shouldFetchOnReconnect());t==null||t.refetch({cancelRefetch:!1}),(n=pe(this,fr))==null||n.continue()}addObserver(t){this.observers.includes(t)||(this.observers.push(t),this.clearGcTimeout(),pe(this,ms).notify({type:"observerAdded",query:this,observer:t}))}removeObserver(t){this.observers.includes(t)&&(this.observers=this.observers.filter(n=>n!==t),this.observers.length||(pe(this,fr)&&(pe(this,ml)?pe(this,fr).cancel({revert:!0}):pe(this,fr).cancelRetry()),this.scheduleGc()),pe(this,ms).notify({type:"observerRemoved",query:this,observer:t}))}getObserversCount(){return this.observers.length}invalidate(){this.state.isInvalidated||cr(this,Bs,Ha).call(this,{type:"invalidate"})}fetch(t,n){var c,u,d;if(this.state.fetchStatus!=="idle"){if(this.state.data!==void 0&&(n!=null&&n.cancelRefetch))this.cancel({silent:!0});else if(pe(this,fr))return pe(this,fr).continueRetry(),pe(this,fr).promise}if(t&&this.setOptions(t),!this.options.queryFn){const f=this.observers.find(h=>h.options.queryFn);f&&this.setOptions(f.options)}const r=new AbortController,s=f=>{Object.defineProperty(f,"signal",{enumerable:!0,get:()=>(Tt(this,ml,!0),r.signal)})},a=()=>{const f=GM(this.options,n),h={queryKey:this.queryKey,meta:this.meta};return s(h),Tt(this,ml,!1),this.options.persister?this.options.persister(f,h,this):f(h)},o={fetchOptions:n,options:this.options,queryKey:this.queryKey,state:this.state,fetchFn:a};s(o),(c=this.options.behavior)==null||c.onFetch(o,this),Tt(this,Yc,this.state),(this.state.fetchStatus==="idle"||this.state.fetchMeta!==((u=o.fetchOptions)==null?void 0:u.meta))&&cr(this,Bs,Ha).call(this,{type:"fetch",meta:(d=o.fetchOptions)==null?void 0:d.meta});const l=f=>{var h,p,g,m;f0(f)&&f.silent||cr(this,Bs,Ha).call(this,{type:"error",error:f}),f0(f)||((p=(h=pe(this,ms).config).onError)==null||p.call(h,f,this),(m=(g=pe(this,ms).config).onSettled)==null||m.call(g,this.state.data,f,this)),this.scheduleGc()};return Tt(this,fr,XM({initialPromise:n==null?void 0:n.initialPromise,fn:o.fetchFn,abort:r.abort.bind(r),onSuccess:f=>{var h,p,g,m;if(f===void 0){l(new Error(`${this.queryHash} data is undefined`));return}try{this.setData(f)}catch(y){l(y);return}(p=(h=pe(this,ms).config).onSuccess)==null||p.call(h,f,this),(m=(g=pe(this,ms).config).onSettled)==null||m.call(g,f,this.state.error,this),this.scheduleGc()},onError:l,onFail:(f,h)=>{cr(this,Bs,Ha).call(this,{type:"failed",failureCount:f,error:h})},onPause:()=>{cr(this,Bs,Ha).call(this,{type:"pause"})},onContinue:()=>{cr(this,Bs,Ha).call(this,{type:"continue"})},retry:o.options.retry,retryDelay:o.options.retryDelay,networkMode:o.options.networkMode,canRun:()=>!0})),pe(this,fr).start()}},Xc=new WeakMap,Yc=new WeakMap,ms=new WeakMap,fr=new WeakMap,qh=new WeakMap,ml=new WeakMap,Bs=new WeakSet,Ha=function(t){const n=r=>{switch(t.type){case"failed":return{...r,fetchFailureCount:t.failureCount,fetchFailureReason:t.error};case"pause":return{...r,fetchStatus:"paused"};case"continue":return{...r,fetchStatus:"fetching"};case"fetch":return{...r,...r9(r.data,this.options),fetchMeta:t.meta??null};case"success":return{...r,data:t.data,dataUpdateCount:r.dataUpdateCount+1,dataUpdatedAt:t.dataUpdatedAt??Date.now(),error:null,isInvalidated:!1,status:"success",...!t.manual&&{fetchStatus:"idle",fetchFailureCount:0,fetchFailureReason:null}};case"error":const s=t.error;return f0(s)&&s.revert&&pe(this,Yc)?{...pe(this,Yc),fetchStatus:"idle"}:{...r,error:s,errorUpdateCount:r.errorUpdateCount+1,errorUpdatedAt:Date.now(),fetchFailureCount:r.fetchFailureCount+1,fetchFailureReason:s,fetchStatus:"idle",status:"error"};case"invalidate":return{...r,isInvalidated:!0};case"setState":return{...r,...t.state}}};this.state=n(this.state),Pr.batch(()=>{this.observers.forEach(r=>{r.onQueryUpdate()}),pe(this,ms).notify({query:this,type:"updated",action:t})})},Uk);function r9(e,t){return{fetchFailureCount:0,fetchFailureReason:null,fetchStatus:qM(t.networkMode)?"fetching":"paused",...e===void 0&&{error:null,status:"pending"}}}function s9(e){const t=typeof e.initialData=="function"?e.initialData():e.initialData,n=t!==void 0,r=n?typeof e.initialDataUpdatedAt=="function"?e.initialDataUpdatedAt():e.initialDataUpdatedAt:0;return{data:t,dataUpdateCount:0,dataUpdatedAt:n?r??Date.now():0,error:null,errorUpdateCount:0,errorUpdatedAt:0,fetchFailureCount:0,fetchFailureReason:null,fetchMeta:null,isInvalidated:!1,status:n?"success":"pending",fetchStatus:"idle"}}var ga,Vk,a9=(Vk=class extends py{constructor(t={}){super();qt(this,ga);this.config=t,Tt(this,ga,new Map)}build(t,n,r){const s=n.queryKey,a=n.queryHash??kS(s,n);let o=this.get(a);return o||(o=new n9({cache:this,queryKey:s,queryHash:a,options:t.defaultQueryOptions(n),state:r,defaultOptions:t.getQueryDefaults(s)}),this.add(o)),o}add(t){pe(this,ga).has(t.queryHash)||(pe(this,ga).set(t.queryHash,t),this.notify({type:"added",query:t}))}remove(t){const n=pe(this,ga).get(t.queryHash);n&&(t.destroy(),n===t&&pe(this,ga).delete(t.queryHash),this.notify({type:"removed",query:t}))}clear(){Pr.batch(()=>{this.getAll().forEach(t=>{this.remove(t)})})}get(t){return pe(this,ga).get(t)}getAll(){return[...pe(this,ga).values()]}find(t){const n={exact:!0,...t};return this.getAll().find(r=>_A(n,r))}findAll(t={}){const n=this.getAll();return Object.keys(t).length>0?n.filter(r=>_A(t,r)):n}notify(t){Pr.batch(()=>{this.listeners.forEach(n=>{n(t)})})}onFocus(){Pr.batch(()=>{this.getAll().forEach(t=>{t.onFocus()})})}onOnline(){Pr.batch(()=>{this.getAll().forEach(t=>{t.onOnline()})})}},ga=new WeakMap,Vk),va,jr,gl,ya,Ii,Wk,i9=(Wk=class extends YM{constructor(t){super();qt(this,ya);qt(this,va);qt(this,jr);qt(this,gl);this.mutationId=t.mutationId,Tt(this,jr,t.mutationCache),Tt(this,va,[]),this.state=t.state||o9(),this.setOptions(t.options),this.scheduleGc()}setOptions(t){this.options=t,this.updateGcTime(this.options.gcTime)}get meta(){return this.options.meta}addObserver(t){pe(this,va).includes(t)||(pe(this,va).push(t),this.clearGcTimeout(),pe(this,jr).notify({type:"observerAdded",mutation:this,observer:t}))}removeObserver(t){Tt(this,va,pe(this,va).filter(n=>n!==t)),this.scheduleGc(),pe(this,jr).notify({type:"observerRemoved",mutation:this,observer:t})}optionalRemove(){pe(this,va).length||(this.state.status==="pending"?this.scheduleGc():pe(this,jr).remove(this))}continue(){var t;return((t=pe(this,gl))==null?void 0:t.continue())??this.execute(this.state.variables)}async execute(t){var s,a,o,l,c,u,d,f,h,p,g,m,y,b,x,w,j,S,N,_;Tt(this,gl,XM({fn:()=>this.options.mutationFn?this.options.mutationFn(t):Promise.reject(new Error("No mutationFn found")),onFail:(P,k)=>{cr(this,ya,Ii).call(this,{type:"failed",failureCount:P,error:k})},onPause:()=>{cr(this,ya,Ii).call(this,{type:"pause"})},onContinue:()=>{cr(this,ya,Ii).call(this,{type:"continue"})},retry:this.options.retry??0,retryDelay:this.options.retryDelay,networkMode:this.options.networkMode,canRun:()=>pe(this,jr).canRun(this)}));const n=this.state.status==="pending",r=!pe(this,gl).canStart();try{if(!n){cr(this,ya,Ii).call(this,{type:"pending",variables:t,isPaused:r}),await((a=(s=pe(this,jr).config).onMutate)==null?void 0:a.call(s,t,this));const k=await((l=(o=this.options).onMutate)==null?void 0:l.call(o,t));k!==this.state.context&&cr(this,ya,Ii).call(this,{type:"pending",context:k,variables:t,isPaused:r})}const P=await pe(this,gl).start();return await((u=(c=pe(this,jr).config).onSuccess)==null?void 0:u.call(c,P,t,this.state.context,this)),await((f=(d=this.options).onSuccess)==null?void 0:f.call(d,P,t,this.state.context)),await((p=(h=pe(this,jr).config).onSettled)==null?void 0:p.call(h,P,null,this.state.variables,this.state.context,this)),await((m=(g=this.options).onSettled)==null?void 0:m.call(g,P,null,t,this.state.context)),cr(this,ya,Ii).call(this,{type:"success",data:P}),P}catch(P){try{throw await((b=(y=pe(this,jr).config).onError)==null?void 0:b.call(y,P,t,this.state.context,this)),await((w=(x=this.options).onError)==null?void 0:w.call(x,P,t,this.state.context)),await((S=(j=pe(this,jr).config).onSettled)==null?void 0:S.call(j,void 0,P,this.state.variables,this.state.context,this)),await((_=(N=this.options).onSettled)==null?void 0:_.call(N,void 0,P,t,this.state.context)),P}finally{cr(this,ya,Ii).call(this,{type:"error",error:P})}}finally{pe(this,jr).runNext(this)}}},va=new WeakMap,jr=new WeakMap,gl=new WeakMap,ya=new WeakSet,Ii=function(t){const n=r=>{switch(t.type){case"failed":return{...r,failureCount:t.failureCount,failureReason:t.error};case"pause":return{...r,isPaused:!0};case"continue":return{...r,isPaused:!1};case"pending":return{...r,context:t.context,data:void 0,failureCount:0,failureReason:null,error:null,isPaused:t.isPaused,status:"pending",variables:t.variables,submittedAt:Date.now()};case"success":return{...r,data:t.data,failureCount:0,failureReason:null,error:null,status:"success",isPaused:!1};case"error":return{...r,data:void 0,error:t.error,failureCount:r.failureCount+1,failureReason:t.error,isPaused:!1,status:"error"}}};this.state=n(this.state),Pr.batch(()=>{pe(this,va).forEach(r=>{r.onMutationUpdate(t)}),pe(this,jr).notify({mutation:this,type:"updated",action:t})})},Wk);function o9(){return{context:void 0,data:void 0,error:null,failureCount:0,failureReason:null,isPaused:!1,status:"idle",variables:void 0,submittedAt:0}}var Zr,Kh,Gk,l9=(Gk=class extends py{constructor(t={}){super();qt(this,Zr);qt(this,Kh);this.config=t,Tt(this,Zr,new Map),Tt(this,Kh,Date.now())}build(t,n,r){const s=new i9({mutationCache:this,mutationId:++_p(this,Kh)._,options:t.defaultMutationOptions(n),state:r});return this.add(s),s}add(t){const n=qp(t),r=pe(this,Zr).get(n)??[];r.push(t),pe(this,Zr).set(n,r),this.notify({type:"added",mutation:t})}remove(t){var r;const n=qp(t);if(pe(this,Zr).has(n)){const s=(r=pe(this,Zr).get(n))==null?void 0:r.filter(a=>a!==t);s&&(s.length===0?pe(this,Zr).delete(n):pe(this,Zr).set(n,s))}this.notify({type:"removed",mutation:t})}canRun(t){var r;const n=(r=pe(this,Zr).get(qp(t)))==null?void 0:r.find(s=>s.state.status==="pending");return!n||n===t}runNext(t){var r;const n=(r=pe(this,Zr).get(qp(t)))==null?void 0:r.find(s=>s!==t&&s.state.isPaused);return(n==null?void 0:n.continue())??Promise.resolve()}clear(){Pr.batch(()=>{this.getAll().forEach(t=>{this.remove(t)})})}getAll(){return[...pe(this,Zr).values()].flat()}find(t){const n={exact:!0,...t};return this.getAll().find(r=>PA(n,r))}findAll(t={}){return this.getAll().filter(n=>PA(t,n))}notify(t){Pr.batch(()=>{this.listeners.forEach(n=>{n(t)})})}resumePausedMutations(){const t=this.getAll().filter(n=>n.state.isPaused);return Pr.batch(()=>Promise.all(t.map(n=>n.continue().catch(Fs))))}},Zr=new WeakMap,Kh=new WeakMap,Gk);function qp(e){var t;return((t=e.options.scope)==null?void 0:t.id)??String(e.mutationId)}function EA(e){return{onFetch:(t,n)=>{var d,f,h,p,g;const r=t.options,s=(h=(f=(d=t.fetchOptions)==null?void 0:d.meta)==null?void 0:f.fetchMore)==null?void 0:h.direction,a=((p=t.state.data)==null?void 0:p.pages)||[],o=((g=t.state.data)==null?void 0:g.pageParams)||[];let l={pages:[],pageParams:[]},c=0;const u=async()=>{let m=!1;const y=w=>{Object.defineProperty(w,"signal",{enumerable:!0,get:()=>(t.signal.aborted?m=!0:t.signal.addEventListener("abort",()=>{m=!0}),t.signal)})},b=GM(t.options,t.fetchOptions),x=async(w,j,S)=>{if(m)return Promise.reject();if(j==null&&w.pages.length)return Promise.resolve(w);const N={queryKey:t.queryKey,pageParam:j,direction:S?"backward":"forward",meta:t.options.meta};y(N);const _=await b(N),{maxPages:P}=t.options,k=S?Y7:X7;return{pages:k(w.pages,_,P),pageParams:k(w.pageParams,j,P)}};if(s&&a.length){const w=s==="backward",j=w?c9:OA,S={pages:a,pageParams:o},N=j(r,S);l=await x(S,N,w)}else{const w=e??a.length;do{const j=c===0?o[0]??r.initialPageParam:OA(r,l);if(c>0&&j==null)break;l=await x(l,j),c++}while(c{var m,y;return(y=(m=t.options).persister)==null?void 0:y.call(m,u,{queryKey:t.queryKey,meta:t.options.meta,signal:t.signal},n)}:t.fetchFn=u}}}function OA(e,{pages:t,pageParams:n}){const r=t.length-1;return t.length>0?e.getNextPageParam(t[r],t,n[r],n):void 0}function c9(e,{pages:t,pageParams:n}){var r;return t.length>0?(r=e.getPreviousPageParam)==null?void 0:r.call(e,t[0],t,n[0],n):void 0}var bn,Xi,Yi,Zc,Qc,Zi,Jc,eu,Hk,u9=(Hk=class{constructor(e={}){qt(this,bn);qt(this,Xi);qt(this,Yi);qt(this,Zc);qt(this,Qc);qt(this,Zi);qt(this,Jc);qt(this,eu);Tt(this,bn,e.queryCache||new a9),Tt(this,Xi,e.mutationCache||new l9),Tt(this,Yi,e.defaultOptions||{}),Tt(this,Zc,new Map),Tt(this,Qc,new Map),Tt(this,Zi,0)}mount(){_p(this,Zi)._++,pe(this,Zi)===1&&(Tt(this,Jc,HM.subscribe(async e=>{e&&(await this.resumePausedMutations(),pe(this,bn).onFocus())})),Tt(this,eu,ug.subscribe(async e=>{e&&(await this.resumePausedMutations(),pe(this,bn).onOnline())})))}unmount(){var e,t;_p(this,Zi)._--,pe(this,Zi)===0&&((e=pe(this,Jc))==null||e.call(this),Tt(this,Jc,void 0),(t=pe(this,eu))==null||t.call(this),Tt(this,eu,void 0))}isFetching(e){return pe(this,bn).findAll({...e,fetchStatus:"fetching"}).length}isMutating(e){return pe(this,Xi).findAll({...e,status:"pending"}).length}getQueryData(e){var n;const t=this.defaultQueryOptions({queryKey:e});return(n=pe(this,bn).get(t.queryHash))==null?void 0:n.state.data}ensureQueryData(e){const t=this.getQueryData(e.queryKey);if(t===void 0)return this.fetchQuery(e);{const n=this.defaultQueryOptions(e),r=pe(this,bn).build(this,n);return e.revalidateIfStale&&r.isStaleByTime(NA(n.staleTime,r))&&this.prefetchQuery(n),Promise.resolve(t)}}getQueriesData(e){return pe(this,bn).findAll(e).map(({queryKey:t,state:n})=>{const r=n.data;return[t,r]})}setQueryData(e,t,n){const r=this.defaultQueryOptions({queryKey:e}),s=pe(this,bn).get(r.queryHash),a=s==null?void 0:s.state.data,o=V7(t,a);if(o!==void 0)return pe(this,bn).build(this,r).setData(o,{...n,manual:!0})}setQueriesData(e,t,n){return Pr.batch(()=>pe(this,bn).findAll(e).map(({queryKey:r})=>[r,this.setQueryData(r,t,n)]))}getQueryState(e){var n;const t=this.defaultQueryOptions({queryKey:e});return(n=pe(this,bn).get(t.queryHash))==null?void 0:n.state}removeQueries(e){const t=pe(this,bn);Pr.batch(()=>{t.findAll(e).forEach(n=>{t.remove(n)})})}resetQueries(e,t){const n=pe(this,bn),r={type:"active",...e};return Pr.batch(()=>(n.findAll(e).forEach(s=>{s.reset()}),this.refetchQueries(r,t)))}cancelQueries(e={},t={}){const n={revert:!0,...t},r=Pr.batch(()=>pe(this,bn).findAll(e).map(s=>s.cancel(n)));return Promise.all(r).then(Fs).catch(Fs)}invalidateQueries(e={},t={}){return Pr.batch(()=>{if(pe(this,bn).findAll(e).forEach(r=>{r.invalidate()}),e.refetchType==="none")return Promise.resolve();const n={...e,type:e.refetchType??e.type??"active"};return this.refetchQueries(n,t)})}refetchQueries(e={},t){const n={...t,cancelRefetch:(t==null?void 0:t.cancelRefetch)??!0},r=Pr.batch(()=>pe(this,bn).findAll(e).filter(s=>!s.isDisabled()).map(s=>{let a=s.fetch(void 0,n);return n.throwOnError||(a=a.catch(Fs)),s.state.fetchStatus==="paused"?Promise.resolve():a}));return Promise.all(r).then(Fs)}fetchQuery(e){const t=this.defaultQueryOptions(e);t.retry===void 0&&(t.retry=!1);const n=pe(this,bn).build(this,t);return n.isStaleByTime(NA(t.staleTime,n))?n.fetch(t):Promise.resolve(n.state.data)}prefetchQuery(e){return this.fetchQuery(e).then(Fs).catch(Fs)}fetchInfiniteQuery(e){return e.behavior=EA(e.pages),this.fetchQuery(e)}prefetchInfiniteQuery(e){return this.fetchInfiniteQuery(e).then(Fs).catch(Fs)}ensureInfiniteQueryData(e){return e.behavior=EA(e.pages),this.ensureQueryData(e)}resumePausedMutations(){return ug.isOnline()?pe(this,Xi).resumePausedMutations():Promise.resolve()}getQueryCache(){return pe(this,bn)}getMutationCache(){return pe(this,Xi)}getDefaultOptions(){return pe(this,Yi)}setDefaultOptions(e){Tt(this,Yi,e)}setQueryDefaults(e,t){pe(this,Zc).set(Df(e),{queryKey:e,defaultOptions:t})}getQueryDefaults(e){const t=[...pe(this,Zc).values()];let n={};return t.forEach(r=>{Lf(e,r.queryKey)&&(n={...n,...r.defaultOptions})}),n}setMutationDefaults(e,t){pe(this,Qc).set(Df(e),{mutationKey:e,defaultOptions:t})}getMutationDefaults(e){const t=[...pe(this,Qc).values()];let n={};return t.forEach(r=>{Lf(e,r.mutationKey)&&(n={...n,...r.defaultOptions})}),n}defaultQueryOptions(e){if(e._defaulted)return e;const t={...pe(this,Yi).queries,...this.getQueryDefaults(e.queryKey),...e,_defaulted:!0};return t.queryHash||(t.queryHash=kS(t.queryKey,t)),t.refetchOnReconnect===void 0&&(t.refetchOnReconnect=t.networkMode!=="always"),t.throwOnError===void 0&&(t.throwOnError=!!t.suspense),!t.networkMode&&t.persister&&(t.networkMode="offlineFirst"),t.enabled!==!0&&t.queryFn===TS&&(t.enabled=!1),t}defaultMutationOptions(e){return e!=null&&e._defaulted?e:{...pe(this,Yi).mutations,...(e==null?void 0:e.mutationKey)&&this.getMutationDefaults(e.mutationKey),...e,_defaulted:!0}}clear(){pe(this,bn).clear(),pe(this,Xi).clear()}},bn=new WeakMap,Xi=new WeakMap,Yi=new WeakMap,Zc=new WeakMap,Qc=new WeakMap,Zi=new WeakMap,Jc=new WeakMap,eu=new WeakMap,Hk),d9=v.createContext(void 0),f9=({client:e,children:t})=>(v.useEffect(()=>(e.mount(),()=>{e.unmount()}),[e]),i.jsx(d9.Provider,{value:e,children:t}));/** * @remix-run/router v1.20.0 * * Copyright (c) Remix Software Inc. @@ -47,7 +47,7 @@ Error generating stack: `+a.message+` * LICENSE.md file in the root directory of this source tree. * * @license MIT - */function Ff(){return Ff=Object.assign?Object.assign.bind():function(e){for(var t=1;t"u")throw new Error(t)}function GM(e,t){if(!e){typeof console<"u"&&console.warn(t);try{throw new Error(t)}catch{}}}function l9(){return Math.random().toString(36).substr(2,8)}function AA(e,t){return{usr:e.state,key:e.key,idx:t}}function aw(e,t,n,r){return n===void 0&&(n=null),Ff({pathname:typeof e=="string"?e:e.pathname,search:"",hash:""},typeof t=="string"?Ku(t):t,{state:n,key:t&&t.key||r||l9()})}function cg(e){let{pathname:t="/",search:n="",hash:r=""}=e;return n&&n!=="?"&&(t+=n.charAt(0)==="?"?n:"?"+n),r&&r!=="#"&&(t+=r.charAt(0)==="#"?r:"#"+r),t}function Ku(e){let t={};if(e){let n=e.indexOf("#");n>=0&&(t.hash=e.substr(n),e=e.substr(0,n));let r=e.indexOf("?");r>=0&&(t.search=e.substr(r),e=e.substr(0,r)),e&&(t.pathname=e)}return t}function c9(e,t,n,r){r===void 0&&(r={});let{window:s=document.defaultView,v5Compat:a=!1}=r,o=s.history,l=Ji.Pop,c=null,u=d();u==null&&(u=0,o.replaceState(Ff({},o.state,{idx:u}),""));function d(){return(o.state||{idx:null}).idx}function f(){l=Ji.Pop;let y=d(),b=y==null?null:y-u;u=y,c&&c({action:l,location:m.location,delta:b})}function h(y,b){l=Ji.Push;let x=aw(m.location,y,b);u=d()+1;let w=AA(x,u),j=m.createHref(x);try{o.pushState(w,"",j)}catch(S){if(S instanceof DOMException&&S.name==="DataCloneError")throw S;s.location.assign(j)}a&&c&&c({action:l,location:m.location,delta:1})}function p(y,b){l=Ji.Replace;let x=aw(m.location,y,b);u=d();let w=AA(x,u),j=m.createHref(x);o.replaceState(w,"",j),a&&c&&c({action:l,location:m.location,delta:0})}function g(y){let b=s.location.origin!=="null"?s.location.origin:s.location.href,x=typeof y=="string"?y:cg(y);return x=x.replace(/ $/,"%20"),On(b,"No window.location.(origin|href) available to create URL for href: "+x),new URL(x,b)}let m={get action(){return l},get location(){return e(s,o)},listen(y){if(c)throw new Error("A history only accepts one active listener");return s.addEventListener(PA,f),c=y,()=>{s.removeEventListener(PA,f),c=null}},createHref(y){return t(s,y)},createURL:g,encodeLocation(y){let b=g(y);return{pathname:b.pathname,search:b.search,hash:b.hash}},push:h,replace:p,go(y){return o.go(y)}};return m}var CA;(function(e){e.data="data",e.deferred="deferred",e.redirect="redirect",e.error="error"})(CA||(CA={}));function u9(e,t,n){return n===void 0&&(n="/"),d9(e,t,n,!1)}function d9(e,t,n,r){let s=typeof t=="string"?Ku(t):t,a=ES(s.pathname||"/",n);if(a==null)return null;let o=qM(e);f9(o);let l=null;for(let c=0;l==null&&c{let c={relativePath:l===void 0?a.path||"":l,caseSensitive:a.caseSensitive===!0,childrenIndex:o,route:a};c.relativePath.startsWith("/")&&(On(c.relativePath.startsWith(r),'Absolute route path "'+c.relativePath+'" nested under path '+('"'+r+'" is not valid. An absolute child route path ')+"must start with the combined path of all its parent routes."),c.relativePath=c.relativePath.slice(r.length));let u=uo([r,c.relativePath]),d=n.concat(c);a.children&&a.children.length>0&&(On(a.index!==!0,"Index routes must not have child routes. Please remove "+('all child routes from route path "'+u+'".')),qM(a.children,t,d,u)),!(a.path==null&&!a.index)&&t.push({path:u,score:x9(u,a.index),routesMeta:d})};return e.forEach((a,o)=>{var l;if(a.path===""||!((l=a.path)!=null&&l.includes("?")))s(a,o);else for(let c of KM(a.path))s(a,o,c)}),t}function KM(e){let t=e.split("/");if(t.length===0)return[];let[n,...r]=t,s=n.endsWith("?"),a=n.replace(/\?$/,"");if(r.length===0)return s?[a,""]:[a];let o=KM(r.join("/")),l=[];return l.push(...o.map(c=>c===""?a:[a,c].join("/"))),s&&l.push(...o),l.map(c=>e.startsWith("/")&&c===""?"/":c)}function f9(e){e.sort((t,n)=>t.score!==n.score?n.score-t.score:b9(t.routesMeta.map(r=>r.childrenIndex),n.routesMeta.map(r=>r.childrenIndex)))}const h9=/^:[\w-]+$/,p9=3,m9=2,g9=1,v9=10,y9=-2,EA=e=>e==="*";function x9(e,t){let n=e.split("/"),r=n.length;return n.some(EA)&&(r+=y9),t&&(r+=m9),n.filter(s=>!EA(s)).reduce((s,a)=>s+(h9.test(a)?p9:a===""?g9:v9),r)}function b9(e,t){return e.length===t.length&&e.slice(0,-1).every((r,s)=>r===t[s])?e[e.length-1]-t[t.length-1]:0}function w9(e,t,n){let{routesMeta:r}=e,s={},a="/",o=[];for(let l=0;l{let{paramName:h,isOptional:p}=d;if(h==="*"){let m=l[f]||"";o=a.slice(0,a.length-m.length).replace(/(.)\/+$/,"$1")}const g=l[f];return p&&!g?u[h]=void 0:u[h]=(g||"").replace(/%2F/g,"/"),u},{}),pathname:a,pathnameBase:o,pattern:e}}function j9(e,t,n){t===void 0&&(t=!1),n===void 0&&(n=!0),GM(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=[],s="^"+e.replace(/\/*\*?$/,"").replace(/^\/*/,"/").replace(/[\\.*+^${}|()[\]]/g,"\\$&").replace(/\/:([\w-]+)(\?)?/g,(o,l,c)=>(r.push({paramName:l,isOptional:c!=null}),c?"/?([^\\/]+)?":"/([^\\/]+)"));return e.endsWith("*")?(r.push({paramName:"*"}),s+=e==="*"||e==="/*"?"(.*)$":"(?:\\/(.+)|\\/*)$"):n?s+="\\/*$":e!==""&&e!=="/"&&(s+="(?:(?=\\/|$))"),[new RegExp(s,t?void 0:"i"),r]}function S9(e){try{return e.split("/").map(t=>decodeURIComponent(t).replace(/\//g,"%2F")).join("/")}catch(t){return GM(!1,'The URL path "'+e+'" could not be decoded because it is is a malformed URL segment. This is probably due to a bad percent '+("encoding ("+t+").")),e}}function ES(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 N9(e,t){t===void 0&&(t="/");let{pathname:n,search:r="",hash:s=""}=typeof e=="string"?Ku(e):e;return{pathname:n?n.startsWith("/")?n:_9(n,t):t,search:C9(r),hash:E9(s)}}function _9(e,t){let n=t.replace(/\/+$/,"").split("/");return e.split("/").forEach(s=>{s===".."?n.length>1&&n.pop():s!=="."&&n.push(s)}),n.length>1?n.join("/"):"/"}function u0(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 and the router will parse it for you.'}function P9(e){return e.filter((t,n)=>n===0||t.route.path&&t.route.path.length>0)}function OS(e,t){let n=P9(e);return t?n.map((r,s)=>s===n.length-1?r.pathname:r.pathnameBase):n.map(r=>r.pathnameBase)}function kS(e,t,n,r){r===void 0&&(r=!1);let s;typeof e=="string"?s=Ku(e):(s=Ff({},e),On(!s.pathname||!s.pathname.includes("?"),u0("?","pathname","search",s)),On(!s.pathname||!s.pathname.includes("#"),u0("#","pathname","hash",s)),On(!s.search||!s.search.includes("#"),u0("#","search","hash",s)));let a=e===""||s.pathname==="",o=a?"/":s.pathname,l;if(o==null)l=n;else{let f=t.length-1;if(!r&&o.startsWith("..")){let h=o.split("/");for(;h[0]==="..";)h.shift(),f-=1;s.pathname=h.join("/")}l=f>=0?t[f]:"/"}let c=N9(s,l),u=o&&o!=="/"&&o.endsWith("/"),d=(a||o===".")&&n.endsWith("/");return!c.pathname.endsWith("/")&&(u||d)&&(c.pathname+="/"),c}const uo=e=>e.join("/").replace(/\/\/+/g,"/"),A9=e=>e.replace(/\/+$/,"").replace(/^\/*/,"/"),C9=e=>!e||e==="?"?"":e.startsWith("?")?e:"?"+e,E9=e=>!e||e==="#"?"":e.startsWith("#")?e:"#"+e;function O9(e){return e!=null&&typeof e.status=="number"&&typeof e.statusText=="string"&&typeof e.internal=="boolean"&&"data"in e}const XM=["post","put","patch","delete"];new Set(XM);const k9=["get",...XM];new Set(k9);/** + */function Ff(){return Ff=Object.assign?Object.assign.bind():function(e){for(var t=1;t"u")throw new Error(t)}function ZM(e,t){if(!e){typeof console<"u"&&console.warn(t);try{throw new Error(t)}catch{}}}function p9(){return Math.random().toString(36).substr(2,8)}function TA(e,t){return{usr:e.state,key:e.key,idx:t}}function lw(e,t,n,r){return n===void 0&&(n=null),Ff({pathname:typeof e=="string"?e:e.pathname,search:"",hash:""},typeof t=="string"?Ku(t):t,{state:n,key:t&&t.key||r||p9()})}function dg(e){let{pathname:t="/",search:n="",hash:r=""}=e;return n&&n!=="?"&&(t+=n.charAt(0)==="?"?n:"?"+n),r&&r!=="#"&&(t+=r.charAt(0)==="#"?r:"#"+r),t}function Ku(e){let t={};if(e){let n=e.indexOf("#");n>=0&&(t.hash=e.substr(n),e=e.substr(0,n));let r=e.indexOf("?");r>=0&&(t.search=e.substr(r),e=e.substr(0,r)),e&&(t.pathname=e)}return t}function m9(e,t,n,r){r===void 0&&(r={});let{window:s=document.defaultView,v5Compat:a=!1}=r,o=s.history,l=eo.Pop,c=null,u=d();u==null&&(u=0,o.replaceState(Ff({},o.state,{idx:u}),""));function d(){return(o.state||{idx:null}).idx}function f(){l=eo.Pop;let y=d(),b=y==null?null:y-u;u=y,c&&c({action:l,location:m.location,delta:b})}function h(y,b){l=eo.Push;let x=lw(m.location,y,b);u=d()+1;let w=TA(x,u),j=m.createHref(x);try{o.pushState(w,"",j)}catch(S){if(S instanceof DOMException&&S.name==="DataCloneError")throw S;s.location.assign(j)}a&&c&&c({action:l,location:m.location,delta:1})}function p(y,b){l=eo.Replace;let x=lw(m.location,y,b);u=d();let w=TA(x,u),j=m.createHref(x);o.replaceState(w,"",j),a&&c&&c({action:l,location:m.location,delta:0})}function g(y){let b=s.location.origin!=="null"?s.location.origin:s.location.href,x=typeof y=="string"?y:dg(y);return x=x.replace(/ $/,"%20"),On(b,"No window.location.(origin|href) available to create URL for href: "+x),new URL(x,b)}let m={get action(){return l},get location(){return e(s,o)},listen(y){if(c)throw new Error("A history only accepts one active listener");return s.addEventListener(kA,f),c=y,()=>{s.removeEventListener(kA,f),c=null}},createHref(y){return t(s,y)},createURL:g,encodeLocation(y){let b=g(y);return{pathname:b.pathname,search:b.search,hash:b.hash}},push:h,replace:p,go(y){return o.go(y)}};return m}var $A;(function(e){e.data="data",e.deferred="deferred",e.redirect="redirect",e.error="error"})($A||($A={}));function g9(e,t,n){return n===void 0&&(n="/"),v9(e,t,n,!1)}function v9(e,t,n,r){let s=typeof t=="string"?Ku(t):t,a=$S(s.pathname||"/",n);if(a==null)return null;let o=QM(e);y9(o);let l=null;for(let c=0;l==null&&c{let c={relativePath:l===void 0?a.path||"":l,caseSensitive:a.caseSensitive===!0,childrenIndex:o,route:a};c.relativePath.startsWith("/")&&(On(c.relativePath.startsWith(r),'Absolute route path "'+c.relativePath+'" nested under path '+('"'+r+'" is not valid. An absolute child route path ')+"must start with the combined path of all its parent routes."),c.relativePath=c.relativePath.slice(r.length));let u=fo([r,c.relativePath]),d=n.concat(c);a.children&&a.children.length>0&&(On(a.index!==!0,"Index routes must not have child routes. Please remove "+('all child routes from route path "'+u+'".')),QM(a.children,t,d,u)),!(a.path==null&&!a.index)&&t.push({path:u,score:_9(u,a.index),routesMeta:d})};return e.forEach((a,o)=>{var l;if(a.path===""||!((l=a.path)!=null&&l.includes("?")))s(a,o);else for(let c of JM(a.path))s(a,o,c)}),t}function JM(e){let t=e.split("/");if(t.length===0)return[];let[n,...r]=t,s=n.endsWith("?"),a=n.replace(/\?$/,"");if(r.length===0)return s?[a,""]:[a];let o=JM(r.join("/")),l=[];return l.push(...o.map(c=>c===""?a:[a,c].join("/"))),s&&l.push(...o),l.map(c=>e.startsWith("/")&&c===""?"/":c)}function y9(e){e.sort((t,n)=>t.score!==n.score?n.score-t.score:P9(t.routesMeta.map(r=>r.childrenIndex),n.routesMeta.map(r=>r.childrenIndex)))}const x9=/^:[\w-]+$/,b9=3,w9=2,j9=1,S9=10,N9=-2,MA=e=>e==="*";function _9(e,t){let n=e.split("/"),r=n.length;return n.some(MA)&&(r+=N9),t&&(r+=w9),n.filter(s=>!MA(s)).reduce((s,a)=>s+(x9.test(a)?b9:a===""?j9:S9),r)}function P9(e,t){return e.length===t.length&&e.slice(0,-1).every((r,s)=>r===t[s])?e[e.length-1]-t[t.length-1]:0}function A9(e,t,n){let{routesMeta:r}=e,s={},a="/",o=[];for(let l=0;l{let{paramName:h,isOptional:p}=d;if(h==="*"){let m=l[f]||"";o=a.slice(0,a.length-m.length).replace(/(.)\/+$/,"$1")}const g=l[f];return p&&!g?u[h]=void 0:u[h]=(g||"").replace(/%2F/g,"/"),u},{}),pathname:a,pathnameBase:o,pattern:e}}function C9(e,t,n){t===void 0&&(t=!1),n===void 0&&(n=!0),ZM(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=[],s="^"+e.replace(/\/*\*?$/,"").replace(/^\/*/,"/").replace(/[\\.*+^${}|()[\]]/g,"\\$&").replace(/\/:([\w-]+)(\?)?/g,(o,l,c)=>(r.push({paramName:l,isOptional:c!=null}),c?"/?([^\\/]+)?":"/([^\\/]+)"));return e.endsWith("*")?(r.push({paramName:"*"}),s+=e==="*"||e==="/*"?"(.*)$":"(?:\\/(.+)|\\/*)$"):n?s+="\\/*$":e!==""&&e!=="/"&&(s+="(?:(?=\\/|$))"),[new RegExp(s,t?void 0:"i"),r]}function E9(e){try{return e.split("/").map(t=>decodeURIComponent(t).replace(/\//g,"%2F")).join("/")}catch(t){return ZM(!1,'The URL path "'+e+'" could not be decoded because it is is a malformed URL segment. This is probably due to a bad percent '+("encoding ("+t+").")),e}}function $S(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 O9(e,t){t===void 0&&(t="/");let{pathname:n,search:r="",hash:s=""}=typeof e=="string"?Ku(e):e;return{pathname:n?n.startsWith("/")?n:k9(n,t):t,search:M9(r),hash:I9(s)}}function k9(e,t){let n=t.replace(/\/+$/,"").split("/");return e.split("/").forEach(s=>{s===".."?n.length>1&&n.pop():s!=="."&&n.push(s)}),n.length>1?n.join("/"):"/"}function h0(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 and the router will parse it for you.'}function T9(e){return e.filter((t,n)=>n===0||t.route.path&&t.route.path.length>0)}function MS(e,t){let n=T9(e);return t?n.map((r,s)=>s===n.length-1?r.pathname:r.pathnameBase):n.map(r=>r.pathnameBase)}function IS(e,t,n,r){r===void 0&&(r=!1);let s;typeof e=="string"?s=Ku(e):(s=Ff({},e),On(!s.pathname||!s.pathname.includes("?"),h0("?","pathname","search",s)),On(!s.pathname||!s.pathname.includes("#"),h0("#","pathname","hash",s)),On(!s.search||!s.search.includes("#"),h0("#","search","hash",s)));let a=e===""||s.pathname==="",o=a?"/":s.pathname,l;if(o==null)l=n;else{let f=t.length-1;if(!r&&o.startsWith("..")){let h=o.split("/");for(;h[0]==="..";)h.shift(),f-=1;s.pathname=h.join("/")}l=f>=0?t[f]:"/"}let c=O9(s,l),u=o&&o!=="/"&&o.endsWith("/"),d=(a||o===".")&&n.endsWith("/");return!c.pathname.endsWith("/")&&(u||d)&&(c.pathname+="/"),c}const fo=e=>e.join("/").replace(/\/\/+/g,"/"),$9=e=>e.replace(/\/+$/,"").replace(/^\/*/,"/"),M9=e=>!e||e==="?"?"":e.startsWith("?")?e:"?"+e,I9=e=>!e||e==="#"?"":e.startsWith("#")?e:"#"+e;function R9(e){return e!=null&&typeof e.status=="number"&&typeof e.statusText=="string"&&typeof e.internal=="boolean"&&"data"in e}const eI=["post","put","patch","delete"];new Set(eI);const D9=["get",...eI];new Set(D9);/** * React Router v6.27.0 * * Copyright (c) Remix Software Inc. @@ -56,7 +56,7 @@ Error generating stack: `+a.message+` * LICENSE.md file in the root directory of this source tree. * * @license MIT - */function Bf(){return Bf=Object.assign?Object.assign.bind():function(e){for(var t=1;t{l.current=!0}),v.useCallback(function(u,d){if(d===void 0&&(d={}),!l.current)return;if(typeof u=="number"){r.go(u);return}let f=kS(u,JSON.parse(o),a,d.relative==="path");e==null&&t!=="/"&&(f.pathname=f.pathname==="/"?t:uo([t,f.pathname])),(d.replace?r.replace:r.push)(f,d.state,d)},[t,r,o,a,e])}function QM(){let{matches:e}=v.useContext(_i),t=e[e.length-1];return t?t.params:{}}function JM(e,t){let{relative:n}=t===void 0?{}:t,{future:r}=v.useContext(Ro),{matches:s}=v.useContext(_i),{pathname:a}=qr(),o=JSON.stringify(OS(s,r.v7_relativeSplatPath));return v.useMemo(()=>kS(e,JSON.parse(o),a,n==="path"),[e,o,a,n])}function I9(e,t){return R9(e,t)}function R9(e,t,n,r){Xu()||On(!1);let{navigator:s}=v.useContext(Ro),{matches:a}=v.useContext(_i),o=a[a.length-1],l=o?o.params:{};o&&o.pathname;let c=o?o.pathnameBase:"/";o&&o.route;let u=qr(),d;if(t){var f;let y=typeof t=="string"?Ku(t):t;c==="/"||(f=y.pathname)!=null&&f.startsWith(c)||On(!1),d=y}else d=u;let h=d.pathname||"/",p=h;if(c!=="/"){let y=c.replace(/^\//,"").split("/");p="/"+h.replace(/^\//,"").split("/").slice(y.length).join("/")}let g=u9(e,{pathname:p}),m=z9(g&&g.map(y=>Object.assign({},y,{params:Object.assign({},l,y.params),pathname:uo([c,s.encodeLocation?s.encodeLocation(y.pathname).pathname:y.pathname]),pathnameBase:y.pathnameBase==="/"?c:uo([c,s.encodeLocation?s.encodeLocation(y.pathnameBase).pathname:y.pathnameBase])})),a,n,r);return t&&m?v.createElement(py.Provider,{value:{location:Bf({pathname:"/",search:"",hash:"",state:null,key:"default"},d),navigationType:Ji.Pop}},m):m}function D9(){let e=H9(),t=O9(e)?e.status+" "+e.statusText:e instanceof Error?e.message:JSON.stringify(e),n=e instanceof Error?e.stack:null,s={padding:"0.5rem",backgroundColor:"rgba(200,200,200, 0.5)"};return v.createElement(v.Fragment,null,v.createElement("h2",null,"Unexpected Application Error!"),v.createElement("h3",{style:{fontStyle:"italic"}},t),n?v.createElement("pre",{style:s},n):null,null)}const L9=v.createElement(D9,null);class F9 extends v.Component{constructor(t){super(t),this.state={location:t.location,revalidation:t.revalidation,error:t.error}}static getDerivedStateFromError(t){return{error:t}}static getDerivedStateFromProps(t,n){return n.location!==t.location||n.revalidation!=="idle"&&t.revalidation==="idle"?{error:t.error,location:t.location,revalidation:t.revalidation}:{error:t.error!==void 0?t.error:n.error,location:n.location,revalidation:t.revalidation||n.revalidation}}componentDidCatch(t,n){console.error("React Router caught the following error during render",t,n)}render(){return this.state.error!==void 0?v.createElement(_i.Provider,{value:this.props.routeContext},v.createElement(YM.Provider,{value:this.state.error,children:this.props.component})):this.props.children}}function B9(e){let{routeContext:t,match:n,children:r}=e,s=v.useContext(TS);return s&&s.static&&s.staticContext&&(n.route.errorElement||n.route.ErrorBoundary)&&(s.staticContext._deepestRenderedBoundaryId=n.route.id),v.createElement(_i.Provider,{value:t},r)}function z9(e,t,n,r){var s;if(t===void 0&&(t=[]),n===void 0&&(n=null),r===void 0&&(r=null),e==null){var a;if(!n)return null;if(n.errors)e=n.matches;else if((a=r)!=null&&a.v7_partialHydration&&t.length===0&&!n.initialized&&n.matches.length>0)e=n.matches;else return null}let o=e,l=(s=n)==null?void 0:s.errors;if(l!=null){let d=o.findIndex(f=>f.route.id&&(l==null?void 0:l[f.route.id])!==void 0);d>=0||On(!1),o=o.slice(0,Math.min(o.length,d+1))}let c=!1,u=-1;if(n&&r&&r.v7_partialHydration)for(let d=0;d=0?o=o.slice(0,u+1):o=[o[0]];break}}}return o.reduceRight((d,f,h)=>{let p,g=!1,m=null,y=null;n&&(p=l&&f.route.id?l[f.route.id]:void 0,m=f.route.errorElement||L9,c&&(u<0&&h===0?(g=!0,y=null):u===h&&(g=!0,y=f.route.hydrateFallbackElement||null)));let b=t.concat(o.slice(0,h+1)),x=()=>{let w;return p?w=m:g?w=y:f.route.Component?w=v.createElement(f.route.Component,null):f.route.element?w=f.route.element:w=d,v.createElement(B9,{match:f,routeContext:{outlet:d,matches:b,isDataRoute:n!=null},children:w})};return n&&(f.route.ErrorBoundary||f.route.errorElement||h===0)?v.createElement(F9,{location:n.location,revalidation:n.revalidation,component:m,error:p,children:x(),routeContext:{outlet:null,matches:b,isDataRoute:!0}}):x()},null)}var eI=function(e){return e.UseBlocker="useBlocker",e.UseRevalidator="useRevalidator",e.UseNavigateStable="useNavigate",e}(eI||{}),ug=function(e){return e.UseBlocker="useBlocker",e.UseLoaderData="useLoaderData",e.UseActionData="useActionData",e.UseRouteError="useRouteError",e.UseNavigation="useNavigation",e.UseRouteLoaderData="useRouteLoaderData",e.UseMatches="useMatches",e.UseRevalidator="useRevalidator",e.UseNavigateStable="useNavigate",e.UseRouteId="useRouteId",e}(ug||{});function U9(e){let t=v.useContext(TS);return t||On(!1),t}function V9(e){let t=v.useContext(T9);return t||On(!1),t}function W9(e){let t=v.useContext(_i);return t||On(!1),t}function tI(e){let t=W9(),n=t.matches[t.matches.length-1];return n.route.id||On(!1),n.route.id}function H9(){var e;let t=v.useContext(YM),n=V9(ug.UseRouteError),r=tI(ug.UseRouteError);return t!==void 0?t:(e=n.errors)==null?void 0:e[r]}function G9(){let{router:e}=U9(eI.UseNavigateStable),t=tI(ug.UseNavigateStable),n=v.useRef(!1);return ZM(()=>{n.current=!0}),v.useCallback(function(s,a){a===void 0&&(a={}),n.current&&(typeof s=="number"?e.navigate(s):e.navigate(s,Bf({fromRouteId:t},a)))},[e,t])}function nI(e){let{to:t,replace:n,state:r,relative:s}=e;Xu()||On(!1);let{future:a,static:o}=v.useContext(Ro),{matches:l}=v.useContext(_i),{pathname:c}=qr(),u=Tn(),d=kS(t,OS(l,a.v7_relativeSplatPath),c,s==="path"),f=JSON.stringify(d);return v.useEffect(()=>u(JSON.parse(f),{replace:n,state:r,relative:s}),[u,f,s,n,r]),null}function Is(e){On(!1)}function q9(e){let{basename:t="/",children:n=null,location:r,navigationType:s=Ji.Pop,navigator:a,static:o=!1,future:l}=e;Xu()&&On(!1);let c=t.replace(/^\/*/,"/"),u=v.useMemo(()=>({basename:c,navigator:a,static:o,future:Bf({v7_relativeSplatPath:!1},l)}),[c,l,a,o]);typeof r=="string"&&(r=Ku(r));let{pathname:d="/",search:f="",hash:h="",state:p=null,key:g="default"}=r,m=v.useMemo(()=>{let y=ES(d,c);return y==null?null:{location:{pathname:y,search:f,hash:h,state:p,key:g},navigationType:s}},[c,d,f,h,p,g,s]);return m==null?null:v.createElement(Ro.Provider,{value:u},v.createElement(py.Provider,{children:n,value:m}))}function K9(e){let{children:t,location:n}=e;return I9(iw(t),n)}new Promise(()=>{});function iw(e,t){t===void 0&&(t=[]);let n=[];return v.Children.forEach(e,(r,s)=>{if(!v.isValidElement(r))return;let a=[...t,s];if(r.type===v.Fragment){n.push.apply(n,iw(r.props.children,a));return}r.type!==Is&&On(!1),!r.props.index||!r.props.children||On(!1);let o={id:r.props.id||a.join("-"),caseSensitive:r.props.caseSensitive,element:r.props.element,Component:r.props.Component,index:r.props.index,path:r.props.path,loader:r.props.loader,action:r.props.action,errorElement:r.props.errorElement,ErrorBoundary:r.props.ErrorBoundary,hasErrorBoundary:r.props.ErrorBoundary!=null||r.props.errorElement!=null,shouldRevalidate:r.props.shouldRevalidate,handle:r.props.handle,lazy:r.props.lazy};r.props.children&&(o.children=iw(r.props.children,a)),n.push(o)}),n}/** + */function Bf(){return Bf=Object.assign?Object.assign.bind():function(e){for(var t=1;t{l.current=!0}),v.useCallback(function(u,d){if(d===void 0&&(d={}),!l.current)return;if(typeof u=="number"){r.go(u);return}let f=IS(u,JSON.parse(o),a,d.relative==="path");e==null&&t!=="/"&&(f.pathname=f.pathname==="/"?t:fo([t,f.pathname])),(d.replace?r.replace:r.push)(f,d.state,d)},[t,r,o,a,e])}function DS(){let{matches:e}=v.useContext(Pi),t=e[e.length-1];return t?t.params:{}}function rI(e,t){let{relative:n}=t===void 0?{}:t,{future:r}=v.useContext(Ro),{matches:s}=v.useContext(Pi),{pathname:a}=qr(),o=JSON.stringify(MS(s,r.v7_relativeSplatPath));return v.useMemo(()=>IS(e,JSON.parse(o),a,n==="path"),[e,o,a,n])}function z9(e,t){return U9(e,t)}function U9(e,t,n,r){Xu()||On(!1);let{navigator:s}=v.useContext(Ro),{matches:a}=v.useContext(Pi),o=a[a.length-1],l=o?o.params:{};o&&o.pathname;let c=o?o.pathnameBase:"/";o&&o.route;let u=qr(),d;if(t){var f;let y=typeof t=="string"?Ku(t):t;c==="/"||(f=y.pathname)!=null&&f.startsWith(c)||On(!1),d=y}else d=u;let h=d.pathname||"/",p=h;if(c!=="/"){let y=c.replace(/^\//,"").split("/");p="/"+h.replace(/^\//,"").split("/").slice(y.length).join("/")}let g=g9(e,{pathname:p}),m=q9(g&&g.map(y=>Object.assign({},y,{params:Object.assign({},l,y.params),pathname:fo([c,s.encodeLocation?s.encodeLocation(y.pathname).pathname:y.pathname]),pathnameBase:y.pathnameBase==="/"?c:fo([c,s.encodeLocation?s.encodeLocation(y.pathnameBase).pathname:y.pathnameBase])})),a,n,r);return t&&m?v.createElement(gy.Provider,{value:{location:Bf({pathname:"/",search:"",hash:"",state:null,key:"default"},d),navigationType:eo.Pop}},m):m}function V9(){let e=Z9(),t=R9(e)?e.status+" "+e.statusText:e instanceof Error?e.message:JSON.stringify(e),n=e instanceof Error?e.stack:null,s={padding:"0.5rem",backgroundColor:"rgba(200,200,200, 0.5)"};return v.createElement(v.Fragment,null,v.createElement("h2",null,"Unexpected Application Error!"),v.createElement("h3",{style:{fontStyle:"italic"}},t),n?v.createElement("pre",{style:s},n):null,null)}const W9=v.createElement(V9,null);class G9 extends v.Component{constructor(t){super(t),this.state={location:t.location,revalidation:t.revalidation,error:t.error}}static getDerivedStateFromError(t){return{error:t}}static getDerivedStateFromProps(t,n){return n.location!==t.location||n.revalidation!=="idle"&&t.revalidation==="idle"?{error:t.error,location:t.location,revalidation:t.revalidation}:{error:t.error!==void 0?t.error:n.error,location:n.location,revalidation:t.revalidation||n.revalidation}}componentDidCatch(t,n){console.error("React Router caught the following error during render",t,n)}render(){return this.state.error!==void 0?v.createElement(Pi.Provider,{value:this.props.routeContext},v.createElement(tI.Provider,{value:this.state.error,children:this.props.component})):this.props.children}}function H9(e){let{routeContext:t,match:n,children:r}=e,s=v.useContext(RS);return s&&s.static&&s.staticContext&&(n.route.errorElement||n.route.ErrorBoundary)&&(s.staticContext._deepestRenderedBoundaryId=n.route.id),v.createElement(Pi.Provider,{value:t},r)}function q9(e,t,n,r){var s;if(t===void 0&&(t=[]),n===void 0&&(n=null),r===void 0&&(r=null),e==null){var a;if(!n)return null;if(n.errors)e=n.matches;else if((a=r)!=null&&a.v7_partialHydration&&t.length===0&&!n.initialized&&n.matches.length>0)e=n.matches;else return null}let o=e,l=(s=n)==null?void 0:s.errors;if(l!=null){let d=o.findIndex(f=>f.route.id&&(l==null?void 0:l[f.route.id])!==void 0);d>=0||On(!1),o=o.slice(0,Math.min(o.length,d+1))}let c=!1,u=-1;if(n&&r&&r.v7_partialHydration)for(let d=0;d=0?o=o.slice(0,u+1):o=[o[0]];break}}}return o.reduceRight((d,f,h)=>{let p,g=!1,m=null,y=null;n&&(p=l&&f.route.id?l[f.route.id]:void 0,m=f.route.errorElement||W9,c&&(u<0&&h===0?(g=!0,y=null):u===h&&(g=!0,y=f.route.hydrateFallbackElement||null)));let b=t.concat(o.slice(0,h+1)),x=()=>{let w;return p?w=m:g?w=y:f.route.Component?w=v.createElement(f.route.Component,null):f.route.element?w=f.route.element:w=d,v.createElement(H9,{match:f,routeContext:{outlet:d,matches:b,isDataRoute:n!=null},children:w})};return n&&(f.route.ErrorBoundary||f.route.errorElement||h===0)?v.createElement(G9,{location:n.location,revalidation:n.revalidation,component:m,error:p,children:x(),routeContext:{outlet:null,matches:b,isDataRoute:!0}}):x()},null)}var sI=function(e){return e.UseBlocker="useBlocker",e.UseRevalidator="useRevalidator",e.UseNavigateStable="useNavigate",e}(sI||{}),fg=function(e){return e.UseBlocker="useBlocker",e.UseLoaderData="useLoaderData",e.UseActionData="useActionData",e.UseRouteError="useRouteError",e.UseNavigation="useNavigation",e.UseRouteLoaderData="useRouteLoaderData",e.UseMatches="useMatches",e.UseRevalidator="useRevalidator",e.UseNavigateStable="useNavigate",e.UseRouteId="useRouteId",e}(fg||{});function K9(e){let t=v.useContext(RS);return t||On(!1),t}function X9(e){let t=v.useContext(L9);return t||On(!1),t}function Y9(e){let t=v.useContext(Pi);return t||On(!1),t}function aI(e){let t=Y9(),n=t.matches[t.matches.length-1];return n.route.id||On(!1),n.route.id}function Z9(){var e;let t=v.useContext(tI),n=X9(fg.UseRouteError),r=aI(fg.UseRouteError);return t!==void 0?t:(e=n.errors)==null?void 0:e[r]}function Q9(){let{router:e}=K9(sI.UseNavigateStable),t=aI(fg.UseNavigateStable),n=v.useRef(!1);return nI(()=>{n.current=!0}),v.useCallback(function(s,a){a===void 0&&(a={}),n.current&&(typeof s=="number"?e.navigate(s):e.navigate(s,Bf({fromRouteId:t},a)))},[e,t])}function iI(e){let{to:t,replace:n,state:r,relative:s}=e;Xu()||On(!1);let{future:a,static:o}=v.useContext(Ro),{matches:l}=v.useContext(Pi),{pathname:c}=qr(),u=Tn(),d=IS(t,MS(l,a.v7_relativeSplatPath),c,s==="path"),f=JSON.stringify(d);return v.useEffect(()=>u(JSON.parse(f),{replace:n,state:r,relative:s}),[u,f,s,n,r]),null}function Rs(e){On(!1)}function J9(e){let{basename:t="/",children:n=null,location:r,navigationType:s=eo.Pop,navigator:a,static:o=!1,future:l}=e;Xu()&&On(!1);let c=t.replace(/^\/*/,"/"),u=v.useMemo(()=>({basename:c,navigator:a,static:o,future:Bf({v7_relativeSplatPath:!1},l)}),[c,l,a,o]);typeof r=="string"&&(r=Ku(r));let{pathname:d="/",search:f="",hash:h="",state:p=null,key:g="default"}=r,m=v.useMemo(()=>{let y=$S(d,c);return y==null?null:{location:{pathname:y,search:f,hash:h,state:p,key:g},navigationType:s}},[c,d,f,h,p,g,s]);return m==null?null:v.createElement(Ro.Provider,{value:u},v.createElement(gy.Provider,{children:n,value:m}))}function eW(e){let{children:t,location:n}=e;return z9(cw(t),n)}new Promise(()=>{});function cw(e,t){t===void 0&&(t=[]);let n=[];return v.Children.forEach(e,(r,s)=>{if(!v.isValidElement(r))return;let a=[...t,s];if(r.type===v.Fragment){n.push.apply(n,cw(r.props.children,a));return}r.type!==Rs&&On(!1),!r.props.index||!r.props.children||On(!1);let o={id:r.props.id||a.join("-"),caseSensitive:r.props.caseSensitive,element:r.props.element,Component:r.props.Component,index:r.props.index,path:r.props.path,loader:r.props.loader,action:r.props.action,errorElement:r.props.errorElement,ErrorBoundary:r.props.ErrorBoundary,hasErrorBoundary:r.props.ErrorBoundary!=null||r.props.errorElement!=null,shouldRevalidate:r.props.shouldRevalidate,handle:r.props.handle,lazy:r.props.lazy};r.props.children&&(o.children=cw(r.props.children,a)),n.push(o)}),n}/** * React Router DOM v6.27.0 * * Copyright (c) Remix Software Inc. @@ -65,37 +65,37 @@ Error generating stack: `+a.message+` * LICENSE.md file in the root directory of this source tree. * * @license MIT - */function ow(){return ow=Object.assign?Object.assign.bind():function(e){for(var t=1;t=0)&&(n[s]=e[s]);return n}function Y9(e){return!!(e.metaKey||e.altKey||e.ctrlKey||e.shiftKey)}function Z9(e,t){return e.button===0&&(!t||t==="_self")&&!Y9(e)}function lw(e){return e===void 0&&(e=""),new URLSearchParams(typeof e=="string"||Array.isArray(e)||e instanceof URLSearchParams?e:Object.keys(e).reduce((t,n)=>{let r=e[n];return t.concat(Array.isArray(r)?r.map(s=>[n,s]):[[n,r]])},[]))}function Q9(e,t){let n=lw(e);return t&&t.forEach((r,s)=>{n.has(s)||t.getAll(s).forEach(a=>{n.append(s,a)})}),n}const J9=["onClick","relative","reloadDocument","replace","state","target","to","preventScrollReset","viewTransition"],eW="6";try{window.__reactRouterVersion=eW}catch{}const tW="startTransition",kA=Qk[tW];function nW(e){let{basename:t,children:n,future:r,window:s}=e,a=v.useRef();a.current==null&&(a.current=o9({window:s,v5Compat:!0}));let o=a.current,[l,c]=v.useState({action:o.action,location:o.location}),{v7_startTransition:u}=r||{},d=v.useCallback(f=>{u&&kA?kA(()=>c(f)):c(f)},[c,u]);return v.useLayoutEffect(()=>o.listen(d),[o,d]),v.createElement(q9,{basename:t,children:n,location:l.location,navigationType:l.action,navigator:o,future:r})}const rW=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u",sW=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,bs=v.forwardRef(function(t,n){let{onClick:r,relative:s,reloadDocument:a,replace:o,state:l,target:c,to:u,preventScrollReset:d,viewTransition:f}=t,h=X9(t,J9),{basename:p}=v.useContext(Ro),g,m=!1;if(typeof u=="string"&&sW.test(u)&&(g=u,rW))try{let w=new URL(window.location.href),j=u.startsWith("//")?new URL(w.protocol+u):new URL(u),S=ES(j.pathname,p);j.origin===w.origin&&S!=null?u=S+j.search+j.hash:m=!0}catch{}let y=$9(u,{relative:s}),b=aW(u,{replace:o,state:l,target:c,preventScrollReset:d,relative:s,viewTransition:f});function x(w){r&&r(w),w.defaultPrevented||b(w)}return v.createElement("a",ow({},h,{href:g||y,onClick:m||a?r:x,ref:n,target:c}))});var TA;(function(e){e.UseScrollRestoration="useScrollRestoration",e.UseSubmit="useSubmit",e.UseSubmitFetcher="useSubmitFetcher",e.UseFetcher="useFetcher",e.useViewTransitionState="useViewTransitionState"})(TA||(TA={}));var $A;(function(e){e.UseFetcher="useFetcher",e.UseFetchers="useFetchers",e.UseScrollRestoration="useScrollRestoration"})($A||($A={}));function aW(e,t){let{target:n,replace:r,state:s,preventScrollReset:a,relative:o,viewTransition:l}=t===void 0?{}:t,c=Tn(),u=qr(),d=JM(e,{relative:o});return v.useCallback(f=>{if(Z9(f,n)){f.preventDefault();let h=r!==void 0?r:cg(u)===cg(d);c(e,{replace:h,state:s,preventScrollReset:a,relative:o,viewTransition:l})}},[u,c,d,r,s,n,e,a,o,l])}function iW(e){let t=v.useRef(lw(e)),n=v.useRef(!1),r=qr(),s=v.useMemo(()=>Q9(r.search,n.current?null:t.current),[r.search]),a=Tn(),o=v.useCallback((l,c)=>{const u=lw(typeof l=="function"?l(s):l);n.current=!0,a("?"+u,c)},[a,s]);return[s,o]}/** + */function uw(){return uw=Object.assign?Object.assign.bind():function(e){for(var t=1;t=0)&&(n[s]=e[s]);return n}function nW(e){return!!(e.metaKey||e.altKey||e.ctrlKey||e.shiftKey)}function rW(e,t){return e.button===0&&(!t||t==="_self")&&!nW(e)}function dw(e){return e===void 0&&(e=""),new URLSearchParams(typeof e=="string"||Array.isArray(e)||e instanceof URLSearchParams?e:Object.keys(e).reduce((t,n)=>{let r=e[n];return t.concat(Array.isArray(r)?r.map(s=>[n,s]):[[n,r]])},[]))}function sW(e,t){let n=dw(e);return t&&t.forEach((r,s)=>{n.has(s)||t.getAll(s).forEach(a=>{n.append(s,a)})}),n}const aW=["onClick","relative","reloadDocument","replace","state","target","to","preventScrollReset","viewTransition"],iW="6";try{window.__reactRouterVersion=iW}catch{}const oW="startTransition",RA=rT[oW];function lW(e){let{basename:t,children:n,future:r,window:s}=e,a=v.useRef();a.current==null&&(a.current=h9({window:s,v5Compat:!0}));let o=a.current,[l,c]=v.useState({action:o.action,location:o.location}),{v7_startTransition:u}=r||{},d=v.useCallback(f=>{u&&RA?RA(()=>c(f)):c(f)},[c,u]);return v.useLayoutEffect(()=>o.listen(d),[o,d]),v.createElement(J9,{basename:t,children:n,location:l.location,navigationType:l.action,navigator:o,future:r})}const cW=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u",uW=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,ws=v.forwardRef(function(t,n){let{onClick:r,relative:s,reloadDocument:a,replace:o,state:l,target:c,to:u,preventScrollReset:d,viewTransition:f}=t,h=tW(t,aW),{basename:p}=v.useContext(Ro),g,m=!1;if(typeof u=="string"&&uW.test(u)&&(g=u,cW))try{let w=new URL(window.location.href),j=u.startsWith("//")?new URL(w.protocol+u):new URL(u),S=$S(j.pathname,p);j.origin===w.origin&&S!=null?u=S+j.search+j.hash:m=!0}catch{}let y=F9(u,{relative:s}),b=dW(u,{replace:o,state:l,target:c,preventScrollReset:d,relative:s,viewTransition:f});function x(w){r&&r(w),w.defaultPrevented||b(w)}return v.createElement("a",uw({},h,{href:g||y,onClick:m||a?r:x,ref:n,target:c}))});var DA;(function(e){e.UseScrollRestoration="useScrollRestoration",e.UseSubmit="useSubmit",e.UseSubmitFetcher="useSubmitFetcher",e.UseFetcher="useFetcher",e.useViewTransitionState="useViewTransitionState"})(DA||(DA={}));var LA;(function(e){e.UseFetcher="useFetcher",e.UseFetchers="useFetchers",e.UseScrollRestoration="useScrollRestoration"})(LA||(LA={}));function dW(e,t){let{target:n,replace:r,state:s,preventScrollReset:a,relative:o,viewTransition:l}=t===void 0?{}:t,c=Tn(),u=qr(),d=rI(e,{relative:o});return v.useCallback(f=>{if(rW(f,n)){f.preventDefault();let h=r!==void 0?r:dg(u)===dg(d);c(e,{replace:h,state:s,preventScrollReset:a,relative:o,viewTransition:l})}},[u,c,d,r,s,n,e,a,o,l])}function fW(e){let t=v.useRef(dw(e)),n=v.useRef(!1),r=qr(),s=v.useMemo(()=>sW(r.search,n.current?null:t.current),[r.search]),a=Tn(),o=v.useCallback((l,c)=>{const u=dw(typeof l=="function"?l(s):l);n.current=!0,a("?"+u,c)},[a,s]);return[s,o]}/** * @license lucide-react v0.462.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const oW=e=>e.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase(),rI=(...e)=>e.filter((t,n,r)=>!!t&&t.trim()!==""&&r.indexOf(t)===n).join(" ").trim();/** + */const hW=e=>e.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase(),oI=(...e)=>e.filter((t,n,r)=>!!t&&t.trim()!==""&&r.indexOf(t)===n).join(" ").trim();/** * @license lucide-react v0.462.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */var lW={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"};/** + */var pW={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"};/** * @license lucide-react v0.462.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const cW=v.forwardRef(({color:e="currentColor",size:t=24,strokeWidth:n=2,absoluteStrokeWidth:r,className:s="",children:a,iconNode:o,...l},c)=>v.createElement("svg",{ref:c,...lW,width:t,height:t,stroke:e,strokeWidth:r?Number(n)*24/Number(t):n,className:rI("lucide",s),...l},[...o.map(([u,d])=>v.createElement(u,d)),...Array.isArray(a)?a:[a]]));/** + */const mW=v.forwardRef(({color:e="currentColor",size:t=24,strokeWidth:n=2,absoluteStrokeWidth:r,className:s="",children:a,iconNode:o,...l},c)=>v.createElement("svg",{ref:c,...pW,width:t,height:t,stroke:e,strokeWidth:r?Number(n)*24/Number(t):n,className:oI("lucide",s),...l},[...o.map(([u,d])=>v.createElement(u,d)),...Array.isArray(a)?a:[a]]));/** * @license lucide-react v0.462.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const Re=(e,t)=>{const n=v.forwardRef(({className:r,...s},a)=>v.createElement(cW,{ref:a,iconNode:t,className:rI(`lucide-${oW(e)}`,r),...s}));return n.displayName=`${e}`,n};/** + */const Re=(e,t)=>{const n=v.forwardRef(({className:r,...s},a)=>v.createElement(mW,{ref:a,iconNode:t,className:oI(`lucide-${hW(e)}`,r),...s}));return n.displayName=`${e}`,n};/** * @license lucide-react v0.462.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const Za=Re("Activity",[["path",{d:"M22 12h-2.48a2 2 0 0 0-1.93 1.46l-2.35 8.36a.25.25 0 0 1-.48 0L9.24 2.18a.25.25 0 0 0-.48 0l-2.35 8.36A2 2 0 0 1 4.49 12H2",key:"169zse"}]]);/** + */const Qa=Re("Activity",[["path",{d:"M22 12h-2.48a2 2 0 0 0-1.93 1.46l-2.35 8.36a.25.25 0 0 1-.48 0L9.24 2.18a.25.25 0 0 0-.48 0l-2.35 8.36A2 2 0 0 1 4.49 12H2",key:"169zse"}]]);/** * @license lucide-react v0.462.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const MA=Re("ArrowDown",[["path",{d:"M12 5v14",key:"s699le"}],["path",{d:"m19 12-7 7-7-7",key:"1idqje"}]]);/** + */const FA=Re("ArrowDown",[["path",{d:"M12 5v14",key:"s699le"}],["path",{d:"m19 12-7 7-7-7",key:"1idqje"}]]);/** * @license lucide-react v0.462.0 - ISC * * This source code is licensed under the ISC license. @@ -105,12 +105,12 @@ Error generating stack: `+a.message+` * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const d0=Re("BookOpen",[["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"}]]);/** + */const p0=Re("BookOpen",[["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"}]]);/** * @license lucide-react v0.462.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const fo=Re("Bot",[["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"}]]);/** + */const ni=Re("Bot",[["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"}]]);/** * @license lucide-react v0.462.0 - ISC * * This source code is licensed under the ISC license. @@ -120,42 +120,42 @@ Error generating stack: `+a.message+` * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const IA=Re("Briefcase",[["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"}]]);/** + */const BA=Re("Briefcase",[["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"}]]);/** * @license lucide-react v0.462.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const uW=Re("Calendar",[["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"}]]);/** + */const gW=Re("Calendar",[["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"}]]);/** * @license lucide-react v0.462.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const dW=Re("ChartColumn",[["path",{d:"M3 3v16a2 2 0 0 0 2 2h16",key:"c24i48"}],["path",{d:"M18 17V9",key:"2bz60n"}],["path",{d:"M13 17V5",key:"1frdt8"}],["path",{d:"M8 17v-3",key:"17ska0"}]]);/** + */const vW=Re("ChartColumn",[["path",{d:"M3 3v16a2 2 0 0 0 2 2h16",key:"c24i48"}],["path",{d:"M18 17V9",key:"2bz60n"}],["path",{d:"M13 17V5",key:"1frdt8"}],["path",{d:"M8 17v-3",key:"17ska0"}]]);/** * @license lucide-react v0.462.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const cw=Re("ChartNoAxesColumnIncreasing",[["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"}]]);/** + */const fw=Re("ChartNoAxesColumnIncreasing",[["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"}]]);/** * @license lucide-react v0.462.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const fW=Re("ChartPie",[["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"}]]);/** + */const yW=Re("ChartPie",[["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"}]]);/** * @license lucide-react v0.462.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const Ta=Re("Check",[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]]);/** + */const $a=Re("Check",[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]]);/** * @license lucide-react v0.462.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const yi=Re("ChevronDown",[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]]);/** + */const xi=Re("ChevronDown",[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]]);/** * @license lucide-react v0.462.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const zs=Re("ChevronRight",[["path",{d:"m9 18 6-6-6-6",key:"mthhwq"}]]);/** + */const gs=Re("ChevronRight",[["path",{d:"m9 18 6-6-6-6",key:"mthhwq"}]]);/** * @license lucide-react v0.462.0 - ISC * * This source code is licensed under the ISC license. @@ -165,42 +165,42 @@ Error generating stack: `+a.message+` * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const hW=Re("CircleAlert",[["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"}]]);/** + */const xW=Re("CircleAlert",[["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"}]]);/** * @license lucide-react v0.462.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const $S=Re("CircleCheckBig",[["path",{d:"M21.801 10A10 10 0 1 1 17 3.335",key:"yps3ct"}],["path",{d:"m9 11 3 3L22 4",key:"1pflzl"}]]);/** + */const LS=Re("CircleCheckBig",[["path",{d:"M21.801 10A10 10 0 1 1 17 3.335",key:"yps3ct"}],["path",{d:"m9 11 3 3L22 4",key:"1pflzl"}]]);/** * @license lucide-react v0.462.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const Gd=Re("CircleCheck",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m9 12 2 2 4-4",key:"dzmm74"}]]);/** + */const Hd=Re("CircleCheck",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m9 12 2 2 4-4",key:"dzmm74"}]]);/** * @license lucide-react v0.462.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const sI=Re("CirclePlay",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["polygon",{points:"10 8 16 12 10 16 10 8",key:"1cimsy"}]]);/** + */const lI=Re("CirclePlay",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["polygon",{points:"10 8 16 12 10 16 10 8",key:"1cimsy"}]]);/** * @license lucide-react v0.462.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const pW=Re("CircleUser",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["circle",{cx:"12",cy:"10",r:"3",key:"ilqhr7"}],["path",{d:"M7 20.662V19a2 2 0 0 1 2-2h6a2 2 0 0 1 2 2v1.662",key:"154egf"}]]);/** + */const bW=Re("CircleUser",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["circle",{cx:"12",cy:"10",r:"3",key:"ilqhr7"}],["path",{d:"M7 20.662V19a2 2 0 0 1 2-2h6a2 2 0 0 1 2 2v1.662",key:"154egf"}]]);/** * @license lucide-react v0.462.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const mW=Re("CircleX",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m15 9-6 6",key:"1uzhvr"}],["path",{d:"m9 9 6 6",key:"z0biqf"}]]);/** + */const wW=Re("CircleX",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m15 9-6 6",key:"1uzhvr"}],["path",{d:"m9 9 6 6",key:"z0biqf"}]]);/** * @license lucide-react v0.462.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const MS=Re("Circle",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}]]);/** + */const FS=Re("Circle",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}]]);/** * @license lucide-react v0.462.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const gW=Re("ClipboardList",[["rect",{width:"8",height:"4",x:"8",y:"2",rx:"1",ry:"1",key:"tgr4d6"}],["path",{d:"M16 4h2a2 2 0 0 1 2 2v14a2 2 0 0 1-2 2H6a2 2 0 0 1-2-2V6a2 2 0 0 1 2-2h2",key:"116196"}],["path",{d:"M12 11h4",key:"1jrz19"}],["path",{d:"M12 16h4",key:"n85exb"}],["path",{d:"M8 11h.01",key:"1dfujw"}],["path",{d:"M8 16h.01",key:"18s6g9"}]]);/** + */const jW=Re("ClipboardList",[["rect",{width:"8",height:"4",x:"8",y:"2",rx:"1",ry:"1",key:"tgr4d6"}],["path",{d:"M16 4h2a2 2 0 0 1 2 2v14a2 2 0 0 1-2 2H6a2 2 0 0 1-2-2V6a2 2 0 0 1 2-2h2",key:"116196"}],["path",{d:"M12 11h4",key:"1jrz19"}],["path",{d:"M12 16h4",key:"n85exb"}],["path",{d:"M8 11h.01",key:"1dfujw"}],["path",{d:"M8 16h.01",key:"18s6g9"}]]);/** * @license lucide-react v0.462.0 - ISC * * This source code is licensed under the ISC license. @@ -210,12 +210,12 @@ Error generating stack: `+a.message+` * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const aI=Re("CloudUpload",[["path",{d:"M12 13v8",key:"1l5pq0"}],["path",{d:"M4 14.899A7 7 0 1 1 15.71 8h1.79a4.5 4.5 0 0 1 2.5 8.242",key:"1pljnt"}],["path",{d:"m8 17 4-4 4 4",key:"1quai1"}]]);/** + */const cI=Re("CloudUpload",[["path",{d:"M12 13v8",key:"1l5pq0"}],["path",{d:"M4 14.899A7 7 0 1 1 15.71 8h1.79a4.5 4.5 0 0 1 2.5 8.242",key:"1pljnt"}],["path",{d:"m8 17 4-4 4 4",key:"1quai1"}]]);/** * @license lucide-react v0.462.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const RA=Re("DollarSign",[["line",{x1:"12",x2:"12",y1:"2",y2:"22",key:"7eqyqh"}],["path",{d:"M17 5H9.5a3.5 3.5 0 0 0 0 7h5a3.5 3.5 0 0 1 0 7H6",key:"1b0p4s"}]]);/** + */const zA=Re("DollarSign",[["line",{x1:"12",x2:"12",y1:"2",y2:"22",key:"7eqyqh"}],["path",{d:"M17 5H9.5a3.5 3.5 0 0 0 0 7h5a3.5 3.5 0 0 1 0 7H6",key:"1b0p4s"}]]);/** * @license lucide-react v0.462.0 - ISC * * This source code is licensed under the ISC license. @@ -225,27 +225,27 @@ Error generating stack: `+a.message+` * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const uw=Re("Ellipsis",[["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"}]]);/** + */const hw=Re("Ellipsis",[["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"}]]);/** * @license lucide-react v0.462.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const vW=Re("Eye",[["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"}]]);/** + */const SW=Re("Eye",[["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"}]]);/** * @license lucide-react v0.462.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const dw=Re("FileText",[["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"}]]);/** + */const pw=Re("FileText",[["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"}]]);/** * @license lucide-react v0.462.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const IS=Re("Filter",[["polygon",{points:"22 3 2 3 10 12.46 10 19 14 21 14 12.46 22 3",key:"1yg77f"}]]);/** + */const BS=Re("Filter",[["polygon",{points:"22 3 2 3 10 12.46 10 19 14 21 14 12.46 22 3",key:"1yg77f"}]]);/** * @license lucide-react v0.462.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const iI=Re("FolderPlus",[["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"}]]);/** + */const uI=Re("FolderPlus",[["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"}]]);/** * @license lucide-react v0.462.0 - ISC * * This source code is licensed under the ISC license. @@ -255,42 +255,42 @@ Error generating stack: `+a.message+` * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const yW=Re("Grid2x2",[["path",{d:"M12 3v18",key:"108xh3"}],["path",{d:"M3 12h18",key:"1i2n21"}],["rect",{x:"3",y:"3",width:"18",height:"18",rx:"2",key:"h1oib"}]]);/** + */const NW=Re("Grid2x2",[["path",{d:"M12 3v18",key:"108xh3"}],["path",{d:"M3 12h18",key:"1i2n21"}],["rect",{x:"3",y:"3",width:"18",height:"18",rx:"2",key:"h1oib"}]]);/** * @license lucide-react v0.462.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const fw=Re("Heart",[["path",{d:"M19 14c1.49-1.46 3-3.21 3-5.5A5.5 5.5 0 0 0 16.5 3c-1.76 0-3 .5-4.5 2-1.5-1.5-2.74-2-4.5-2A5.5 5.5 0 0 0 2 8.5c0 2.3 1.5 4.05 3 5.5l7 7Z",key:"c3ymky"}]]);/** + */const mw=Re("Heart",[["path",{d:"M19 14c1.49-1.46 3-3.21 3-5.5A5.5 5.5 0 0 0 16.5 3c-1.76 0-3 .5-4.5 2-1.5-1.5-2.74-2-4.5-2A5.5 5.5 0 0 0 2 8.5c0 2.3 1.5 4.05 3 5.5l7 7Z",key:"c3ymky"}]]);/** * @license lucide-react v0.462.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const hw=Re("House",[["path",{d:"M15 21v-8a1 1 0 0 0-1-1h-4a1 1 0 0 0-1 1v8",key:"5wwlr5"}],["path",{d:"M3 10a2 2 0 0 1 .709-1.528l7-5.999a2 2 0 0 1 2.582 0l7 5.999A2 2 0 0 1 21 10v9a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2z",key:"1d0kgt"}]]);/** + */const hg=Re("House",[["path",{d:"M15 21v-8a1 1 0 0 0-1-1h-4a1 1 0 0 0-1 1v8",key:"5wwlr5"}],["path",{d:"M3 10a2 2 0 0 1 .709-1.528l7-5.999a2 2 0 0 1 2.582 0l7 5.999A2 2 0 0 1 21 10v9a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2z",key:"1d0kgt"}]]);/** * @license lucide-react v0.462.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const _m=Re("Image",[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",ry:"2",key:"1m3agn"}],["circle",{cx:"9",cy:"9",r:"2",key:"af1f0g"}],["path",{d:"m21 15-3.086-3.086a2 2 0 0 0-2.828 0L6 21",key:"1xmnt7"}]]);/** + */const Pm=Re("Image",[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",ry:"2",key:"1m3agn"}],["circle",{cx:"9",cy:"9",r:"2",key:"af1f0g"}],["path",{d:"m21 15-3.086-3.086a2 2 0 0 0-2.828 0L6 21",key:"1xmnt7"}]]);/** * @license lucide-react v0.462.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const xW=Re("Info",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 16v-4",key:"1dtifu"}],["path",{d:"M12 8h.01",key:"e9boi3"}]]);/** + */const _W=Re("Info",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 16v-4",key:"1dtifu"}],["path",{d:"M12 8h.01",key:"e9boi3"}]]);/** * @license lucide-react v0.462.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const bW=Re("Laptop",[["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"}]]);/** + */const PW=Re("Laptop",[["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"}]]);/** * @license lucide-react v0.462.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const pw=Re("LayoutDashboard",[["rect",{width:"7",height:"9",x:"3",y:"3",rx:"1",key:"10lvy0"}],["rect",{width:"7",height:"5",x:"14",y:"3",rx:"1",key:"16une8"}],["rect",{width:"7",height:"9",x:"14",y:"12",rx:"1",key:"1hutg5"}],["rect",{width:"7",height:"5",x:"3",y:"16",rx:"1",key:"ldoo1y"}]]);/** + */const gw=Re("LayoutDashboard",[["rect",{width:"7",height:"9",x:"3",y:"3",rx:"1",key:"10lvy0"}],["rect",{width:"7",height:"5",x:"14",y:"3",rx:"1",key:"16une8"}],["rect",{width:"7",height:"9",x:"14",y:"12",rx:"1",key:"1hutg5"}],["rect",{width:"7",height:"5",x:"3",y:"16",rx:"1",key:"ldoo1y"}]]);/** * @license lucide-react v0.462.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const wW=Re("LayoutGrid",[["rect",{width:"7",height:"7",x:"3",y:"3",rx:"1",key:"1g98yp"}],["rect",{width:"7",height:"7",x:"14",y:"3",rx:"1",key:"6d4xhi"}],["rect",{width:"7",height:"7",x:"14",y:"14",rx:"1",key:"nxv5o0"}],["rect",{width:"7",height:"7",x:"3",y:"14",rx:"1",key:"1bb6yr"}]]);/** + */const AW=Re("LayoutGrid",[["rect",{width:"7",height:"7",x:"3",y:"3",rx:"1",key:"1g98yp"}],["rect",{width:"7",height:"7",x:"14",y:"3",rx:"1",key:"6d4xhi"}],["rect",{width:"7",height:"7",x:"14",y:"14",rx:"1",key:"nxv5o0"}],["rect",{width:"7",height:"7",x:"3",y:"14",rx:"1",key:"1bb6yr"}]]);/** * @license lucide-react v0.462.0 - ISC * * This source code is licensed under the ISC license. @@ -300,37 +300,37 @@ Error generating stack: `+a.message+` * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const qp=Re("ListChecks",[["path",{d:"m3 17 2 2 4-4",key:"1jhpwq"}],["path",{d:"m3 7 2 2 4-4",key:"1obspn"}],["path",{d:"M13 6h8",key:"15sg57"}],["path",{d:"M13 12h8",key:"h98zly"}],["path",{d:"M13 18h8",key:"oe0vm4"}]]);/** + */const Kp=Re("ListChecks",[["path",{d:"m3 17 2 2 4-4",key:"1jhpwq"}],["path",{d:"m3 7 2 2 4-4",key:"1obspn"}],["path",{d:"M13 6h8",key:"15sg57"}],["path",{d:"M13 12h8",key:"h98zly"}],["path",{d:"M13 18h8",key:"oe0vm4"}]]);/** * @license lucide-react v0.462.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const ii=Re("LoaderCircle",[["path",{d:"M21 12a9 9 0 1 1-6.219-8.56",key:"13zald"}]]);/** + */const li=Re("LoaderCircle",[["path",{d:"M21 12a9 9 0 1 1-6.219-8.56",key:"13zald"}]]);/** * @license lucide-react v0.462.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const jW=Re("Loader",[["path",{d:"M12 2v4",key:"3427ic"}],["path",{d:"m16.2 7.8 2.9-2.9",key:"r700ao"}],["path",{d:"M18 12h4",key:"wj9ykh"}],["path",{d:"m16.2 16.2 2.9 2.9",key:"1bxg5t"}],["path",{d:"M12 18v4",key:"jadmvz"}],["path",{d:"m4.9 19.1 2.9-2.9",key:"bwix9q"}],["path",{d:"M2 12h4",key:"j09sii"}],["path",{d:"m4.9 4.9 2.9 2.9",key:"giyufr"}]]);/** + */const CW=Re("Loader",[["path",{d:"M12 2v4",key:"3427ic"}],["path",{d:"m16.2 7.8 2.9-2.9",key:"r700ao"}],["path",{d:"M18 12h4",key:"wj9ykh"}],["path",{d:"m16.2 16.2 2.9 2.9",key:"1bxg5t"}],["path",{d:"M12 18v4",key:"jadmvz"}],["path",{d:"m4.9 19.1 2.9-2.9",key:"bwix9q"}],["path",{d:"M2 12h4",key:"j09sii"}],["path",{d:"m4.9 4.9 2.9 2.9",key:"giyufr"}]]);/** * @license lucide-react v0.462.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const DA=Re("LogIn",[["path",{d:"M15 3h4a2 2 0 0 1 2 2v14a2 2 0 0 1-2 2h-4",key:"u53s6r"}],["polyline",{points:"10 17 15 12 10 7",key:"1ail0h"}],["line",{x1:"15",x2:"3",y1:"12",y2:"12",key:"v6grx8"}]]);/** + */const UA=Re("LogIn",[["path",{d:"M15 3h4a2 2 0 0 1 2 2v14a2 2 0 0 1-2 2h-4",key:"u53s6r"}],["polyline",{points:"10 17 15 12 10 7",key:"1ail0h"}],["line",{x1:"15",x2:"3",y1:"12",y2:"12",key:"v6grx8"}]]);/** * @license lucide-react v0.462.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const LA=Re("LogOut",[["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"}]]);/** + */const VA=Re("LogOut",[["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"}]]);/** * @license lucide-react v0.462.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const SW=Re("MapPin",[["path",{d:"M20 10c0 4.993-5.539 10.193-7.399 11.799a1 1 0 0 1-1.202 0C9.539 20.193 4 14.993 4 10a8 8 0 0 1 16 0",key:"1r0f0z"}],["circle",{cx:"12",cy:"10",r:"3",key:"ilqhr7"}]]);/** + */const EW=Re("MapPin",[["path",{d:"M20 10c0 4.993-5.539 10.193-7.399 11.799a1 1 0 0 1-1.202 0C9.539 20.193 4 14.993 4 10a8 8 0 0 1 16 0",key:"1r0f0z"}],["circle",{cx:"12",cy:"10",r:"3",key:"ilqhr7"}]]);/** * @license lucide-react v0.462.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const NW=Re("Menu",[["line",{x1:"4",x2:"20",y1:"12",y2:"12",key:"1e0a9i"}],["line",{x1:"4",x2:"20",y1:"6",y2:"6",key:"1owob3"}],["line",{x1:"4",x2:"20",y1:"18",y2:"18",key:"yk5zj1"}]]);/** + */const OW=Re("Menu",[["line",{x1:"4",x2:"20",y1:"12",y2:"12",key:"1e0a9i"}],["line",{x1:"4",x2:"20",y1:"6",y2:"6",key:"1owob3"}],["line",{x1:"4",x2:"20",y1:"18",y2:"18",key:"yk5zj1"}]]);/** * @license lucide-react v0.462.0 - ISC * * This source code is licensed under the ISC license. @@ -340,32 +340,32 @@ Error generating stack: `+a.message+` * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const $a=Re("MessageSquare",[["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"}]]);/** + */const Ma=Re("MessageSquare",[["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"}]]);/** * @license lucide-react v0.462.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const _W=Re("Monitor",[["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"}]]);/** + */const kW=Re("Monitor",[["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"}]]);/** * @license lucide-react v0.462.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const FA=Re("Paperclip",[["path",{d:"m21.44 11.05-9.19 9.19a6 6 0 0 1-8.49-8.49l8.57-8.57A4 4 0 1 1 18 8.84l-8.59 8.57a2 2 0 0 1-2.83-2.83l8.49-8.48",key:"1u3ebp"}]]);/** + */const WA=Re("Paperclip",[["path",{d:"m21.44 11.05-9.19 9.19a6 6 0 0 1-8.49-8.49l8.57-8.57A4 4 0 1 1 18 8.84l-8.59 8.57a2 2 0 0 1-2.83-2.83l8.49-8.48",key:"1u3ebp"}]]);/** * @license lucide-react v0.462.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const BA=Re("PenLine",[["path",{d:"M12 20h9",key:"t2du7b"}],["path",{d:"M16.376 3.622a1 1 0 0 1 3.002 3.002L7.368 18.635a2 2 0 0 1-.855.506l-2.872.838a.5.5 0 0 1-.62-.62l.838-2.872a2 2 0 0 1 .506-.854z",key:"1ykcvy"}]]);/** + */const GA=Re("PenLine",[["path",{d:"M12 20h9",key:"t2du7b"}],["path",{d:"M16.376 3.622a1 1 0 0 1 3.002 3.002L7.368 18.635a2 2 0 0 1-.855.506l-2.872.838a.5.5 0 0 1-.62-.62l.838-2.872a2 2 0 0 1 .506-.854z",key:"1ykcvy"}]]);/** * @license lucide-react v0.462.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const PW=Re("Pencil",[["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"}]]);/** + */const TW=Re("Pencil",[["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"}]]);/** * @license lucide-react v0.462.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const AW=Re("Play",[["polygon",{points:"6 3 20 12 6 21 6 3",key:"1oa8hb"}]]);/** + */const $W=Re("Play",[["polygon",{points:"6 3 20 12 6 21 6 3",key:"1oa8hb"}]]);/** * @license lucide-react v0.462.0 - ISC * * This source code is licensed under the ISC license. @@ -375,7 +375,7 @@ Error generating stack: `+a.message+` * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const CW=Re("Quote",[["path",{d:"M16 3a2 2 0 0 0-2 2v6a2 2 0 0 0 2 2 1 1 0 0 1 1 1v1a2 2 0 0 1-2 2 1 1 0 0 0-1 1v2a1 1 0 0 0 1 1 6 6 0 0 0 6-6V5a2 2 0 0 0-2-2z",key:"rib7q0"}],["path",{d:"M5 3a2 2 0 0 0-2 2v6a2 2 0 0 0 2 2 1 1 0 0 1 1 1v1a2 2 0 0 1-2 2 1 1 0 0 0-1 1v2a1 1 0 0 0 1 1 6 6 0 0 0 6-6V5a2 2 0 0 0-2-2z",key:"1ymkrd"}]]);/** + */const MW=Re("Quote",[["path",{d:"M16 3a2 2 0 0 0-2 2v6a2 2 0 0 0 2 2 1 1 0 0 1 1 1v1a2 2 0 0 1-2 2 1 1 0 0 0-1 1v2a1 1 0 0 0 1 1 6 6 0 0 0 6-6V5a2 2 0 0 0-2-2z",key:"rib7q0"}],["path",{d:"M5 3a2 2 0 0 0-2 2v6a2 2 0 0 0 2 2 1 1 0 0 1 1 1v1a2 2 0 0 1-2 2 1 1 0 0 0-1 1v2a1 1 0 0 0 1 1 6 6 0 0 0 6-6V5a2 2 0 0 0-2-2z",key:"1ymkrd"}]]);/** * @license lucide-react v0.462.0 - ISC * * This source code is licensed under the ISC license. @@ -385,57 +385,57 @@ Error generating stack: `+a.message+` * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const RS=Re("Save",[["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"}]]);/** + */const zS=Re("Save",[["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"}]]);/** * @license lucide-react v0.462.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const DS=Re("Search",[["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}],["path",{d:"m21 21-4.3-4.3",key:"1qie3q"}]]);/** + */const US=Re("Search",[["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}],["path",{d:"m21 21-4.3-4.3",key:"1qie3q"}]]);/** * @license lucide-react v0.462.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const LS=Re("Settings",[["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"}]]);/** + */const VS=Re("Settings",[["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"}]]);/** * @license lucide-react v0.462.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const EW=Re("ShoppingBag",[["path",{d:"M6 2 3 6v14a2 2 0 0 0 2 2h14a2 2 0 0 0 2-2V6l-3-4Z",key:"hou9p0"}],["path",{d:"M3 6h18",key:"d0wm0j"}],["path",{d:"M16 10a4 4 0 0 1-8 0",key:"1ltviw"}]]);/** + */const IW=Re("ShoppingBag",[["path",{d:"M6 2 3 6v14a2 2 0 0 0 2 2h14a2 2 0 0 0 2-2V6l-3-4Z",key:"hou9p0"}],["path",{d:"M3 6h18",key:"d0wm0j"}],["path",{d:"M16 10a4 4 0 0 1-8 0",key:"1ltviw"}]]);/** * @license lucide-react v0.462.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const OW=Re("Smartphone",[["rect",{width:"14",height:"20",x:"5",y:"2",rx:"2",ry:"2",key:"1yt0o3"}],["path",{d:"M12 18h.01",key:"mhygvu"}]]);/** + */const RW=Re("Smartphone",[["rect",{width:"14",height:"20",x:"5",y:"2",rx:"2",ry:"2",key:"1yt0o3"}],["path",{d:"M12 18h.01",key:"mhygvu"}]]);/** * @license lucide-react v0.462.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const kW=Re("Sparkles",[["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"}]]);/** + */const DW=Re("Sparkles",[["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"}]]);/** * @license lucide-react v0.462.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const TW=Re("SquarePen",[["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"}]]);/** + */const LW=Re("SquarePen",[["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"}]]);/** * @license lucide-react v0.462.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const $W=Re("Star",[["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"}]]);/** + */const FW=Re("Star",[["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"}]]);/** * @license lucide-react v0.462.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const dg=Re("StickyNote",[["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"}]]);/** + */const pg=Re("StickyNote",[["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"}]]);/** * @license lucide-react v0.462.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const MW=Re("Tag",[["path",{d:"M12.586 2.586A2 2 0 0 0 11.172 2H4a2 2 0 0 0-2 2v7.172a2 2 0 0 0 .586 1.414l8.704 8.704a2.426 2.426 0 0 0 3.42 0l6.58-6.58a2.426 2.426 0 0 0 0-3.42z",key:"vktsd0"}],["circle",{cx:"7.5",cy:"7.5",r:".5",fill:"currentColor",key:"kqv944"}]]);/** + */const BW=Re("Tag",[["path",{d:"M12.586 2.586A2 2 0 0 0 11.172 2H4a2 2 0 0 0-2 2v7.172a2 2 0 0 0 .586 1.414l8.704 8.704a2.426 2.426 0 0 0 3.42 0l6.58-6.58a2.426 2.426 0 0 0 0-3.42z",key:"vktsd0"}],["circle",{cx:"7.5",cy:"7.5",r:".5",fill:"currentColor",key:"kqv944"}]]);/** * @license lucide-react v0.462.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const Pm=Re("Target",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["circle",{cx:"12",cy:"12",r:"6",key:"1vlfrh"}],["circle",{cx:"12",cy:"12",r:"2",key:"1c9p78"}]]);/** + */const Am=Re("Target",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["circle",{cx:"12",cy:"12",r:"6",key:"1vlfrh"}],["circle",{cx:"12",cy:"12",r:"2",key:"1c9p78"}]]);/** * @license lucide-react v0.462.0 - ISC * * This source code is licensed under the ISC license. @@ -445,32 +445,32 @@ Error generating stack: `+a.message+` * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const IW=Re("TrendingUp",[["polyline",{points:"22 7 13.5 15.5 8.5 10.5 2 17",key:"126l90"}],["polyline",{points:"16 7 22 7 22 13",key:"kwv8wd"}]]);/** + */const zW=Re("TrendingUp",[["polyline",{points:"22 7 13.5 15.5 8.5 10.5 2 17",key:"126l90"}],["polyline",{points:"16 7 22 7 22 13",key:"kwv8wd"}]]);/** * @license lucide-react v0.462.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const RW=Re("TriangleAlert",[["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"}]]);/** + */const UW=Re("TriangleAlert",[["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"}]]);/** * @license lucide-react v0.462.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const oI=Re("Upload",[["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"}]]);/** + */const dI=Re("Upload",[["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"}]]);/** * @license lucide-react v0.462.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const fg=Re("User",[["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"}]]);/** + */const Vf=Re("User",[["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"}]]);/** * @license lucide-react v0.462.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const or=Re("Users",[["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"}]]);/** + */const tr=Re("Users",[["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"}]]);/** * @license lucide-react v0.462.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const DW=Re("WandSparkles",[["path",{d:"m21.64 3.64-1.28-1.28a1.21 1.21 0 0 0-1.72 0L2.36 18.64a1.21 1.21 0 0 0 0 1.72l1.28 1.28a1.2 1.2 0 0 0 1.72 0L21.64 5.36a1.2 1.2 0 0 0 0-1.72",key:"ul74o6"}],["path",{d:"m14 7 3 3",key:"1r5n42"}],["path",{d:"M5 6v4",key:"ilb8ba"}],["path",{d:"M19 14v4",key:"blhpug"}],["path",{d:"M10 2v2",key:"7u0qdc"}],["path",{d:"M7 8H3",key:"zfb6yr"}],["path",{d:"M21 16h-4",key:"1cnmox"}],["path",{d:"M11 3H9",key:"1obp7u"}]]);/** + */const VW=Re("WandSparkles",[["path",{d:"m21.64 3.64-1.28-1.28a1.21 1.21 0 0 0-1.72 0L2.36 18.64a1.21 1.21 0 0 0 0 1.72l1.28 1.28a1.2 1.2 0 0 0 1.72 0L21.64 5.36a1.2 1.2 0 0 0 0-1.72",key:"ul74o6"}],["path",{d:"m14 7 3 3",key:"1r5n42"}],["path",{d:"M5 6v4",key:"ilb8ba"}],["path",{d:"M19 14v4",key:"blhpug"}],["path",{d:"M10 2v2",key:"7u0qdc"}],["path",{d:"M7 8H3",key:"zfb6yr"}],["path",{d:"M21 16h-4",key:"1cnmox"}],["path",{d:"M11 3H9",key:"1obp7u"}]]);/** * @license lucide-react v0.462.0 - ISC * * This source code is licensed under the ISC license. @@ -480,18 +480,18 @@ Error generating stack: `+a.message+` * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const lI=Re("Zap",[["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"}]]);function cI(e,t){return function(){return e.apply(t,arguments)}}const{toString:LW}=Object.prototype,{getPrototypeOf:FS}=Object,{iterator:my,toStringTag:uI}=Symbol,gy=(e=>t=>{const n=LW.call(t);return e[n]||(e[n]=n.slice(8,-1).toLowerCase())})(Object.create(null)),la=e=>(e=e.toLowerCase(),t=>gy(t)===e),vy=e=>t=>typeof t===e,{isArray:Yu}=Array,Vf=vy("undefined");function FW(e){return e!==null&&!Vf(e)&&e.constructor!==null&&!Vf(e.constructor)&&Wr(e.constructor.isBuffer)&&e.constructor.isBuffer(e)}const dI=la("ArrayBuffer");function BW(e){let t;return typeof ArrayBuffer<"u"&&ArrayBuffer.isView?t=ArrayBuffer.isView(e):t=e&&e.buffer&&dI(e.buffer),t}const zW=vy("string"),Wr=vy("function"),fI=vy("number"),yy=e=>e!==null&&typeof e=="object",UW=e=>e===!0||e===!1,Am=e=>{if(gy(e)!=="object")return!1;const t=FS(e);return(t===null||t===Object.prototype||Object.getPrototypeOf(t)===null)&&!(uI in e)&&!(my in e)},VW=la("Date"),WW=la("File"),HW=la("Blob"),GW=la("FileList"),qW=e=>yy(e)&&Wr(e.pipe),KW=e=>{let t;return e&&(typeof FormData=="function"&&e instanceof FormData||Wr(e.append)&&((t=gy(e))==="formdata"||t==="object"&&Wr(e.toString)&&e.toString()==="[object FormData]"))},XW=la("URLSearchParams"),[YW,ZW,QW,JW]=["ReadableStream","Request","Response","Headers"].map(la),eH=e=>e.trim?e.trim():e.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,"");function np(e,t,{allOwnKeys:n=!1}={}){if(e===null||typeof e>"u")return;let r,s;if(typeof e!="object"&&(e=[e]),Yu(e))for(r=0,s=e.length;r0;)if(s=n[r],t===s.toLowerCase())return s;return null}const sl=typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:global,pI=e=>!Vf(e)&&e!==sl;function mw(){const{caseless:e}=pI(this)&&this||{},t={},n=(r,s)=>{const a=e&&hI(t,s)||s;Am(t[a])&&Am(r)?t[a]=mw(t[a],r):Am(r)?t[a]=mw({},r):Yu(r)?t[a]=r.slice():t[a]=r};for(let r=0,s=arguments.length;r(np(t,(s,a)=>{n&&Wr(s)?e[a]=cI(s,n):e[a]=s},{allOwnKeys:r}),e),nH=e=>(e.charCodeAt(0)===65279&&(e=e.slice(1)),e),rH=(e,t,n,r)=>{e.prototype=Object.create(t.prototype,r),e.prototype.constructor=e,Object.defineProperty(e,"super",{value:t.prototype}),n&&Object.assign(e.prototype,n)},sH=(e,t,n,r)=>{let s,a,o;const l={};if(t=t||{},e==null)return t;do{for(s=Object.getOwnPropertyNames(e),a=s.length;a-- >0;)o=s[a],(!r||r(o,e,t))&&!l[o]&&(t[o]=e[o],l[o]=!0);e=n!==!1&&FS(e)}while(e&&(!n||n(e,t))&&e!==Object.prototype);return t},aH=(e,t,n)=>{e=String(e),(n===void 0||n>e.length)&&(n=e.length),n-=t.length;const r=e.indexOf(t,n);return r!==-1&&r===n},iH=e=>{if(!e)return null;if(Yu(e))return e;let t=e.length;if(!fI(t))return null;const n=new Array(t);for(;t-- >0;)n[t]=e[t];return n},oH=(e=>t=>e&&t instanceof e)(typeof Uint8Array<"u"&&FS(Uint8Array)),lH=(e,t)=>{const r=(e&&e[my]).call(e);let s;for(;(s=r.next())&&!s.done;){const a=s.value;t.call(e,a[0],a[1])}},cH=(e,t)=>{let n;const r=[];for(;(n=e.exec(t))!==null;)r.push(n);return r},uH=la("HTMLFormElement"),dH=e=>e.toLowerCase().replace(/[-_\s]([a-z\d])(\w*)/g,function(n,r,s){return r.toUpperCase()+s}),zA=(({hasOwnProperty:e})=>(t,n)=>e.call(t,n))(Object.prototype),fH=la("RegExp"),mI=(e,t)=>{const n=Object.getOwnPropertyDescriptors(e),r={};np(n,(s,a)=>{let o;(o=t(s,a,e))!==!1&&(r[a]=o||s)}),Object.defineProperties(e,r)},hH=e=>{mI(e,(t,n)=>{if(Wr(e)&&["arguments","caller","callee"].indexOf(n)!==-1)return!1;const r=e[n];if(Wr(r)){if(t.enumerable=!1,"writable"in t){t.writable=!1;return}t.set||(t.set=()=>{throw Error("Can not rewrite read-only method '"+n+"'")})}})},pH=(e,t)=>{const n={},r=s=>{s.forEach(a=>{n[a]=!0})};return Yu(e)?r(e):r(String(e).split(t)),n},mH=()=>{},gH=(e,t)=>e!=null&&Number.isFinite(e=+e)?e:t;function vH(e){return!!(e&&Wr(e.append)&&e[uI]==="FormData"&&e[my])}const yH=e=>{const t=new Array(10),n=(r,s)=>{if(yy(r)){if(t.indexOf(r)>=0)return;if(!("toJSON"in r)){t[s]=r;const a=Yu(r)?[]:{};return np(r,(o,l)=>{const c=n(o,s+1);!Vf(c)&&(a[l]=c)}),t[s]=void 0,a}}return r};return n(e,0)},xH=la("AsyncFunction"),bH=e=>e&&(yy(e)||Wr(e))&&Wr(e.then)&&Wr(e.catch),gI=((e,t)=>e?setImmediate:t?((n,r)=>(sl.addEventListener("message",({source:s,data:a})=>{s===sl&&a===n&&r.length&&r.shift()()},!1),s=>{r.push(s),sl.postMessage(n,"*")}))(`axios@${Math.random()}`,[]):n=>setTimeout(n))(typeof setImmediate=="function",Wr(sl.postMessage)),wH=typeof queueMicrotask<"u"?queueMicrotask.bind(sl):typeof process<"u"&&process.nextTick||gI,jH=e=>e!=null&&Wr(e[my]),ae={isArray:Yu,isArrayBuffer:dI,isBuffer:FW,isFormData:KW,isArrayBufferView:BW,isString:zW,isNumber:fI,isBoolean:UW,isObject:yy,isPlainObject:Am,isReadableStream:YW,isRequest:ZW,isResponse:QW,isHeaders:JW,isUndefined:Vf,isDate:VW,isFile:WW,isBlob:HW,isRegExp:fH,isFunction:Wr,isStream:qW,isURLSearchParams:XW,isTypedArray:oH,isFileList:GW,forEach:np,merge:mw,extend:tH,trim:eH,stripBOM:nH,inherits:rH,toFlatObject:sH,kindOf:gy,kindOfTest:la,endsWith:aH,toArray:iH,forEachEntry:lH,matchAll:cH,isHTMLForm:uH,hasOwnProperty:zA,hasOwnProp:zA,reduceDescriptors:mI,freezeMethods:hH,toObjectSet:pH,toCamelCase:dH,noop:mH,toFiniteNumber:gH,findKey:hI,global:sl,isContextDefined:pI,isSpecCompliantForm:vH,toJSONObject:yH,isAsyncFn:xH,isThenable:bH,setImmediate:gI,asap:wH,isIterable:jH};function _t(e,t,n,r,s){Error.call(this),Error.captureStackTrace?Error.captureStackTrace(this,this.constructor):this.stack=new Error().stack,this.message=e,this.name="AxiosError",t&&(this.code=t),n&&(this.config=n),r&&(this.request=r),s&&(this.response=s,this.status=s.status?s.status:null)}ae.inherits(_t,Error,{toJSON:function(){return{message:this.message,name:this.name,description:this.description,number:this.number,fileName:this.fileName,lineNumber:this.lineNumber,columnNumber:this.columnNumber,stack:this.stack,config:ae.toJSONObject(this.config),code:this.code,status:this.status}}});const vI=_t.prototype,yI={};["ERR_BAD_OPTION_VALUE","ERR_BAD_OPTION","ECONNABORTED","ETIMEDOUT","ERR_NETWORK","ERR_FR_TOO_MANY_REDIRECTS","ERR_DEPRECATED","ERR_BAD_RESPONSE","ERR_BAD_REQUEST","ERR_CANCELED","ERR_NOT_SUPPORT","ERR_INVALID_URL"].forEach(e=>{yI[e]={value:e}});Object.defineProperties(_t,yI);Object.defineProperty(vI,"isAxiosError",{value:!0});_t.from=(e,t,n,r,s,a)=>{const o=Object.create(vI);return ae.toFlatObject(e,o,function(c){return c!==Error.prototype},l=>l!=="isAxiosError"),_t.call(o,e.message,t,n,r,s),o.cause=e,o.name=e.name,a&&Object.assign(o,a),o};const SH=null;function gw(e){return ae.isPlainObject(e)||ae.isArray(e)}function xI(e){return ae.endsWith(e,"[]")?e.slice(0,-2):e}function UA(e,t,n){return e?e.concat(t).map(function(s,a){return s=xI(s),!n&&a?"["+s+"]":s}).join(n?".":""):t}function NH(e){return ae.isArray(e)&&!e.some(gw)}const _H=ae.toFlatObject(ae,{},null,function(t){return/^is[A-Z]/.test(t)});function xy(e,t,n){if(!ae.isObject(e))throw new TypeError("target must be an object");t=t||new FormData,n=ae.toFlatObject(n,{metaTokens:!0,dots:!1,indexes:!1},!1,function(m,y){return!ae.isUndefined(y[m])});const r=n.metaTokens,s=n.visitor||d,a=n.dots,o=n.indexes,c=(n.Blob||typeof Blob<"u"&&Blob)&&ae.isSpecCompliantForm(t);if(!ae.isFunction(s))throw new TypeError("visitor must be a function");function u(g){if(g===null)return"";if(ae.isDate(g))return g.toISOString();if(!c&&ae.isBlob(g))throw new _t("Blob is not supported. Use a Buffer instead.");return ae.isArrayBuffer(g)||ae.isTypedArray(g)?c&&typeof Blob=="function"?new Blob([g]):Buffer.from(g):g}function d(g,m,y){let b=g;if(g&&!y&&typeof g=="object"){if(ae.endsWith(m,"{}"))m=r?m:m.slice(0,-2),g=JSON.stringify(g);else if(ae.isArray(g)&&NH(g)||(ae.isFileList(g)||ae.endsWith(m,"[]"))&&(b=ae.toArray(g)))return m=xI(m),b.forEach(function(w,j){!(ae.isUndefined(w)||w===null)&&t.append(o===!0?UA([m],j,a):o===null?m:m+"[]",u(w))}),!1}return gw(g)?!0:(t.append(UA(y,m,a),u(g)),!1)}const f=[],h=Object.assign(_H,{defaultVisitor:d,convertValue:u,isVisitable:gw});function p(g,m){if(!ae.isUndefined(g)){if(f.indexOf(g)!==-1)throw Error("Circular reference detected in "+m.join("."));f.push(g),ae.forEach(g,function(b,x){(!(ae.isUndefined(b)||b===null)&&s.call(t,b,ae.isString(x)?x.trim():x,m,h))===!0&&p(b,m?m.concat(x):[x])}),f.pop()}}if(!ae.isObject(e))throw new TypeError("data must be an object");return p(e),t}function VA(e){const t={"!":"%21","'":"%27","(":"%28",")":"%29","~":"%7E","%20":"+","%00":"\0"};return encodeURIComponent(e).replace(/[!'()~]|%20|%00/g,function(r){return t[r]})}function BS(e,t){this._pairs=[],e&&xy(e,this,t)}const bI=BS.prototype;bI.append=function(t,n){this._pairs.push([t,n])};bI.toString=function(t){const n=t?function(r){return t.call(this,r,VA)}:VA;return this._pairs.map(function(s){return n(s[0])+"="+n(s[1])},"").join("&")};function PH(e){return encodeURIComponent(e).replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+").replace(/%5B/gi,"[").replace(/%5D/gi,"]")}function wI(e,t,n){if(!t)return e;const r=n&&n.encode||PH;ae.isFunction(n)&&(n={serialize:n});const s=n&&n.serialize;let a;if(s?a=s(t,n):a=ae.isURLSearchParams(t)?t.toString():new BS(t,n).toString(r),a){const o=e.indexOf("#");o!==-1&&(e=e.slice(0,o)),e+=(e.indexOf("?")===-1?"?":"&")+a}return e}class WA{constructor(){this.handlers=[]}use(t,n,r){return this.handlers.push({fulfilled:t,rejected:n,synchronous:r?r.synchronous:!1,runWhen:r?r.runWhen:null}),this.handlers.length-1}eject(t){this.handlers[t]&&(this.handlers[t]=null)}clear(){this.handlers&&(this.handlers=[])}forEach(t){ae.forEach(this.handlers,function(r){r!==null&&t(r)})}}const jI={silentJSONParsing:!0,forcedJSONParsing:!0,clarifyTimeoutError:!1},AH=typeof URLSearchParams<"u"?URLSearchParams:BS,CH=typeof FormData<"u"?FormData:null,EH=typeof Blob<"u"?Blob:null,OH={isBrowser:!0,classes:{URLSearchParams:AH,FormData:CH,Blob:EH},protocols:["http","https","file","blob","url","data"]},zS=typeof window<"u"&&typeof document<"u",vw=typeof navigator=="object"&&navigator||void 0,kH=zS&&(!vw||["ReactNative","NativeScript","NS"].indexOf(vw.product)<0),TH=typeof WorkerGlobalScope<"u"&&self instanceof WorkerGlobalScope&&typeof self.importScripts=="function",$H=zS&&window.location.href||"http://localhost",MH=Object.freeze(Object.defineProperty({__proto__:null,hasBrowserEnv:zS,hasStandardBrowserEnv:kH,hasStandardBrowserWebWorkerEnv:TH,navigator:vw,origin:$H},Symbol.toStringTag,{value:"Module"})),yr={...MH,...OH};function IH(e,t){return xy(e,new yr.classes.URLSearchParams,Object.assign({visitor:function(n,r,s,a){return yr.isNode&&ae.isBuffer(n)?(this.append(r,n.toString("base64")),!1):a.defaultVisitor.apply(this,arguments)}},t))}function RH(e){return ae.matchAll(/\w+|\[(\w*)]/g,e).map(t=>t[0]==="[]"?"":t[1]||t[0])}function DH(e){const t={},n=Object.keys(e);let r;const s=n.length;let a;for(r=0;r=n.length;return o=!o&&ae.isArray(s)?s.length:o,c?(ae.hasOwnProp(s,o)?s[o]=[s[o],r]:s[o]=r,!l):((!s[o]||!ae.isObject(s[o]))&&(s[o]=[]),t(n,r,s[o],a)&&ae.isArray(s[o])&&(s[o]=DH(s[o])),!l)}if(ae.isFormData(e)&&ae.isFunction(e.entries)){const n={};return ae.forEachEntry(e,(r,s)=>{t(RH(r),s,n,0)}),n}return null}function LH(e,t,n){if(ae.isString(e))try{return(t||JSON.parse)(e),ae.trim(e)}catch(r){if(r.name!=="SyntaxError")throw r}return(0,JSON.stringify)(e)}const rp={transitional:jI,adapter:["xhr","http","fetch"],transformRequest:[function(t,n){const r=n.getContentType()||"",s=r.indexOf("application/json")>-1,a=ae.isObject(t);if(a&&ae.isHTMLForm(t)&&(t=new FormData(t)),ae.isFormData(t))return s?JSON.stringify(SI(t)):t;if(ae.isArrayBuffer(t)||ae.isBuffer(t)||ae.isStream(t)||ae.isFile(t)||ae.isBlob(t)||ae.isReadableStream(t))return t;if(ae.isArrayBufferView(t))return t.buffer;if(ae.isURLSearchParams(t))return n.setContentType("application/x-www-form-urlencoded;charset=utf-8",!1),t.toString();let l;if(a){if(r.indexOf("application/x-www-form-urlencoded")>-1)return IH(t,this.formSerializer).toString();if((l=ae.isFileList(t))||r.indexOf("multipart/form-data")>-1){const c=this.env&&this.env.FormData;return xy(l?{"files[]":t}:t,c&&new c,this.formSerializer)}}return a||s?(n.setContentType("application/json",!1),LH(t)):t}],transformResponse:[function(t){const n=this.transitional||rp.transitional,r=n&&n.forcedJSONParsing,s=this.responseType==="json";if(ae.isResponse(t)||ae.isReadableStream(t))return t;if(t&&ae.isString(t)&&(r&&!this.responseType||s)){const o=!(n&&n.silentJSONParsing)&&s;try{return JSON.parse(t)}catch(l){if(o)throw l.name==="SyntaxError"?_t.from(l,_t.ERR_BAD_RESPONSE,this,null,this.response):l}}return t}],timeout:0,xsrfCookieName:"XSRF-TOKEN",xsrfHeaderName:"X-XSRF-TOKEN",maxContentLength:-1,maxBodyLength:-1,env:{FormData:yr.classes.FormData,Blob:yr.classes.Blob},validateStatus:function(t){return t>=200&&t<300},headers:{common:{Accept:"application/json, text/plain, */*","Content-Type":void 0}}};ae.forEach(["delete","get","head","post","put","patch"],e=>{rp.headers[e]={}});const FH=ae.toObjectSet(["age","authorization","content-length","content-type","etag","expires","from","host","if-modified-since","if-unmodified-since","last-modified","location","max-forwards","proxy-authorization","referer","retry-after","user-agent"]),BH=e=>{const t={};let n,r,s;return e&&e.split(` -`).forEach(function(o){s=o.indexOf(":"),n=o.substring(0,s).trim().toLowerCase(),r=o.substring(s+1).trim(),!(!n||t[n]&&FH[n])&&(n==="set-cookie"?t[n]?t[n].push(r):t[n]=[r]:t[n]=t[n]?t[n]+", "+r:r)}),t},HA=Symbol("internals");function Cd(e){return e&&String(e).trim().toLowerCase()}function Cm(e){return e===!1||e==null?e:ae.isArray(e)?e.map(Cm):String(e)}function zH(e){const t=Object.create(null),n=/([^\s,;=]+)\s*(?:=\s*([^,;]+))?/g;let r;for(;r=n.exec(e);)t[r[1]]=r[2];return t}const UH=e=>/^[-_a-zA-Z0-9^`|~,!#$%&'*+.]+$/.test(e.trim());function f0(e,t,n,r,s){if(ae.isFunction(r))return r.call(this,t,n);if(s&&(t=n),!!ae.isString(t)){if(ae.isString(r))return t.indexOf(r)!==-1;if(ae.isRegExp(r))return r.test(t)}}function VH(e){return e.trim().toLowerCase().replace(/([a-z\d])(\w*)/g,(t,n,r)=>n.toUpperCase()+r)}function WH(e,t){const n=ae.toCamelCase(" "+t);["get","set","has"].forEach(r=>{Object.defineProperty(e,r+n,{value:function(s,a,o){return this[r].call(this,t,s,a,o)},configurable:!0})})}class Hr{constructor(t){t&&this.set(t)}set(t,n,r){const s=this;function a(l,c,u){const d=Cd(c);if(!d)throw new Error("header name must be a non-empty string");const f=ae.findKey(s,d);(!f||s[f]===void 0||u===!0||u===void 0&&s[f]!==!1)&&(s[f||c]=Cm(l))}const o=(l,c)=>ae.forEach(l,(u,d)=>a(u,d,c));if(ae.isPlainObject(t)||t instanceof this.constructor)o(t,n);else if(ae.isString(t)&&(t=t.trim())&&!UH(t))o(BH(t),n);else if(ae.isObject(t)&&ae.isIterable(t)){let l={},c,u;for(const d of t){if(!ae.isArray(d))throw TypeError("Object iterator must return a key-value pair");l[u=d[0]]=(c=l[u])?ae.isArray(c)?[...c,d[1]]:[c,d[1]]:d[1]}o(l,n)}else t!=null&&a(n,t,r);return this}get(t,n){if(t=Cd(t),t){const r=ae.findKey(this,t);if(r){const s=this[r];if(!n)return s;if(n===!0)return zH(s);if(ae.isFunction(n))return n.call(this,s,r);if(ae.isRegExp(n))return n.exec(s);throw new TypeError("parser must be boolean|regexp|function")}}}has(t,n){if(t=Cd(t),t){const r=ae.findKey(this,t);return!!(r&&this[r]!==void 0&&(!n||f0(this,this[r],r,n)))}return!1}delete(t,n){const r=this;let s=!1;function a(o){if(o=Cd(o),o){const l=ae.findKey(r,o);l&&(!n||f0(r,r[l],l,n))&&(delete r[l],s=!0)}}return ae.isArray(t)?t.forEach(a):a(t),s}clear(t){const n=Object.keys(this);let r=n.length,s=!1;for(;r--;){const a=n[r];(!t||f0(this,this[a],a,t,!0))&&(delete this[a],s=!0)}return s}normalize(t){const n=this,r={};return ae.forEach(this,(s,a)=>{const o=ae.findKey(r,a);if(o){n[o]=Cm(s),delete n[a];return}const l=t?VH(a):String(a).trim();l!==a&&delete n[a],n[l]=Cm(s),r[l]=!0}),this}concat(...t){return this.constructor.concat(this,...t)}toJSON(t){const n=Object.create(null);return ae.forEach(this,(r,s)=>{r!=null&&r!==!1&&(n[s]=t&&ae.isArray(r)?r.join(", "):r)}),n}[Symbol.iterator](){return Object.entries(this.toJSON())[Symbol.iterator]()}toString(){return Object.entries(this.toJSON()).map(([t,n])=>t+": "+n).join(` -`)}getSetCookie(){return this.get("set-cookie")||[]}get[Symbol.toStringTag](){return"AxiosHeaders"}static from(t){return t instanceof this?t:new this(t)}static concat(t,...n){const r=new this(t);return n.forEach(s=>r.set(s)),r}static accessor(t){const r=(this[HA]=this[HA]={accessors:{}}).accessors,s=this.prototype;function a(o){const l=Cd(o);r[l]||(WH(s,o),r[l]=!0)}return ae.isArray(t)?t.forEach(a):a(t),this}}Hr.accessor(["Content-Type","Content-Length","Accept","Accept-Encoding","User-Agent","Authorization"]);ae.reduceDescriptors(Hr.prototype,({value:e},t)=>{let n=t[0].toUpperCase()+t.slice(1);return{get:()=>e,set(r){this[n]=r}}});ae.freezeMethods(Hr);function h0(e,t){const n=this||rp,r=t||n,s=Hr.from(r.headers);let a=r.data;return ae.forEach(e,function(l){a=l.call(n,a,s.normalize(),t?t.status:void 0)}),s.normalize(),a}function NI(e){return!!(e&&e.__CANCEL__)}function Zu(e,t,n){_t.call(this,e??"canceled",_t.ERR_CANCELED,t,n),this.name="CanceledError"}ae.inherits(Zu,_t,{__CANCEL__:!0});function _I(e,t,n){const r=n.config.validateStatus;!n.status||!r||r(n.status)?e(n):t(new _t("Request failed with status code "+n.status,[_t.ERR_BAD_REQUEST,_t.ERR_BAD_RESPONSE][Math.floor(n.status/100)-4],n.config,n.request,n))}function HH(e){const t=/^([-+\w]{1,25})(:?\/\/|:)/.exec(e);return t&&t[1]||""}function GH(e,t){e=e||10;const n=new Array(e),r=new Array(e);let s=0,a=0,o;return t=t!==void 0?t:1e3,function(c){const u=Date.now(),d=r[a];o||(o=u),n[s]=c,r[s]=u;let f=a,h=0;for(;f!==s;)h+=n[f++],f=f%e;if(s=(s+1)%e,s===a&&(a=(a+1)%e),u-o{n=d,s=null,a&&(clearTimeout(a),a=null),e.apply(null,u)};return[(...u)=>{const d=Date.now(),f=d-n;f>=r?o(u,d):(s=u,a||(a=setTimeout(()=>{a=null,o(s)},r-f)))},()=>s&&o(s)]}const hg=(e,t,n=3)=>{let r=0;const s=GH(50,250);return qH(a=>{const o=a.loaded,l=a.lengthComputable?a.total:void 0,c=o-r,u=s(c),d=o<=l;r=o;const f={loaded:o,total:l,progress:l?o/l:void 0,bytes:c,rate:u||void 0,estimated:u&&l&&d?(l-o)/u:void 0,event:a,lengthComputable:l!=null,[t?"download":"upload"]:!0};e(f)},n)},GA=(e,t)=>{const n=e!=null;return[r=>t[0]({lengthComputable:n,total:e,loaded:r}),t[1]]},qA=e=>(...t)=>ae.asap(()=>e(...t)),KH=yr.hasStandardBrowserEnv?((e,t)=>n=>(n=new URL(n,yr.origin),e.protocol===n.protocol&&e.host===n.host&&(t||e.port===n.port)))(new URL(yr.origin),yr.navigator&&/(msie|trident)/i.test(yr.navigator.userAgent)):()=>!0,XH=yr.hasStandardBrowserEnv?{write(e,t,n,r,s,a){const o=[e+"="+encodeURIComponent(t)];ae.isNumber(n)&&o.push("expires="+new Date(n).toGMTString()),ae.isString(r)&&o.push("path="+r),ae.isString(s)&&o.push("domain="+s),a===!0&&o.push("secure"),document.cookie=o.join("; ")},read(e){const t=document.cookie.match(new RegExp("(^|;\\s*)("+e+")=([^;]*)"));return t?decodeURIComponent(t[3]):null},remove(e){this.write(e,"",Date.now()-864e5)}}:{write(){},read(){return null},remove(){}};function YH(e){return/^([a-z][a-z\d+\-.]*:)?\/\//i.test(e)}function ZH(e,t){return t?e.replace(/\/?\/$/,"")+"/"+t.replace(/^\/+/,""):e}function PI(e,t,n){let r=!YH(t);return e&&(r||n==!1)?ZH(e,t):t}const KA=e=>e instanceof Hr?{...e}:e;function Il(e,t){t=t||{};const n={};function r(u,d,f,h){return ae.isPlainObject(u)&&ae.isPlainObject(d)?ae.merge.call({caseless:h},u,d):ae.isPlainObject(d)?ae.merge({},d):ae.isArray(d)?d.slice():d}function s(u,d,f,h){if(ae.isUndefined(d)){if(!ae.isUndefined(u))return r(void 0,u,f,h)}else return r(u,d,f,h)}function a(u,d){if(!ae.isUndefined(d))return r(void 0,d)}function o(u,d){if(ae.isUndefined(d)){if(!ae.isUndefined(u))return r(void 0,u)}else return r(void 0,d)}function l(u,d,f){if(f in t)return r(u,d);if(f in e)return r(void 0,u)}const c={url:a,method:a,data:a,baseURL:o,transformRequest:o,transformResponse:o,paramsSerializer:o,timeout:o,timeoutMessage:o,withCredentials:o,withXSRFToken:o,adapter:o,responseType:o,xsrfCookieName:o,xsrfHeaderName:o,onUploadProgress:o,onDownloadProgress:o,decompress:o,maxContentLength:o,maxBodyLength:o,beforeRedirect:o,transport:o,httpAgent:o,httpsAgent:o,cancelToken:o,socketPath:o,responseEncoding:o,validateStatus:l,headers:(u,d,f)=>s(KA(u),KA(d),f,!0)};return ae.forEach(Object.keys(Object.assign({},e,t)),function(d){const f=c[d]||s,h=f(e[d],t[d],d);ae.isUndefined(h)&&f!==l||(n[d]=h)}),n}const AI=e=>{const t=Il({},e);let{data:n,withXSRFToken:r,xsrfHeaderName:s,xsrfCookieName:a,headers:o,auth:l}=t;t.headers=o=Hr.from(o),t.url=wI(PI(t.baseURL,t.url,t.allowAbsoluteUrls),e.params,e.paramsSerializer),l&&o.set("Authorization","Basic "+btoa((l.username||"")+":"+(l.password?unescape(encodeURIComponent(l.password)):"")));let c;if(ae.isFormData(n)){if(yr.hasStandardBrowserEnv||yr.hasStandardBrowserWebWorkerEnv)o.setContentType(void 0);else if((c=o.getContentType())!==!1){const[u,...d]=c?c.split(";").map(f=>f.trim()).filter(Boolean):[];o.setContentType([u||"multipart/form-data",...d].join("; "))}}if(yr.hasStandardBrowserEnv&&(r&&ae.isFunction(r)&&(r=r(t)),r||r!==!1&&KH(t.url))){const u=s&&a&&XH.read(a);u&&o.set(s,u)}return t},QH=typeof XMLHttpRequest<"u",JH=QH&&function(e){return new Promise(function(n,r){const s=AI(e);let a=s.data;const o=Hr.from(s.headers).normalize();let{responseType:l,onUploadProgress:c,onDownloadProgress:u}=s,d,f,h,p,g;function m(){p&&p(),g&&g(),s.cancelToken&&s.cancelToken.unsubscribe(d),s.signal&&s.signal.removeEventListener("abort",d)}let y=new XMLHttpRequest;y.open(s.method.toUpperCase(),s.url,!0),y.timeout=s.timeout;function b(){if(!y)return;const w=Hr.from("getAllResponseHeaders"in y&&y.getAllResponseHeaders()),S={data:!l||l==="text"||l==="json"?y.responseText:y.response,status:y.status,statusText:y.statusText,headers:w,config:e,request:y};_I(function(_){n(_),m()},function(_){r(_),m()},S),y=null}"onloadend"in y?y.onloadend=b:y.onreadystatechange=function(){!y||y.readyState!==4||y.status===0&&!(y.responseURL&&y.responseURL.indexOf("file:")===0)||setTimeout(b)},y.onabort=function(){y&&(r(new _t("Request aborted",_t.ECONNABORTED,e,y)),y=null)},y.onerror=function(){r(new _t("Network Error",_t.ERR_NETWORK,e,y)),y=null},y.ontimeout=function(){let j=s.timeout?"timeout of "+s.timeout+"ms exceeded":"timeout exceeded";const S=s.transitional||jI;s.timeoutErrorMessage&&(j=s.timeoutErrorMessage),r(new _t(j,S.clarifyTimeoutError?_t.ETIMEDOUT:_t.ECONNABORTED,e,y)),y=null},a===void 0&&o.setContentType(null),"setRequestHeader"in y&&ae.forEach(o.toJSON(),function(j,S){y.setRequestHeader(S,j)}),ae.isUndefined(s.withCredentials)||(y.withCredentials=!!s.withCredentials),l&&l!=="json"&&(y.responseType=s.responseType),u&&([h,g]=hg(u,!0),y.addEventListener("progress",h)),c&&y.upload&&([f,p]=hg(c),y.upload.addEventListener("progress",f),y.upload.addEventListener("loadend",p)),(s.cancelToken||s.signal)&&(d=w=>{y&&(r(!w||w.type?new Zu(null,e,y):w),y.abort(),y=null)},s.cancelToken&&s.cancelToken.subscribe(d),s.signal&&(s.signal.aborted?d():s.signal.addEventListener("abort",d)));const x=HH(s.url);if(x&&yr.protocols.indexOf(x)===-1){r(new _t("Unsupported protocol "+x+":",_t.ERR_BAD_REQUEST,e));return}y.send(a||null)})},eG=(e,t)=>{const{length:n}=e=e?e.filter(Boolean):[];if(t||n){let r=new AbortController,s;const a=function(u){if(!s){s=!0,l();const d=u instanceof Error?u:this.reason;r.abort(d instanceof _t?d:new Zu(d instanceof Error?d.message:d))}};let o=t&&setTimeout(()=>{o=null,a(new _t(`timeout ${t} of ms exceeded`,_t.ETIMEDOUT))},t);const l=()=>{e&&(o&&clearTimeout(o),o=null,e.forEach(u=>{u.unsubscribe?u.unsubscribe(a):u.removeEventListener("abort",a)}),e=null)};e.forEach(u=>u.addEventListener("abort",a));const{signal:c}=r;return c.unsubscribe=()=>ae.asap(l),c}},tG=function*(e,t){let n=e.byteLength;if(n{const s=nG(e,t);let a=0,o,l=c=>{o||(o=!0,r&&r(c))};return new ReadableStream({async pull(c){try{const{done:u,value:d}=await s.next();if(u){l(),c.close();return}let f=d.byteLength;if(n){let h=a+=f;n(h)}c.enqueue(new Uint8Array(d))}catch(u){throw l(u),u}},cancel(c){return l(c),s.return()}},{highWaterMark:2})},by=typeof fetch=="function"&&typeof Request=="function"&&typeof Response=="function",CI=by&&typeof ReadableStream=="function",sG=by&&(typeof TextEncoder=="function"?(e=>t=>e.encode(t))(new TextEncoder):async e=>new Uint8Array(await new Response(e).arrayBuffer())),EI=(e,...t)=>{try{return!!e(...t)}catch{return!1}},aG=CI&&EI(()=>{let e=!1;const t=new Request(yr.origin,{body:new ReadableStream,method:"POST",get duplex(){return e=!0,"half"}}).headers.has("Content-Type");return e&&!t}),YA=64*1024,yw=CI&&EI(()=>ae.isReadableStream(new Response("").body)),pg={stream:yw&&(e=>e.body)};by&&(e=>{["text","arrayBuffer","blob","formData","stream"].forEach(t=>{!pg[t]&&(pg[t]=ae.isFunction(e[t])?n=>n[t]():(n,r)=>{throw new _t(`Response type '${t}' is not supported`,_t.ERR_NOT_SUPPORT,r)})})})(new Response);const iG=async e=>{if(e==null)return 0;if(ae.isBlob(e))return e.size;if(ae.isSpecCompliantForm(e))return(await new Request(yr.origin,{method:"POST",body:e}).arrayBuffer()).byteLength;if(ae.isArrayBufferView(e)||ae.isArrayBuffer(e))return e.byteLength;if(ae.isURLSearchParams(e)&&(e=e+""),ae.isString(e))return(await sG(e)).byteLength},oG=async(e,t)=>{const n=ae.toFiniteNumber(e.getContentLength());return n??iG(t)},lG=by&&(async e=>{let{url:t,method:n,data:r,signal:s,cancelToken:a,timeout:o,onDownloadProgress:l,onUploadProgress:c,responseType:u,headers:d,withCredentials:f="same-origin",fetchOptions:h}=AI(e);u=u?(u+"").toLowerCase():"text";let p=eG([s,a&&a.toAbortSignal()],o),g;const m=p&&p.unsubscribe&&(()=>{p.unsubscribe()});let y;try{if(c&&aG&&n!=="get"&&n!=="head"&&(y=await oG(d,r))!==0){let S=new Request(t,{method:"POST",body:r,duplex:"half"}),N;if(ae.isFormData(r)&&(N=S.headers.get("content-type"))&&d.setContentType(N),S.body){const[_,P]=GA(y,hg(qA(c)));r=XA(S.body,YA,_,P)}}ae.isString(f)||(f=f?"include":"omit");const b="credentials"in Request.prototype;g=new Request(t,{...h,signal:p,method:n.toUpperCase(),headers:d.normalize().toJSON(),body:r,duplex:"half",credentials:b?f:void 0});let x=await fetch(g);const w=yw&&(u==="stream"||u==="response");if(yw&&(l||w&&m)){const S={};["status","statusText","headers"].forEach(k=>{S[k]=x[k]});const N=ae.toFiniteNumber(x.headers.get("content-length")),[_,P]=l&&GA(N,hg(qA(l),!0))||[];x=new Response(XA(x.body,YA,_,()=>{P&&P(),m&&m()}),S)}u=u||"text";let j=await pg[ae.findKey(pg,u)||"text"](x,e);return!w&&m&&m(),await new Promise((S,N)=>{_I(S,N,{data:j,headers:Hr.from(x.headers),status:x.status,statusText:x.statusText,config:e,request:g})})}catch(b){throw m&&m(),b&&b.name==="TypeError"&&/Load failed|fetch/i.test(b.message)?Object.assign(new _t("Network Error",_t.ERR_NETWORK,e,g),{cause:b.cause||b}):_t.from(b,b&&b.code,e,g)}}),xw={http:SH,xhr:JH,fetch:lG};ae.forEach(xw,(e,t)=>{if(e){try{Object.defineProperty(e,"name",{value:t})}catch{}Object.defineProperty(e,"adapterName",{value:t})}});const ZA=e=>`- ${e}`,cG=e=>ae.isFunction(e)||e===null||e===!1,OI={getAdapter:e=>{e=ae.isArray(e)?e:[e];const{length:t}=e;let n,r;const s={};for(let a=0;a`adapter ${l} `+(c===!1?"is not supported by the environment":"is not available in the build"));let o=t?a.length>1?`since : -`+a.map(ZA).join(` -`):" "+ZA(a[0]):"as no adapter specified";throw new _t("There is no suitable adapter to dispatch the request "+o,"ERR_NOT_SUPPORT")}return r},adapters:xw};function p0(e){if(e.cancelToken&&e.cancelToken.throwIfRequested(),e.signal&&e.signal.aborted)throw new Zu(null,e)}function QA(e){return p0(e),e.headers=Hr.from(e.headers),e.data=h0.call(e,e.transformRequest),["post","put","patch"].indexOf(e.method)!==-1&&e.headers.setContentType("application/x-www-form-urlencoded",!1),OI.getAdapter(e.adapter||rp.adapter)(e).then(function(r){return p0(e),r.data=h0.call(e,e.transformResponse,r),r.headers=Hr.from(r.headers),r},function(r){return NI(r)||(p0(e),r&&r.response&&(r.response.data=h0.call(e,e.transformResponse,r.response),r.response.headers=Hr.from(r.response.headers))),Promise.reject(r)})}const kI="1.9.0",wy={};["object","boolean","number","function","string","symbol"].forEach((e,t)=>{wy[e]=function(r){return typeof r===e||"a"+(t<1?"n ":" ")+e}});const JA={};wy.transitional=function(t,n,r){function s(a,o){return"[Axios v"+kI+"] Transitional option '"+a+"'"+o+(r?". "+r:"")}return(a,o,l)=>{if(t===!1)throw new _t(s(o," has been removed"+(n?" in "+n:"")),_t.ERR_DEPRECATED);return n&&!JA[o]&&(JA[o]=!0,console.warn(s(o," has been deprecated since v"+n+" and will be removed in the near future"))),t?t(a,o,l):!0}};wy.spelling=function(t){return(n,r)=>(console.warn(`${r} is likely a misspelling of ${t}`),!0)};function uG(e,t,n){if(typeof e!="object")throw new _t("options must be an object",_t.ERR_BAD_OPTION_VALUE);const r=Object.keys(e);let s=r.length;for(;s-- >0;){const a=r[s],o=t[a];if(o){const l=e[a],c=l===void 0||o(l,a,e);if(c!==!0)throw new _t("option "+a+" must be "+c,_t.ERR_BAD_OPTION_VALUE);continue}if(n!==!0)throw new _t("Unknown option "+a,_t.ERR_BAD_OPTION)}}const Em={assertOptions:uG,validators:wy},pa=Em.validators;class xl{constructor(t){this.defaults=t||{},this.interceptors={request:new WA,response:new WA}}async request(t,n){try{return await this._request(t,n)}catch(r){if(r instanceof Error){let s={};Error.captureStackTrace?Error.captureStackTrace(s):s=new Error;const a=s.stack?s.stack.replace(/^.+\n/,""):"";try{r.stack?a&&!String(r.stack).endsWith(a.replace(/^.+\n.+\n/,""))&&(r.stack+=` -`+a):r.stack=a}catch{}}throw r}}_request(t,n){typeof t=="string"?(n=n||{},n.url=t):n=t||{},n=Il(this.defaults,n);const{transitional:r,paramsSerializer:s,headers:a}=n;r!==void 0&&Em.assertOptions(r,{silentJSONParsing:pa.transitional(pa.boolean),forcedJSONParsing:pa.transitional(pa.boolean),clarifyTimeoutError:pa.transitional(pa.boolean)},!1),s!=null&&(ae.isFunction(s)?n.paramsSerializer={serialize:s}:Em.assertOptions(s,{encode:pa.function,serialize:pa.function},!0)),n.allowAbsoluteUrls!==void 0||(this.defaults.allowAbsoluteUrls!==void 0?n.allowAbsoluteUrls=this.defaults.allowAbsoluteUrls:n.allowAbsoluteUrls=!0),Em.assertOptions(n,{baseUrl:pa.spelling("baseURL"),withXsrfToken:pa.spelling("withXSRFToken")},!0),n.method=(n.method||this.defaults.method||"get").toLowerCase();let o=a&&ae.merge(a.common,a[n.method]);a&&ae.forEach(["delete","get","head","post","put","patch","common"],g=>{delete a[g]}),n.headers=Hr.concat(o,a);const l=[];let c=!0;this.interceptors.request.forEach(function(m){typeof m.runWhen=="function"&&m.runWhen(n)===!1||(c=c&&m.synchronous,l.unshift(m.fulfilled,m.rejected))});const u=[];this.interceptors.response.forEach(function(m){u.push(m.fulfilled,m.rejected)});let d,f=0,h;if(!c){const g=[QA.bind(this),void 0];for(g.unshift.apply(g,l),g.push.apply(g,u),h=g.length,d=Promise.resolve(n);f{if(!r._listeners)return;let a=r._listeners.length;for(;a-- >0;)r._listeners[a](s);r._listeners=null}),this.promise.then=s=>{let a;const o=new Promise(l=>{r.subscribe(l),a=l}).then(s);return o.cancel=function(){r.unsubscribe(a)},o},t(function(a,o,l){r.reason||(r.reason=new Zu(a,o,l),n(r.reason))})}throwIfRequested(){if(this.reason)throw this.reason}subscribe(t){if(this.reason){t(this.reason);return}this._listeners?this._listeners.push(t):this._listeners=[t]}unsubscribe(t){if(!this._listeners)return;const n=this._listeners.indexOf(t);n!==-1&&this._listeners.splice(n,1)}toAbortSignal(){const t=new AbortController,n=r=>{t.abort(r)};return this.subscribe(n),t.signal.unsubscribe=()=>this.unsubscribe(n),t.signal}static source(){let t;return{token:new US(function(s){t=s}),cancel:t}}}function dG(e){return function(n){return e.apply(null,n)}}function fG(e){return ae.isObject(e)&&e.isAxiosError===!0}const bw={Continue:100,SwitchingProtocols:101,Processing:102,EarlyHints:103,Ok:200,Created:201,Accepted:202,NonAuthoritativeInformation:203,NoContent:204,ResetContent:205,PartialContent:206,MultiStatus:207,AlreadyReported:208,ImUsed:226,MultipleChoices:300,MovedPermanently:301,Found:302,SeeOther:303,NotModified:304,UseProxy:305,Unused:306,TemporaryRedirect:307,PermanentRedirect:308,BadRequest:400,Unauthorized:401,PaymentRequired:402,Forbidden:403,NotFound:404,MethodNotAllowed:405,NotAcceptable:406,ProxyAuthenticationRequired:407,RequestTimeout:408,Conflict:409,Gone:410,LengthRequired:411,PreconditionFailed:412,PayloadTooLarge:413,UriTooLong:414,UnsupportedMediaType:415,RangeNotSatisfiable:416,ExpectationFailed:417,ImATeapot:418,MisdirectedRequest:421,UnprocessableEntity:422,Locked:423,FailedDependency:424,TooEarly:425,UpgradeRequired:426,PreconditionRequired:428,TooManyRequests:429,RequestHeaderFieldsTooLarge:431,UnavailableForLegalReasons:451,InternalServerError:500,NotImplemented:501,BadGateway:502,ServiceUnavailable:503,GatewayTimeout:504,HttpVersionNotSupported:505,VariantAlsoNegotiates:506,InsufficientStorage:507,LoopDetected:508,NotExtended:510,NetworkAuthenticationRequired:511};Object.entries(bw).forEach(([e,t])=>{bw[t]=e});function TI(e){const t=new xl(e),n=cI(xl.prototype.request,t);return ae.extend(n,xl.prototype,t,{allOwnKeys:!0}),ae.extend(n,t,null,{allOwnKeys:!0}),n.create=function(s){return TI(Il(e,s))},n}const Fn=TI(rp);Fn.Axios=xl;Fn.CanceledError=Zu;Fn.CancelToken=US;Fn.isCancel=NI;Fn.VERSION=kI;Fn.toFormData=xy;Fn.AxiosError=_t;Fn.Cancel=Fn.CanceledError;Fn.all=function(t){return Promise.all(t)};Fn.spread=dG;Fn.isAxiosError=fG;Fn.mergeConfig=Il;Fn.AxiosHeaders=Hr;Fn.formToJSON=e=>SI(ae.isHTMLForm(e)?new FormData(e):e);Fn.getAdapter=OI.getAdapter;Fn.HttpStatusCode=bw;Fn.default=Fn;const $I="https://ai-sandbox.oliver.solutions/semblance_back/api",He=Fn.create({baseURL:$I,headers:{"Content-Type":"application/json"},timeout:6e5});He.interceptors.request.use(e=>{var n;const t=localStorage.getItem("auth_token");return t&&(e.headers.Authorization=`Bearer ${t}`),e.method==="put"&&((n=e.url)!=null&&n.includes("/focus-groups/"))&&console.log("🌐 API Request:",{method:e.method,url:e.url,baseURL:e.baseURL,fullURL:`${e.baseURL}${e.url}`,data:e.data}),e},e=>Promise.reject(e));const ww="auth_error",hG=e=>{e!=null&&e.isPersonaCreation||(localStorage.removeItem("auth_token"),localStorage.removeItem("user"));const t=new CustomEvent(ww,{detail:e||{}});window.dispatchEvent(t)};He.interceptors.response.use(e=>e,e=>{var t,n,r,s,a,o;if(e.response&&e.response.status===401){const l=e.config&&(((t=e.config.url)==null?void 0:t.includes("/personas"))||((n=e.config.url)==null?void 0:n.includes("/personas/batch"))||e.config.method&&((r=e.config.url)==null?void 0:r.startsWith("/personas")));console.log("API Error:",{url:(s=e.config)==null?void 0:s.url,method:(a=e.config)==null?void 0:a.method,isPersonaRequest:l}),l?console.warn("Authentication error in persona request, letting component handle it"):hG({source:(o=e.config)==null?void 0:o.url,isPersonaCreation:!1})}return Promise.reject(e)});const jw={login:(e,t)=>He.post("/auth/login",{username:e,password:t}),register:(e,t,n)=>He.post("/auth/register",{username:e,email:t,password:n}),getProfile:()=>He.get("/auth/me")},Dn={getAll:()=>He.get("/personas/all"),getById:e=>He.get(`/personas/${e}`),create:e=>He.post("/personas",e),update:(e,t)=>e&&e.startsWith("local-")?(console.log("Cannot update with local ID, creating new instead:",e),He.post("/personas",t)):He.put(`/personas/${e}`,t),delete:e=>{const t=typeof e=="object"&&e!==null&&e._id||e;return console.log(`Deleting persona with ID: ${t}`),He.delete(`/personas/${t}`)},createBatch:e=>He.post("/personas/batch",e)},Ka={generate:e=>He.post("/ai-personas/generate",e||{},{timeout:6e5}),generateAndSave:e=>He.post("/ai-personas/generate-and-save",e||{},{timeout:6e5}),batchGenerate:e=>He.post("/ai-personas/batch-generate",e,{timeout:6e5}),batchGenerateAndSave:e=>He.post("/ai-personas/batch-generate-and-save",e,{timeout:6e5}),generateBasicProfiles:(e,t=5,n=.8)=>He.post("/ai-personas/generate-basic-profiles",{audience_brief:e,count:t,temperature:n},{timeout:6e5}),completePersona:(e,t=.7)=>He.post("/ai-personas/complete-persona",{basic_profile:e,temperature:t},{timeout:6e5}),completeAndSavePersona:(e,t=.7)=>He.post("/ai-personas/complete-and-save-persona",{basic_profile:e,temperature:t},{timeout:6e5}),generatePersonaSummary:(e,t=.7)=>He.post("/ai-personas/generate-persona-summary",{persona_data:e,temperature:t},{timeout:6e5}),batchGenerateWithStages:async(e,t,n=5,r=.7,s,a)=>{var o;try{console.log(`📡 API call to generate-basic-profiles with model: ${a||"gemini-2.5-pro"}`);const c=(await He.post("/ai-personas/generate-basic-profiles",{audience_brief:e,research_objective:t,count:n,temperature:.7,customer_data_session_id:s,llm_model:a||"gemini-2.5-pro"},{timeout:6e5})).data.profiles,u=[],d=[],f=[];console.log(`📡 API call to complete-and-save-persona with model: ${a||"gemini-2.5-pro"}`);const h=c.map(g=>He.post("/ai-personas/complete-and-save-persona",{basic_profile:g,temperature:r,customer_data_session_id:s,llm_model:a||"gemini-2.5-pro"},{timeout:6e5}));if((await Promise.allSettled(h)).forEach((g,m)=>{if(g.status==="fulfilled")u.push(g.value.data.persona),d.push(g.value.data.persona_id);else{const y=c[m],b={index:m,name:y.name||`Persona ${m+1}`,error:g.reason};f.push(b),console.error(`Failed to complete persona ${m+1} (${y.name||"unnamed"}):`,g.reason)}}),u.length===0&&f.length>0)throw new Error(`Failed to generate any personas. ${f.length} profile(s) failed.`);return{data:{message:`Generated and saved ${u.length} personas${f.length>0?` (${f.length} failed)`:""}`,personas:u,persona_ids:d,errors:f.length>0?f:void 0,partial_success:f.length>0&&u.length>0}}}catch(l){throw((o=l.response)==null?void 0:o.status)===504||l.code==="ECONNABORTED"?new Error("Timeout error: The server took too long to generate personas. Please try with fewer personas or try again later."):l}},enhanceAudienceBrief:(e,t,n=.7)=>He.post("/ai-personas/enhance-audience-brief",{audience_brief:e,research_objective:t,temperature:n},{timeout:6e5}),batchGenerateSummaries:(e,t=.7,n)=>(console.log(`📡 Frontend: API call to batch-generate-summaries with model: ${n||"gemini-2.5-pro"}`),He.post("/ai-personas/batch-generate-summaries",{persona_ids:e,temperature:t,llm_model:n||"gemini-2.5-pro"},{timeout:9e5})),uploadCustomerData:e=>{const t=new FormData;for(let n=0;nHe.delete(`/ai-personas/cleanup-customer-data/${e}`)},St={getAll:()=>He.get("/focus-groups"),getById:e=>He.get(`/focus-groups/${e}`),create:e=>He.post("/focus-groups",e),update:(e,t)=>He.put(`/focus-groups/${e}`,t),delete:e=>He.delete(`/focus-groups/${e}`),addParticipant:(e,t)=>He.post(`/focus-groups/${e}/participants`,{persona_id:t}),removeParticipant:(e,t)=>He.delete(`/focus-groups/${e}/participants/${t}`),sendMessage:(e,t)=>He.post(`/focus-groups/${e}/messages`,t),getMessages:e=>He.get(`/focus-groups/${e}/messages`),updateMessageHighlight:(e,t,n)=>He.patch(`/focus-groups/${e}/messages/${t}`,{highlighted:n}),describeAsset:(e,t)=>He.post(`/focus-groups/${e}/describe-asset`,{asset_filename:t},{timeout:12e4}),generateDiscussionGuide:e=>He.post("/focus-groups/generate-discussion-guide",e,{timeout:6e5}),generateDiscussionGuideForGroup:(e,t)=>He.post(`/focus-groups/${e}/generate-discussion-guide`,t,{timeout:6e5}),downloadDiscussionGuide:async e=>{try{const t=await He.get(`/focus-groups/${e}/discussion-guide/download`,{responseType:"blob",timeout:3e4}),n=t.headers["content-disposition"];let r="discussion-guide.md";if(n){const l=n.match(/filename="([^"]+)"/);l&&(r=l[1])}const s=new Blob([t.data],{type:"text/markdown"}),a=URL.createObjectURL(s),o=document.createElement("a");return o.href=a,o.download=r,o.style.display="none",document.body.appendChild(o),o.click(),document.body.removeChild(o),URL.revokeObjectURL(a),{success:!0,filename:r}}catch(t){throw console.error("Error downloading discussion guide:",t),new Error("Failed to download discussion guide")}},createNote:(e,t)=>He.post(`/focus-groups/${e}/notes`,t),getNotes:e=>He.get(`/focus-groups/${e}/notes`),deleteNote:(e,t)=>He.delete(`/focus-groups/${e}/notes/${t}`),uploadAssets:(e,t)=>He.post(`/focus-groups/${e}/assets`,t,{headers:{"Content-Type":"multipart/form-data"},timeout:12e4}),getAssets:e=>He.get(`/focus-groups/${e}/assets`),getAssetUrl:(e,t)=>`${$I}/focus-groups/${e}/assets/${t}`,deleteAsset:(e,t)=>He.delete(`/focus-groups/${e}/assets/${t}`)},jn={generateResponse:(e,t,n,r=.7)=>He.post("/focus-group-ai/generate-response",{focus_group_id:e,persona_id:t,current_topic:n,temperature:r},{timeout:6e5}),generateKeyThemes:(e,t=.7)=>He.post("/focus-group-ai/generate-key-themes",{focus_group_id:e,temperature:t},{timeout:6e5}),getKeyThemes:e=>He.get(`/focus-group-ai/key-themes/${e}`),deleteKeyTheme:(e,t)=>He.delete(`/focus-group-ai/key-themes/${e}/${t}`),getModeratorStatus:e=>He.get(`/focus-group-ai/moderator/status/${e}`),advanceModeratorDiscussion:e=>He.post(`/focus-group-ai/moderator/advance/${e}`,{},{timeout:6e5}),setModeratorPosition:(e,t,n)=>He.put(`/focus-group-ai/moderator/position/${e}`,{section_id:t,item_id:n}),startAutonomousConversation:(e,t)=>He.post(`/focus-group-ai/autonomous/start/${e}`,{initial_prompt:t},{timeout:6e5}),stopAutonomousConversation:(e,t)=>He.post(`/focus-group-ai/autonomous/stop/${e}`,{reason:t}),getAutonomousConversationStatus:e=>He.get(`/focus-group-ai/autonomous/status/${e}`),getConversationState:e=>He.get(`/focus-group-ai/conversation/state/${e}`),getConversationAnalytics:e=>He.get(`/focus-group-ai/conversation/analytics/${e}`),makeConversationDecision:(e,t=.7,n="ai")=>He.post(`/focus-group-ai/conversation/decision/${e}`,{temperature:t,mode:n},{timeout:6e5}),getConversationInsights:e=>He.get(`/focus-group-ai/conversation/insights/${e}`,{timeout:6e5}),manualIntervention:(e,t,n,r)=>He.post(`/focus-group-ai/conversation/intervene/${e}`,{action:t,message:n,participant_id:r}),getReasoningHistory:e=>He.get(`/focus-group-ai/conversation/reasoning-history/${e}`),endSession:(e,t)=>He.post(`/focus-group-ai/moderator/end-session/${e}`,{reason:t||"session_ended"})},MI=v.createContext(void 0);function pG({children:e}){const[t,n]=v.useState(null),[r,s]=v.useState(null),[a,o]=v.useState(!0),l=Tn();v.useEffect(()=>{const p=g=>{const y=g.detail||{};if(y.isPersonaCreation){console.log("Ignoring auth error from persona creation",y);return}s(null),n(null),oe.error("Session expired",{description:"Please log in again"}),l("/login")};return window.addEventListener(ww,p),()=>{window.removeEventListener(ww,p)}},[l]),v.useEffect(()=>{const p=localStorage.getItem("auth_token"),g=localStorage.getItem("user");if(console.log("AuthContext initializing - stored data check:",{hasToken:!!p,hasUser:!!g}),p&&g)try{s(p),n(JSON.parse(g)),console.log("User session restored from localStorage")}catch(m){console.error("Failed to parse stored user data:",m),localStorage.removeItem("auth_token"),localStorage.removeItem("user")}else console.log("No stored authentication data found");o(!1)},[]),v.useEffect(()=>{if(r){console.log("Verifying token...");const p=`token_validated_${r.substring(0,10)}`;if(sessionStorage.getItem(p)==="true"&&t){console.log("Token already validated this session, skipping validation");return}jw.getProfile().then(m=>{m&&"data"in m&&(console.log("Profile verified successfully"),n(m.data),sessionStorage.setItem(p,"true"))}).catch(m=>{m.response&&m.response.status===401?(console.error("Token invalid (401):",m),localStorage.removeItem("auth_token"),localStorage.removeItem("user"),s(null),n(null)):(console.warn("Profile validation error (not clearing token):",m),sessionStorage.setItem(p,"true"))})}else console.log("No token available, not validating profile")},[r,t]);const c=async(p,g)=>{var m,y;o(!0),console.log("Attempting login for user:",p);try{const b=await jw.login(p,g);if(console.log("Login API response received"),!b.data.access_token)throw new Error("No access token received from server");return localStorage.setItem("auth_token",b.data.access_token),localStorage.setItem("user",JSON.stringify(b.data.user)),s(b.data.access_token),n(b.data.user),console.log("Authentication state updated"),oe.success("Login successful!"),b.data.access_token}catch(b){throw console.error("Login failed:",b),oe.error("Login failed",{description:((y=(m=b.response)==null?void 0:m.data)==null?void 0:y.message)||"Invalid username or password"}),b}finally{o(!1)}},u=()=>{localStorage.removeItem("auth_token"),localStorage.removeItem("user"),s(null),n(null),oe.info("You have been logged out")},d=!!localStorage.getItem("auth_token"),h={user:t,token:r,isLoading:a,login:c,logout:u,isAuthenticated:!!r||d};return i.jsx(MI.Provider,{value:h,children:e})}function Kl(){const e=v.useContext(MI);if(e===void 0)throw new Error("useAuth must be used within an AuthProvider");return e}function oi(){const[e,t]=v.useState(!1),n=qr(),r=Tn(),{isAuthenticated:s,logout:a}=Kl(),o=[{name:"Home",href:"/",icon:hw},{name:"Synthetic Personas",href:"/synthetic-users",icon:or},{name:"Focus Groups",href:"/focus-groups",icon:$a},{name:"Dashboard",href:"/dashboard",icon:pw}],l=()=>{t(!e)},c=d=>n.pathname===d,u=d=>{if(d==="/synthetic-users"){const f=new CustomEvent("syntheticUsersNavigation");window.dispatchEvent(f)}r(d)};return i.jsxs("header",{className:"fixed top-0 left-0 right-0 z-50 bg-white/80 backdrop-blur-md border-b border-slate-200/80",children:[i.jsx("div",{className:"px-4 sm:px-6 lg:px-8",children:i.jsxs("div",{className:"flex h-16 items-center justify-between",children:[i.jsx("div",{className:"flex items-center",children:i.jsx(bs,{to:"/",className:"flex items-center",children:i.jsx("span",{className:"font-sf text-2xl font-semibold text-gradient",children:"Semblance"})})}),i.jsx("nav",{className:"hidden md:block",children:i.jsxs("ul",{className:"flex items-center space-x-8",children:[o.map(d=>i.jsx("li",{children:d.href==="/"?i.jsxs(bs,{to:d.href,className:Me("flex items-center px-1 py-2 text-sm font-medium hover-transition border-b-2",c(d.href)?"border-primary text-primary":"border-transparent text-slate-600 hover:text-slate-900 hover:border-slate-300"),children:[i.jsx(d.icon,{className:"mr-1 h-4 w-4"}),d.name]}):i.jsxs("button",{onClick:()=>u(d.href),className:Me("flex items-center px-1 py-2 text-sm font-medium hover-transition border-b-2",c(d.href)?"border-primary text-primary":"border-transparent text-slate-600 hover:text-slate-900 hover:border-slate-300"),children:[i.jsx(d.icon,{className:"mr-1 h-4 w-4"}),d.name]})},d.name)),i.jsx("li",{children:s?i.jsxs("button",{onClick:()=>{a(),r("/login")},className:"flex items-center px-3 py-2 text-sm font-medium text-slate-600 hover:text-slate-900 button-transition rounded-md hover:bg-slate-50",children:[i.jsx(LA,{className:"mr-1 h-4 w-4"}),"Logout"]}):i.jsxs(bs,{to:"/login",className:"flex items-center px-3 py-2 text-sm font-medium text-slate-600 hover:text-slate-900 button-transition rounded-md hover:bg-slate-50",children:[i.jsx(DA,{className:"mr-1 h-4 w-4"}),"Login"]})})]})}),i.jsx("div",{className:"flex md:hidden",children:i.jsxs("button",{type:"button",className:"inline-flex items-center justify-center rounded-md p-2 text-slate-700 hover:bg-slate-100 hover:text-slate-900 button-transition",onClick:l,children:[i.jsx("span",{className:"sr-only",children:"Open main menu"}),e?i.jsx(Zs,{className:"block h-6 w-6","aria-hidden":"true"}):i.jsx(NW,{className:"block h-6 w-6","aria-hidden":"true"})]})})]})}),e&&i.jsx("div",{className:"md:hidden glass-panel animate-fade-in",children:i.jsxs("div",{className:"space-y-1 px-4 pb-3 pt-2",children:[o.map(d=>i.jsx("div",{children:d.href==="/"?i.jsxs(bs,{to:d.href,className:Me("flex items-center rounded-md px-3 py-2 text-base font-medium button-transition",c(d.href)?"bg-primary text-white":"text-slate-600 hover:bg-slate-50 hover:text-slate-900"),onClick:()=>t(!1),children:[i.jsx(d.icon,{className:"mr-3 h-5 w-5"}),d.name]}):i.jsxs("button",{className:Me("flex items-center rounded-md px-3 py-2 text-base font-medium button-transition w-full text-left",c(d.href)?"bg-primary text-white":"text-slate-600 hover:bg-slate-50 hover:text-slate-900"),onClick:()=>{t(!1),u(d.href)},children:[i.jsx(d.icon,{className:"mr-3 h-5 w-5"}),d.name]})},d.name)),s?i.jsxs("button",{onClick:()=>{a(),t(!1),r("/login")},className:"flex items-center rounded-md px-3 py-2 text-base font-medium button-transition text-slate-600 hover:bg-slate-50 hover:text-slate-900 w-full",children:[i.jsx(LA,{className:"mr-3 h-5 w-5"}),"Logout"]}):i.jsxs(bs,{to:"/login",className:"flex items-center rounded-md px-3 py-2 text-base font-medium button-transition text-slate-600 hover:bg-slate-50 hover:text-slate-900",onClick:()=>t(!1),children:[i.jsx(DA,{className:"mr-3 h-5 w-5"}),"Login"]})]})})]})}const eC=e=>typeof e=="boolean"?`${e}`:e===0?"0":e,tC=wt,VS=(e,t)=>n=>{var r;if((t==null?void 0:t.variants)==null)return tC(e,n==null?void 0:n.class,n==null?void 0:n.className);const{variants:s,defaultVariants:a}=t,o=Object.keys(s).map(u=>{const d=n==null?void 0:n[u],f=a==null?void 0:a[u];if(d===null)return null;const h=eC(d)||eC(f);return s[u][h]}),l=n&&Object.entries(n).reduce((u,d)=>{let[f,h]=d;return h===void 0||(u[f]=h),u},{}),c=t==null||(r=t.compoundVariants)===null||r===void 0?void 0:r.reduce((u,d)=>{let{class:f,className:h,...p}=d;return Object.entries(p).every(g=>{let[m,y]=g;return Array.isArray(y)?y.includes({...a,...l}[m]):{...a,...l}[m]===y})?[...u,f,h]:u},[]);return tC(e,o,c,n==null?void 0:n.class,n==null?void 0:n.className)},WS=VS("inline-flex items-center justify-center gap-2 whitespace-nowrap rounded-md text-sm font-medium ring-offset-background transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 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 hover:bg-primary/90",destructive:"bg-destructive text-destructive-foreground hover:bg-destructive/90",outline:"border border-input bg-background hover:bg-accent hover:text-accent-foreground",secondary:"bg-secondary text-secondary-foreground hover:bg-secondary/80",ghost:"hover:bg-accent hover:text-accent-foreground",link:"text-primary underline-offset-4 hover:underline"},size:{default:"h-10 px-4 py-2",sm:"h-9 rounded-md px-3",lg:"h-11 rounded-md px-8",icon:"h-10 w-10"}},defaultVariants:{variant:"default",size:"default"}}),te=v.forwardRef(({className:e,variant:t,size:n,asChild:r=!1,...s},a)=>{const o=r?mi:"button";return i.jsx(o,{className:Me(WS({variant:t,size:n,className:e})),ref:a,...s})});te.displayName="Button";function mG(){return i.jsxs("div",{className:"relative isolate overflow-hidden",children:[i.jsx("div",{className:"absolute inset-x-0 top-[-10rem] -z-10 transform-gpu overflow-hidden blur-3xl sm:top-[-20rem]","aria-hidden":"true",children:i.jsx("div",{className:"relative left-[calc(50%-11rem)] aspect-[1155/678] w-[36.125rem] -translate-x-1/2 rotate-[30deg] bg-gradient-to-tr from-primary to-blue-400 opacity-20 sm:left-[calc(50%-30rem)] sm:w-[72.1875rem]",style:{clipPath:"polygon(74.1% 44.1%, 100% 61.6%, 97.5% 26.9%, 85.5% 0.1%, 80.7% 2%, 72.5% 32.5%, 60.2% 62.4%, 52.4% 68.1%, 47.5% 58.3%, 45.2% 34.5%, 27.5% 76.7%, 0.1% 64.9%, 17.9% 100%, 27.6% 76.8%, 76.1% 97.7%, 74.1% 44.1%)"}})}),i.jsxs("div",{className:"mx-auto max-w-7xl px-6 py-24 sm:py-32 lg:flex lg:items-center lg:gap-x-10 lg:px-8 lg:py-40",children:[i.jsxs("div",{className:"mx-auto max-w-2xl lg:mx-0 lg:flex-auto",children:[i.jsx("div",{className:"flex",children:i.jsxs("div",{className:"relative flex items-center gap-x-4 rounded-full px-4 py-1 text-sm leading-6 text-gray-600 ring-1 ring-gray-900/10 hover:ring-gray-900/20",children:[i.jsx("span",{className:"font-semibold text-primary",children:"New"}),i.jsx("span",{className:"h-4 w-px bg-gray-900/10","aria-hidden":"true"}),i.jsx("span",{children:"Introducing AI-driven focus groups"})]})}),i.jsxs("h1",{className:"mt-10 max-w-lg text-4xl font-sf font-bold tracking-tight text-gray-900 sm:text-6xl",children:["Research with ",i.jsx("span",{className:"text-gradient",children:"synthetic personas"})]}),i.jsx("p",{className:"mt-6 text-lg leading-8 text-gray-600",children:"Conduct research using AI-powered synthetic personas and autonomous focus groups. Gain valuable insights without the limitations of traditional research methods."}),i.jsxs("div",{className:"mt-10 flex items-center gap-x-6",children:[i.jsx(bs,{to:"/synthetic-users",children:i.jsxs(te,{className:"px-6 py-6 text-base hover:shadow-lg hover:translate-y-[-2px] button-transition",children:["Create synthetic personas",i.jsx(zs,{className:"ml-2 h-4 w-4"})]})}),i.jsxs(bs,{to:"/focus-groups",className:"text-sm font-semibold leading-6 text-gray-900 hover:text-primary button-transition",children:["Set up focus groups ",i.jsx("span",{"aria-hidden":"true",children:"→"})]})]})]}),i.jsx("div",{className:"mt-16 sm:mt-24 lg:mt-0 lg:flex-shrink-0 lg:flex-grow",children:i.jsxs("div",{className:"relative glass-card mx-auto w-[350px] h-[450px] rounded-2xl shadow-xl overflow-hidden animate-float",children:[i.jsxs("div",{className:"absolute top-4 left-4 right-4 h-12 bg-white/70 backdrop-blur-sm rounded-lg flex items-center px-4",children:[i.jsx("div",{className:"h-3 w-3 rounded-full bg-red-400 mr-2"}),i.jsx("div",{className:"h-3 w-3 rounded-full bg-yellow-400 mr-2"}),i.jsx("div",{className:"h-3 w-3 rounded-full bg-green-400 mr-2"}),i.jsx("div",{className:"text-xs text-gray-500 ml-2",children:"Shampoo Brand Perception"})]}),i.jsx("div",{className:"absolute top-20 left-4 right-4 bottom-4 bg-gray-50 rounded-lg overflow-hidden",children:[1,2,3,4].map(e=>i.jsx("div",{className:`flex ${e%2===0?"justify-end":"justify-start"} px-3 py-2`,children:i.jsxs("div",{className:`max-w-[70%] rounded-lg px-3 py-2 text-xs ${e%2===0?"bg-primary text-white":"bg-gray-200 text-gray-800"}`,children:[e===1&&"What qualities do you look for in a premium shampoo brand?",e===2&&"I value natural ingredients and a brand that feels luxurious but still eco-friendly.",e===3&&"How important is fragrance in your shampoo selection?",e===4&&"Very important - it affects my mood and how I feel about the product throughout the day."]})},e))})]})})]}),i.jsx("div",{className:"absolute inset-x-0 bottom-[-10rem] -z-10 transform-gpu overflow-hidden blur-3xl sm:bottom-[-20rem]","aria-hidden":"true",children:i.jsx("div",{className:"relative left-[calc(50%+11rem)] aspect-[1155/678] w-[36.125rem] -translate-x-1/2 rotate-[30deg] bg-gradient-to-tr from-blue-400 to-primary opacity-20 sm:left-[calc(50%+30rem)] sm:w-[72.1875rem]",style:{clipPath:"polygon(74.1% 44.1%, 100% 61.6%, 97.5% 26.9%, 85.5% 0.1%, 80.7% 2%, 72.5% 32.5%, 60.2% 62.4%, 52.4% 68.1%, 47.5% 58.3%, 45.2% 34.5%, 27.5% 76.7%, 0.1% 64.9%, 17.9% 100%, 27.6% 76.8%, 76.1% 97.7%, 74.1% 44.1%)"}})})]})}function rc({title:e,description:t,icon:n,className:r}){return i.jsxs("div",{className:Me("relative group glass-card rounded-xl overflow-hidden p-6 hover:shadow-lg hover:translate-y-[-4px] button-transition",r),children:[i.jsx("div",{className:"absolute inset-0 bg-gradient-to-r from-primary/5 to-blue-400/5 opacity-0 group-hover:opacity-100 transition-opacity duration-300"}),i.jsxs("div",{className:"relative",children:[i.jsx("div",{className:"rounded-full bg-primary/10 w-12 h-12 flex items-center justify-center mb-4",children:i.jsx(n,{className:"h-6 w-6 text-primary"})}),i.jsx("h3",{className:"font-sf text-lg font-semibold mb-2",children:e}),i.jsx("p",{className:"text-gray-600 text-sm",children:t})]})]})}const gG=()=>(Kl(),Tn(),i.jsxs("div",{className:"min-h-screen overflow-hidden bg-background",children:[i.jsx(oi,{}),i.jsx("main",{children:i.jsxs("div",{className:"pt-16",children:[i.jsx(mG,{}),i.jsx("section",{className:"py-20 px-6 bg-white",children:i.jsxs("div",{className:"max-w-7xl mx-auto",children:[i.jsxs("div",{className:"text-center mb-16",children:[i.jsx("h2",{className:"text-3xl font-sf font-bold sm:text-4xl",children:"Why Synthetic Personas?"}),i.jsx("p",{className:"mt-4 text-lg text-gray-600 max-w-3xl mx-auto",children:"Our platform combines advanced AI with intuitive design to help researchers gain deeper insights faster than traditional methods."})]}),i.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-8",children:[i.jsx(rc,{title:"Scalable Research",description:"Create and test with thousands of synthetic personas, each with unique demographic profiles and behaviors.",icon:or}),i.jsx(rc,{title:"AI-Driven Focus Groups",description:"Run autonomous focus groups moderated by AI that adapts to participant responses in real-time.",icon:$a}),i.jsx(rc,{title:"Instant Analysis",description:"Generate comprehensive reports and visualizations that highlight key insights and patterns.",icon:pw}),i.jsx(rc,{title:"Diverse Perspectives",description:"Access synthetic personas from various backgrounds, ensuring representation across age, gender, and location.",icon:or}),i.jsx(rc,{title:"Dynamic Discussions",description:"AI moderators guide conversations naturally, following up on interesting points without bias.",icon:kW}),i.jsx(rc,{title:"Comprehensive Reporting",description:"Export detailed reports with sentiment analysis, key themes, and actionable recommendations.",icon:pw})]})]})}),i.jsx("section",{className:"py-20 px-6 bg-gradient-to-b from-white to-slate-50",children:i.jsxs("div",{className:"max-w-7xl mx-auto",children:[i.jsxs("div",{className:"text-center mb-16",children:[i.jsx("h2",{className:"text-3xl font-sf font-bold sm:text-4xl",children:"How It Works"}),i.jsx("p",{className:"mt-4 text-lg text-gray-600 max-w-3xl mx-auto",children:"Just three simple steps to gather valuable insights from synthetic personas."})]}),i.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-3 gap-8",children:[i.jsxs("div",{className:"text-center p-6",children:[i.jsx("div",{className:"rounded-full bg-primary/10 w-16 h-16 flex items-center justify-center mx-auto mb-4",children:i.jsx("span",{className:"text-2xl font-bold text-primary",children:"1"})}),i.jsx("h3",{className:"text-xl font-sf font-semibold mb-3",children:"Create Synthetic Personas"}),i.jsx("p",{className:"text-gray-600",children:"Define your target audience with customizable demographic profiles and personality traits."})]}),i.jsxs("div",{className:"text-center p-6",children:[i.jsx("div",{className:"rounded-full bg-primary/10 w-16 h-16 flex items-center justify-center mx-auto mb-4",children:i.jsx("span",{className:"text-2xl font-bold text-primary",children:"2"})}),i.jsx("h3",{className:"text-xl font-sf font-semibold mb-3",children:"Set Up Focus Groups"}),i.jsx("p",{className:"text-gray-600",children:"Configure your research objectives, topics, and parameters for the AI moderator."})]}),i.jsxs("div",{className:"text-center p-6",children:[i.jsx("div",{className:"rounded-full bg-primary/10 w-16 h-16 flex items-center justify-center mx-auto mb-4",children:i.jsx("span",{className:"text-2xl font-bold text-primary",children:"3"})}),i.jsx("h3",{className:"text-xl font-sf font-semibold mb-3",children:"Analyze Results"}),i.jsx("p",{className:"text-gray-600",children:"Review comprehensive visual reports and actionable insights from your synthetic research."})]})]}),i.jsx("div",{className:"text-center mt-12",children:i.jsx(bs,{to:"synthetic-users",className:"inline-flex items-center justify-center px-6 py-3 border border-transparent text-base font-medium rounded-md text-white bg-primary hover:bg-primary/90 button-transition",children:"Get Started"})})]})}),i.jsxs("footer",{className:"bg-white py-12 px-6",children:[i.jsxs("div",{className:"max-w-7xl mx-auto flex flex-col md:flex-row justify-between items-center",children:[i.jsxs("div",{className:"mb-6 md:mb-0",children:[i.jsx("span",{className:"text-xl font-sf font-semibold text-gradient",children:"Semblance"}),i.jsx("p",{className:"text-sm text-gray-500 mt-2",children:"AI-powered synthetic persona research"})]}),i.jsxs("div",{className:"flex flex-col md:flex-row gap-8",children:[i.jsxs("div",{children:[i.jsx("h3",{className:"text-sm font-semibold text-gray-900 mb-3",children:"Platform"}),i.jsxs("ul",{className:"space-y-2",children:[i.jsx("li",{children:i.jsx(bs,{to:"/",className:"text-sm text-gray-600 hover:text-primary button-transition",children:"Home"})}),i.jsx("li",{children:i.jsx(bs,{to:"/synthetic-users",className:"text-sm text-gray-600 hover:text-primary button-transition",children:"Synthetic Personas"})}),i.jsx("li",{children:i.jsx(bs,{to:"/focus-groups",className:"text-sm text-gray-600 hover:text-primary button-transition",children:"Focus Groups"})}),i.jsx("li",{children:i.jsx(bs,{to:"/dashboard",className:"text-sm text-gray-600 hover:text-primary button-transition",children:"Dashboard"})})]})]}),i.jsxs("div",{children:[i.jsx("h3",{className:"text-sm font-semibold text-gray-900 mb-3",children:"Company"}),i.jsxs("ul",{className:"space-y-2",children:[i.jsx("li",{children:i.jsx("a",{href:"#",className:"text-sm text-gray-600 hover:text-primary button-transition",children:"About"})}),i.jsx("li",{children:i.jsx("a",{href:"#",className:"text-sm text-gray-600 hover:text-primary button-transition",children:"Blog"})}),i.jsx("li",{children:i.jsx("a",{href:"#",className:"text-sm text-gray-600 hover:text-primary button-transition",children:"Careers"})}),i.jsx("li",{children:i.jsx("a",{href:"#",className:"text-sm text-gray-600 hover:text-primary button-transition",children:"Contact"})})]})]}),i.jsxs("div",{children:[i.jsx("h3",{className:"text-sm font-semibold text-gray-900 mb-3",children:"Legal"}),i.jsxs("ul",{className:"space-y-2",children:[i.jsx("li",{children:i.jsx("a",{href:"#",className:"text-sm text-gray-600 hover:text-primary button-transition",children:"Privacy"})}),i.jsx("li",{children:i.jsx("a",{href:"#",className:"text-sm text-gray-600 hover:text-primary button-transition",children:"Terms"})}),i.jsx("li",{children:i.jsx("a",{href:"#",className:"text-sm text-gray-600 hover:text-primary button-transition",children:"Security"})})]})]})]})]}),i.jsx("div",{className:"max-w-7xl mx-auto mt-8 pt-8 border-t border-gray-200",children:i.jsxs("p",{className:"text-sm text-gray-500 text-center",children:["© ",new Date().getFullYear()," Semblance. All rights reserved."]})})]})]})})]})),vG=()=>{const e=qr(),t=Tn();v.useEffect(()=>{console.error("404 Error: User attempted to access non-existent route:",e.pathname)},[e.pathname]);const n=e.pathname.startsWith("/synthetic-users/"),s=new URLSearchParams(e.search).get("fromReview")==="true";return i.jsx("div",{className:"min-h-screen flex items-center justify-center bg-gray-100",children:i.jsxs("div",{className:"text-center p-8 max-w-md bg-white rounded-lg shadow-md",children:[i.jsx("h1",{className:"text-4xl font-bold mb-4",children:"404"}),n?i.jsxs(i.Fragment,{children:[i.jsx("p",{className:"text-xl text-gray-600 mb-4",children:"Persona Not Found"}),i.jsx("p",{className:"text-gray-500 mb-6",children:"The persona you're looking for may have been removed or doesn't exist."}),s?i.jsx(te,{onClick:()=>t("/synthetic-users?mode=create&tab=ai&step=review"),className:"mb-2 w-full",children:"Return to Review Page"}):i.jsx(te,{onClick:()=>t("/synthetic-users"),className:"mb-2 w-full",children:"View All Personas"})]}):i.jsxs(i.Fragment,{children:[i.jsx("p",{className:"text-xl text-gray-600 mb-4",children:"Oops! Page not found"}),i.jsx("p",{className:"text-gray-500 mb-6",children:"The page you're looking for doesn't exist or has been moved."})]}),i.jsx(te,{variant:"outline",onClick:()=>t("/"),className:"w-full",children:"Return to Home"})]})})};function yG(e,t=[]){let n=[];function r(a,o){const l=v.createContext(o),c=n.length;n=[...n,o];function u(f){const{scope:h,children:p,...g}=f,m=(h==null?void 0:h[e][c])||l,y=v.useMemo(()=>g,Object.values(g));return i.jsx(m.Provider,{value:y,children:p})}function d(f,h){const p=(h==null?void 0:h[e][c])||l,g=v.useContext(p);if(g)return g;if(o!==void 0)return o;throw new Error(`\`${f}\` must be used within \`${a}\``)}return u.displayName=a+"Provider",[u,d]}const s=()=>{const a=n.map(o=>v.createContext(o));return function(l){const c=(l==null?void 0:l[e])||a;return v.useMemo(()=>({[`__scope${e}`]:{...l,[e]:c}}),[l,c])}};return s.scopeName=e,[r,xG(s,...t)]}function xG(...e){const t=e[0];if(e.length===1)return t;const n=()=>{const r=e.map(s=>({useScope:s(),scopeName:s.scopeName}));return function(a){const o=r.reduce((l,{useScope:c,scopeName:u})=>{const f=c(a)[`__scope${u}`];return{...l,...f}},{});return v.useMemo(()=>({[`__scope${t.scopeName}`]:o}),[o])}};return n.scopeName=t.scopeName,n}var HS="Progress",GS=100,[bG,_Pe]=yG(HS),[wG,jG]=bG(HS),II=v.forwardRef((e,t)=>{const{__scopeProgress:n,value:r=null,max:s,getValueLabel:a=SG,...o}=e;(s||s===0)&&!nC(s)&&console.error(NG(`${s}`,"Progress"));const l=nC(s)?s:GS;r!==null&&!rC(r,l)&&console.error(_G(`${r}`,"Progress"));const c=rC(r,l)?r:null,u=mg(c)?a(c,l):void 0;return i.jsx(wG,{scope:n,value:c,max:l,children:i.jsx(Ye.div,{"aria-valuemax":l,"aria-valuemin":0,"aria-valuenow":mg(c)?c:void 0,"aria-valuetext":u,role:"progressbar","data-state":LI(c,l),"data-value":c??void 0,"data-max":l,...o,ref:t})})});II.displayName=HS;var RI="ProgressIndicator",DI=v.forwardRef((e,t)=>{const{__scopeProgress:n,...r}=e,s=jG(RI,n);return i.jsx(Ye.div,{"data-state":LI(s.value,s.max),"data-value":s.value??void 0,"data-max":s.max,...r,ref:t})});DI.displayName=RI;function SG(e,t){return`${Math.round(e/t*100)}%`}function LI(e,t){return e==null?"indeterminate":e===t?"complete":"loading"}function mg(e){return typeof e=="number"}function nC(e){return mg(e)&&!isNaN(e)&&e>0}function rC(e,t){return mg(e)&&!isNaN(e)&&e<=t&&e>=0}function NG(e,t){return`Invalid prop \`max\` of value \`${e}\` supplied to \`${t}\`. Only numbers greater than 0 are valid max values. Defaulting to \`${GS}\`.`}function _G(e,t){return`Invalid prop \`value\` of value \`${e}\` supplied to \`${t}\`. The \`value\` prop must be: + */const fI=Re("Zap",[["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"}]]);function hI(e,t){return function(){return e.apply(t,arguments)}}const{toString:WW}=Object.prototype,{getPrototypeOf:WS}=Object,{iterator:vy,toStringTag:pI}=Symbol,yy=(e=>t=>{const n=WW.call(t);return e[n]||(e[n]=n.slice(8,-1).toLowerCase())})(Object.create(null)),la=e=>(e=e.toLowerCase(),t=>yy(t)===e),xy=e=>t=>typeof t===e,{isArray:Yu}=Array,Wf=xy("undefined");function GW(e){return e!==null&&!Wf(e)&&e.constructor!==null&&!Wf(e.constructor)&&Wr(e.constructor.isBuffer)&&e.constructor.isBuffer(e)}const mI=la("ArrayBuffer");function HW(e){let t;return typeof ArrayBuffer<"u"&&ArrayBuffer.isView?t=ArrayBuffer.isView(e):t=e&&e.buffer&&mI(e.buffer),t}const qW=xy("string"),Wr=xy("function"),gI=xy("number"),by=e=>e!==null&&typeof e=="object",KW=e=>e===!0||e===!1,Cm=e=>{if(yy(e)!=="object")return!1;const t=WS(e);return(t===null||t===Object.prototype||Object.getPrototypeOf(t)===null)&&!(pI in e)&&!(vy in e)},XW=la("Date"),YW=la("File"),ZW=la("Blob"),QW=la("FileList"),JW=e=>by(e)&&Wr(e.pipe),eG=e=>{let t;return e&&(typeof FormData=="function"&&e instanceof FormData||Wr(e.append)&&((t=yy(e))==="formdata"||t==="object"&&Wr(e.toString)&&e.toString()==="[object FormData]"))},tG=la("URLSearchParams"),[nG,rG,sG,aG]=["ReadableStream","Request","Response","Headers"].map(la),iG=e=>e.trim?e.trim():e.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,"");function rp(e,t,{allOwnKeys:n=!1}={}){if(e===null||typeof e>"u")return;let r,s;if(typeof e!="object"&&(e=[e]),Yu(e))for(r=0,s=e.length;r0;)if(s=n[r],t===s.toLowerCase())return s;return null}const sl=typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:global,yI=e=>!Wf(e)&&e!==sl;function vw(){const{caseless:e}=yI(this)&&this||{},t={},n=(r,s)=>{const a=e&&vI(t,s)||s;Cm(t[a])&&Cm(r)?t[a]=vw(t[a],r):Cm(r)?t[a]=vw({},r):Yu(r)?t[a]=r.slice():t[a]=r};for(let r=0,s=arguments.length;r(rp(t,(s,a)=>{n&&Wr(s)?e[a]=hI(s,n):e[a]=s},{allOwnKeys:r}),e),lG=e=>(e.charCodeAt(0)===65279&&(e=e.slice(1)),e),cG=(e,t,n,r)=>{e.prototype=Object.create(t.prototype,r),e.prototype.constructor=e,Object.defineProperty(e,"super",{value:t.prototype}),n&&Object.assign(e.prototype,n)},uG=(e,t,n,r)=>{let s,a,o;const l={};if(t=t||{},e==null)return t;do{for(s=Object.getOwnPropertyNames(e),a=s.length;a-- >0;)o=s[a],(!r||r(o,e,t))&&!l[o]&&(t[o]=e[o],l[o]=!0);e=n!==!1&&WS(e)}while(e&&(!n||n(e,t))&&e!==Object.prototype);return t},dG=(e,t,n)=>{e=String(e),(n===void 0||n>e.length)&&(n=e.length),n-=t.length;const r=e.indexOf(t,n);return r!==-1&&r===n},fG=e=>{if(!e)return null;if(Yu(e))return e;let t=e.length;if(!gI(t))return null;const n=new Array(t);for(;t-- >0;)n[t]=e[t];return n},hG=(e=>t=>e&&t instanceof e)(typeof Uint8Array<"u"&&WS(Uint8Array)),pG=(e,t)=>{const r=(e&&e[vy]).call(e);let s;for(;(s=r.next())&&!s.done;){const a=s.value;t.call(e,a[0],a[1])}},mG=(e,t)=>{let n;const r=[];for(;(n=e.exec(t))!==null;)r.push(n);return r},gG=la("HTMLFormElement"),vG=e=>e.toLowerCase().replace(/[-_\s]([a-z\d])(\w*)/g,function(n,r,s){return r.toUpperCase()+s}),HA=(({hasOwnProperty:e})=>(t,n)=>e.call(t,n))(Object.prototype),yG=la("RegExp"),xI=(e,t)=>{const n=Object.getOwnPropertyDescriptors(e),r={};rp(n,(s,a)=>{let o;(o=t(s,a,e))!==!1&&(r[a]=o||s)}),Object.defineProperties(e,r)},xG=e=>{xI(e,(t,n)=>{if(Wr(e)&&["arguments","caller","callee"].indexOf(n)!==-1)return!1;const r=e[n];if(Wr(r)){if(t.enumerable=!1,"writable"in t){t.writable=!1;return}t.set||(t.set=()=>{throw Error("Can not rewrite read-only method '"+n+"'")})}})},bG=(e,t)=>{const n={},r=s=>{s.forEach(a=>{n[a]=!0})};return Yu(e)?r(e):r(String(e).split(t)),n},wG=()=>{},jG=(e,t)=>e!=null&&Number.isFinite(e=+e)?e:t;function SG(e){return!!(e&&Wr(e.append)&&e[pI]==="FormData"&&e[vy])}const NG=e=>{const t=new Array(10),n=(r,s)=>{if(by(r)){if(t.indexOf(r)>=0)return;if(!("toJSON"in r)){t[s]=r;const a=Yu(r)?[]:{};return rp(r,(o,l)=>{const c=n(o,s+1);!Wf(c)&&(a[l]=c)}),t[s]=void 0,a}}return r};return n(e,0)},_G=la("AsyncFunction"),PG=e=>e&&(by(e)||Wr(e))&&Wr(e.then)&&Wr(e.catch),bI=((e,t)=>e?setImmediate:t?((n,r)=>(sl.addEventListener("message",({source:s,data:a})=>{s===sl&&a===n&&r.length&&r.shift()()},!1),s=>{r.push(s),sl.postMessage(n,"*")}))(`axios@${Math.random()}`,[]):n=>setTimeout(n))(typeof setImmediate=="function",Wr(sl.postMessage)),AG=typeof queueMicrotask<"u"?queueMicrotask.bind(sl):typeof process<"u"&&process.nextTick||bI,CG=e=>e!=null&&Wr(e[vy]),ae={isArray:Yu,isArrayBuffer:mI,isBuffer:GW,isFormData:eG,isArrayBufferView:HW,isString:qW,isNumber:gI,isBoolean:KW,isObject:by,isPlainObject:Cm,isReadableStream:nG,isRequest:rG,isResponse:sG,isHeaders:aG,isUndefined:Wf,isDate:XW,isFile:YW,isBlob:ZW,isRegExp:yG,isFunction:Wr,isStream:JW,isURLSearchParams:tG,isTypedArray:hG,isFileList:QW,forEach:rp,merge:vw,extend:oG,trim:iG,stripBOM:lG,inherits:cG,toFlatObject:uG,kindOf:yy,kindOfTest:la,endsWith:dG,toArray:fG,forEachEntry:pG,matchAll:mG,isHTMLForm:gG,hasOwnProperty:HA,hasOwnProp:HA,reduceDescriptors:xI,freezeMethods:xG,toObjectSet:bG,toCamelCase:vG,noop:wG,toFiniteNumber:jG,findKey:vI,global:sl,isContextDefined:yI,isSpecCompliantForm:SG,toJSONObject:NG,isAsyncFn:_G,isThenable:PG,setImmediate:bI,asap:AG,isIterable:CG};function _t(e,t,n,r,s){Error.call(this),Error.captureStackTrace?Error.captureStackTrace(this,this.constructor):this.stack=new Error().stack,this.message=e,this.name="AxiosError",t&&(this.code=t),n&&(this.config=n),r&&(this.request=r),s&&(this.response=s,this.status=s.status?s.status:null)}ae.inherits(_t,Error,{toJSON:function(){return{message:this.message,name:this.name,description:this.description,number:this.number,fileName:this.fileName,lineNumber:this.lineNumber,columnNumber:this.columnNumber,stack:this.stack,config:ae.toJSONObject(this.config),code:this.code,status:this.status}}});const wI=_t.prototype,jI={};["ERR_BAD_OPTION_VALUE","ERR_BAD_OPTION","ECONNABORTED","ETIMEDOUT","ERR_NETWORK","ERR_FR_TOO_MANY_REDIRECTS","ERR_DEPRECATED","ERR_BAD_RESPONSE","ERR_BAD_REQUEST","ERR_CANCELED","ERR_NOT_SUPPORT","ERR_INVALID_URL"].forEach(e=>{jI[e]={value:e}});Object.defineProperties(_t,jI);Object.defineProperty(wI,"isAxiosError",{value:!0});_t.from=(e,t,n,r,s,a)=>{const o=Object.create(wI);return ae.toFlatObject(e,o,function(c){return c!==Error.prototype},l=>l!=="isAxiosError"),_t.call(o,e.message,t,n,r,s),o.cause=e,o.name=e.name,a&&Object.assign(o,a),o};const EG=null;function yw(e){return ae.isPlainObject(e)||ae.isArray(e)}function SI(e){return ae.endsWith(e,"[]")?e.slice(0,-2):e}function qA(e,t,n){return e?e.concat(t).map(function(s,a){return s=SI(s),!n&&a?"["+s+"]":s}).join(n?".":""):t}function OG(e){return ae.isArray(e)&&!e.some(yw)}const kG=ae.toFlatObject(ae,{},null,function(t){return/^is[A-Z]/.test(t)});function wy(e,t,n){if(!ae.isObject(e))throw new TypeError("target must be an object");t=t||new FormData,n=ae.toFlatObject(n,{metaTokens:!0,dots:!1,indexes:!1},!1,function(m,y){return!ae.isUndefined(y[m])});const r=n.metaTokens,s=n.visitor||d,a=n.dots,o=n.indexes,c=(n.Blob||typeof Blob<"u"&&Blob)&&ae.isSpecCompliantForm(t);if(!ae.isFunction(s))throw new TypeError("visitor must be a function");function u(g){if(g===null)return"";if(ae.isDate(g))return g.toISOString();if(!c&&ae.isBlob(g))throw new _t("Blob is not supported. Use a Buffer instead.");return ae.isArrayBuffer(g)||ae.isTypedArray(g)?c&&typeof Blob=="function"?new Blob([g]):Buffer.from(g):g}function d(g,m,y){let b=g;if(g&&!y&&typeof g=="object"){if(ae.endsWith(m,"{}"))m=r?m:m.slice(0,-2),g=JSON.stringify(g);else if(ae.isArray(g)&&OG(g)||(ae.isFileList(g)||ae.endsWith(m,"[]"))&&(b=ae.toArray(g)))return m=SI(m),b.forEach(function(w,j){!(ae.isUndefined(w)||w===null)&&t.append(o===!0?qA([m],j,a):o===null?m:m+"[]",u(w))}),!1}return yw(g)?!0:(t.append(qA(y,m,a),u(g)),!1)}const f=[],h=Object.assign(kG,{defaultVisitor:d,convertValue:u,isVisitable:yw});function p(g,m){if(!ae.isUndefined(g)){if(f.indexOf(g)!==-1)throw Error("Circular reference detected in "+m.join("."));f.push(g),ae.forEach(g,function(b,x){(!(ae.isUndefined(b)||b===null)&&s.call(t,b,ae.isString(x)?x.trim():x,m,h))===!0&&p(b,m?m.concat(x):[x])}),f.pop()}}if(!ae.isObject(e))throw new TypeError("data must be an object");return p(e),t}function KA(e){const t={"!":"%21","'":"%27","(":"%28",")":"%29","~":"%7E","%20":"+","%00":"\0"};return encodeURIComponent(e).replace(/[!'()~]|%20|%00/g,function(r){return t[r]})}function GS(e,t){this._pairs=[],e&&wy(e,this,t)}const NI=GS.prototype;NI.append=function(t,n){this._pairs.push([t,n])};NI.toString=function(t){const n=t?function(r){return t.call(this,r,KA)}:KA;return this._pairs.map(function(s){return n(s[0])+"="+n(s[1])},"").join("&")};function TG(e){return encodeURIComponent(e).replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+").replace(/%5B/gi,"[").replace(/%5D/gi,"]")}function _I(e,t,n){if(!t)return e;const r=n&&n.encode||TG;ae.isFunction(n)&&(n={serialize:n});const s=n&&n.serialize;let a;if(s?a=s(t,n):a=ae.isURLSearchParams(t)?t.toString():new GS(t,n).toString(r),a){const o=e.indexOf("#");o!==-1&&(e=e.slice(0,o)),e+=(e.indexOf("?")===-1?"?":"&")+a}return e}class XA{constructor(){this.handlers=[]}use(t,n,r){return this.handlers.push({fulfilled:t,rejected:n,synchronous:r?r.synchronous:!1,runWhen:r?r.runWhen:null}),this.handlers.length-1}eject(t){this.handlers[t]&&(this.handlers[t]=null)}clear(){this.handlers&&(this.handlers=[])}forEach(t){ae.forEach(this.handlers,function(r){r!==null&&t(r)})}}const PI={silentJSONParsing:!0,forcedJSONParsing:!0,clarifyTimeoutError:!1},$G=typeof URLSearchParams<"u"?URLSearchParams:GS,MG=typeof FormData<"u"?FormData:null,IG=typeof Blob<"u"?Blob:null,RG={isBrowser:!0,classes:{URLSearchParams:$G,FormData:MG,Blob:IG},protocols:["http","https","file","blob","url","data"]},HS=typeof window<"u"&&typeof document<"u",xw=typeof navigator=="object"&&navigator||void 0,DG=HS&&(!xw||["ReactNative","NativeScript","NS"].indexOf(xw.product)<0),LG=typeof WorkerGlobalScope<"u"&&self instanceof WorkerGlobalScope&&typeof self.importScripts=="function",FG=HS&&window.location.href||"http://localhost",BG=Object.freeze(Object.defineProperty({__proto__:null,hasBrowserEnv:HS,hasStandardBrowserEnv:DG,hasStandardBrowserWebWorkerEnv:LG,navigator:xw,origin:FG},Symbol.toStringTag,{value:"Module"})),yr={...BG,...RG};function zG(e,t){return wy(e,new yr.classes.URLSearchParams,Object.assign({visitor:function(n,r,s,a){return yr.isNode&&ae.isBuffer(n)?(this.append(r,n.toString("base64")),!1):a.defaultVisitor.apply(this,arguments)}},t))}function UG(e){return ae.matchAll(/\w+|\[(\w*)]/g,e).map(t=>t[0]==="[]"?"":t[1]||t[0])}function VG(e){const t={},n=Object.keys(e);let r;const s=n.length;let a;for(r=0;r=n.length;return o=!o&&ae.isArray(s)?s.length:o,c?(ae.hasOwnProp(s,o)?s[o]=[s[o],r]:s[o]=r,!l):((!s[o]||!ae.isObject(s[o]))&&(s[o]=[]),t(n,r,s[o],a)&&ae.isArray(s[o])&&(s[o]=VG(s[o])),!l)}if(ae.isFormData(e)&&ae.isFunction(e.entries)){const n={};return ae.forEachEntry(e,(r,s)=>{t(UG(r),s,n,0)}),n}return null}function WG(e,t,n){if(ae.isString(e))try{return(t||JSON.parse)(e),ae.trim(e)}catch(r){if(r.name!=="SyntaxError")throw r}return(0,JSON.stringify)(e)}const sp={transitional:PI,adapter:["xhr","http","fetch"],transformRequest:[function(t,n){const r=n.getContentType()||"",s=r.indexOf("application/json")>-1,a=ae.isObject(t);if(a&&ae.isHTMLForm(t)&&(t=new FormData(t)),ae.isFormData(t))return s?JSON.stringify(AI(t)):t;if(ae.isArrayBuffer(t)||ae.isBuffer(t)||ae.isStream(t)||ae.isFile(t)||ae.isBlob(t)||ae.isReadableStream(t))return t;if(ae.isArrayBufferView(t))return t.buffer;if(ae.isURLSearchParams(t))return n.setContentType("application/x-www-form-urlencoded;charset=utf-8",!1),t.toString();let l;if(a){if(r.indexOf("application/x-www-form-urlencoded")>-1)return zG(t,this.formSerializer).toString();if((l=ae.isFileList(t))||r.indexOf("multipart/form-data")>-1){const c=this.env&&this.env.FormData;return wy(l?{"files[]":t}:t,c&&new c,this.formSerializer)}}return a||s?(n.setContentType("application/json",!1),WG(t)):t}],transformResponse:[function(t){const n=this.transitional||sp.transitional,r=n&&n.forcedJSONParsing,s=this.responseType==="json";if(ae.isResponse(t)||ae.isReadableStream(t))return t;if(t&&ae.isString(t)&&(r&&!this.responseType||s)){const o=!(n&&n.silentJSONParsing)&&s;try{return JSON.parse(t)}catch(l){if(o)throw l.name==="SyntaxError"?_t.from(l,_t.ERR_BAD_RESPONSE,this,null,this.response):l}}return t}],timeout:0,xsrfCookieName:"XSRF-TOKEN",xsrfHeaderName:"X-XSRF-TOKEN",maxContentLength:-1,maxBodyLength:-1,env:{FormData:yr.classes.FormData,Blob:yr.classes.Blob},validateStatus:function(t){return t>=200&&t<300},headers:{common:{Accept:"application/json, text/plain, */*","Content-Type":void 0}}};ae.forEach(["delete","get","head","post","put","patch"],e=>{sp.headers[e]={}});const GG=ae.toObjectSet(["age","authorization","content-length","content-type","etag","expires","from","host","if-modified-since","if-unmodified-since","last-modified","location","max-forwards","proxy-authorization","referer","retry-after","user-agent"]),HG=e=>{const t={};let n,r,s;return e&&e.split(` +`).forEach(function(o){s=o.indexOf(":"),n=o.substring(0,s).trim().toLowerCase(),r=o.substring(s+1).trim(),!(!n||t[n]&&GG[n])&&(n==="set-cookie"?t[n]?t[n].push(r):t[n]=[r]:t[n]=t[n]?t[n]+", "+r:r)}),t},YA=Symbol("internals");function Cd(e){return e&&String(e).trim().toLowerCase()}function Em(e){return e===!1||e==null?e:ae.isArray(e)?e.map(Em):String(e)}function qG(e){const t=Object.create(null),n=/([^\s,;=]+)\s*(?:=\s*([^,;]+))?/g;let r;for(;r=n.exec(e);)t[r[1]]=r[2];return t}const KG=e=>/^[-_a-zA-Z0-9^`|~,!#$%&'*+.]+$/.test(e.trim());function m0(e,t,n,r,s){if(ae.isFunction(r))return r.call(this,t,n);if(s&&(t=n),!!ae.isString(t)){if(ae.isString(r))return t.indexOf(r)!==-1;if(ae.isRegExp(r))return r.test(t)}}function XG(e){return e.trim().toLowerCase().replace(/([a-z\d])(\w*)/g,(t,n,r)=>n.toUpperCase()+r)}function YG(e,t){const n=ae.toCamelCase(" "+t);["get","set","has"].forEach(r=>{Object.defineProperty(e,r+n,{value:function(s,a,o){return this[r].call(this,t,s,a,o)},configurable:!0})})}class Gr{constructor(t){t&&this.set(t)}set(t,n,r){const s=this;function a(l,c,u){const d=Cd(c);if(!d)throw new Error("header name must be a non-empty string");const f=ae.findKey(s,d);(!f||s[f]===void 0||u===!0||u===void 0&&s[f]!==!1)&&(s[f||c]=Em(l))}const o=(l,c)=>ae.forEach(l,(u,d)=>a(u,d,c));if(ae.isPlainObject(t)||t instanceof this.constructor)o(t,n);else if(ae.isString(t)&&(t=t.trim())&&!KG(t))o(HG(t),n);else if(ae.isObject(t)&&ae.isIterable(t)){let l={},c,u;for(const d of t){if(!ae.isArray(d))throw TypeError("Object iterator must return a key-value pair");l[u=d[0]]=(c=l[u])?ae.isArray(c)?[...c,d[1]]:[c,d[1]]:d[1]}o(l,n)}else t!=null&&a(n,t,r);return this}get(t,n){if(t=Cd(t),t){const r=ae.findKey(this,t);if(r){const s=this[r];if(!n)return s;if(n===!0)return qG(s);if(ae.isFunction(n))return n.call(this,s,r);if(ae.isRegExp(n))return n.exec(s);throw new TypeError("parser must be boolean|regexp|function")}}}has(t,n){if(t=Cd(t),t){const r=ae.findKey(this,t);return!!(r&&this[r]!==void 0&&(!n||m0(this,this[r],r,n)))}return!1}delete(t,n){const r=this;let s=!1;function a(o){if(o=Cd(o),o){const l=ae.findKey(r,o);l&&(!n||m0(r,r[l],l,n))&&(delete r[l],s=!0)}}return ae.isArray(t)?t.forEach(a):a(t),s}clear(t){const n=Object.keys(this);let r=n.length,s=!1;for(;r--;){const a=n[r];(!t||m0(this,this[a],a,t,!0))&&(delete this[a],s=!0)}return s}normalize(t){const n=this,r={};return ae.forEach(this,(s,a)=>{const o=ae.findKey(r,a);if(o){n[o]=Em(s),delete n[a];return}const l=t?XG(a):String(a).trim();l!==a&&delete n[a],n[l]=Em(s),r[l]=!0}),this}concat(...t){return this.constructor.concat(this,...t)}toJSON(t){const n=Object.create(null);return ae.forEach(this,(r,s)=>{r!=null&&r!==!1&&(n[s]=t&&ae.isArray(r)?r.join(", "):r)}),n}[Symbol.iterator](){return Object.entries(this.toJSON())[Symbol.iterator]()}toString(){return Object.entries(this.toJSON()).map(([t,n])=>t+": "+n).join(` +`)}getSetCookie(){return this.get("set-cookie")||[]}get[Symbol.toStringTag](){return"AxiosHeaders"}static from(t){return t instanceof this?t:new this(t)}static concat(t,...n){const r=new this(t);return n.forEach(s=>r.set(s)),r}static accessor(t){const r=(this[YA]=this[YA]={accessors:{}}).accessors,s=this.prototype;function a(o){const l=Cd(o);r[l]||(YG(s,o),r[l]=!0)}return ae.isArray(t)?t.forEach(a):a(t),this}}Gr.accessor(["Content-Type","Content-Length","Accept","Accept-Encoding","User-Agent","Authorization"]);ae.reduceDescriptors(Gr.prototype,({value:e},t)=>{let n=t[0].toUpperCase()+t.slice(1);return{get:()=>e,set(r){this[n]=r}}});ae.freezeMethods(Gr);function g0(e,t){const n=this||sp,r=t||n,s=Gr.from(r.headers);let a=r.data;return ae.forEach(e,function(l){a=l.call(n,a,s.normalize(),t?t.status:void 0)}),s.normalize(),a}function CI(e){return!!(e&&e.__CANCEL__)}function Zu(e,t,n){_t.call(this,e??"canceled",_t.ERR_CANCELED,t,n),this.name="CanceledError"}ae.inherits(Zu,_t,{__CANCEL__:!0});function EI(e,t,n){const r=n.config.validateStatus;!n.status||!r||r(n.status)?e(n):t(new _t("Request failed with status code "+n.status,[_t.ERR_BAD_REQUEST,_t.ERR_BAD_RESPONSE][Math.floor(n.status/100)-4],n.config,n.request,n))}function ZG(e){const t=/^([-+\w]{1,25})(:?\/\/|:)/.exec(e);return t&&t[1]||""}function QG(e,t){e=e||10;const n=new Array(e),r=new Array(e);let s=0,a=0,o;return t=t!==void 0?t:1e3,function(c){const u=Date.now(),d=r[a];o||(o=u),n[s]=c,r[s]=u;let f=a,h=0;for(;f!==s;)h+=n[f++],f=f%e;if(s=(s+1)%e,s===a&&(a=(a+1)%e),u-o{n=d,s=null,a&&(clearTimeout(a),a=null),e.apply(null,u)};return[(...u)=>{const d=Date.now(),f=d-n;f>=r?o(u,d):(s=u,a||(a=setTimeout(()=>{a=null,o(s)},r-f)))},()=>s&&o(s)]}const mg=(e,t,n=3)=>{let r=0;const s=QG(50,250);return JG(a=>{const o=a.loaded,l=a.lengthComputable?a.total:void 0,c=o-r,u=s(c),d=o<=l;r=o;const f={loaded:o,total:l,progress:l?o/l:void 0,bytes:c,rate:u||void 0,estimated:u&&l&&d?(l-o)/u:void 0,event:a,lengthComputable:l!=null,[t?"download":"upload"]:!0};e(f)},n)},ZA=(e,t)=>{const n=e!=null;return[r=>t[0]({lengthComputable:n,total:e,loaded:r}),t[1]]},QA=e=>(...t)=>ae.asap(()=>e(...t)),eH=yr.hasStandardBrowserEnv?((e,t)=>n=>(n=new URL(n,yr.origin),e.protocol===n.protocol&&e.host===n.host&&(t||e.port===n.port)))(new URL(yr.origin),yr.navigator&&/(msie|trident)/i.test(yr.navigator.userAgent)):()=>!0,tH=yr.hasStandardBrowserEnv?{write(e,t,n,r,s,a){const o=[e+"="+encodeURIComponent(t)];ae.isNumber(n)&&o.push("expires="+new Date(n).toGMTString()),ae.isString(r)&&o.push("path="+r),ae.isString(s)&&o.push("domain="+s),a===!0&&o.push("secure"),document.cookie=o.join("; ")},read(e){const t=document.cookie.match(new RegExp("(^|;\\s*)("+e+")=([^;]*)"));return t?decodeURIComponent(t[3]):null},remove(e){this.write(e,"",Date.now()-864e5)}}:{write(){},read(){return null},remove(){}};function nH(e){return/^([a-z][a-z\d+\-.]*:)?\/\//i.test(e)}function rH(e,t){return t?e.replace(/\/?\/$/,"")+"/"+t.replace(/^\/+/,""):e}function OI(e,t,n){let r=!nH(t);return e&&(r||n==!1)?rH(e,t):t}const JA=e=>e instanceof Gr?{...e}:e;function Il(e,t){t=t||{};const n={};function r(u,d,f,h){return ae.isPlainObject(u)&&ae.isPlainObject(d)?ae.merge.call({caseless:h},u,d):ae.isPlainObject(d)?ae.merge({},d):ae.isArray(d)?d.slice():d}function s(u,d,f,h){if(ae.isUndefined(d)){if(!ae.isUndefined(u))return r(void 0,u,f,h)}else return r(u,d,f,h)}function a(u,d){if(!ae.isUndefined(d))return r(void 0,d)}function o(u,d){if(ae.isUndefined(d)){if(!ae.isUndefined(u))return r(void 0,u)}else return r(void 0,d)}function l(u,d,f){if(f in t)return r(u,d);if(f in e)return r(void 0,u)}const c={url:a,method:a,data:a,baseURL:o,transformRequest:o,transformResponse:o,paramsSerializer:o,timeout:o,timeoutMessage:o,withCredentials:o,withXSRFToken:o,adapter:o,responseType:o,xsrfCookieName:o,xsrfHeaderName:o,onUploadProgress:o,onDownloadProgress:o,decompress:o,maxContentLength:o,maxBodyLength:o,beforeRedirect:o,transport:o,httpAgent:o,httpsAgent:o,cancelToken:o,socketPath:o,responseEncoding:o,validateStatus:l,headers:(u,d,f)=>s(JA(u),JA(d),f,!0)};return ae.forEach(Object.keys(Object.assign({},e,t)),function(d){const f=c[d]||s,h=f(e[d],t[d],d);ae.isUndefined(h)&&f!==l||(n[d]=h)}),n}const kI=e=>{const t=Il({},e);let{data:n,withXSRFToken:r,xsrfHeaderName:s,xsrfCookieName:a,headers:o,auth:l}=t;t.headers=o=Gr.from(o),t.url=_I(OI(t.baseURL,t.url,t.allowAbsoluteUrls),e.params,e.paramsSerializer),l&&o.set("Authorization","Basic "+btoa((l.username||"")+":"+(l.password?unescape(encodeURIComponent(l.password)):"")));let c;if(ae.isFormData(n)){if(yr.hasStandardBrowserEnv||yr.hasStandardBrowserWebWorkerEnv)o.setContentType(void 0);else if((c=o.getContentType())!==!1){const[u,...d]=c?c.split(";").map(f=>f.trim()).filter(Boolean):[];o.setContentType([u||"multipart/form-data",...d].join("; "))}}if(yr.hasStandardBrowserEnv&&(r&&ae.isFunction(r)&&(r=r(t)),r||r!==!1&&eH(t.url))){const u=s&&a&&tH.read(a);u&&o.set(s,u)}return t},sH=typeof XMLHttpRequest<"u",aH=sH&&function(e){return new Promise(function(n,r){const s=kI(e);let a=s.data;const o=Gr.from(s.headers).normalize();let{responseType:l,onUploadProgress:c,onDownloadProgress:u}=s,d,f,h,p,g;function m(){p&&p(),g&&g(),s.cancelToken&&s.cancelToken.unsubscribe(d),s.signal&&s.signal.removeEventListener("abort",d)}let y=new XMLHttpRequest;y.open(s.method.toUpperCase(),s.url,!0),y.timeout=s.timeout;function b(){if(!y)return;const w=Gr.from("getAllResponseHeaders"in y&&y.getAllResponseHeaders()),S={data:!l||l==="text"||l==="json"?y.responseText:y.response,status:y.status,statusText:y.statusText,headers:w,config:e,request:y};EI(function(_){n(_),m()},function(_){r(_),m()},S),y=null}"onloadend"in y?y.onloadend=b:y.onreadystatechange=function(){!y||y.readyState!==4||y.status===0&&!(y.responseURL&&y.responseURL.indexOf("file:")===0)||setTimeout(b)},y.onabort=function(){y&&(r(new _t("Request aborted",_t.ECONNABORTED,e,y)),y=null)},y.onerror=function(){r(new _t("Network Error",_t.ERR_NETWORK,e,y)),y=null},y.ontimeout=function(){let j=s.timeout?"timeout of "+s.timeout+"ms exceeded":"timeout exceeded";const S=s.transitional||PI;s.timeoutErrorMessage&&(j=s.timeoutErrorMessage),r(new _t(j,S.clarifyTimeoutError?_t.ETIMEDOUT:_t.ECONNABORTED,e,y)),y=null},a===void 0&&o.setContentType(null),"setRequestHeader"in y&&ae.forEach(o.toJSON(),function(j,S){y.setRequestHeader(S,j)}),ae.isUndefined(s.withCredentials)||(y.withCredentials=!!s.withCredentials),l&&l!=="json"&&(y.responseType=s.responseType),u&&([h,g]=mg(u,!0),y.addEventListener("progress",h)),c&&y.upload&&([f,p]=mg(c),y.upload.addEventListener("progress",f),y.upload.addEventListener("loadend",p)),(s.cancelToken||s.signal)&&(d=w=>{y&&(r(!w||w.type?new Zu(null,e,y):w),y.abort(),y=null)},s.cancelToken&&s.cancelToken.subscribe(d),s.signal&&(s.signal.aborted?d():s.signal.addEventListener("abort",d)));const x=ZG(s.url);if(x&&yr.protocols.indexOf(x)===-1){r(new _t("Unsupported protocol "+x+":",_t.ERR_BAD_REQUEST,e));return}y.send(a||null)})},iH=(e,t)=>{const{length:n}=e=e?e.filter(Boolean):[];if(t||n){let r=new AbortController,s;const a=function(u){if(!s){s=!0,l();const d=u instanceof Error?u:this.reason;r.abort(d instanceof _t?d:new Zu(d instanceof Error?d.message:d))}};let o=t&&setTimeout(()=>{o=null,a(new _t(`timeout ${t} of ms exceeded`,_t.ETIMEDOUT))},t);const l=()=>{e&&(o&&clearTimeout(o),o=null,e.forEach(u=>{u.unsubscribe?u.unsubscribe(a):u.removeEventListener("abort",a)}),e=null)};e.forEach(u=>u.addEventListener("abort",a));const{signal:c}=r;return c.unsubscribe=()=>ae.asap(l),c}},oH=function*(e,t){let n=e.byteLength;if(n{const s=lH(e,t);let a=0,o,l=c=>{o||(o=!0,r&&r(c))};return new ReadableStream({async pull(c){try{const{done:u,value:d}=await s.next();if(u){l(),c.close();return}let f=d.byteLength;if(n){let h=a+=f;n(h)}c.enqueue(new Uint8Array(d))}catch(u){throw l(u),u}},cancel(c){return l(c),s.return()}},{highWaterMark:2})},jy=typeof fetch=="function"&&typeof Request=="function"&&typeof Response=="function",TI=jy&&typeof ReadableStream=="function",uH=jy&&(typeof TextEncoder=="function"?(e=>t=>e.encode(t))(new TextEncoder):async e=>new Uint8Array(await new Response(e).arrayBuffer())),$I=(e,...t)=>{try{return!!e(...t)}catch{return!1}},dH=TI&&$I(()=>{let e=!1;const t=new Request(yr.origin,{body:new ReadableStream,method:"POST",get duplex(){return e=!0,"half"}}).headers.has("Content-Type");return e&&!t}),tC=64*1024,bw=TI&&$I(()=>ae.isReadableStream(new Response("").body)),gg={stream:bw&&(e=>e.body)};jy&&(e=>{["text","arrayBuffer","blob","formData","stream"].forEach(t=>{!gg[t]&&(gg[t]=ae.isFunction(e[t])?n=>n[t]():(n,r)=>{throw new _t(`Response type '${t}' is not supported`,_t.ERR_NOT_SUPPORT,r)})})})(new Response);const fH=async e=>{if(e==null)return 0;if(ae.isBlob(e))return e.size;if(ae.isSpecCompliantForm(e))return(await new Request(yr.origin,{method:"POST",body:e}).arrayBuffer()).byteLength;if(ae.isArrayBufferView(e)||ae.isArrayBuffer(e))return e.byteLength;if(ae.isURLSearchParams(e)&&(e=e+""),ae.isString(e))return(await uH(e)).byteLength},hH=async(e,t)=>{const n=ae.toFiniteNumber(e.getContentLength());return n??fH(t)},pH=jy&&(async e=>{let{url:t,method:n,data:r,signal:s,cancelToken:a,timeout:o,onDownloadProgress:l,onUploadProgress:c,responseType:u,headers:d,withCredentials:f="same-origin",fetchOptions:h}=kI(e);u=u?(u+"").toLowerCase():"text";let p=iH([s,a&&a.toAbortSignal()],o),g;const m=p&&p.unsubscribe&&(()=>{p.unsubscribe()});let y;try{if(c&&dH&&n!=="get"&&n!=="head"&&(y=await hH(d,r))!==0){let S=new Request(t,{method:"POST",body:r,duplex:"half"}),N;if(ae.isFormData(r)&&(N=S.headers.get("content-type"))&&d.setContentType(N),S.body){const[_,P]=ZA(y,mg(QA(c)));r=eC(S.body,tC,_,P)}}ae.isString(f)||(f=f?"include":"omit");const b="credentials"in Request.prototype;g=new Request(t,{...h,signal:p,method:n.toUpperCase(),headers:d.normalize().toJSON(),body:r,duplex:"half",credentials:b?f:void 0});let x=await fetch(g);const w=bw&&(u==="stream"||u==="response");if(bw&&(l||w&&m)){const S={};["status","statusText","headers"].forEach(k=>{S[k]=x[k]});const N=ae.toFiniteNumber(x.headers.get("content-length")),[_,P]=l&&ZA(N,mg(QA(l),!0))||[];x=new Response(eC(x.body,tC,_,()=>{P&&P(),m&&m()}),S)}u=u||"text";let j=await gg[ae.findKey(gg,u)||"text"](x,e);return!w&&m&&m(),await new Promise((S,N)=>{EI(S,N,{data:j,headers:Gr.from(x.headers),status:x.status,statusText:x.statusText,config:e,request:g})})}catch(b){throw m&&m(),b&&b.name==="TypeError"&&/Load failed|fetch/i.test(b.message)?Object.assign(new _t("Network Error",_t.ERR_NETWORK,e,g),{cause:b.cause||b}):_t.from(b,b&&b.code,e,g)}}),ww={http:EG,xhr:aH,fetch:pH};ae.forEach(ww,(e,t)=>{if(e){try{Object.defineProperty(e,"name",{value:t})}catch{}Object.defineProperty(e,"adapterName",{value:t})}});const nC=e=>`- ${e}`,mH=e=>ae.isFunction(e)||e===null||e===!1,MI={getAdapter:e=>{e=ae.isArray(e)?e:[e];const{length:t}=e;let n,r;const s={};for(let a=0;a`adapter ${l} `+(c===!1?"is not supported by the environment":"is not available in the build"));let o=t?a.length>1?`since : +`+a.map(nC).join(` +`):" "+nC(a[0]):"as no adapter specified";throw new _t("There is no suitable adapter to dispatch the request "+o,"ERR_NOT_SUPPORT")}return r},adapters:ww};function v0(e){if(e.cancelToken&&e.cancelToken.throwIfRequested(),e.signal&&e.signal.aborted)throw new Zu(null,e)}function rC(e){return v0(e),e.headers=Gr.from(e.headers),e.data=g0.call(e,e.transformRequest),["post","put","patch"].indexOf(e.method)!==-1&&e.headers.setContentType("application/x-www-form-urlencoded",!1),MI.getAdapter(e.adapter||sp.adapter)(e).then(function(r){return v0(e),r.data=g0.call(e,e.transformResponse,r),r.headers=Gr.from(r.headers),r},function(r){return CI(r)||(v0(e),r&&r.response&&(r.response.data=g0.call(e,e.transformResponse,r.response),r.response.headers=Gr.from(r.response.headers))),Promise.reject(r)})}const II="1.9.0",Sy={};["object","boolean","number","function","string","symbol"].forEach((e,t)=>{Sy[e]=function(r){return typeof r===e||"a"+(t<1?"n ":" ")+e}});const sC={};Sy.transitional=function(t,n,r){function s(a,o){return"[Axios v"+II+"] Transitional option '"+a+"'"+o+(r?". "+r:"")}return(a,o,l)=>{if(t===!1)throw new _t(s(o," has been removed"+(n?" in "+n:"")),_t.ERR_DEPRECATED);return n&&!sC[o]&&(sC[o]=!0,console.warn(s(o," has been deprecated since v"+n+" and will be removed in the near future"))),t?t(a,o,l):!0}};Sy.spelling=function(t){return(n,r)=>(console.warn(`${r} is likely a misspelling of ${t}`),!0)};function gH(e,t,n){if(typeof e!="object")throw new _t("options must be an object",_t.ERR_BAD_OPTION_VALUE);const r=Object.keys(e);let s=r.length;for(;s-- >0;){const a=r[s],o=t[a];if(o){const l=e[a],c=l===void 0||o(l,a,e);if(c!==!0)throw new _t("option "+a+" must be "+c,_t.ERR_BAD_OPTION_VALUE);continue}if(n!==!0)throw new _t("Unknown option "+a,_t.ERR_BAD_OPTION)}}const Om={assertOptions:gH,validators:Sy},pa=Om.validators;class xl{constructor(t){this.defaults=t||{},this.interceptors={request:new XA,response:new XA}}async request(t,n){try{return await this._request(t,n)}catch(r){if(r instanceof Error){let s={};Error.captureStackTrace?Error.captureStackTrace(s):s=new Error;const a=s.stack?s.stack.replace(/^.+\n/,""):"";try{r.stack?a&&!String(r.stack).endsWith(a.replace(/^.+\n.+\n/,""))&&(r.stack+=` +`+a):r.stack=a}catch{}}throw r}}_request(t,n){typeof t=="string"?(n=n||{},n.url=t):n=t||{},n=Il(this.defaults,n);const{transitional:r,paramsSerializer:s,headers:a}=n;r!==void 0&&Om.assertOptions(r,{silentJSONParsing:pa.transitional(pa.boolean),forcedJSONParsing:pa.transitional(pa.boolean),clarifyTimeoutError:pa.transitional(pa.boolean)},!1),s!=null&&(ae.isFunction(s)?n.paramsSerializer={serialize:s}:Om.assertOptions(s,{encode:pa.function,serialize:pa.function},!0)),n.allowAbsoluteUrls!==void 0||(this.defaults.allowAbsoluteUrls!==void 0?n.allowAbsoluteUrls=this.defaults.allowAbsoluteUrls:n.allowAbsoluteUrls=!0),Om.assertOptions(n,{baseUrl:pa.spelling("baseURL"),withXsrfToken:pa.spelling("withXSRFToken")},!0),n.method=(n.method||this.defaults.method||"get").toLowerCase();let o=a&&ae.merge(a.common,a[n.method]);a&&ae.forEach(["delete","get","head","post","put","patch","common"],g=>{delete a[g]}),n.headers=Gr.concat(o,a);const l=[];let c=!0;this.interceptors.request.forEach(function(m){typeof m.runWhen=="function"&&m.runWhen(n)===!1||(c=c&&m.synchronous,l.unshift(m.fulfilled,m.rejected))});const u=[];this.interceptors.response.forEach(function(m){u.push(m.fulfilled,m.rejected)});let d,f=0,h;if(!c){const g=[rC.bind(this),void 0];for(g.unshift.apply(g,l),g.push.apply(g,u),h=g.length,d=Promise.resolve(n);f{if(!r._listeners)return;let a=r._listeners.length;for(;a-- >0;)r._listeners[a](s);r._listeners=null}),this.promise.then=s=>{let a;const o=new Promise(l=>{r.subscribe(l),a=l}).then(s);return o.cancel=function(){r.unsubscribe(a)},o},t(function(a,o,l){r.reason||(r.reason=new Zu(a,o,l),n(r.reason))})}throwIfRequested(){if(this.reason)throw this.reason}subscribe(t){if(this.reason){t(this.reason);return}this._listeners?this._listeners.push(t):this._listeners=[t]}unsubscribe(t){if(!this._listeners)return;const n=this._listeners.indexOf(t);n!==-1&&this._listeners.splice(n,1)}toAbortSignal(){const t=new AbortController,n=r=>{t.abort(r)};return this.subscribe(n),t.signal.unsubscribe=()=>this.unsubscribe(n),t.signal}static source(){let t;return{token:new qS(function(s){t=s}),cancel:t}}}function vH(e){return function(n){return e.apply(null,n)}}function yH(e){return ae.isObject(e)&&e.isAxiosError===!0}const jw={Continue:100,SwitchingProtocols:101,Processing:102,EarlyHints:103,Ok:200,Created:201,Accepted:202,NonAuthoritativeInformation:203,NoContent:204,ResetContent:205,PartialContent:206,MultiStatus:207,AlreadyReported:208,ImUsed:226,MultipleChoices:300,MovedPermanently:301,Found:302,SeeOther:303,NotModified:304,UseProxy:305,Unused:306,TemporaryRedirect:307,PermanentRedirect:308,BadRequest:400,Unauthorized:401,PaymentRequired:402,Forbidden:403,NotFound:404,MethodNotAllowed:405,NotAcceptable:406,ProxyAuthenticationRequired:407,RequestTimeout:408,Conflict:409,Gone:410,LengthRequired:411,PreconditionFailed:412,PayloadTooLarge:413,UriTooLong:414,UnsupportedMediaType:415,RangeNotSatisfiable:416,ExpectationFailed:417,ImATeapot:418,MisdirectedRequest:421,UnprocessableEntity:422,Locked:423,FailedDependency:424,TooEarly:425,UpgradeRequired:426,PreconditionRequired:428,TooManyRequests:429,RequestHeaderFieldsTooLarge:431,UnavailableForLegalReasons:451,InternalServerError:500,NotImplemented:501,BadGateway:502,ServiceUnavailable:503,GatewayTimeout:504,HttpVersionNotSupported:505,VariantAlsoNegotiates:506,InsufficientStorage:507,LoopDetected:508,NotExtended:510,NetworkAuthenticationRequired:511};Object.entries(jw).forEach(([e,t])=>{jw[t]=e});function RI(e){const t=new xl(e),n=hI(xl.prototype.request,t);return ae.extend(n,xl.prototype,t,{allOwnKeys:!0}),ae.extend(n,t,null,{allOwnKeys:!0}),n.create=function(s){return RI(Il(e,s))},n}const Fn=RI(sp);Fn.Axios=xl;Fn.CanceledError=Zu;Fn.CancelToken=qS;Fn.isCancel=CI;Fn.VERSION=II;Fn.toFormData=wy;Fn.AxiosError=_t;Fn.Cancel=Fn.CanceledError;Fn.all=function(t){return Promise.all(t)};Fn.spread=vH;Fn.isAxiosError=yH;Fn.mergeConfig=Il;Fn.AxiosHeaders=Gr;Fn.formToJSON=e=>AI(ae.isHTMLForm(e)?new FormData(e):e);Fn.getAdapter=MI.getAdapter;Fn.HttpStatusCode=jw;Fn.default=Fn;const DI="https://ai-sandbox.oliver.solutions/semblance_back/api",Ge=Fn.create({baseURL:DI,headers:{"Content-Type":"application/json"},timeout:6e5});Ge.interceptors.request.use(e=>{var n;const t=localStorage.getItem("auth_token");return t&&(e.headers.Authorization=`Bearer ${t}`),e.method==="put"&&((n=e.url)!=null&&n.includes("/focus-groups/"))&&console.log("🌐 API Request:",{method:e.method,url:e.url,baseURL:e.baseURL,fullURL:`${e.baseURL}${e.url}`,data:e.data}),e},e=>Promise.reject(e));const Sw="auth_error",xH=e=>{e!=null&&e.isPersonaCreation||(localStorage.removeItem("auth_token"),localStorage.removeItem("user"));const t=new CustomEvent(Sw,{detail:e||{}});window.dispatchEvent(t)};Ge.interceptors.response.use(e=>e,e=>{var t,n,r,s,a,o;if(e.response&&e.response.status===401){const l=e.config&&(((t=e.config.url)==null?void 0:t.includes("/personas"))||((n=e.config.url)==null?void 0:n.includes("/personas/batch"))||e.config.method&&((r=e.config.url)==null?void 0:r.startsWith("/personas")));console.log("API Error:",{url:(s=e.config)==null?void 0:s.url,method:(a=e.config)==null?void 0:a.method,isPersonaRequest:l}),l?console.warn("Authentication error in persona request, letting component handle it"):xH({source:(o=e.config)==null?void 0:o.url,isPersonaCreation:!1})}return Promise.reject(e)});const Nw={login:(e,t)=>Ge.post("/auth/login",{username:e,password:t}),register:(e,t,n)=>Ge.post("/auth/register",{username:e,email:t,password:n}),getProfile:()=>Ge.get("/auth/me")},Dn={getAll:()=>Ge.get("/personas/all"),getById:e=>Ge.get(`/personas/${e}`),create:e=>Ge.post("/personas",e),update:(e,t)=>e&&e.startsWith("local-")?(console.log("Cannot update with local ID, creating new instead:",e),Ge.post("/personas",t)):Ge.put(`/personas/${e}`,t),delete:e=>{const t=typeof e=="object"&&e!==null&&e._id||e;return console.log(`Deleting persona with ID: ${t}`),Ge.delete(`/personas/${t}`)},createBatch:e=>Ge.post("/personas/batch",e)},Xa={generate:e=>Ge.post("/ai-personas/generate",e||{},{timeout:6e5}),generateAndSave:e=>Ge.post("/ai-personas/generate-and-save",e||{},{timeout:6e5}),batchGenerate:e=>Ge.post("/ai-personas/batch-generate",e,{timeout:6e5}),batchGenerateAndSave:e=>Ge.post("/ai-personas/batch-generate-and-save",e,{timeout:6e5}),generateBasicProfiles:(e,t=5,n=.8)=>Ge.post("/ai-personas/generate-basic-profiles",{audience_brief:e,count:t,temperature:n},{timeout:6e5}),completePersona:(e,t=.7)=>Ge.post("/ai-personas/complete-persona",{basic_profile:e,temperature:t},{timeout:6e5}),completeAndSavePersona:(e,t=.7)=>Ge.post("/ai-personas/complete-and-save-persona",{basic_profile:e,temperature:t},{timeout:6e5}),generatePersonaSummary:(e,t=.7)=>Ge.post("/ai-personas/generate-persona-summary",{persona_data:e,temperature:t},{timeout:6e5}),batchGenerateWithStages:async(e,t,n=5,r=.7,s,a)=>{var o;try{console.log(`📡 API call to generate-basic-profiles with model: ${a||"gemini-2.5-pro"}`);const c=(await Ge.post("/ai-personas/generate-basic-profiles",{audience_brief:e,research_objective:t,count:n,temperature:.7,customer_data_session_id:s,llm_model:a||"gemini-2.5-pro"},{timeout:6e5})).data.profiles,u=[],d=[],f=[];console.log(`📡 API call to complete-and-save-persona with model: ${a||"gemini-2.5-pro"}`);const h=c.map(g=>Ge.post("/ai-personas/complete-and-save-persona",{basic_profile:g,temperature:r,customer_data_session_id:s,llm_model:a||"gemini-2.5-pro"},{timeout:6e5}));if((await Promise.allSettled(h)).forEach((g,m)=>{if(g.status==="fulfilled")u.push(g.value.data.persona),d.push(g.value.data.persona_id);else{const y=c[m],b={index:m,name:y.name||`Persona ${m+1}`,error:g.reason};f.push(b),console.error(`Failed to complete persona ${m+1} (${y.name||"unnamed"}):`,g.reason)}}),u.length===0&&f.length>0)throw new Error(`Failed to generate any personas. ${f.length} profile(s) failed.`);return{data:{message:`Generated and saved ${u.length} personas${f.length>0?` (${f.length} failed)`:""}`,personas:u,persona_ids:d,errors:f.length>0?f:void 0,partial_success:f.length>0&&u.length>0}}}catch(l){throw((o=l.response)==null?void 0:o.status)===504||l.code==="ECONNABORTED"?new Error("Timeout error: The server took too long to generate personas. Please try with fewer personas or try again later."):l}},enhanceAudienceBrief:(e,t,n=.7)=>Ge.post("/ai-personas/enhance-audience-brief",{audience_brief:e,research_objective:t,temperature:n},{timeout:6e5}),batchGenerateSummaries:(e,t=.7,n)=>(console.log(`📡 Frontend: API call to batch-generate-summaries with model: ${n||"gemini-2.5-pro"}`),Ge.post("/ai-personas/batch-generate-summaries",{persona_ids:e,temperature:t,llm_model:n||"gemini-2.5-pro"},{timeout:9e5})),uploadCustomerData:e=>{const t=new FormData;for(let n=0;nGe.delete(`/ai-personas/cleanup-customer-data/${e}`)},bt={getAll:()=>Ge.get("/focus-groups"),getById:e=>Ge.get(`/focus-groups/${e}`),create:e=>Ge.post("/focus-groups",e),update:(e,t)=>Ge.put(`/focus-groups/${e}`,t),delete:e=>Ge.delete(`/focus-groups/${e}`),addParticipant:(e,t)=>Ge.post(`/focus-groups/${e}/participants`,{persona_id:t}),removeParticipant:(e,t)=>Ge.delete(`/focus-groups/${e}/participants/${t}`),sendMessage:(e,t)=>Ge.post(`/focus-groups/${e}/messages`,t),getMessages:e=>Ge.get(`/focus-groups/${e}/messages`),updateMessageHighlight:(e,t,n)=>Ge.patch(`/focus-groups/${e}/messages/${t}`,{highlighted:n}),describeAsset:(e,t)=>Ge.post(`/focus-groups/${e}/describe-asset`,{asset_filename:t},{timeout:12e4}),generateDiscussionGuide:e=>Ge.post("/focus-groups/generate-discussion-guide",e,{timeout:6e5}),generateDiscussionGuideForGroup:(e,t)=>Ge.post(`/focus-groups/${e}/generate-discussion-guide`,t,{timeout:6e5}),downloadDiscussionGuide:async e=>{try{const t=await Ge.get(`/focus-groups/${e}/discussion-guide/download`,{responseType:"blob",timeout:3e4}),n=t.headers["content-disposition"];let r="discussion-guide.md";if(n){const l=n.match(/filename="([^"]+)"/);l&&(r=l[1])}const s=new Blob([t.data],{type:"text/markdown"}),a=URL.createObjectURL(s),o=document.createElement("a");return o.href=a,o.download=r,o.style.display="none",document.body.appendChild(o),o.click(),document.body.removeChild(o),URL.revokeObjectURL(a),{success:!0,filename:r}}catch(t){throw console.error("Error downloading discussion guide:",t),new Error("Failed to download discussion guide")}},createNote:(e,t)=>Ge.post(`/focus-groups/${e}/notes`,t),getNotes:e=>Ge.get(`/focus-groups/${e}/notes`),deleteNote:(e,t)=>Ge.delete(`/focus-groups/${e}/notes/${t}`),uploadAssets:(e,t)=>Ge.post(`/focus-groups/${e}/assets`,t,{headers:{"Content-Type":"multipart/form-data"},timeout:12e4}),getAssets:e=>Ge.get(`/focus-groups/${e}/assets`),getAssetUrl:(e,t)=>`${DI}/focus-groups/${e}/assets/${t}`,deleteAsset:(e,t)=>Ge.delete(`/focus-groups/${e}/assets/${t}`)},jn={generateResponse:(e,t,n,r=.7)=>Ge.post("/focus-group-ai/generate-response",{focus_group_id:e,persona_id:t,current_topic:n,temperature:r},{timeout:6e5}),generateKeyThemes:(e,t=.7)=>Ge.post("/focus-group-ai/generate-key-themes",{focus_group_id:e,temperature:t},{timeout:6e5}),getKeyThemes:e=>Ge.get(`/focus-group-ai/key-themes/${e}`),deleteKeyTheme:(e,t)=>Ge.delete(`/focus-group-ai/key-themes/${e}/${t}`),getModeratorStatus:e=>Ge.get(`/focus-group-ai/moderator/status/${e}`),advanceModeratorDiscussion:e=>Ge.post(`/focus-group-ai/moderator/advance/${e}`,{},{timeout:6e5}),setModeratorPosition:(e,t,n)=>Ge.put(`/focus-group-ai/moderator/position/${e}`,{section_id:t,item_id:n}),startAutonomousConversation:(e,t)=>Ge.post(`/focus-group-ai/autonomous/start/${e}`,{initial_prompt:t},{timeout:6e5}),stopAutonomousConversation:(e,t)=>Ge.post(`/focus-group-ai/autonomous/stop/${e}`,{reason:t}),getAutonomousConversationStatus:e=>Ge.get(`/focus-group-ai/autonomous/status/${e}`),getConversationState:e=>Ge.get(`/focus-group-ai/conversation/state/${e}`),getConversationAnalytics:e=>Ge.get(`/focus-group-ai/conversation/analytics/${e}`),makeConversationDecision:(e,t=.7,n="ai")=>Ge.post(`/focus-group-ai/conversation/decision/${e}`,{temperature:t,mode:n},{timeout:6e5}),getConversationInsights:e=>Ge.get(`/focus-group-ai/conversation/insights/${e}`,{timeout:6e5}),manualIntervention:(e,t,n,r)=>Ge.post(`/focus-group-ai/conversation/intervene/${e}`,{action:t,message:n,participant_id:r}),getReasoningHistory:e=>Ge.get(`/focus-group-ai/conversation/reasoning-history/${e}`),endSession:(e,t)=>Ge.post(`/focus-group-ai/moderator/end-session/${e}`,{reason:t||"session_ended"})},LI=v.createContext(void 0);function bH({children:e}){const[t,n]=v.useState(null),[r,s]=v.useState(null),[a,o]=v.useState(!0),l=Tn();v.useEffect(()=>{const p=g=>{const y=g.detail||{};if(y.isPersonaCreation){console.log("Ignoring auth error from persona creation",y);return}s(null),n(null),oe.error("Session expired",{description:"Please log in again"}),l("/login")};return window.addEventListener(Sw,p),()=>{window.removeEventListener(Sw,p)}},[l]),v.useEffect(()=>{const p=localStorage.getItem("auth_token"),g=localStorage.getItem("user");if(console.log("AuthContext initializing - stored data check:",{hasToken:!!p,hasUser:!!g}),p&&g)try{s(p),n(JSON.parse(g)),console.log("User session restored from localStorage")}catch(m){console.error("Failed to parse stored user data:",m),localStorage.removeItem("auth_token"),localStorage.removeItem("user")}else console.log("No stored authentication data found");o(!1)},[]),v.useEffect(()=>{if(r){console.log("Verifying token...");const p=`token_validated_${r.substring(0,10)}`;if(sessionStorage.getItem(p)==="true"&&t){console.log("Token already validated this session, skipping validation");return}Nw.getProfile().then(m=>{m&&"data"in m&&(console.log("Profile verified successfully"),n(m.data),sessionStorage.setItem(p,"true"))}).catch(m=>{m.response&&m.response.status===401?(console.error("Token invalid (401):",m),localStorage.removeItem("auth_token"),localStorage.removeItem("user"),s(null),n(null)):(console.warn("Profile validation error (not clearing token):",m),sessionStorage.setItem(p,"true"))})}else console.log("No token available, not validating profile")},[r,t]);const c=async(p,g)=>{var m,y;o(!0),console.log("Attempting login for user:",p);try{const b=await Nw.login(p,g);if(console.log("Login API response received"),!b.data.access_token)throw new Error("No access token received from server");return localStorage.setItem("auth_token",b.data.access_token),localStorage.setItem("user",JSON.stringify(b.data.user)),s(b.data.access_token),n(b.data.user),console.log("Authentication state updated"),oe.success("Login successful!"),b.data.access_token}catch(b){throw console.error("Login failed:",b),oe.error("Login failed",{description:((y=(m=b.response)==null?void 0:m.data)==null?void 0:y.message)||"Invalid username or password"}),b}finally{o(!1)}},u=()=>{localStorage.removeItem("auth_token"),localStorage.removeItem("user"),s(null),n(null),oe.info("You have been logged out")},d=!!localStorage.getItem("auth_token"),h={user:t,token:r,isLoading:a,login:c,logout:u,isAuthenticated:!!r||d};return i.jsx(LI.Provider,{value:h,children:e})}function Kl(){const e=v.useContext(LI);if(e===void 0)throw new Error("useAuth must be used within an AuthProvider");return e}function ci(){const[e,t]=v.useState(!1),n=qr(),r=Tn(),{isAuthenticated:s,logout:a}=Kl(),o=[{name:"Home",href:"/",icon:hg},{name:"Synthetic Personas",href:"/synthetic-users",icon:tr},{name:"Focus Groups",href:"/focus-groups",icon:Ma},{name:"Dashboard",href:"/dashboard",icon:gw}],l=()=>{t(!e)},c=d=>n.pathname===d,u=d=>{if(d==="/synthetic-users"){const f=new CustomEvent("syntheticUsersNavigation");window.dispatchEvent(f)}r(d)};return i.jsxs("header",{className:"fixed top-0 left-0 right-0 z-50 bg-white/80 backdrop-blur-md border-b border-slate-200/80",children:[i.jsx("div",{className:"px-4 sm:px-6 lg:px-8",children:i.jsxs("div",{className:"flex h-16 items-center justify-between",children:[i.jsx("div",{className:"flex items-center",children:i.jsx(ws,{to:"/",className:"flex items-center",children:i.jsx("span",{className:"font-sf text-2xl font-semibold text-gradient",children:"Semblance"})})}),i.jsx("nav",{className:"hidden md:block",children:i.jsxs("ul",{className:"flex items-center space-x-8",children:[o.map(d=>i.jsx("li",{children:d.href==="/"?i.jsxs(ws,{to:d.href,className:Oe("flex items-center px-1 py-2 text-sm font-medium hover-transition border-b-2",c(d.href)?"border-primary text-primary":"border-transparent text-slate-600 hover:text-slate-900 hover:border-slate-300"),children:[i.jsx(d.icon,{className:"mr-1 h-4 w-4"}),d.name]}):i.jsxs("button",{onClick:()=>u(d.href),className:Oe("flex items-center px-1 py-2 text-sm font-medium hover-transition border-b-2",c(d.href)?"border-primary text-primary":"border-transparent text-slate-600 hover:text-slate-900 hover:border-slate-300"),children:[i.jsx(d.icon,{className:"mr-1 h-4 w-4"}),d.name]})},d.name)),i.jsx("li",{children:s?i.jsxs("button",{onClick:()=>{a(),r("/login")},className:"flex items-center px-3 py-2 text-sm font-medium text-slate-600 hover:text-slate-900 button-transition rounded-md hover:bg-slate-50",children:[i.jsx(VA,{className:"mr-1 h-4 w-4"}),"Logout"]}):i.jsxs(ws,{to:"/login",className:"flex items-center px-3 py-2 text-sm font-medium text-slate-600 hover:text-slate-900 button-transition rounded-md hover:bg-slate-50",children:[i.jsx(UA,{className:"mr-1 h-4 w-4"}),"Login"]})})]})}),i.jsx("div",{className:"flex md:hidden",children:i.jsxs("button",{type:"button",className:"inline-flex items-center justify-center rounded-md p-2 text-slate-700 hover:bg-slate-100 hover:text-slate-900 button-transition",onClick:l,children:[i.jsx("span",{className:"sr-only",children:"Open main menu"}),e?i.jsx(Zs,{className:"block h-6 w-6","aria-hidden":"true"}):i.jsx(OW,{className:"block h-6 w-6","aria-hidden":"true"})]})})]})}),e&&i.jsx("div",{className:"md:hidden glass-panel animate-fade-in",children:i.jsxs("div",{className:"space-y-1 px-4 pb-3 pt-2",children:[o.map(d=>i.jsx("div",{children:d.href==="/"?i.jsxs(ws,{to:d.href,className:Oe("flex items-center rounded-md px-3 py-2 text-base font-medium button-transition",c(d.href)?"bg-primary text-white":"text-slate-600 hover:bg-slate-50 hover:text-slate-900"),onClick:()=>t(!1),children:[i.jsx(d.icon,{className:"mr-3 h-5 w-5"}),d.name]}):i.jsxs("button",{className:Oe("flex items-center rounded-md px-3 py-2 text-base font-medium button-transition w-full text-left",c(d.href)?"bg-primary text-white":"text-slate-600 hover:bg-slate-50 hover:text-slate-900"),onClick:()=>{t(!1),u(d.href)},children:[i.jsx(d.icon,{className:"mr-3 h-5 w-5"}),d.name]})},d.name)),s?i.jsxs("button",{onClick:()=>{a(),t(!1),r("/login")},className:"flex items-center rounded-md px-3 py-2 text-base font-medium button-transition text-slate-600 hover:bg-slate-50 hover:text-slate-900 w-full",children:[i.jsx(VA,{className:"mr-3 h-5 w-5"}),"Logout"]}):i.jsxs(ws,{to:"/login",className:"flex items-center rounded-md px-3 py-2 text-base font-medium button-transition text-slate-600 hover:bg-slate-50 hover:text-slate-900",onClick:()=>t(!1),children:[i.jsx(UA,{className:"mr-3 h-5 w-5"}),"Login"]})]})})]})}const aC=e=>typeof e=="boolean"?`${e}`:e===0?"0":e,iC=jt,KS=(e,t)=>n=>{var r;if((t==null?void 0:t.variants)==null)return iC(e,n==null?void 0:n.class,n==null?void 0:n.className);const{variants:s,defaultVariants:a}=t,o=Object.keys(s).map(u=>{const d=n==null?void 0:n[u],f=a==null?void 0:a[u];if(d===null)return null;const h=aC(d)||aC(f);return s[u][h]}),l=n&&Object.entries(n).reduce((u,d)=>{let[f,h]=d;return h===void 0||(u[f]=h),u},{}),c=t==null||(r=t.compoundVariants)===null||r===void 0?void 0:r.reduce((u,d)=>{let{class:f,className:h,...p}=d;return Object.entries(p).every(g=>{let[m,y]=g;return Array.isArray(y)?y.includes({...a,...l}[m]):{...a,...l}[m]===y})?[...u,f,h]:u},[]);return iC(e,o,c,n==null?void 0:n.class,n==null?void 0:n.className)},XS=KS("inline-flex items-center justify-center gap-2 whitespace-nowrap rounded-md text-sm font-medium ring-offset-background transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 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 hover:bg-primary/90",destructive:"bg-destructive text-destructive-foreground hover:bg-destructive/90",outline:"border border-input bg-background hover:bg-accent hover:text-accent-foreground",secondary:"bg-secondary text-secondary-foreground hover:bg-secondary/80",ghost:"hover:bg-accent hover:text-accent-foreground",link:"text-primary underline-offset-4 hover:underline"},size:{default:"h-10 px-4 py-2",sm:"h-9 rounded-md px-3",lg:"h-11 rounded-md px-8",icon:"h-10 w-10"}},defaultVariants:{variant:"default",size:"default"}}),te=v.forwardRef(({className:e,variant:t,size:n,asChild:r=!1,...s},a)=>{const o=r?ka:"button";return i.jsx(o,{className:Oe(XS({variant:t,size:n,className:e})),ref:a,...s})});te.displayName="Button";function wH(){return i.jsxs("div",{className:"relative isolate overflow-hidden",children:[i.jsx("div",{className:"absolute inset-x-0 top-[-10rem] -z-10 transform-gpu overflow-hidden blur-3xl sm:top-[-20rem]","aria-hidden":"true",children:i.jsx("div",{className:"relative left-[calc(50%-11rem)] aspect-[1155/678] w-[36.125rem] -translate-x-1/2 rotate-[30deg] bg-gradient-to-tr from-primary to-blue-400 opacity-20 sm:left-[calc(50%-30rem)] sm:w-[72.1875rem]",style:{clipPath:"polygon(74.1% 44.1%, 100% 61.6%, 97.5% 26.9%, 85.5% 0.1%, 80.7% 2%, 72.5% 32.5%, 60.2% 62.4%, 52.4% 68.1%, 47.5% 58.3%, 45.2% 34.5%, 27.5% 76.7%, 0.1% 64.9%, 17.9% 100%, 27.6% 76.8%, 76.1% 97.7%, 74.1% 44.1%)"}})}),i.jsxs("div",{className:"mx-auto max-w-7xl px-6 py-24 sm:py-32 lg:flex lg:items-center lg:gap-x-10 lg:px-8 lg:py-40",children:[i.jsxs("div",{className:"mx-auto max-w-2xl lg:mx-0 lg:flex-auto",children:[i.jsx("div",{className:"flex",children:i.jsxs("div",{className:"relative flex items-center gap-x-4 rounded-full px-4 py-1 text-sm leading-6 text-gray-600 ring-1 ring-gray-900/10 hover:ring-gray-900/20",children:[i.jsx("span",{className:"font-semibold text-primary",children:"New"}),i.jsx("span",{className:"h-4 w-px bg-gray-900/10","aria-hidden":"true"}),i.jsx("span",{children:"Introducing AI-driven focus groups"})]})}),i.jsxs("h1",{className:"mt-10 max-w-lg text-4xl font-sf font-bold tracking-tight text-gray-900 sm:text-6xl",children:["Research with ",i.jsx("span",{className:"text-gradient",children:"synthetic personas"})]}),i.jsx("p",{className:"mt-6 text-lg leading-8 text-gray-600",children:"Conduct research using AI-powered synthetic personas and autonomous focus groups. Gain valuable insights without the limitations of traditional research methods."}),i.jsxs("div",{className:"mt-10 flex items-center gap-x-6",children:[i.jsx(ws,{to:"/synthetic-users",children:i.jsxs(te,{className:"px-6 py-6 text-base hover:shadow-lg hover:translate-y-[-2px] button-transition",children:["Create synthetic personas",i.jsx(gs,{className:"ml-2 h-4 w-4"})]})}),i.jsxs(ws,{to:"/focus-groups",className:"text-sm font-semibold leading-6 text-gray-900 hover:text-primary button-transition",children:["Set up focus groups ",i.jsx("span",{"aria-hidden":"true",children:"→"})]})]})]}),i.jsx("div",{className:"mt-16 sm:mt-24 lg:mt-0 lg:flex-shrink-0 lg:flex-grow",children:i.jsxs("div",{className:"relative glass-card mx-auto w-[350px] h-[450px] rounded-2xl shadow-xl overflow-hidden animate-float",children:[i.jsxs("div",{className:"absolute top-4 left-4 right-4 h-12 bg-white/70 backdrop-blur-sm rounded-lg flex items-center px-4",children:[i.jsx("div",{className:"h-3 w-3 rounded-full bg-red-400 mr-2"}),i.jsx("div",{className:"h-3 w-3 rounded-full bg-yellow-400 mr-2"}),i.jsx("div",{className:"h-3 w-3 rounded-full bg-green-400 mr-2"}),i.jsx("div",{className:"text-xs text-gray-500 ml-2",children:"Shampoo Brand Perception"})]}),i.jsx("div",{className:"absolute top-20 left-4 right-4 bottom-4 bg-gray-50 rounded-lg overflow-hidden",children:[1,2,3,4].map(e=>i.jsx("div",{className:`flex ${e%2===0?"justify-end":"justify-start"} px-3 py-2`,children:i.jsxs("div",{className:`max-w-[70%] rounded-lg px-3 py-2 text-xs ${e%2===0?"bg-primary text-white":"bg-gray-200 text-gray-800"}`,children:[e===1&&"What qualities do you look for in a premium shampoo brand?",e===2&&"I value natural ingredients and a brand that feels luxurious but still eco-friendly.",e===3&&"How important is fragrance in your shampoo selection?",e===4&&"Very important - it affects my mood and how I feel about the product throughout the day."]})},e))})]})})]}),i.jsx("div",{className:"absolute inset-x-0 bottom-[-10rem] -z-10 transform-gpu overflow-hidden blur-3xl sm:bottom-[-20rem]","aria-hidden":"true",children:i.jsx("div",{className:"relative left-[calc(50%+11rem)] aspect-[1155/678] w-[36.125rem] -translate-x-1/2 rotate-[30deg] bg-gradient-to-tr from-blue-400 to-primary opacity-20 sm:left-[calc(50%+30rem)] sm:w-[72.1875rem]",style:{clipPath:"polygon(74.1% 44.1%, 100% 61.6%, 97.5% 26.9%, 85.5% 0.1%, 80.7% 2%, 72.5% 32.5%, 60.2% 62.4%, 52.4% 68.1%, 47.5% 58.3%, 45.2% 34.5%, 27.5% 76.7%, 0.1% 64.9%, 17.9% 100%, 27.6% 76.8%, 76.1% 97.7%, 74.1% 44.1%)"}})})]})}function rc({title:e,description:t,icon:n,className:r}){return i.jsxs("div",{className:Oe("relative group glass-card rounded-xl overflow-hidden p-6 hover:shadow-lg hover:translate-y-[-4px] button-transition",r),children:[i.jsx("div",{className:"absolute inset-0 bg-gradient-to-r from-primary/5 to-blue-400/5 opacity-0 group-hover:opacity-100 transition-opacity duration-300"}),i.jsxs("div",{className:"relative",children:[i.jsx("div",{className:"rounded-full bg-primary/10 w-12 h-12 flex items-center justify-center mb-4",children:i.jsx(n,{className:"h-6 w-6 text-primary"})}),i.jsx("h3",{className:"font-sf text-lg font-semibold mb-2",children:e}),i.jsx("p",{className:"text-gray-600 text-sm",children:t})]})]})}const jH=()=>(Kl(),Tn(),i.jsxs("div",{className:"min-h-screen overflow-hidden bg-background",children:[i.jsx(ci,{}),i.jsx("main",{children:i.jsxs("div",{className:"pt-16",children:[i.jsx(wH,{}),i.jsx("section",{className:"py-20 px-6 bg-white",children:i.jsxs("div",{className:"max-w-7xl mx-auto",children:[i.jsxs("div",{className:"text-center mb-16",children:[i.jsx("h2",{className:"text-3xl font-sf font-bold sm:text-4xl",children:"Why Synthetic Personas?"}),i.jsx("p",{className:"mt-4 text-lg text-gray-600 max-w-3xl mx-auto",children:"Our platform combines advanced AI with intuitive design to help researchers gain deeper insights faster than traditional methods."})]}),i.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-8",children:[i.jsx(rc,{title:"Scalable Research",description:"Create and test with thousands of synthetic personas, each with unique demographic profiles and behaviors.",icon:tr}),i.jsx(rc,{title:"AI-Driven Focus Groups",description:"Run autonomous focus groups moderated by AI that adapts to participant responses in real-time.",icon:Ma}),i.jsx(rc,{title:"Instant Analysis",description:"Generate comprehensive reports and visualizations that highlight key insights and patterns.",icon:gw}),i.jsx(rc,{title:"Diverse Perspectives",description:"Access synthetic personas from various backgrounds, ensuring representation across age, gender, and location.",icon:tr}),i.jsx(rc,{title:"Dynamic Discussions",description:"AI moderators guide conversations naturally, following up on interesting points without bias.",icon:DW}),i.jsx(rc,{title:"Comprehensive Reporting",description:"Export detailed reports with sentiment analysis, key themes, and actionable recommendations.",icon:gw})]})]})}),i.jsx("section",{className:"py-20 px-6 bg-gradient-to-b from-white to-slate-50",children:i.jsxs("div",{className:"max-w-7xl mx-auto",children:[i.jsxs("div",{className:"text-center mb-16",children:[i.jsx("h2",{className:"text-3xl font-sf font-bold sm:text-4xl",children:"How It Works"}),i.jsx("p",{className:"mt-4 text-lg text-gray-600 max-w-3xl mx-auto",children:"Just three simple steps to gather valuable insights from synthetic personas."})]}),i.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-3 gap-8",children:[i.jsxs("div",{className:"text-center p-6",children:[i.jsx("div",{className:"rounded-full bg-primary/10 w-16 h-16 flex items-center justify-center mx-auto mb-4",children:i.jsx("span",{className:"text-2xl font-bold text-primary",children:"1"})}),i.jsx("h3",{className:"text-xl font-sf font-semibold mb-3",children:"Create Synthetic Personas"}),i.jsx("p",{className:"text-gray-600",children:"Define your target audience with customizable demographic profiles and personality traits."})]}),i.jsxs("div",{className:"text-center p-6",children:[i.jsx("div",{className:"rounded-full bg-primary/10 w-16 h-16 flex items-center justify-center mx-auto mb-4",children:i.jsx("span",{className:"text-2xl font-bold text-primary",children:"2"})}),i.jsx("h3",{className:"text-xl font-sf font-semibold mb-3",children:"Set Up Focus Groups"}),i.jsx("p",{className:"text-gray-600",children:"Configure your research objectives, topics, and parameters for the AI moderator."})]}),i.jsxs("div",{className:"text-center p-6",children:[i.jsx("div",{className:"rounded-full bg-primary/10 w-16 h-16 flex items-center justify-center mx-auto mb-4",children:i.jsx("span",{className:"text-2xl font-bold text-primary",children:"3"})}),i.jsx("h3",{className:"text-xl font-sf font-semibold mb-3",children:"Analyze Results"}),i.jsx("p",{className:"text-gray-600",children:"Review comprehensive visual reports and actionable insights from your synthetic research."})]})]}),i.jsx("div",{className:"text-center mt-12",children:i.jsx(ws,{to:"synthetic-users",className:"inline-flex items-center justify-center px-6 py-3 border border-transparent text-base font-medium rounded-md text-white bg-primary hover:bg-primary/90 button-transition",children:"Get Started"})})]})}),i.jsxs("footer",{className:"bg-white py-12 px-6",children:[i.jsxs("div",{className:"max-w-7xl mx-auto flex flex-col md:flex-row justify-between items-center",children:[i.jsxs("div",{className:"mb-6 md:mb-0",children:[i.jsx("span",{className:"text-xl font-sf font-semibold text-gradient",children:"Semblance"}),i.jsx("p",{className:"text-sm text-gray-500 mt-2",children:"AI-powered synthetic persona research"})]}),i.jsxs("div",{className:"flex flex-col md:flex-row gap-8",children:[i.jsxs("div",{children:[i.jsx("h3",{className:"text-sm font-semibold text-gray-900 mb-3",children:"Platform"}),i.jsxs("ul",{className:"space-y-2",children:[i.jsx("li",{children:i.jsx(ws,{to:"/",className:"text-sm text-gray-600 hover:text-primary button-transition",children:"Home"})}),i.jsx("li",{children:i.jsx(ws,{to:"/synthetic-users",className:"text-sm text-gray-600 hover:text-primary button-transition",children:"Synthetic Personas"})}),i.jsx("li",{children:i.jsx(ws,{to:"/focus-groups",className:"text-sm text-gray-600 hover:text-primary button-transition",children:"Focus Groups"})}),i.jsx("li",{children:i.jsx(ws,{to:"/dashboard",className:"text-sm text-gray-600 hover:text-primary button-transition",children:"Dashboard"})})]})]}),i.jsxs("div",{children:[i.jsx("h3",{className:"text-sm font-semibold text-gray-900 mb-3",children:"Company"}),i.jsxs("ul",{className:"space-y-2",children:[i.jsx("li",{children:i.jsx("a",{href:"#",className:"text-sm text-gray-600 hover:text-primary button-transition",children:"About"})}),i.jsx("li",{children:i.jsx("a",{href:"#",className:"text-sm text-gray-600 hover:text-primary button-transition",children:"Blog"})}),i.jsx("li",{children:i.jsx("a",{href:"#",className:"text-sm text-gray-600 hover:text-primary button-transition",children:"Careers"})}),i.jsx("li",{children:i.jsx("a",{href:"#",className:"text-sm text-gray-600 hover:text-primary button-transition",children:"Contact"})})]})]}),i.jsxs("div",{children:[i.jsx("h3",{className:"text-sm font-semibold text-gray-900 mb-3",children:"Legal"}),i.jsxs("ul",{className:"space-y-2",children:[i.jsx("li",{children:i.jsx("a",{href:"#",className:"text-sm text-gray-600 hover:text-primary button-transition",children:"Privacy"})}),i.jsx("li",{children:i.jsx("a",{href:"#",className:"text-sm text-gray-600 hover:text-primary button-transition",children:"Terms"})}),i.jsx("li",{children:i.jsx("a",{href:"#",className:"text-sm text-gray-600 hover:text-primary button-transition",children:"Security"})})]})]})]})]}),i.jsx("div",{className:"max-w-7xl mx-auto mt-8 pt-8 border-t border-gray-200",children:i.jsxs("p",{className:"text-sm text-gray-500 text-center",children:["© ",new Date().getFullYear()," Semblance. All rights reserved."]})})]})]})})]})),SH=()=>{const e=qr(),t=Tn();v.useEffect(()=>{console.error("404 Error: User attempted to access non-existent route:",e.pathname)},[e.pathname]);const n=e.pathname.startsWith("/synthetic-users/"),s=new URLSearchParams(e.search).get("fromReview")==="true";return i.jsx("div",{className:"min-h-screen flex items-center justify-center bg-gray-100",children:i.jsxs("div",{className:"text-center p-8 max-w-md bg-white rounded-lg shadow-md",children:[i.jsx("h1",{className:"text-4xl font-bold mb-4",children:"404"}),n?i.jsxs(i.Fragment,{children:[i.jsx("p",{className:"text-xl text-gray-600 mb-4",children:"Persona Not Found"}),i.jsx("p",{className:"text-gray-500 mb-6",children:"The persona you're looking for may have been removed or doesn't exist."}),s?i.jsx(te,{onClick:()=>t("/synthetic-users?mode=create&tab=ai&step=review"),className:"mb-2 w-full",children:"Return to Review Page"}):i.jsx(te,{onClick:()=>t("/synthetic-users"),className:"mb-2 w-full",children:"View All Personas"})]}):i.jsxs(i.Fragment,{children:[i.jsx("p",{className:"text-xl text-gray-600 mb-4",children:"Oops! Page not found"}),i.jsx("p",{className:"text-gray-500 mb-6",children:"The page you're looking for doesn't exist or has been moved."})]}),i.jsx(te,{variant:"outline",onClick:()=>t("/"),className:"w-full",children:"Return to Home"})]})})};function NH(e,t=[]){let n=[];function r(a,o){const l=v.createContext(o),c=n.length;n=[...n,o];function u(f){const{scope:h,children:p,...g}=f,m=(h==null?void 0:h[e][c])||l,y=v.useMemo(()=>g,Object.values(g));return i.jsx(m.Provider,{value:y,children:p})}function d(f,h){const p=(h==null?void 0:h[e][c])||l,g=v.useContext(p);if(g)return g;if(o!==void 0)return o;throw new Error(`\`${f}\` must be used within \`${a}\``)}return u.displayName=a+"Provider",[u,d]}const s=()=>{const a=n.map(o=>v.createContext(o));return function(l){const c=(l==null?void 0:l[e])||a;return v.useMemo(()=>({[`__scope${e}`]:{...l,[e]:c}}),[l,c])}};return s.scopeName=e,[r,_H(s,...t)]}function _H(...e){const t=e[0];if(e.length===1)return t;const n=()=>{const r=e.map(s=>({useScope:s(),scopeName:s.scopeName}));return function(a){const o=r.reduce((l,{useScope:c,scopeName:u})=>{const f=c(a)[`__scope${u}`];return{...l,...f}},{});return v.useMemo(()=>({[`__scope${t.scopeName}`]:o}),[o])}};return n.scopeName=t.scopeName,n}var YS="Progress",ZS=100,[PH,kPe]=NH(YS),[AH,CH]=PH(YS),FI=v.forwardRef((e,t)=>{const{__scopeProgress:n,value:r=null,max:s,getValueLabel:a=EH,...o}=e;(s||s===0)&&!oC(s)&&console.error(OH(`${s}`,"Progress"));const l=oC(s)?s:ZS;r!==null&&!lC(r,l)&&console.error(kH(`${r}`,"Progress"));const c=lC(r,l)?r:null,u=vg(c)?a(c,l):void 0;return i.jsx(AH,{scope:n,value:c,max:l,children:i.jsx(Ye.div,{"aria-valuemax":l,"aria-valuemin":0,"aria-valuenow":vg(c)?c:void 0,"aria-valuetext":u,role:"progressbar","data-state":UI(c,l),"data-value":c??void 0,"data-max":l,...o,ref:t})})});FI.displayName=YS;var BI="ProgressIndicator",zI=v.forwardRef((e,t)=>{const{__scopeProgress:n,...r}=e,s=CH(BI,n);return i.jsx(Ye.div,{"data-state":UI(s.value,s.max),"data-value":s.value??void 0,"data-max":s.max,...r,ref:t})});zI.displayName=BI;function EH(e,t){return`${Math.round(e/t*100)}%`}function UI(e,t){return e==null?"indeterminate":e===t?"complete":"loading"}function vg(e){return typeof e=="number"}function oC(e){return vg(e)&&!isNaN(e)&&e>0}function lC(e,t){return vg(e)&&!isNaN(e)&&e<=t&&e>=0}function OH(e,t){return`Invalid prop \`max\` of value \`${e}\` supplied to \`${t}\`. Only numbers greater than 0 are valid max values. Defaulting to \`${ZS}\`.`}function kH(e,t){return`Invalid prop \`value\` of value \`${e}\` supplied to \`${t}\`. The \`value\` prop must be: - a positive number - - less than the value passed to \`max\` (or ${GS} if no \`max\` prop is set) + - less than the value passed to \`max\` (or ${ZS} if no \`max\` prop is set) - \`null\` or \`undefined\` if the progress is indeterminate. -Defaulting to \`null\`.`}var FI=II,PG=DI;const al=v.forwardRef(({className:e,value:t,...n},r)=>i.jsx(FI,{ref:r,className:Me("relative h-4 w-full overflow-hidden rounded-full bg-secondary",e),...n,children:i.jsx(PG,{className:"h-full w-full flex-1 bg-primary transition-all",style:{transform:`translateX(-${100-(t||0)}%)`}})}));al.displayName=FI.displayName;var sp=e=>e.type==="checkbox",il=e=>e instanceof Date,_r=e=>e==null;const BI=e=>typeof e=="object";var kn=e=>!_r(e)&&!Array.isArray(e)&&BI(e)&&!il(e),zI=e=>kn(e)&&e.target?sp(e.target)?e.target.checked:e.target.value:e,AG=e=>e.substring(0,e.search(/\.\d+(\.|$)/))||e,UI=(e,t)=>e.has(AG(t)),CG=e=>{const t=e.constructor&&e.constructor.prototype;return kn(t)&&t.hasOwnProperty("isPrototypeOf")},qS=typeof window<"u"&&typeof window.HTMLElement<"u"&&typeof document<"u";function Ir(e){let t;const n=Array.isArray(e);if(e instanceof Date)t=new Date(e);else if(e instanceof Set)t=new Set(e);else if(!(qS&&(e instanceof Blob||e instanceof FileList))&&(n||kn(e)))if(t=n?[]:{},!n&&!CG(e))t=e;else for(const r in e)e.hasOwnProperty(r)&&(t[r]=Ir(e[r]));else return e;return t}var jy=e=>Array.isArray(e)?e.filter(Boolean):[],Sn=e=>e===void 0,$e=(e,t,n)=>{if(!t||!kn(e))return n;const r=jy(t.split(/[,[\].]+?/)).reduce((s,a)=>_r(s)?s:s[a],e);return Sn(r)||r===e?Sn(e[t])?n:e[t]:r},gs=e=>typeof e=="boolean",KS=e=>/^\w*$/.test(e),VI=e=>jy(e.replace(/["|']|\]/g,"").split(/\.|\[/)),Kt=(e,t,n)=>{let r=-1;const s=KS(t)?[t]:VI(t),a=s.length,o=a-1;for(;++rE.useContext(WI),EG=e=>{const{children:t,...n}=e;return E.createElement(WI.Provider,{value:n},t)};var HI=(e,t,n,r=!0)=>{const s={defaultValues:t._defaultValues};for(const a in e)Object.defineProperty(s,a,{get:()=>{const o=a;return t._proxyFormState[o]!==Hs.all&&(t._proxyFormState[o]=!r||Hs.all),n&&(n[o]=!0),e[o]}});return s},Rr=e=>kn(e)&&!Object.keys(e).length,GI=(e,t,n,r)=>{n(e);const{name:s,...a}=e;return Rr(a)||Object.keys(a).length>=Object.keys(t).length||Object.keys(a).find(o=>t[o]===(!r||Hs.all))},cf=e=>Array.isArray(e)?e:[e],qI=(e,t,n)=>!e||!t||e===t||cf(e).some(r=>r&&(n?r===t:r.startsWith(t)||t.startsWith(r)));function XS(e){const t=E.useRef(e);t.current=e,E.useEffect(()=>{const n=!e.disabled&&t.current.subject&&t.current.subject.subscribe({next:t.current.next});return()=>{n&&n.unsubscribe()}},[e.disabled])}function OG(e){const t=Sy(),{control:n=t.control,disabled:r,name:s,exact:a}=e||{},[o,l]=E.useState(n._formState),c=E.useRef(!0),u=E.useRef({isDirty:!1,isLoading:!1,dirtyFields:!1,touchedFields:!1,validatingFields:!1,isValidating:!1,isValid:!1,errors:!1}),d=E.useRef(s);return d.current=s,XS({disabled:r,next:f=>c.current&&qI(d.current,f.name,a)&&GI(f,u.current,n._updateFormState)&&l({...n._formState,...f}),subject:n._subjects.state}),E.useEffect(()=>(c.current=!0,u.current.isValid&&n._updateValid(!0),()=>{c.current=!1}),[n]),HI(o,n,u.current,!1)}var ja=e=>typeof e=="string",KI=(e,t,n,r,s)=>ja(e)?(r&&t.watch.add(e),$e(n,e,s)):Array.isArray(e)?e.map(a=>(r&&t.watch.add(a),$e(n,a))):(r&&(t.watchAll=!0),n);function kG(e){const t=Sy(),{control:n=t.control,name:r,defaultValue:s,disabled:a,exact:o}=e||{},l=E.useRef(r);l.current=r,XS({disabled:a,subject:n._subjects.values,next:d=>{qI(l.current,d.name,o)&&u(Ir(KI(l.current,n._names,d.values||n._formValues,!1,s)))}});const[c,u]=E.useState(n._getWatch(r,s));return E.useEffect(()=>n._removeUnmounted()),c}function TG(e){const t=Sy(),{name:n,disabled:r,control:s=t.control,shouldUnregister:a}=e,o=UI(s._names.array,n),l=kG({control:s,name:n,defaultValue:$e(s._formValues,n,$e(s._defaultValues,n,e.defaultValue)),exact:!0}),c=OG({control:s,name:n,exact:!0}),u=E.useRef(s.register(n,{...e.rules,value:l,...gs(e.disabled)?{disabled:e.disabled}:{}}));return E.useEffect(()=>{const d=s._options.shouldUnregister||a,f=(h,p)=>{const g=$e(s._fields,h);g&&g._f&&(g._f.mount=p)};if(f(n,!0),d){const h=Ir($e(s._options.defaultValues,n));Kt(s._defaultValues,n,h),Sn($e(s._formValues,n))&&Kt(s._formValues,n,h)}return()=>{(o?d&&!s._state.action:d)?s.unregister(n):f(n,!1)}},[n,s,o,a]),E.useEffect(()=>{$e(s._fields,n)&&s._updateDisabledField({disabled:r,fields:s._fields,name:n,value:$e(s._fields,n)._f.value})},[r,n,s]),{field:{name:n,value:l,...gs(r)||c.disabled?{disabled:c.disabled||r}:{},onChange:E.useCallback(d=>u.current.onChange({target:{value:zI(d),name:n},type:gg.CHANGE}),[n]),onBlur:E.useCallback(()=>u.current.onBlur({target:{value:$e(s._formValues,n),name:n},type:gg.BLUR}),[n,s]),ref:E.useCallback(d=>{const f=$e(s._fields,n);f&&d&&(f._f.ref={focus:()=>d.focus(),select:()=>d.select(),setCustomValidity:h=>d.setCustomValidity(h),reportValidity:()=>d.reportValidity()})},[s._fields,n])},formState:c,fieldState:Object.defineProperties({},{invalid:{enumerable:!0,get:()=>!!$e(c.errors,n)},isDirty:{enumerable:!0,get:()=>!!$e(c.dirtyFields,n)},isTouched:{enumerable:!0,get:()=>!!$e(c.touchedFields,n)},isValidating:{enumerable:!0,get:()=>!!$e(c.validatingFields,n)},error:{enumerable:!0,get:()=>$e(c.errors,n)}})}}const $G=e=>e.render(TG(e));var XI=(e,t,n,r,s)=>t?{...n[e],types:{...n[e]&&n[e].types?n[e].types:{},[r]:s||!0}}:{},sC=e=>({isOnSubmit:!e||e===Hs.onSubmit,isOnBlur:e===Hs.onBlur,isOnChange:e===Hs.onChange,isOnAll:e===Hs.all,isOnTouch:e===Hs.onTouched}),aC=(e,t,n)=>!n&&(t.watchAll||t.watch.has(e)||[...t.watch].some(r=>e.startsWith(r)&&/^\.\w+/.test(e.slice(r.length))));const uf=(e,t,n,r)=>{for(const s of n||Object.keys(e)){const a=$e(e,s);if(a){const{_f:o,...l}=a;if(o){if(o.refs&&o.refs[0]&&t(o.refs[0],s)&&!r)return!0;if(o.ref&&t(o.ref,o.name)&&!r)return!0;if(uf(l,t))break}else if(kn(l)&&uf(l,t))break}}};var MG=(e,t,n)=>{const r=cf($e(e,n));return Kt(r,"root",t[n]),Kt(e,n,r),e},YS=e=>e.type==="file",ti=e=>typeof e=="function",vg=e=>{if(!qS)return!1;const t=e?e.ownerDocument:0;return e instanceof(t&&t.defaultView?t.defaultView.HTMLElement:HTMLElement)},Om=e=>ja(e),ZS=e=>e.type==="radio",yg=e=>e instanceof RegExp;const iC={value:!1,isValid:!1},oC={value:!0,isValid:!0};var YI=e=>{if(Array.isArray(e)){if(e.length>1){const t=e.filter(n=>n&&n.checked&&!n.disabled).map(n=>n.value);return{value:t,isValid:!!t.length}}return e[0].checked&&!e[0].disabled?e[0].attributes&&!Sn(e[0].attributes.value)?Sn(e[0].value)||e[0].value===""?oC:{value:e[0].value,isValid:!0}:oC:iC}return iC};const lC={isValid:!1,value:null};var ZI=e=>Array.isArray(e)?e.reduce((t,n)=>n&&n.checked&&!n.disabled?{isValid:!0,value:n.value}:t,lC):lC;function cC(e,t,n="validate"){if(Om(e)||Array.isArray(e)&&e.every(Om)||gs(e)&&!e)return{type:n,message:Om(e)?e:"",ref:t}}var sc=e=>kn(e)&&!yg(e)?e:{value:e,message:""},uC=async(e,t,n,r,s)=>{const{ref:a,refs:o,required:l,maxLength:c,minLength:u,min:d,max:f,pattern:h,validate:p,name:g,valueAsNumber:m,mount:y,disabled:b}=e._f,x=$e(t,g);if(!y||b)return{};const w=o?o[0]:a,j=A=>{r&&w.reportValidity&&(w.setCustomValidity(gs(A)?"":A||""),w.reportValidity())},S={},N=ZS(a),_=sp(a),P=N||_,k=(m||YS(a))&&Sn(a.value)&&Sn(x)||vg(a)&&a.value===""||x===""||Array.isArray(x)&&!x.length,O=XI.bind(null,g,n,S),M=(A,$,L,H=Va.maxLength,D=Va.minLength)=>{const V=A?$:L;S[g]={type:A?H:D,message:V,ref:a,...O(A?H:D,V)}};if(s?!Array.isArray(x)||!x.length:l&&(!P&&(k||_r(x))||gs(x)&&!x||_&&!YI(o).isValid||N&&!ZI(o).isValid)){const{value:A,message:$}=Om(l)?{value:!!l,message:l}:sc(l);if(A&&(S[g]={type:Va.required,message:$,ref:w,...O(Va.required,$)},!n))return j($),S}if(!k&&(!_r(d)||!_r(f))){let A,$;const L=sc(f),H=sc(d);if(!_r(x)&&!isNaN(x)){const D=a.valueAsNumber||x&&+x;_r(L.value)||(A=D>L.value),_r(H.value)||($=Dnew Date(new Date().toDateString()+" "+q),T=a.type=="time",F=a.type=="week";ja(L.value)&&x&&(A=T?V(x)>V(L.value):F?x>L.value:D>new Date(L.value)),ja(H.value)&&x&&($=T?V(x)+A.value,H=!_r($.value)&&x.length<+$.value;if((L||H)&&(M(L,A.message,$.message),!n))return j(S[g].message),S}if(h&&!k&&ja(x)){const{value:A,message:$}=sc(h);if(yg(A)&&!x.match(A)&&(S[g]={type:Va.pattern,message:$,ref:a,...O(Va.pattern,$)},!n))return j($),S}if(p){if(ti(p)){const A=await p(x,t),$=cC(A,w);if($&&(S[g]={...$,...O(Va.validate,$.message)},!n))return j($.message),S}else if(kn(p)){let A={};for(const $ in p){if(!Rr(A)&&!n)break;const L=cC(await p[$](x,t),w,$);L&&(A={...L,...O($,L.message)},j(L.message),n&&(S[g]=A))}if(!Rr(A)&&(S[g]={ref:w,...A},!n))return S}}return j(!0),S};function IG(e,t){const n=t.slice(0,-1).length;let r=0;for(;r{let e=[];return{get observers(){return e},next:s=>{for(const a of e)a.next&&a.next(s)},subscribe:s=>(e.push(s),{unsubscribe:()=>{e=e.filter(a=>a!==s)}}),unsubscribe:()=>{e=[]}}},Sw=e=>_r(e)||!BI(e);function Vi(e,t){if(Sw(e)||Sw(t))return e===t;if(il(e)&&il(t))return e.getTime()===t.getTime();const n=Object.keys(e),r=Object.keys(t);if(n.length!==r.length)return!1;for(const s of n){const a=e[s];if(!r.includes(s))return!1;if(s!=="ref"){const o=t[s];if(il(a)&&il(o)||kn(a)&&kn(o)||Array.isArray(a)&&Array.isArray(o)?!Vi(a,o):a!==o)return!1}}return!0}var QI=e=>e.type==="select-multiple",DG=e=>ZS(e)||sp(e),g0=e=>vg(e)&&e.isConnected,JI=e=>{for(const t in e)if(ti(e[t]))return!0;return!1};function xg(e,t={}){const n=Array.isArray(e);if(kn(e)||n)for(const r in e)Array.isArray(e[r])||kn(e[r])&&!JI(e[r])?(t[r]=Array.isArray(e[r])?[]:{},xg(e[r],t[r])):_r(e[r])||(t[r]=!0);return t}function eR(e,t,n){const r=Array.isArray(e);if(kn(e)||r)for(const s in e)Array.isArray(e[s])||kn(e[s])&&!JI(e[s])?Sn(t)||Sw(n[s])?n[s]=Array.isArray(e[s])?xg(e[s],[]):{...xg(e[s])}:eR(e[s],_r(t)?{}:t[s],n[s]):n[s]=!Vi(e[s],t[s]);return n}var Ed=(e,t)=>eR(e,t,xg(t)),tR=(e,{valueAsNumber:t,valueAsDate:n,setValueAs:r})=>Sn(e)?e:t?e===""?NaN:e&&+e:n&&ja(e)?new Date(e):r?r(e):e;function v0(e){const t=e.ref;if(!(e.refs?e.refs.every(n=>n.disabled):t.disabled))return YS(t)?t.files:ZS(t)?ZI(e.refs).value:QI(t)?[...t.selectedOptions].map(({value:n})=>n):sp(t)?YI(e.refs).value:tR(Sn(t.value)?e.ref.value:t.value,e)}var LG=(e,t,n,r)=>{const s={};for(const a of e){const o=$e(t,a);o&&Kt(s,a,o._f)}return{criteriaMode:n,names:[...e],fields:s,shouldUseNativeValidation:r}},Od=e=>Sn(e)?e:yg(e)?e.source:kn(e)?yg(e.value)?e.value.source:e.value:e;const dC="AsyncFunction";var FG=e=>(!e||!e.validate)&&!!(ti(e.validate)&&e.validate.constructor.name===dC||kn(e.validate)&&Object.values(e.validate).find(t=>t.constructor.name===dC)),BG=e=>e.mount&&(e.required||e.min||e.max||e.maxLength||e.minLength||e.pattern||e.validate);function fC(e,t,n){const r=$e(e,n);if(r||KS(n))return{error:r,name:n};const s=n.split(".");for(;s.length;){const a=s.join("."),o=$e(t,a),l=$e(e,a);if(o&&!Array.isArray(o)&&n!==a)return{name:n};if(l&&l.type)return{name:a,error:l};s.pop()}return{name:n}}var zG=(e,t,n,r,s)=>s.isOnAll?!1:!n&&s.isOnTouch?!(t||e):(n?r.isOnBlur:s.isOnBlur)?!e:(n?r.isOnChange:s.isOnChange)?e:!0,UG=(e,t)=>!jy($e(e,t)).length&&zn(e,t);const VG={mode:Hs.onSubmit,reValidateMode:Hs.onChange,shouldFocusError:!0};function WG(e={}){let t={...VG,...e},n={submitCount:0,isDirty:!1,isLoading:ti(t.defaultValues),isValidating:!1,isSubmitted:!1,isSubmitting:!1,isSubmitSuccessful:!1,isValid:!1,touchedFields:{},dirtyFields:{},validatingFields:{},errors:t.errors||{},disabled:t.disabled||!1},r={},s=kn(t.defaultValues)||kn(t.values)?Ir(t.defaultValues||t.values)||{}:{},a=t.shouldUnregister?{}:Ir(s),o={action:!1,mount:!1,watch:!1},l={mount:new Set,unMount:new Set,array:new Set,watch:new Set},c,u=0;const d={isDirty:!1,dirtyFields:!1,validatingFields:!1,touchedFields:!1,isValidating:!1,isValid:!1,errors:!1},f={values:m0(),array:m0(),state:m0()},h=sC(t.mode),p=sC(t.reValidateMode),g=t.criteriaMode===Hs.all,m=C=>R=>{clearTimeout(u),u=setTimeout(C,R)},y=async C=>{if(!e.disabled&&(d.isValid||C)){const R=t.resolver?Rr((await P()).errors):await O(r,!0);R!==n.isValid&&f.state.next({isValid:R})}},b=(C,R)=>{!e.disabled&&(d.isValidating||d.validatingFields)&&((C||Array.from(l.mount)).forEach(U=>{U&&(R?Kt(n.validatingFields,U,R):zn(n.validatingFields,U))}),f.state.next({validatingFields:n.validatingFields,isValidating:!Rr(n.validatingFields)}))},x=(C,R=[],U,X,Q=!0,z=!0)=>{if(X&&U&&!e.disabled){if(o.action=!0,z&&Array.isArray($e(r,C))){const ee=U($e(r,C),X.argA,X.argB);Q&&Kt(r,C,ee)}if(z&&Array.isArray($e(n.errors,C))){const ee=U($e(n.errors,C),X.argA,X.argB);Q&&Kt(n.errors,C,ee),UG(n.errors,C)}if(d.touchedFields&&z&&Array.isArray($e(n.touchedFields,C))){const ee=U($e(n.touchedFields,C),X.argA,X.argB);Q&&Kt(n.touchedFields,C,ee)}d.dirtyFields&&(n.dirtyFields=Ed(s,a)),f.state.next({name:C,isDirty:A(C,R),dirtyFields:n.dirtyFields,errors:n.errors,isValid:n.isValid})}else Kt(a,C,R)},w=(C,R)=>{Kt(n.errors,C,R),f.state.next({errors:n.errors})},j=C=>{n.errors=C,f.state.next({errors:n.errors,isValid:!1})},S=(C,R,U,X)=>{const Q=$e(r,C);if(Q){const z=$e(a,C,Sn(U)?$e(s,C):U);Sn(z)||X&&X.defaultChecked||R?Kt(a,C,R?z:v0(Q._f)):H(C,z),o.mount&&y()}},N=(C,R,U,X,Q)=>{let z=!1,ee=!1;const me={name:C};if(!e.disabled){const Se=!!($e(r,C)&&$e(r,C)._f&&$e(r,C)._f.disabled);if(!U||X){d.isDirty&&(ee=n.isDirty,n.isDirty=me.isDirty=A(),z=ee!==me.isDirty);const Ie=Se||Vi($e(s,C),R);ee=!!(!Se&&$e(n.dirtyFields,C)),Ie||Se?zn(n.dirtyFields,C):Kt(n.dirtyFields,C,!0),me.dirtyFields=n.dirtyFields,z=z||d.dirtyFields&&ee!==!Ie}if(U){const Ie=$e(n.touchedFields,C);Ie||(Kt(n.touchedFields,C,U),me.touchedFields=n.touchedFields,z=z||d.touchedFields&&Ie!==U)}z&&Q&&f.state.next(me)}return z?me:{}},_=(C,R,U,X)=>{const Q=$e(n.errors,C),z=d.isValid&&gs(R)&&n.isValid!==R;if(e.delayError&&U?(c=m(()=>w(C,U)),c(e.delayError)):(clearTimeout(u),c=null,U?Kt(n.errors,C,U):zn(n.errors,C)),(U?!Vi(Q,U):Q)||!Rr(X)||z){const ee={...X,...z&&gs(R)?{isValid:R}:{},errors:n.errors,name:C};n={...n,...ee},f.state.next(ee)}},P=async C=>{b(C,!0);const R=await t.resolver(a,t.context,LG(C||l.mount,r,t.criteriaMode,t.shouldUseNativeValidation));return b(C),R},k=async C=>{const{errors:R}=await P(C);if(C)for(const U of C){const X=$e(R,U);X?Kt(n.errors,U,X):zn(n.errors,U)}else n.errors=R;return R},O=async(C,R,U={valid:!0})=>{for(const X in C){const Q=C[X];if(Q){const{_f:z,...ee}=Q;if(z){const me=l.array.has(z.name),Se=Q._f&&FG(Q._f);Se&&d.validatingFields&&b([X],!0);const Ie=await uC(Q,a,g,t.shouldUseNativeValidation&&!R,me);if(Se&&d.validatingFields&&b([X]),Ie[z.name]&&(U.valid=!1,R))break;!R&&($e(Ie,z.name)?me?MG(n.errors,Ie,z.name):Kt(n.errors,z.name,Ie[z.name]):zn(n.errors,z.name))}!Rr(ee)&&await O(ee,R,U)}}return U.valid},M=()=>{for(const C of l.unMount){const R=$e(r,C);R&&(R._f.refs?R._f.refs.every(U=>!g0(U)):!g0(R._f.ref))&&se(C)}l.unMount=new Set},A=(C,R)=>!e.disabled&&(C&&R&&Kt(a,C,R),!Vi(Z(),s)),$=(C,R,U)=>KI(C,l,{...o.mount?a:Sn(R)?s:ja(C)?{[C]:R}:R},U,R),L=C=>jy($e(o.mount?a:s,C,e.shouldUnregister?$e(s,C,[]):[])),H=(C,R,U={})=>{const X=$e(r,C);let Q=R;if(X){const z=X._f;z&&(!z.disabled&&Kt(a,C,tR(R,z)),Q=vg(z.ref)&&_r(R)?"":R,QI(z.ref)?[...z.ref.options].forEach(ee=>ee.selected=Q.includes(ee.value)):z.refs?sp(z.ref)?z.refs.length>1?z.refs.forEach(ee=>(!ee.defaultChecked||!ee.disabled)&&(ee.checked=Array.isArray(Q)?!!Q.find(me=>me===ee.value):Q===ee.value)):z.refs[0]&&(z.refs[0].checked=!!Q):z.refs.forEach(ee=>ee.checked=ee.value===Q):YS(z.ref)?z.ref.value="":(z.ref.value=Q,z.ref.type||f.values.next({name:C,values:{...a}})))}(U.shouldDirty||U.shouldTouch)&&N(C,Q,U.shouldTouch,U.shouldDirty,!0),U.shouldValidate&&q(C)},D=(C,R,U)=>{for(const X in R){const Q=R[X],z=`${C}.${X}`,ee=$e(r,z);(l.array.has(C)||kn(Q)||ee&&!ee._f)&&!il(Q)?D(z,Q,U):H(z,Q,U)}},V=(C,R,U={})=>{const X=$e(r,C),Q=l.array.has(C),z=Ir(R);Kt(a,C,z),Q?(f.array.next({name:C,values:{...a}}),(d.isDirty||d.dirtyFields)&&U.shouldDirty&&f.state.next({name:C,dirtyFields:Ed(s,a),isDirty:A(C,z)})):X&&!X._f&&!_r(z)?D(C,z,U):H(C,z,U),aC(C,l)&&f.state.next({...n}),f.values.next({name:o.mount?C:void 0,values:{...a}})},T=async C=>{o.mount=!0;const R=C.target;let U=R.name,X=!0;const Q=$e(r,U),z=()=>R.type?v0(Q._f):zI(C),ee=me=>{X=Number.isNaN(me)||il(me)&&isNaN(me.getTime())||Vi(me,$e(a,U,me))};if(Q){let me,Se;const Ie=z(),we=C.type===gg.BLUR||C.type===gg.FOCUS_OUT,ze=!BG(Q._f)&&!t.resolver&&!$e(n.errors,U)&&!Q._f.deps||zG(we,$e(n.touchedFields,U),n.isSubmitted,p,h),gt=aC(U,l,we);Kt(a,U,Ie),we?(Q._f.onBlur&&Q._f.onBlur(C),c&&c(0)):Q._f.onChange&&Q._f.onChange(C);const jt=N(U,Ie,we,!1),Ge=!Rr(jt)||gt;if(!we&&f.values.next({name:U,type:C.type,values:{...a}}),ze)return d.isValid&&(e.mode==="onBlur"?we&&y():y()),Ge&&f.state.next({name:U,...gt?{}:jt});if(!we&>&&f.state.next({...n}),t.resolver){const{errors:Ze}=await P([U]);if(ee(Ie),X){const kt=fC(n.errors,r,U),Vt=fC(Ze,r,kt.name||U);me=Vt.error,U=Vt.name,Se=Rr(Ze)}}else b([U],!0),me=(await uC(Q,a,g,t.shouldUseNativeValidation))[U],b([U]),ee(Ie),X&&(me?Se=!1:d.isValid&&(Se=await O(r,!0)));X&&(Q._f.deps&&q(Q._f.deps),_(U,Se,me,jt))}},F=(C,R)=>{if($e(n.errors,R)&&C.focus)return C.focus(),1},q=async(C,R={})=>{let U,X;const Q=cf(C);if(t.resolver){const z=await k(Sn(C)?C:Q);U=Rr(z),X=C?!Q.some(ee=>$e(z,ee)):U}else C?(X=(await Promise.all(Q.map(async z=>{const ee=$e(r,z);return await O(ee&&ee._f?{[z]:ee}:ee)}))).every(Boolean),!(!X&&!n.isValid)&&y()):X=U=await O(r);return f.state.next({...!ja(C)||d.isValid&&U!==n.isValid?{}:{name:C},...t.resolver||!C?{isValid:U}:{},errors:n.errors}),R.shouldFocus&&!X&&uf(r,F,C?Q:l.mount),X},Z=C=>{const R={...o.mount?a:s};return Sn(C)?R:ja(C)?$e(R,C):C.map(U=>$e(R,U))},re=(C,R)=>({invalid:!!$e((R||n).errors,C),isDirty:!!$e((R||n).dirtyFields,C),error:$e((R||n).errors,C),isValidating:!!$e(n.validatingFields,C),isTouched:!!$e((R||n).touchedFields,C)}),ge=C=>{C&&cf(C).forEach(R=>zn(n.errors,R)),f.state.next({errors:C?n.errors:{}})},B=(C,R,U)=>{const X=($e(r,C,{_f:{}})._f||{}).ref,Q=$e(n.errors,C)||{},{ref:z,message:ee,type:me,...Se}=Q;Kt(n.errors,C,{...Se,...R,ref:X}),f.state.next({name:C,errors:n.errors,isValid:!1}),U&&U.shouldFocus&&X&&X.focus&&X.focus()},le=(C,R)=>ti(C)?f.values.subscribe({next:U=>C($(void 0,R),U)}):$(C,R,!0),se=(C,R={})=>{for(const U of C?cf(C):l.mount)l.mount.delete(U),l.array.delete(U),R.keepValue||(zn(r,U),zn(a,U)),!R.keepError&&zn(n.errors,U),!R.keepDirty&&zn(n.dirtyFields,U),!R.keepTouched&&zn(n.touchedFields,U),!R.keepIsValidating&&zn(n.validatingFields,U),!t.shouldUnregister&&!R.keepDefaultValue&&zn(s,U);f.values.next({values:{...a}}),f.state.next({...n,...R.keepDirty?{isDirty:A()}:{}}),!R.keepIsValid&&y()},ce=({disabled:C,name:R,field:U,fields:X,value:Q})=>{if(gs(C)&&o.mount||C){const z=C?void 0:Sn(Q)?v0(U?U._f:$e(X,R)._f):Q;Kt(a,R,z),N(R,z,!1,!1,!0)}},De=(C,R={})=>{let U=$e(r,C);const X=gs(R.disabled)||gs(e.disabled);return Kt(r,C,{...U||{},_f:{...U&&U._f?U._f:{ref:{name:C}},name:C,mount:!0,...R}}),l.mount.add(C),U?ce({field:U,disabled:gs(R.disabled)?R.disabled:e.disabled,name:C,value:R.value}):S(C,!0,R.value),{...X?{disabled:R.disabled||e.disabled}:{},...t.progressive?{required:!!R.required,min:Od(R.min),max:Od(R.max),minLength:Od(R.minLength),maxLength:Od(R.maxLength),pattern:Od(R.pattern)}:{},name:C,onChange:T,onBlur:T,ref:Q=>{if(Q){De(C,R),U=$e(r,C);const z=Sn(Q.value)&&Q.querySelectorAll&&Q.querySelectorAll("input,select,textarea")[0]||Q,ee=DG(z),me=U._f.refs||[];if(ee?me.find(Se=>Se===z):z===U._f.ref)return;Kt(r,C,{_f:{...U._f,...ee?{refs:[...me.filter(g0),z,...Array.isArray($e(s,C))?[{}]:[]],ref:{type:z.type,name:C}}:{ref:z}}}),S(C,!1,void 0,z)}else U=$e(r,C,{}),U._f&&(U._f.mount=!1),(t.shouldUnregister||R.shouldUnregister)&&!(UI(l.array,C)&&o.action)&&l.unMount.add(C)}}},de=()=>t.shouldFocusError&&uf(r,F,l.mount),be=C=>{gs(C)&&(f.state.next({disabled:C}),uf(r,(R,U)=>{const X=$e(r,U);X&&(R.disabled=X._f.disabled||C,Array.isArray(X._f.refs)&&X._f.refs.forEach(Q=>{Q.disabled=X._f.disabled||C}))},0,!1))},Pe=(C,R)=>async U=>{let X;U&&(U.preventDefault&&U.preventDefault(),U.persist&&U.persist());let Q=Ir(a);if(f.state.next({isSubmitting:!0}),t.resolver){const{errors:z,values:ee}=await P();n.errors=z,Q=ee}else await O(r);if(zn(n.errors,"root"),Rr(n.errors)){f.state.next({errors:{}});try{await C(Q,U)}catch(z){X=z}}else R&&await R({...n.errors},U),de(),setTimeout(de);if(f.state.next({isSubmitted:!0,isSubmitting:!1,isSubmitSuccessful:Rr(n.errors)&&!X,submitCount:n.submitCount+1,errors:n.errors}),X)throw X},ne=(C,R={})=>{$e(r,C)&&(Sn(R.defaultValue)?V(C,Ir($e(s,C))):(V(C,R.defaultValue),Kt(s,C,Ir(R.defaultValue))),R.keepTouched||zn(n.touchedFields,C),R.keepDirty||(zn(n.dirtyFields,C),n.isDirty=R.defaultValue?A(C,Ir($e(s,C))):A()),R.keepError||(zn(n.errors,C),d.isValid&&y()),f.state.next({...n}))},Je=(C,R={})=>{const U=C?Ir(C):s,X=Ir(U),Q=Rr(C),z=Q?s:X;if(R.keepDefaultValues||(s=U),!R.keepValues){if(R.keepDirtyValues){const ee=new Set([...l.mount,...Object.keys(Ed(s,a))]);for(const me of Array.from(ee))$e(n.dirtyFields,me)?Kt(z,me,$e(a,me)):V(me,$e(z,me))}else{if(qS&&Sn(C))for(const ee of l.mount){const me=$e(r,ee);if(me&&me._f){const Se=Array.isArray(me._f.refs)?me._f.refs[0]:me._f.ref;if(vg(Se)){const Ie=Se.closest("form");if(Ie){Ie.reset();break}}}}r={}}a=e.shouldUnregister?R.keepDefaultValues?Ir(s):{}:Ir(z),f.array.next({values:{...z}}),f.values.next({values:{...z}})}l={mount:R.keepDirtyValues?l.mount:new Set,unMount:new Set,array:new Set,watch:new Set,watchAll:!1,focus:""},o.mount=!d.isValid||!!R.keepIsValid||!!R.keepDirtyValues,o.watch=!!e.shouldUnregister,f.state.next({submitCount:R.keepSubmitCount?n.submitCount:0,isDirty:Q?!1:R.keepDirty?n.isDirty:!!(R.keepDefaultValues&&!Vi(C,s)),isSubmitted:R.keepIsSubmitted?n.isSubmitted:!1,dirtyFields:Q?{}:R.keepDirtyValues?R.keepDefaultValues&&a?Ed(s,a):n.dirtyFields:R.keepDefaultValues&&C?Ed(s,C):R.keepDirty?n.dirtyFields:{},touchedFields:R.keepTouched?n.touchedFields:{},errors:R.keepErrors?n.errors:{},isSubmitSuccessful:R.keepIsSubmitSuccessful?n.isSubmitSuccessful:!1,isSubmitting:!1})},ve=(C,R)=>Je(ti(C)?C(a):C,R);return{control:{register:De,unregister:se,getFieldState:re,handleSubmit:Pe,setError:B,_executeSchema:P,_getWatch:$,_getDirty:A,_updateValid:y,_removeUnmounted:M,_updateFieldArray:x,_updateDisabledField:ce,_getFieldArray:L,_reset:Je,_resetDefaultValues:()=>ti(t.defaultValues)&&t.defaultValues().then(C=>{ve(C,t.resetOptions),f.state.next({isLoading:!1})}),_updateFormState:C=>{n={...n,...C}},_disableForm:be,_subjects:f,_proxyFormState:d,_setErrors:j,get _fields(){return r},get _formValues(){return a},get _state(){return o},set _state(C){o=C},get _defaultValues(){return s},get _names(){return l},set _names(C){l=C},get _formState(){return n},set _formState(C){n=C},get _options(){return t},set _options(C){t={...t,...C}}},trigger:q,register:De,handleSubmit:Pe,watch:le,setValue:V,getValues:Z,reset:ve,resetField:ne,clearErrors:ge,unregister:se,setError:B,setFocus:(C,R={})=>{const U=$e(r,C),X=U&&U._f;if(X){const Q=X.refs?X.refs[0]:X.ref;Q.focus&&(Q.focus(),R.shouldSelect&&Q.select())}},getFieldState:re}}function Ny(e={}){const t=E.useRef(),n=E.useRef(),[r,s]=E.useState({isDirty:!1,isValidating:!1,isLoading:ti(e.defaultValues),isSubmitted:!1,isSubmitting:!1,isSubmitSuccessful:!1,isValid:!1,submitCount:0,dirtyFields:{},touchedFields:{},validatingFields:{},errors:e.errors||{},disabled:e.disabled||!1,defaultValues:ti(e.defaultValues)?void 0:e.defaultValues});t.current||(t.current={...WG(e),formState:r});const a=t.current.control;return a._options=e,XS({subject:a._subjects.state,next:o=>{GI(o,a._proxyFormState,a._updateFormState,!0)&&s({...a._formState})}}),E.useEffect(()=>a._disableForm(e.disabled),[a,e.disabled]),E.useEffect(()=>{if(a._proxyFormState.isDirty){const o=a._getDirty();o!==r.isDirty&&a._subjects.state.next({isDirty:o})}},[a,r.isDirty]),E.useEffect(()=>{e.values&&!Vi(e.values,n.current)?(a._reset(e.values,a._options.resetOptions),n.current=e.values,s(o=>({...o}))):a._resetDefaultValues()},[e.values,a]),E.useEffect(()=>{e.errors&&a._setErrors(e.errors)},[e.errors,a]),E.useEffect(()=>{a._state.mount||(a._updateValid(),a._state.mount=!0),a._state.watch&&(a._state.watch=!1,a._subjects.state.next({...a._formState})),a._removeUnmounted()}),E.useEffect(()=>{e.shouldUnregister&&a._subjects.values.next({values:a._getWatch()})},[e.shouldUnregister,a]),E.useEffect(()=>{t.current&&(t.current.watch=t.current.watch.bind({}))},[r]),t.current.formState=HI(r,a),t.current}const hC=(e,t,n)=>{if(e&&"reportValidity"in e){const r=$e(n,t);e.setCustomValidity(r&&r.message||""),e.reportValidity()}},nR=(e,t)=>{for(const n in t.fields){const r=t.fields[n];r&&r.ref&&"reportValidity"in r.ref?hC(r.ref,n,e):r.refs&&r.refs.forEach(s=>hC(s,n,e))}},HG=(e,t)=>{t.shouldUseNativeValidation&&nR(e,t);const n={};for(const r in e){const s=$e(t.fields,r),a=Object.assign(e[r]||{},{ref:s&&s.ref});if(GG(t.names||Object.keys(e),r)){const o=Object.assign({},$e(n,r));Kt(o,"root",a),Kt(n,r,o)}else Kt(n,r,a)}return n},GG=(e,t)=>e.some(n=>n.startsWith(t+"."));var qG=function(e,t){for(var n={};e.length;){var r=e[0],s=r.code,a=r.message,o=r.path.join(".");if(!n[o])if("unionErrors"in r){var l=r.unionErrors[0].errors[0];n[o]={message:l.message,type:l.code}}else n[o]={message:a,type:s};if("unionErrors"in r&&r.unionErrors.forEach(function(d){return d.errors.forEach(function(f){return e.push(f)})}),t){var c=n[o].types,u=c&&c[r.code];n[o]=XI(o,t,n,s,u?[].concat(u,r.message):r.message)}e.shift()}return n},_y=function(e,t,n){return n===void 0&&(n={}),function(r,s,a){try{return Promise.resolve(function(o,l){try{var c=Promise.resolve(e[n.mode==="sync"?"parse":"parseAsync"](r,t)).then(function(u){return a.shouldUseNativeValidation&&nR({},a),{errors:{},values:n.raw?r:u}})}catch(u){return l(u)}return c&&c.then?c.then(void 0,l):c}(0,function(o){if(function(l){return Array.isArray(l==null?void 0:l.errors)}(o))return{values:{},errors:HG(qG(o.errors,!a.shouldUseNativeValidation&&a.criteriaMode==="all"),a)};throw o}))}catch(o){return Promise.reject(o)}}},Bt;(function(e){e.assertEqual=s=>s;function t(s){}e.assertIs=t;function n(s){throw new Error}e.assertNever=n,e.arrayToEnum=s=>{const a={};for(const o of s)a[o]=o;return a},e.getValidEnumValues=s=>{const a=e.objectKeys(s).filter(l=>typeof s[s[l]]!="number"),o={};for(const l of a)o[l]=s[l];return e.objectValues(o)},e.objectValues=s=>e.objectKeys(s).map(function(a){return s[a]}),e.objectKeys=typeof Object.keys=="function"?s=>Object.keys(s):s=>{const a=[];for(const o in s)Object.prototype.hasOwnProperty.call(s,o)&&a.push(o);return a},e.find=(s,a)=>{for(const o of s)if(a(o))return o},e.isInteger=typeof Number.isInteger=="function"?s=>Number.isInteger(s):s=>typeof s=="number"&&isFinite(s)&&Math.floor(s)===s;function r(s,a=" | "){return s.map(o=>typeof o=="string"?`'${o}'`:o).join(a)}e.joinValues=r,e.jsonStringifyReplacer=(s,a)=>typeof a=="bigint"?a.toString():a})(Bt||(Bt={}));var Nw;(function(e){e.mergeShapes=(t,n)=>({...t,...n})})(Nw||(Nw={}));const Be=Bt.arrayToEnum(["string","nan","number","integer","float","boolean","date","bigint","symbol","function","undefined","null","array","object","unknown","promise","void","never","map","set"]),Wi=e=>{switch(typeof e){case"undefined":return Be.undefined;case"string":return Be.string;case"number":return isNaN(e)?Be.nan:Be.number;case"boolean":return Be.boolean;case"function":return Be.function;case"bigint":return Be.bigint;case"symbol":return Be.symbol;case"object":return Array.isArray(e)?Be.array:e===null?Be.null:e.then&&typeof e.then=="function"&&e.catch&&typeof e.catch=="function"?Be.promise:typeof Map<"u"&&e instanceof Map?Be.map:typeof Set<"u"&&e instanceof Set?Be.set:typeof Date<"u"&&e instanceof Date?Be.date:Be.object;default:return Be.unknown}},_e=Bt.arrayToEnum(["invalid_type","invalid_literal","custom","invalid_union","invalid_union_discriminator","invalid_enum_value","unrecognized_keys","invalid_arguments","invalid_return_type","invalid_date","invalid_string","too_small","too_big","invalid_intersection_types","not_multiple_of","not_finite"]),KG=e=>JSON.stringify(e,null,2).replace(/"([^"]+)":/g,"$1:");class os extends Error{constructor(t){super(),this.issues=[],this.addIssue=r=>{this.issues=[...this.issues,r]},this.addIssues=(r=[])=>{this.issues=[...this.issues,...r]};const n=new.target.prototype;Object.setPrototypeOf?Object.setPrototypeOf(this,n):this.__proto__=n,this.name="ZodError",this.issues=t}get errors(){return this.issues}format(t){const n=t||function(a){return a.message},r={_errors:[]},s=a=>{for(const o of a.issues)if(o.code==="invalid_union")o.unionErrors.map(s);else if(o.code==="invalid_return_type")s(o.returnTypeError);else if(o.code==="invalid_arguments")s(o.argumentsError);else if(o.path.length===0)r._errors.push(n(o));else{let l=r,c=0;for(;cn.message){const n={},r=[];for(const s of this.issues)s.path.length>0?(n[s.path[0]]=n[s.path[0]]||[],n[s.path[0]].push(t(s))):r.push(t(s));return{formErrors:r,fieldErrors:n}}get formErrors(){return this.flatten()}}os.create=e=>new os(e);const uu=(e,t)=>{let n;switch(e.code){case _e.invalid_type:e.received===Be.undefined?n="Required":n=`Expected ${e.expected}, received ${e.received}`;break;case _e.invalid_literal:n=`Invalid literal value, expected ${JSON.stringify(e.expected,Bt.jsonStringifyReplacer)}`;break;case _e.unrecognized_keys:n=`Unrecognized key(s) in object: ${Bt.joinValues(e.keys,", ")}`;break;case _e.invalid_union:n="Invalid input";break;case _e.invalid_union_discriminator:n=`Invalid discriminator value. Expected ${Bt.joinValues(e.options)}`;break;case _e.invalid_enum_value:n=`Invalid enum value. Expected ${Bt.joinValues(e.options)}, received '${e.received}'`;break;case _e.invalid_arguments:n="Invalid function arguments";break;case _e.invalid_return_type:n="Invalid function return type";break;case _e.invalid_date:n="Invalid date";break;case _e.invalid_string:typeof e.validation=="object"?"includes"in e.validation?(n=`Invalid input: must include "${e.validation.includes}"`,typeof e.validation.position=="number"&&(n=`${n} at one or more positions greater than or equal to ${e.validation.position}`)):"startsWith"in e.validation?n=`Invalid input: must start with "${e.validation.startsWith}"`:"endsWith"in e.validation?n=`Invalid input: must end with "${e.validation.endsWith}"`:Bt.assertNever(e.validation):e.validation!=="regex"?n=`Invalid ${e.validation}`:n="Invalid";break;case _e.too_small:e.type==="array"?n=`Array must contain ${e.exact?"exactly":e.inclusive?"at least":"more than"} ${e.minimum} element(s)`:e.type==="string"?n=`String must contain ${e.exact?"exactly":e.inclusive?"at least":"over"} ${e.minimum} character(s)`:e.type==="number"?n=`Number must be ${e.exact?"exactly equal to ":e.inclusive?"greater than or equal to ":"greater than "}${e.minimum}`:e.type==="date"?n=`Date must be ${e.exact?"exactly equal to ":e.inclusive?"greater than or equal to ":"greater than "}${new Date(Number(e.minimum))}`:n="Invalid input";break;case _e.too_big:e.type==="array"?n=`Array must contain ${e.exact?"exactly":e.inclusive?"at most":"less than"} ${e.maximum} element(s)`:e.type==="string"?n=`String must contain ${e.exact?"exactly":e.inclusive?"at most":"under"} ${e.maximum} character(s)`:e.type==="number"?n=`Number must be ${e.exact?"exactly":e.inclusive?"less than or equal to":"less than"} ${e.maximum}`:e.type==="bigint"?n=`BigInt must be ${e.exact?"exactly":e.inclusive?"less than or equal to":"less than"} ${e.maximum}`:e.type==="date"?n=`Date must be ${e.exact?"exactly":e.inclusive?"smaller than or equal to":"smaller than"} ${new Date(Number(e.maximum))}`:n="Invalid input";break;case _e.custom:n="Invalid input";break;case _e.invalid_intersection_types:n="Intersection results could not be merged";break;case _e.not_multiple_of:n=`Number must be a multiple of ${e.multipleOf}`;break;case _e.not_finite:n="Number must be finite";break;default:n=t.defaultError,Bt.assertNever(e)}return{message:n}};let rR=uu;function XG(e){rR=e}function bg(){return rR}const wg=e=>{const{data:t,path:n,errorMaps:r,issueData:s}=e,a=[...n,...s.path||[]],o={...s,path:a};if(s.message!==void 0)return{...s,path:a,message:s.message};let l="";const c=r.filter(u=>!!u).slice().reverse();for(const u of c)l=u(o,{data:t,defaultError:l}).message;return{...s,path:a,message:l}},YG=[];function Fe(e,t){const n=bg(),r=wg({issueData:t,data:e.data,path:e.path,errorMaps:[e.common.contextualErrorMap,e.schemaErrorMap,n,n===uu?void 0:uu].filter(s=>!!s)});e.common.issues.push(r)}class br{constructor(){this.value="valid"}dirty(){this.value==="valid"&&(this.value="dirty")}abort(){this.value!=="aborted"&&(this.value="aborted")}static mergeArray(t,n){const r=[];for(const s of n){if(s.status==="aborted")return yt;s.status==="dirty"&&t.dirty(),r.push(s.value)}return{status:t.value,value:r}}static async mergeObjectAsync(t,n){const r=[];for(const s of n){const a=await s.key,o=await s.value;r.push({key:a,value:o})}return br.mergeObjectSync(t,r)}static mergeObjectSync(t,n){const r={};for(const s of n){const{key:a,value:o}=s;if(a.status==="aborted"||o.status==="aborted")return yt;a.status==="dirty"&&t.dirty(),o.status==="dirty"&&t.dirty(),a.value!=="__proto__"&&(typeof o.value<"u"||s.alwaysSet)&&(r[a.value]=o.value)}return{status:t.value,value:r}}}const yt=Object.freeze({status:"aborted"}),_c=e=>({status:"dirty",value:e}),kr=e=>({status:"valid",value:e}),_w=e=>e.status==="aborted",Pw=e=>e.status==="dirty",Wf=e=>e.status==="valid",Hf=e=>typeof Promise<"u"&&e instanceof Promise;function jg(e,t,n,r){if(typeof t=="function"?e!==t||!r:!t.has(e))throw new TypeError("Cannot read private member from an object whose class did not declare it");return t.get(e)}function sR(e,t,n,r,s){if(typeof t=="function"?e!==t||!s:!t.has(e))throw new TypeError("Cannot write private member to an object whose class did not declare it");return t.set(e,n),n}var et;(function(e){e.errToObj=t=>typeof t=="string"?{message:t}:t||{},e.toString=t=>typeof t=="string"?t:t==null?void 0:t.message})(et||(et={}));var qd,Kd;class Ma{constructor(t,n,r,s){this._cachedPath=[],this.parent=t,this.data=n,this._path=r,this._key=s}get path(){return this._cachedPath.length||(this._key instanceof Array?this._cachedPath.push(...this._path,...this._key):this._cachedPath.push(...this._path,this._key)),this._cachedPath}}const pC=(e,t)=>{if(Wf(t))return{success:!0,data:t.value};if(!e.common.issues.length)throw new Error("Validation failed but no issues detected.");return{success:!1,get error(){if(this._error)return this._error;const n=new os(e.common.issues);return this._error=n,this._error}}};function Pt(e){if(!e)return{};const{errorMap:t,invalid_type_error:n,required_error:r,description:s}=e;if(t&&(n||r))throw new Error(`Can't use "invalid_type_error" or "required_error" in conjunction with custom error map.`);return t?{errorMap:t,description:s}:{errorMap:(o,l)=>{var c,u;const{message:d}=e;return o.code==="invalid_enum_value"?{message:d??l.defaultError}:typeof l.data>"u"?{message:(c=d??r)!==null&&c!==void 0?c:l.defaultError}:o.code!=="invalid_type"?{message:l.defaultError}:{message:(u=d??n)!==null&&u!==void 0?u:l.defaultError}},description:s}}class $t{constructor(t){this.spa=this.safeParseAsync,this._def=t,this.parse=this.parse.bind(this),this.safeParse=this.safeParse.bind(this),this.parseAsync=this.parseAsync.bind(this),this.safeParseAsync=this.safeParseAsync.bind(this),this.spa=this.spa.bind(this),this.refine=this.refine.bind(this),this.refinement=this.refinement.bind(this),this.superRefine=this.superRefine.bind(this),this.optional=this.optional.bind(this),this.nullable=this.nullable.bind(this),this.nullish=this.nullish.bind(this),this.array=this.array.bind(this),this.promise=this.promise.bind(this),this.or=this.or.bind(this),this.and=this.and.bind(this),this.transform=this.transform.bind(this),this.brand=this.brand.bind(this),this.default=this.default.bind(this),this.catch=this.catch.bind(this),this.describe=this.describe.bind(this),this.pipe=this.pipe.bind(this),this.readonly=this.readonly.bind(this),this.isNullable=this.isNullable.bind(this),this.isOptional=this.isOptional.bind(this)}get description(){return this._def.description}_getType(t){return Wi(t.data)}_getOrReturnCtx(t,n){return n||{common:t.parent.common,data:t.data,parsedType:Wi(t.data),schemaErrorMap:this._def.errorMap,path:t.path,parent:t.parent}}_processInputParams(t){return{status:new br,ctx:{common:t.parent.common,data:t.data,parsedType:Wi(t.data),schemaErrorMap:this._def.errorMap,path:t.path,parent:t.parent}}}_parseSync(t){const n=this._parse(t);if(Hf(n))throw new Error("Synchronous parse encountered promise.");return n}_parseAsync(t){const n=this._parse(t);return Promise.resolve(n)}parse(t,n){const r=this.safeParse(t,n);if(r.success)return r.data;throw r.error}safeParse(t,n){var r;const s={common:{issues:[],async:(r=n==null?void 0:n.async)!==null&&r!==void 0?r:!1,contextualErrorMap:n==null?void 0:n.errorMap},path:(n==null?void 0:n.path)||[],schemaErrorMap:this._def.errorMap,parent:null,data:t,parsedType:Wi(t)},a=this._parseSync({data:t,path:s.path,parent:s});return pC(s,a)}async parseAsync(t,n){const r=await this.safeParseAsync(t,n);if(r.success)return r.data;throw r.error}async safeParseAsync(t,n){const r={common:{issues:[],contextualErrorMap:n==null?void 0:n.errorMap,async:!0},path:(n==null?void 0:n.path)||[],schemaErrorMap:this._def.errorMap,parent:null,data:t,parsedType:Wi(t)},s=this._parse({data:t,path:r.path,parent:r}),a=await(Hf(s)?s:Promise.resolve(s));return pC(r,a)}refine(t,n){const r=s=>typeof n=="string"||typeof n>"u"?{message:n}:typeof n=="function"?n(s):n;return this._refinement((s,a)=>{const o=t(s),l=()=>a.addIssue({code:_e.custom,...r(s)});return typeof Promise<"u"&&o instanceof Promise?o.then(c=>c?!0:(l(),!1)):o?!0:(l(),!1)})}refinement(t,n){return this._refinement((r,s)=>t(r)?!0:(s.addIssue(typeof n=="function"?n(r,s):n),!1))}_refinement(t){return new ia({schema:this,typeName:mt.ZodEffects,effect:{type:"refinement",refinement:t}})}superRefine(t){return this._refinement(t)}optional(){return Aa.create(this,this._def)}nullable(){return Eo.create(this,this._def)}nullish(){return this.nullable().optional()}array(){return Qs.create(this,this._def)}promise(){return fu.create(this,this._def)}or(t){return Xf.create([this,t],this._def)}and(t){return Yf.create(this,t,this._def)}transform(t){return new ia({...Pt(this._def),schema:this,typeName:mt.ZodEffects,effect:{type:"transform",transform:t}})}default(t){const n=typeof t=="function"?t:()=>t;return new th({...Pt(this._def),innerType:this,defaultValue:n,typeName:mt.ZodDefault})}brand(){return new QS({typeName:mt.ZodBranded,type:this,...Pt(this._def)})}catch(t){const n=typeof t=="function"?t:()=>t;return new nh({...Pt(this._def),innerType:this,catchValue:n,typeName:mt.ZodCatch})}describe(t){const n=this.constructor;return new n({...this._def,description:t})}pipe(t){return ap.create(this,t)}readonly(){return rh.create(this)}isOptional(){return this.safeParse(void 0).success}isNullable(){return this.safeParse(null).success}}const ZG=/^c[^\s-]{8,}$/i,QG=/^[0-9a-z]+$/,JG=/^[0-9A-HJKMNP-TV-Z]{26}$/,eq=/^[0-9a-fA-F]{8}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{12}$/i,tq=/^[a-z0-9_-]{21}$/i,nq=/^[-+]?P(?!$)(?:(?:[-+]?\d+Y)|(?:[-+]?\d+[.,]\d+Y$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:(?:[-+]?\d+W)|(?:[-+]?\d+[.,]\d+W$))?(?:(?:[-+]?\d+D)|(?:[-+]?\d+[.,]\d+D$))?(?:T(?=[\d+-])(?:(?:[-+]?\d+H)|(?:[-+]?\d+[.,]\d+H$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:[-+]?\d+(?:[.,]\d+)?S)?)??$/,rq=/^(?!\.)(?!.*\.\.)([A-Z0-9_'+\-\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i,sq="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$";let y0;const aq=/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])$/,iq=/^(([a-f0-9]{1,4}:){7}|::([a-f0-9]{1,4}:){0,6}|([a-f0-9]{1,4}:){1}:([a-f0-9]{1,4}:){0,5}|([a-f0-9]{1,4}:){2}:([a-f0-9]{1,4}:){0,4}|([a-f0-9]{1,4}:){3}:([a-f0-9]{1,4}:){0,3}|([a-f0-9]{1,4}:){4}:([a-f0-9]{1,4}:){0,2}|([a-f0-9]{1,4}:){5}:([a-f0-9]{1,4}:){0,1})([a-f0-9]{1,4}|(((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2}))\.){3}((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2})))$/,oq=/^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/,aR="((\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-((0[13578]|1[02])-(0[1-9]|[12]\\d|3[01])|(0[469]|11)-(0[1-9]|[12]\\d|30)|(02)-(0[1-9]|1\\d|2[0-8])))",lq=new RegExp(`^${aR}$`);function iR(e){let t="([01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d";return e.precision?t=`${t}\\.\\d{${e.precision}}`:e.precision==null&&(t=`${t}(\\.\\d+)?`),t}function cq(e){return new RegExp(`^${iR(e)}$`)}function oR(e){let t=`${aR}T${iR(e)}`;const n=[];return n.push(e.local?"Z?":"Z"),e.offset&&n.push("([+-]\\d{2}:?\\d{2})"),t=`${t}(${n.join("|")})`,new RegExp(`^${t}$`)}function uq(e,t){return!!((t==="v4"||!t)&&aq.test(e)||(t==="v6"||!t)&&iq.test(e))}class qs extends $t{_parse(t){if(this._def.coerce&&(t.data=String(t.data)),this._getType(t)!==Be.string){const a=this._getOrReturnCtx(t);return Fe(a,{code:_e.invalid_type,expected:Be.string,received:a.parsedType}),yt}const r=new br;let s;for(const a of this._def.checks)if(a.kind==="min")t.data.lengtha.value&&(s=this._getOrReturnCtx(t,s),Fe(s,{code:_e.too_big,maximum:a.value,type:"string",inclusive:!0,exact:!1,message:a.message}),r.dirty());else if(a.kind==="length"){const o=t.data.length>a.value,l=t.data.lengtht.test(s),{validation:n,code:_e.invalid_string,...et.errToObj(r)})}_addCheck(t){return new qs({...this._def,checks:[...this._def.checks,t]})}email(t){return this._addCheck({kind:"email",...et.errToObj(t)})}url(t){return this._addCheck({kind:"url",...et.errToObj(t)})}emoji(t){return this._addCheck({kind:"emoji",...et.errToObj(t)})}uuid(t){return this._addCheck({kind:"uuid",...et.errToObj(t)})}nanoid(t){return this._addCheck({kind:"nanoid",...et.errToObj(t)})}cuid(t){return this._addCheck({kind:"cuid",...et.errToObj(t)})}cuid2(t){return this._addCheck({kind:"cuid2",...et.errToObj(t)})}ulid(t){return this._addCheck({kind:"ulid",...et.errToObj(t)})}base64(t){return this._addCheck({kind:"base64",...et.errToObj(t)})}ip(t){return this._addCheck({kind:"ip",...et.errToObj(t)})}datetime(t){var n,r;return typeof t=="string"?this._addCheck({kind:"datetime",precision:null,offset:!1,local:!1,message:t}):this._addCheck({kind:"datetime",precision:typeof(t==null?void 0:t.precision)>"u"?null:t==null?void 0:t.precision,offset:(n=t==null?void 0:t.offset)!==null&&n!==void 0?n:!1,local:(r=t==null?void 0:t.local)!==null&&r!==void 0?r:!1,...et.errToObj(t==null?void 0:t.message)})}date(t){return this._addCheck({kind:"date",message:t})}time(t){return typeof t=="string"?this._addCheck({kind:"time",precision:null,message:t}):this._addCheck({kind:"time",precision:typeof(t==null?void 0:t.precision)>"u"?null:t==null?void 0:t.precision,...et.errToObj(t==null?void 0:t.message)})}duration(t){return this._addCheck({kind:"duration",...et.errToObj(t)})}regex(t,n){return this._addCheck({kind:"regex",regex:t,...et.errToObj(n)})}includes(t,n){return this._addCheck({kind:"includes",value:t,position:n==null?void 0:n.position,...et.errToObj(n==null?void 0:n.message)})}startsWith(t,n){return this._addCheck({kind:"startsWith",value:t,...et.errToObj(n)})}endsWith(t,n){return this._addCheck({kind:"endsWith",value:t,...et.errToObj(n)})}min(t,n){return this._addCheck({kind:"min",value:t,...et.errToObj(n)})}max(t,n){return this._addCheck({kind:"max",value:t,...et.errToObj(n)})}length(t,n){return this._addCheck({kind:"length",value:t,...et.errToObj(n)})}nonempty(t){return this.min(1,et.errToObj(t))}trim(){return new qs({...this._def,checks:[...this._def.checks,{kind:"trim"}]})}toLowerCase(){return new qs({...this._def,checks:[...this._def.checks,{kind:"toLowerCase"}]})}toUpperCase(){return new qs({...this._def,checks:[...this._def.checks,{kind:"toUpperCase"}]})}get isDatetime(){return!!this._def.checks.find(t=>t.kind==="datetime")}get isDate(){return!!this._def.checks.find(t=>t.kind==="date")}get isTime(){return!!this._def.checks.find(t=>t.kind==="time")}get isDuration(){return!!this._def.checks.find(t=>t.kind==="duration")}get isEmail(){return!!this._def.checks.find(t=>t.kind==="email")}get isURL(){return!!this._def.checks.find(t=>t.kind==="url")}get isEmoji(){return!!this._def.checks.find(t=>t.kind==="emoji")}get isUUID(){return!!this._def.checks.find(t=>t.kind==="uuid")}get isNANOID(){return!!this._def.checks.find(t=>t.kind==="nanoid")}get isCUID(){return!!this._def.checks.find(t=>t.kind==="cuid")}get isCUID2(){return!!this._def.checks.find(t=>t.kind==="cuid2")}get isULID(){return!!this._def.checks.find(t=>t.kind==="ulid")}get isIP(){return!!this._def.checks.find(t=>t.kind==="ip")}get isBase64(){return!!this._def.checks.find(t=>t.kind==="base64")}get minLength(){let t=null;for(const n of this._def.checks)n.kind==="min"&&(t===null||n.value>t)&&(t=n.value);return t}get maxLength(){let t=null;for(const n of this._def.checks)n.kind==="max"&&(t===null||n.value{var t;return new qs({checks:[],typeName:mt.ZodString,coerce:(t=e==null?void 0:e.coerce)!==null&&t!==void 0?t:!1,...Pt(e)})};function dq(e,t){const n=(e.toString().split(".")[1]||"").length,r=(t.toString().split(".")[1]||"").length,s=n>r?n:r,a=parseInt(e.toFixed(s).replace(".","")),o=parseInt(t.toFixed(s).replace(".",""));return a%o/Math.pow(10,s)}class Po extends $t{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte,this.step=this.multipleOf}_parse(t){if(this._def.coerce&&(t.data=Number(t.data)),this._getType(t)!==Be.number){const a=this._getOrReturnCtx(t);return Fe(a,{code:_e.invalid_type,expected:Be.number,received:a.parsedType}),yt}let r;const s=new br;for(const a of this._def.checks)a.kind==="int"?Bt.isInteger(t.data)||(r=this._getOrReturnCtx(t,r),Fe(r,{code:_e.invalid_type,expected:"integer",received:"float",message:a.message}),s.dirty()):a.kind==="min"?(a.inclusive?t.dataa.value:t.data>=a.value)&&(r=this._getOrReturnCtx(t,r),Fe(r,{code:_e.too_big,maximum:a.value,type:"number",inclusive:a.inclusive,exact:!1,message:a.message}),s.dirty()):a.kind==="multipleOf"?dq(t.data,a.value)!==0&&(r=this._getOrReturnCtx(t,r),Fe(r,{code:_e.not_multiple_of,multipleOf:a.value,message:a.message}),s.dirty()):a.kind==="finite"?Number.isFinite(t.data)||(r=this._getOrReturnCtx(t,r),Fe(r,{code:_e.not_finite,message:a.message}),s.dirty()):Bt.assertNever(a);return{status:s.value,value:t.data}}gte(t,n){return this.setLimit("min",t,!0,et.toString(n))}gt(t,n){return this.setLimit("min",t,!1,et.toString(n))}lte(t,n){return this.setLimit("max",t,!0,et.toString(n))}lt(t,n){return this.setLimit("max",t,!1,et.toString(n))}setLimit(t,n,r,s){return new Po({...this._def,checks:[...this._def.checks,{kind:t,value:n,inclusive:r,message:et.toString(s)}]})}_addCheck(t){return new Po({...this._def,checks:[...this._def.checks,t]})}int(t){return this._addCheck({kind:"int",message:et.toString(t)})}positive(t){return this._addCheck({kind:"min",value:0,inclusive:!1,message:et.toString(t)})}negative(t){return this._addCheck({kind:"max",value:0,inclusive:!1,message:et.toString(t)})}nonpositive(t){return this._addCheck({kind:"max",value:0,inclusive:!0,message:et.toString(t)})}nonnegative(t){return this._addCheck({kind:"min",value:0,inclusive:!0,message:et.toString(t)})}multipleOf(t,n){return this._addCheck({kind:"multipleOf",value:t,message:et.toString(n)})}finite(t){return this._addCheck({kind:"finite",message:et.toString(t)})}safe(t){return this._addCheck({kind:"min",inclusive:!0,value:Number.MIN_SAFE_INTEGER,message:et.toString(t)})._addCheck({kind:"max",inclusive:!0,value:Number.MAX_SAFE_INTEGER,message:et.toString(t)})}get minValue(){let t=null;for(const n of this._def.checks)n.kind==="min"&&(t===null||n.value>t)&&(t=n.value);return t}get maxValue(){let t=null;for(const n of this._def.checks)n.kind==="max"&&(t===null||n.valuet.kind==="int"||t.kind==="multipleOf"&&Bt.isInteger(t.value))}get isFinite(){let t=null,n=null;for(const r of this._def.checks){if(r.kind==="finite"||r.kind==="int"||r.kind==="multipleOf")return!0;r.kind==="min"?(n===null||r.value>n)&&(n=r.value):r.kind==="max"&&(t===null||r.valuenew Po({checks:[],typeName:mt.ZodNumber,coerce:(e==null?void 0:e.coerce)||!1,...Pt(e)});class Ao extends $t{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte}_parse(t){if(this._def.coerce&&(t.data=BigInt(t.data)),this._getType(t)!==Be.bigint){const a=this._getOrReturnCtx(t);return Fe(a,{code:_e.invalid_type,expected:Be.bigint,received:a.parsedType}),yt}let r;const s=new br;for(const a of this._def.checks)a.kind==="min"?(a.inclusive?t.dataa.value:t.data>=a.value)&&(r=this._getOrReturnCtx(t,r),Fe(r,{code:_e.too_big,type:"bigint",maximum:a.value,inclusive:a.inclusive,message:a.message}),s.dirty()):a.kind==="multipleOf"?t.data%a.value!==BigInt(0)&&(r=this._getOrReturnCtx(t,r),Fe(r,{code:_e.not_multiple_of,multipleOf:a.value,message:a.message}),s.dirty()):Bt.assertNever(a);return{status:s.value,value:t.data}}gte(t,n){return this.setLimit("min",t,!0,et.toString(n))}gt(t,n){return this.setLimit("min",t,!1,et.toString(n))}lte(t,n){return this.setLimit("max",t,!0,et.toString(n))}lt(t,n){return this.setLimit("max",t,!1,et.toString(n))}setLimit(t,n,r,s){return new Ao({...this._def,checks:[...this._def.checks,{kind:t,value:n,inclusive:r,message:et.toString(s)}]})}_addCheck(t){return new Ao({...this._def,checks:[...this._def.checks,t]})}positive(t){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!1,message:et.toString(t)})}negative(t){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!1,message:et.toString(t)})}nonpositive(t){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!0,message:et.toString(t)})}nonnegative(t){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!0,message:et.toString(t)})}multipleOf(t,n){return this._addCheck({kind:"multipleOf",value:t,message:et.toString(n)})}get minValue(){let t=null;for(const n of this._def.checks)n.kind==="min"&&(t===null||n.value>t)&&(t=n.value);return t}get maxValue(){let t=null;for(const n of this._def.checks)n.kind==="max"&&(t===null||n.value{var t;return new Ao({checks:[],typeName:mt.ZodBigInt,coerce:(t=e==null?void 0:e.coerce)!==null&&t!==void 0?t:!1,...Pt(e)})};class Gf extends $t{_parse(t){if(this._def.coerce&&(t.data=!!t.data),this._getType(t)!==Be.boolean){const r=this._getOrReturnCtx(t);return Fe(r,{code:_e.invalid_type,expected:Be.boolean,received:r.parsedType}),yt}return kr(t.data)}}Gf.create=e=>new Gf({typeName:mt.ZodBoolean,coerce:(e==null?void 0:e.coerce)||!1,...Pt(e)});class Rl extends $t{_parse(t){if(this._def.coerce&&(t.data=new Date(t.data)),this._getType(t)!==Be.date){const a=this._getOrReturnCtx(t);return Fe(a,{code:_e.invalid_type,expected:Be.date,received:a.parsedType}),yt}if(isNaN(t.data.getTime())){const a=this._getOrReturnCtx(t);return Fe(a,{code:_e.invalid_date}),yt}const r=new br;let s;for(const a of this._def.checks)a.kind==="min"?t.data.getTime()a.value&&(s=this._getOrReturnCtx(t,s),Fe(s,{code:_e.too_big,message:a.message,inclusive:!0,exact:!1,maximum:a.value,type:"date"}),r.dirty()):Bt.assertNever(a);return{status:r.value,value:new Date(t.data.getTime())}}_addCheck(t){return new Rl({...this._def,checks:[...this._def.checks,t]})}min(t,n){return this._addCheck({kind:"min",value:t.getTime(),message:et.toString(n)})}max(t,n){return this._addCheck({kind:"max",value:t.getTime(),message:et.toString(n)})}get minDate(){let t=null;for(const n of this._def.checks)n.kind==="min"&&(t===null||n.value>t)&&(t=n.value);return t!=null?new Date(t):null}get maxDate(){let t=null;for(const n of this._def.checks)n.kind==="max"&&(t===null||n.valuenew Rl({checks:[],coerce:(e==null?void 0:e.coerce)||!1,typeName:mt.ZodDate,...Pt(e)});class Sg extends $t{_parse(t){if(this._getType(t)!==Be.symbol){const r=this._getOrReturnCtx(t);return Fe(r,{code:_e.invalid_type,expected:Be.symbol,received:r.parsedType}),yt}return kr(t.data)}}Sg.create=e=>new Sg({typeName:mt.ZodSymbol,...Pt(e)});class qf extends $t{_parse(t){if(this._getType(t)!==Be.undefined){const r=this._getOrReturnCtx(t);return Fe(r,{code:_e.invalid_type,expected:Be.undefined,received:r.parsedType}),yt}return kr(t.data)}}qf.create=e=>new qf({typeName:mt.ZodUndefined,...Pt(e)});class Kf extends $t{_parse(t){if(this._getType(t)!==Be.null){const r=this._getOrReturnCtx(t);return Fe(r,{code:_e.invalid_type,expected:Be.null,received:r.parsedType}),yt}return kr(t.data)}}Kf.create=e=>new Kf({typeName:mt.ZodNull,...Pt(e)});class du extends $t{constructor(){super(...arguments),this._any=!0}_parse(t){return kr(t.data)}}du.create=e=>new du({typeName:mt.ZodAny,...Pt(e)});class bl extends $t{constructor(){super(...arguments),this._unknown=!0}_parse(t){return kr(t.data)}}bl.create=e=>new bl({typeName:mt.ZodUnknown,...Pt(e)});class xi extends $t{_parse(t){const n=this._getOrReturnCtx(t);return Fe(n,{code:_e.invalid_type,expected:Be.never,received:n.parsedType}),yt}}xi.create=e=>new xi({typeName:mt.ZodNever,...Pt(e)});class Ng extends $t{_parse(t){if(this._getType(t)!==Be.undefined){const r=this._getOrReturnCtx(t);return Fe(r,{code:_e.invalid_type,expected:Be.void,received:r.parsedType}),yt}return kr(t.data)}}Ng.create=e=>new Ng({typeName:mt.ZodVoid,...Pt(e)});class Qs extends $t{_parse(t){const{ctx:n,status:r}=this._processInputParams(t),s=this._def;if(n.parsedType!==Be.array)return Fe(n,{code:_e.invalid_type,expected:Be.array,received:n.parsedType}),yt;if(s.exactLength!==null){const o=n.data.length>s.exactLength.value,l=n.data.lengths.maxLength.value&&(Fe(n,{code:_e.too_big,maximum:s.maxLength.value,type:"array",inclusive:!0,exact:!1,message:s.maxLength.message}),r.dirty()),n.common.async)return Promise.all([...n.data].map((o,l)=>s.type._parseAsync(new Ma(n,o,n.path,l)))).then(o=>br.mergeArray(r,o));const a=[...n.data].map((o,l)=>s.type._parseSync(new Ma(n,o,n.path,l)));return br.mergeArray(r,a)}get element(){return this._def.type}min(t,n){return new Qs({...this._def,minLength:{value:t,message:et.toString(n)}})}max(t,n){return new Qs({...this._def,maxLength:{value:t,message:et.toString(n)}})}length(t,n){return new Qs({...this._def,exactLength:{value:t,message:et.toString(n)}})}nonempty(t){return this.min(1,t)}}Qs.create=(e,t)=>new Qs({type:e,minLength:null,maxLength:null,exactLength:null,typeName:mt.ZodArray,...Pt(t)});function fc(e){if(e instanceof mn){const t={};for(const n in e.shape){const r=e.shape[n];t[n]=Aa.create(fc(r))}return new mn({...e._def,shape:()=>t})}else return e instanceof Qs?new Qs({...e._def,type:fc(e.element)}):e instanceof Aa?Aa.create(fc(e.unwrap())):e instanceof Eo?Eo.create(fc(e.unwrap())):e instanceof Ia?Ia.create(e.items.map(t=>fc(t))):e}class mn extends $t{constructor(){super(...arguments),this._cached=null,this.nonstrict=this.passthrough,this.augment=this.extend}_getCached(){if(this._cached!==null)return this._cached;const t=this._def.shape(),n=Bt.objectKeys(t);return this._cached={shape:t,keys:n}}_parse(t){if(this._getType(t)!==Be.object){const u=this._getOrReturnCtx(t);return Fe(u,{code:_e.invalid_type,expected:Be.object,received:u.parsedType}),yt}const{status:r,ctx:s}=this._processInputParams(t),{shape:a,keys:o}=this._getCached(),l=[];if(!(this._def.catchall instanceof xi&&this._def.unknownKeys==="strip"))for(const u in s.data)o.includes(u)||l.push(u);const c=[];for(const u of o){const d=a[u],f=s.data[u];c.push({key:{status:"valid",value:u},value:d._parse(new Ma(s,f,s.path,u)),alwaysSet:u in s.data})}if(this._def.catchall instanceof xi){const u=this._def.unknownKeys;if(u==="passthrough")for(const d of l)c.push({key:{status:"valid",value:d},value:{status:"valid",value:s.data[d]}});else if(u==="strict")l.length>0&&(Fe(s,{code:_e.unrecognized_keys,keys:l}),r.dirty());else if(u!=="strip")throw new Error("Internal ZodObject error: invalid unknownKeys value.")}else{const u=this._def.catchall;for(const d of l){const f=s.data[d];c.push({key:{status:"valid",value:d},value:u._parse(new Ma(s,f,s.path,d)),alwaysSet:d in s.data})}}return s.common.async?Promise.resolve().then(async()=>{const u=[];for(const d of c){const f=await d.key,h=await d.value;u.push({key:f,value:h,alwaysSet:d.alwaysSet})}return u}).then(u=>br.mergeObjectSync(r,u)):br.mergeObjectSync(r,c)}get shape(){return this._def.shape()}strict(t){return et.errToObj,new mn({...this._def,unknownKeys:"strict",...t!==void 0?{errorMap:(n,r)=>{var s,a,o,l;const c=(o=(a=(s=this._def).errorMap)===null||a===void 0?void 0:a.call(s,n,r).message)!==null&&o!==void 0?o:r.defaultError;return n.code==="unrecognized_keys"?{message:(l=et.errToObj(t).message)!==null&&l!==void 0?l:c}:{message:c}}}:{}})}strip(){return new mn({...this._def,unknownKeys:"strip"})}passthrough(){return new mn({...this._def,unknownKeys:"passthrough"})}extend(t){return new mn({...this._def,shape:()=>({...this._def.shape(),...t})})}merge(t){return new mn({unknownKeys:t._def.unknownKeys,catchall:t._def.catchall,shape:()=>({...this._def.shape(),...t._def.shape()}),typeName:mt.ZodObject})}setKey(t,n){return this.augment({[t]:n})}catchall(t){return new mn({...this._def,catchall:t})}pick(t){const n={};return Bt.objectKeys(t).forEach(r=>{t[r]&&this.shape[r]&&(n[r]=this.shape[r])}),new mn({...this._def,shape:()=>n})}omit(t){const n={};return Bt.objectKeys(this.shape).forEach(r=>{t[r]||(n[r]=this.shape[r])}),new mn({...this._def,shape:()=>n})}deepPartial(){return fc(this)}partial(t){const n={};return Bt.objectKeys(this.shape).forEach(r=>{const s=this.shape[r];t&&!t[r]?n[r]=s:n[r]=s.optional()}),new mn({...this._def,shape:()=>n})}required(t){const n={};return Bt.objectKeys(this.shape).forEach(r=>{if(t&&!t[r])n[r]=this.shape[r];else{let a=this.shape[r];for(;a instanceof Aa;)a=a._def.innerType;n[r]=a}}),new mn({...this._def,shape:()=>n})}keyof(){return lR(Bt.objectKeys(this.shape))}}mn.create=(e,t)=>new mn({shape:()=>e,unknownKeys:"strip",catchall:xi.create(),typeName:mt.ZodObject,...Pt(t)});mn.strictCreate=(e,t)=>new mn({shape:()=>e,unknownKeys:"strict",catchall:xi.create(),typeName:mt.ZodObject,...Pt(t)});mn.lazycreate=(e,t)=>new mn({shape:e,unknownKeys:"strip",catchall:xi.create(),typeName:mt.ZodObject,...Pt(t)});class Xf extends $t{_parse(t){const{ctx:n}=this._processInputParams(t),r=this._def.options;function s(a){for(const l of a)if(l.result.status==="valid")return l.result;for(const l of a)if(l.result.status==="dirty")return n.common.issues.push(...l.ctx.common.issues),l.result;const o=a.map(l=>new os(l.ctx.common.issues));return Fe(n,{code:_e.invalid_union,unionErrors:o}),yt}if(n.common.async)return Promise.all(r.map(async a=>{const o={...n,common:{...n.common,issues:[]},parent:null};return{result:await a._parseAsync({data:n.data,path:n.path,parent:o}),ctx:o}})).then(s);{let a;const o=[];for(const c of r){const u={...n,common:{...n.common,issues:[]},parent:null},d=c._parseSync({data:n.data,path:n.path,parent:u});if(d.status==="valid")return d;d.status==="dirty"&&!a&&(a={result:d,ctx:u}),u.common.issues.length&&o.push(u.common.issues)}if(a)return n.common.issues.push(...a.ctx.common.issues),a.result;const l=o.map(c=>new os(c));return Fe(n,{code:_e.invalid_union,unionErrors:l}),yt}}get options(){return this._def.options}}Xf.create=(e,t)=>new Xf({options:e,typeName:mt.ZodUnion,...Pt(t)});const Ga=e=>e instanceof Qf?Ga(e.schema):e instanceof ia?Ga(e.innerType()):e instanceof Jf?[e.value]:e instanceof Co?e.options:e instanceof eh?Bt.objectValues(e.enum):e instanceof th?Ga(e._def.innerType):e instanceof qf?[void 0]:e instanceof Kf?[null]:e instanceof Aa?[void 0,...Ga(e.unwrap())]:e instanceof Eo?[null,...Ga(e.unwrap())]:e instanceof QS||e instanceof rh?Ga(e.unwrap()):e instanceof nh?Ga(e._def.innerType):[];class Py extends $t{_parse(t){const{ctx:n}=this._processInputParams(t);if(n.parsedType!==Be.object)return Fe(n,{code:_e.invalid_type,expected:Be.object,received:n.parsedType}),yt;const r=this.discriminator,s=n.data[r],a=this.optionsMap.get(s);return a?n.common.async?a._parseAsync({data:n.data,path:n.path,parent:n}):a._parseSync({data:n.data,path:n.path,parent:n}):(Fe(n,{code:_e.invalid_union_discriminator,options:Array.from(this.optionsMap.keys()),path:[r]}),yt)}get discriminator(){return this._def.discriminator}get options(){return this._def.options}get optionsMap(){return this._def.optionsMap}static create(t,n,r){const s=new Map;for(const a of n){const o=Ga(a.shape[t]);if(!o.length)throw new Error(`A discriminator value for key \`${t}\` could not be extracted from all schema options`);for(const l of o){if(s.has(l))throw new Error(`Discriminator property ${String(t)} has duplicate value ${String(l)}`);s.set(l,a)}}return new Py({typeName:mt.ZodDiscriminatedUnion,discriminator:t,options:n,optionsMap:s,...Pt(r)})}}function Aw(e,t){const n=Wi(e),r=Wi(t);if(e===t)return{valid:!0,data:e};if(n===Be.object&&r===Be.object){const s=Bt.objectKeys(t),a=Bt.objectKeys(e).filter(l=>s.indexOf(l)!==-1),o={...e,...t};for(const l of a){const c=Aw(e[l],t[l]);if(!c.valid)return{valid:!1};o[l]=c.data}return{valid:!0,data:o}}else if(n===Be.array&&r===Be.array){if(e.length!==t.length)return{valid:!1};const s=[];for(let a=0;a{if(_w(a)||_w(o))return yt;const l=Aw(a.value,o.value);return l.valid?((Pw(a)||Pw(o))&&n.dirty(),{status:n.value,value:l.data}):(Fe(r,{code:_e.invalid_intersection_types}),yt)};return r.common.async?Promise.all([this._def.left._parseAsync({data:r.data,path:r.path,parent:r}),this._def.right._parseAsync({data:r.data,path:r.path,parent:r})]).then(([a,o])=>s(a,o)):s(this._def.left._parseSync({data:r.data,path:r.path,parent:r}),this._def.right._parseSync({data:r.data,path:r.path,parent:r}))}}Yf.create=(e,t,n)=>new Yf({left:e,right:t,typeName:mt.ZodIntersection,...Pt(n)});class Ia extends $t{_parse(t){const{status:n,ctx:r}=this._processInputParams(t);if(r.parsedType!==Be.array)return Fe(r,{code:_e.invalid_type,expected:Be.array,received:r.parsedType}),yt;if(r.data.lengththis._def.items.length&&(Fe(r,{code:_e.too_big,maximum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),n.dirty());const a=[...r.data].map((o,l)=>{const c=this._def.items[l]||this._def.rest;return c?c._parse(new Ma(r,o,r.path,l)):null}).filter(o=>!!o);return r.common.async?Promise.all(a).then(o=>br.mergeArray(n,o)):br.mergeArray(n,a)}get items(){return this._def.items}rest(t){return new Ia({...this._def,rest:t})}}Ia.create=(e,t)=>{if(!Array.isArray(e))throw new Error("You must pass an array of schemas to z.tuple([ ... ])");return new Ia({items:e,typeName:mt.ZodTuple,rest:null,...Pt(t)})};class Zf extends $t{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(t){const{status:n,ctx:r}=this._processInputParams(t);if(r.parsedType!==Be.object)return Fe(r,{code:_e.invalid_type,expected:Be.object,received:r.parsedType}),yt;const s=[],a=this._def.keyType,o=this._def.valueType;for(const l in r.data)s.push({key:a._parse(new Ma(r,l,r.path,l)),value:o._parse(new Ma(r,r.data[l],r.path,l)),alwaysSet:l in r.data});return r.common.async?br.mergeObjectAsync(n,s):br.mergeObjectSync(n,s)}get element(){return this._def.valueType}static create(t,n,r){return n instanceof $t?new Zf({keyType:t,valueType:n,typeName:mt.ZodRecord,...Pt(r)}):new Zf({keyType:qs.create(),valueType:t,typeName:mt.ZodRecord,...Pt(n)})}}class _g extends $t{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(t){const{status:n,ctx:r}=this._processInputParams(t);if(r.parsedType!==Be.map)return Fe(r,{code:_e.invalid_type,expected:Be.map,received:r.parsedType}),yt;const s=this._def.keyType,a=this._def.valueType,o=[...r.data.entries()].map(([l,c],u)=>({key:s._parse(new Ma(r,l,r.path,[u,"key"])),value:a._parse(new Ma(r,c,r.path,[u,"value"]))}));if(r.common.async){const l=new Map;return Promise.resolve().then(async()=>{for(const c of o){const u=await c.key,d=await c.value;if(u.status==="aborted"||d.status==="aborted")return yt;(u.status==="dirty"||d.status==="dirty")&&n.dirty(),l.set(u.value,d.value)}return{status:n.value,value:l}})}else{const l=new Map;for(const c of o){const u=c.key,d=c.value;if(u.status==="aborted"||d.status==="aborted")return yt;(u.status==="dirty"||d.status==="dirty")&&n.dirty(),l.set(u.value,d.value)}return{status:n.value,value:l}}}}_g.create=(e,t,n)=>new _g({valueType:t,keyType:e,typeName:mt.ZodMap,...Pt(n)});class Dl extends $t{_parse(t){const{status:n,ctx:r}=this._processInputParams(t);if(r.parsedType!==Be.set)return Fe(r,{code:_e.invalid_type,expected:Be.set,received:r.parsedType}),yt;const s=this._def;s.minSize!==null&&r.data.sizes.maxSize.value&&(Fe(r,{code:_e.too_big,maximum:s.maxSize.value,type:"set",inclusive:!0,exact:!1,message:s.maxSize.message}),n.dirty());const a=this._def.valueType;function o(c){const u=new Set;for(const d of c){if(d.status==="aborted")return yt;d.status==="dirty"&&n.dirty(),u.add(d.value)}return{status:n.value,value:u}}const l=[...r.data.values()].map((c,u)=>a._parse(new Ma(r,c,r.path,u)));return r.common.async?Promise.all(l).then(c=>o(c)):o(l)}min(t,n){return new Dl({...this._def,minSize:{value:t,message:et.toString(n)}})}max(t,n){return new Dl({...this._def,maxSize:{value:t,message:et.toString(n)}})}size(t,n){return this.min(t,n).max(t,n)}nonempty(t){return this.min(1,t)}}Dl.create=(e,t)=>new Dl({valueType:e,minSize:null,maxSize:null,typeName:mt.ZodSet,...Pt(t)});class Fc extends $t{constructor(){super(...arguments),this.validate=this.implement}_parse(t){const{ctx:n}=this._processInputParams(t);if(n.parsedType!==Be.function)return Fe(n,{code:_e.invalid_type,expected:Be.function,received:n.parsedType}),yt;function r(l,c){return wg({data:l,path:n.path,errorMaps:[n.common.contextualErrorMap,n.schemaErrorMap,bg(),uu].filter(u=>!!u),issueData:{code:_e.invalid_arguments,argumentsError:c}})}function s(l,c){return wg({data:l,path:n.path,errorMaps:[n.common.contextualErrorMap,n.schemaErrorMap,bg(),uu].filter(u=>!!u),issueData:{code:_e.invalid_return_type,returnTypeError:c}})}const a={errorMap:n.common.contextualErrorMap},o=n.data;if(this._def.returns instanceof fu){const l=this;return kr(async function(...c){const u=new os([]),d=await l._def.args.parseAsync(c,a).catch(p=>{throw u.addIssue(r(c,p)),u}),f=await Reflect.apply(o,this,d);return await l._def.returns._def.type.parseAsync(f,a).catch(p=>{throw u.addIssue(s(f,p)),u})})}else{const l=this;return kr(function(...c){const u=l._def.args.safeParse(c,a);if(!u.success)throw new os([r(c,u.error)]);const d=Reflect.apply(o,this,u.data),f=l._def.returns.safeParse(d,a);if(!f.success)throw new os([s(d,f.error)]);return f.data})}}parameters(){return this._def.args}returnType(){return this._def.returns}args(...t){return new Fc({...this._def,args:Ia.create(t).rest(bl.create())})}returns(t){return new Fc({...this._def,returns:t})}implement(t){return this.parse(t)}strictImplement(t){return this.parse(t)}static create(t,n,r){return new Fc({args:t||Ia.create([]).rest(bl.create()),returns:n||bl.create(),typeName:mt.ZodFunction,...Pt(r)})}}class Qf extends $t{get schema(){return this._def.getter()}_parse(t){const{ctx:n}=this._processInputParams(t);return this._def.getter()._parse({data:n.data,path:n.path,parent:n})}}Qf.create=(e,t)=>new Qf({getter:e,typeName:mt.ZodLazy,...Pt(t)});class Jf extends $t{_parse(t){if(t.data!==this._def.value){const n=this._getOrReturnCtx(t);return Fe(n,{received:n.data,code:_e.invalid_literal,expected:this._def.value}),yt}return{status:"valid",value:t.data}}get value(){return this._def.value}}Jf.create=(e,t)=>new Jf({value:e,typeName:mt.ZodLiteral,...Pt(t)});function lR(e,t){return new Co({values:e,typeName:mt.ZodEnum,...Pt(t)})}class Co extends $t{constructor(){super(...arguments),qd.set(this,void 0)}_parse(t){if(typeof t.data!="string"){const n=this._getOrReturnCtx(t),r=this._def.values;return Fe(n,{expected:Bt.joinValues(r),received:n.parsedType,code:_e.invalid_type}),yt}if(jg(this,qd)||sR(this,qd,new Set(this._def.values)),!jg(this,qd).has(t.data)){const n=this._getOrReturnCtx(t),r=this._def.values;return Fe(n,{received:n.data,code:_e.invalid_enum_value,options:r}),yt}return kr(t.data)}get options(){return this._def.values}get enum(){const t={};for(const n of this._def.values)t[n]=n;return t}get Values(){const t={};for(const n of this._def.values)t[n]=n;return t}get Enum(){const t={};for(const n of this._def.values)t[n]=n;return t}extract(t,n=this._def){return Co.create(t,{...this._def,...n})}exclude(t,n=this._def){return Co.create(this.options.filter(r=>!t.includes(r)),{...this._def,...n})}}qd=new WeakMap;Co.create=lR;class eh extends $t{constructor(){super(...arguments),Kd.set(this,void 0)}_parse(t){const n=Bt.getValidEnumValues(this._def.values),r=this._getOrReturnCtx(t);if(r.parsedType!==Be.string&&r.parsedType!==Be.number){const s=Bt.objectValues(n);return Fe(r,{expected:Bt.joinValues(s),received:r.parsedType,code:_e.invalid_type}),yt}if(jg(this,Kd)||sR(this,Kd,new Set(Bt.getValidEnumValues(this._def.values))),!jg(this,Kd).has(t.data)){const s=Bt.objectValues(n);return Fe(r,{received:r.data,code:_e.invalid_enum_value,options:s}),yt}return kr(t.data)}get enum(){return this._def.values}}Kd=new WeakMap;eh.create=(e,t)=>new eh({values:e,typeName:mt.ZodNativeEnum,...Pt(t)});class fu extends $t{unwrap(){return this._def.type}_parse(t){const{ctx:n}=this._processInputParams(t);if(n.parsedType!==Be.promise&&n.common.async===!1)return Fe(n,{code:_e.invalid_type,expected:Be.promise,received:n.parsedType}),yt;const r=n.parsedType===Be.promise?n.data:Promise.resolve(n.data);return kr(r.then(s=>this._def.type.parseAsync(s,{path:n.path,errorMap:n.common.contextualErrorMap})))}}fu.create=(e,t)=>new fu({type:e,typeName:mt.ZodPromise,...Pt(t)});class ia extends $t{innerType(){return this._def.schema}sourceType(){return this._def.schema._def.typeName===mt.ZodEffects?this._def.schema.sourceType():this._def.schema}_parse(t){const{status:n,ctx:r}=this._processInputParams(t),s=this._def.effect||null,a={addIssue:o=>{Fe(r,o),o.fatal?n.abort():n.dirty()},get path(){return r.path}};if(a.addIssue=a.addIssue.bind(a),s.type==="preprocess"){const o=s.transform(r.data,a);if(r.common.async)return Promise.resolve(o).then(async l=>{if(n.value==="aborted")return yt;const c=await this._def.schema._parseAsync({data:l,path:r.path,parent:r});return c.status==="aborted"?yt:c.status==="dirty"||n.value==="dirty"?_c(c.value):c});{if(n.value==="aborted")return yt;const l=this._def.schema._parseSync({data:o,path:r.path,parent:r});return l.status==="aborted"?yt:l.status==="dirty"||n.value==="dirty"?_c(l.value):l}}if(s.type==="refinement"){const o=l=>{const c=s.refinement(l,a);if(r.common.async)return Promise.resolve(c);if(c instanceof Promise)throw new Error("Async refinement encountered during synchronous parse operation. Use .parseAsync instead.");return l};if(r.common.async===!1){const l=this._def.schema._parseSync({data:r.data,path:r.path,parent:r});return l.status==="aborted"?yt:(l.status==="dirty"&&n.dirty(),o(l.value),{status:n.value,value:l.value})}else return this._def.schema._parseAsync({data:r.data,path:r.path,parent:r}).then(l=>l.status==="aborted"?yt:(l.status==="dirty"&&n.dirty(),o(l.value).then(()=>({status:n.value,value:l.value}))))}if(s.type==="transform")if(r.common.async===!1){const o=this._def.schema._parseSync({data:r.data,path:r.path,parent:r});if(!Wf(o))return o;const l=s.transform(o.value,a);if(l instanceof Promise)throw new Error("Asynchronous transform encountered during synchronous parse operation. Use .parseAsync instead.");return{status:n.value,value:l}}else return this._def.schema._parseAsync({data:r.data,path:r.path,parent:r}).then(o=>Wf(o)?Promise.resolve(s.transform(o.value,a)).then(l=>({status:n.value,value:l})):o);Bt.assertNever(s)}}ia.create=(e,t,n)=>new ia({schema:e,typeName:mt.ZodEffects,effect:t,...Pt(n)});ia.createWithPreprocess=(e,t,n)=>new ia({schema:t,effect:{type:"preprocess",transform:e},typeName:mt.ZodEffects,...Pt(n)});class Aa extends $t{_parse(t){return this._getType(t)===Be.undefined?kr(void 0):this._def.innerType._parse(t)}unwrap(){return this._def.innerType}}Aa.create=(e,t)=>new Aa({innerType:e,typeName:mt.ZodOptional,...Pt(t)});class Eo extends $t{_parse(t){return this._getType(t)===Be.null?kr(null):this._def.innerType._parse(t)}unwrap(){return this._def.innerType}}Eo.create=(e,t)=>new Eo({innerType:e,typeName:mt.ZodNullable,...Pt(t)});class th extends $t{_parse(t){const{ctx:n}=this._processInputParams(t);let r=n.data;return n.parsedType===Be.undefined&&(r=this._def.defaultValue()),this._def.innerType._parse({data:r,path:n.path,parent:n})}removeDefault(){return this._def.innerType}}th.create=(e,t)=>new th({innerType:e,typeName:mt.ZodDefault,defaultValue:typeof t.default=="function"?t.default:()=>t.default,...Pt(t)});class nh extends $t{_parse(t){const{ctx:n}=this._processInputParams(t),r={...n,common:{...n.common,issues:[]}},s=this._def.innerType._parse({data:r.data,path:r.path,parent:{...r}});return Hf(s)?s.then(a=>({status:"valid",value:a.status==="valid"?a.value:this._def.catchValue({get error(){return new os(r.common.issues)},input:r.data})})):{status:"valid",value:s.status==="valid"?s.value:this._def.catchValue({get error(){return new os(r.common.issues)},input:r.data})}}removeCatch(){return this._def.innerType}}nh.create=(e,t)=>new nh({innerType:e,typeName:mt.ZodCatch,catchValue:typeof t.catch=="function"?t.catch:()=>t.catch,...Pt(t)});class Pg extends $t{_parse(t){if(this._getType(t)!==Be.nan){const r=this._getOrReturnCtx(t);return Fe(r,{code:_e.invalid_type,expected:Be.nan,received:r.parsedType}),yt}return{status:"valid",value:t.data}}}Pg.create=e=>new Pg({typeName:mt.ZodNaN,...Pt(e)});const fq=Symbol("zod_brand");class QS extends $t{_parse(t){const{ctx:n}=this._processInputParams(t),r=n.data;return this._def.type._parse({data:r,path:n.path,parent:n})}unwrap(){return this._def.type}}class ap extends $t{_parse(t){const{status:n,ctx:r}=this._processInputParams(t);if(r.common.async)return(async()=>{const a=await this._def.in._parseAsync({data:r.data,path:r.path,parent:r});return a.status==="aborted"?yt:a.status==="dirty"?(n.dirty(),_c(a.value)):this._def.out._parseAsync({data:a.value,path:r.path,parent:r})})();{const s=this._def.in._parseSync({data:r.data,path:r.path,parent:r});return s.status==="aborted"?yt:s.status==="dirty"?(n.dirty(),{status:"dirty",value:s.value}):this._def.out._parseSync({data:s.value,path:r.path,parent:r})}}static create(t,n){return new ap({in:t,out:n,typeName:mt.ZodPipeline})}}class rh extends $t{_parse(t){const n=this._def.innerType._parse(t),r=s=>(Wf(s)&&(s.value=Object.freeze(s.value)),s);return Hf(n)?n.then(s=>r(s)):r(n)}unwrap(){return this._def.innerType}}rh.create=(e,t)=>new rh({innerType:e,typeName:mt.ZodReadonly,...Pt(t)});function cR(e,t={},n){return e?du.create().superRefine((r,s)=>{var a,o;if(!e(r)){const l=typeof t=="function"?t(r):typeof t=="string"?{message:t}:t,c=(o=(a=l.fatal)!==null&&a!==void 0?a:n)!==null&&o!==void 0?o:!0,u=typeof l=="string"?{message:l}:l;s.addIssue({code:"custom",...u,fatal:c})}}):du.create()}const hq={object:mn.lazycreate};var mt;(function(e){e.ZodString="ZodString",e.ZodNumber="ZodNumber",e.ZodNaN="ZodNaN",e.ZodBigInt="ZodBigInt",e.ZodBoolean="ZodBoolean",e.ZodDate="ZodDate",e.ZodSymbol="ZodSymbol",e.ZodUndefined="ZodUndefined",e.ZodNull="ZodNull",e.ZodAny="ZodAny",e.ZodUnknown="ZodUnknown",e.ZodNever="ZodNever",e.ZodVoid="ZodVoid",e.ZodArray="ZodArray",e.ZodObject="ZodObject",e.ZodUnion="ZodUnion",e.ZodDiscriminatedUnion="ZodDiscriminatedUnion",e.ZodIntersection="ZodIntersection",e.ZodTuple="ZodTuple",e.ZodRecord="ZodRecord",e.ZodMap="ZodMap",e.ZodSet="ZodSet",e.ZodFunction="ZodFunction",e.ZodLazy="ZodLazy",e.ZodLiteral="ZodLiteral",e.ZodEnum="ZodEnum",e.ZodEffects="ZodEffects",e.ZodNativeEnum="ZodNativeEnum",e.ZodOptional="ZodOptional",e.ZodNullable="ZodNullable",e.ZodDefault="ZodDefault",e.ZodCatch="ZodCatch",e.ZodPromise="ZodPromise",e.ZodBranded="ZodBranded",e.ZodPipeline="ZodPipeline",e.ZodReadonly="ZodReadonly"})(mt||(mt={}));const pq=(e,t={message:`Input not instance of ${e.name}`})=>cR(n=>n instanceof e,t),uR=qs.create,dR=Po.create,mq=Pg.create,gq=Ao.create,fR=Gf.create,vq=Rl.create,yq=Sg.create,xq=qf.create,bq=Kf.create,wq=du.create,jq=bl.create,Sq=xi.create,Nq=Ng.create,_q=Qs.create,Pq=mn.create,Aq=mn.strictCreate,Cq=Xf.create,Eq=Py.create,Oq=Yf.create,kq=Ia.create,Tq=Zf.create,$q=_g.create,Mq=Dl.create,Iq=Fc.create,Rq=Qf.create,Dq=Jf.create,Lq=Co.create,Fq=eh.create,Bq=fu.create,mC=ia.create,zq=Aa.create,Uq=Eo.create,Vq=ia.createWithPreprocess,Wq=ap.create,Hq=()=>uR().optional(),Gq=()=>dR().optional(),qq=()=>fR().optional(),Kq={string:e=>qs.create({...e,coerce:!0}),number:e=>Po.create({...e,coerce:!0}),boolean:e=>Gf.create({...e,coerce:!0}),bigint:e=>Ao.create({...e,coerce:!0}),date:e=>Rl.create({...e,coerce:!0})},Xq=yt;var Te=Object.freeze({__proto__:null,defaultErrorMap:uu,setErrorMap:XG,getErrorMap:bg,makeIssue:wg,EMPTY_PATH:YG,addIssueToContext:Fe,ParseStatus:br,INVALID:yt,DIRTY:_c,OK:kr,isAborted:_w,isDirty:Pw,isValid:Wf,isAsync:Hf,get util(){return Bt},get objectUtil(){return Nw},ZodParsedType:Be,getParsedType:Wi,ZodType:$t,datetimeRegex:oR,ZodString:qs,ZodNumber:Po,ZodBigInt:Ao,ZodBoolean:Gf,ZodDate:Rl,ZodSymbol:Sg,ZodUndefined:qf,ZodNull:Kf,ZodAny:du,ZodUnknown:bl,ZodNever:xi,ZodVoid:Ng,ZodArray:Qs,ZodObject:mn,ZodUnion:Xf,ZodDiscriminatedUnion:Py,ZodIntersection:Yf,ZodTuple:Ia,ZodRecord:Zf,ZodMap:_g,ZodSet:Dl,ZodFunction:Fc,ZodLazy:Qf,ZodLiteral:Jf,ZodEnum:Co,ZodNativeEnum:eh,ZodPromise:fu,ZodEffects:ia,ZodTransformer:ia,ZodOptional:Aa,ZodNullable:Eo,ZodDefault:th,ZodCatch:nh,ZodNaN:Pg,BRAND:fq,ZodBranded:QS,ZodPipeline:ap,ZodReadonly:rh,custom:cR,Schema:$t,ZodSchema:$t,late:hq,get ZodFirstPartyTypeKind(){return mt},coerce:Kq,any:wq,array:_q,bigint:gq,boolean:fR,date:vq,discriminatedUnion:Eq,effect:mC,enum:Lq,function:Iq,instanceof:pq,intersection:Oq,lazy:Rq,literal:Dq,map:$q,nan:mq,nativeEnum:Fq,never:Sq,null:bq,nullable:Uq,number:dR,object:Pq,oboolean:qq,onumber:Gq,optional:zq,ostring:Hq,pipeline:Wq,preprocess:Vq,promise:Bq,record:Tq,set:Mq,strictObject:Aq,string:uR,symbol:yq,transformer:mC,tuple:kq,undefined:xq,union:Cq,unknown:jq,void:Nq,NEVER:Xq,ZodIssueCode:_e,quotelessJson:KG,ZodError:os}),Yq="Label",hR=v.forwardRef((e,t)=>i.jsx(Ye.label,{...e,ref:t,onMouseDown:n=>{var s;n.target.closest("button, input, select, textarea")||((s=e.onMouseDown)==null||s.call(e,n),!n.defaultPrevented&&n.detail>1&&n.preventDefault())}}));hR.displayName=Yq;var pR=hR;const Zq=VS("text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70"),vs=v.forwardRef(({className:e,...t},n)=>i.jsx(pR,{ref:n,className:Me(Zq(),e),...t}));vs.displayName=pR.displayName;const Ay=EG,mR=v.createContext({}),dt=({...e})=>i.jsx(mR.Provider,{value:{name:e.name},children:i.jsx($G,{...e})}),Cy=()=>{const e=v.useContext(mR),t=v.useContext(gR),{getFieldState:n,formState:r}=Sy(),s=n(e.name,r);if(!e)throw new Error("useFormField should be used within ");const{id:a}=t;return{id:a,name:e.name,formItemId:`${a}-form-item`,formDescriptionId:`${a}-form-item-description`,formMessageId:`${a}-form-item-message`,...s}},gR=v.createContext({}),ot=v.forwardRef(({className:e,...t},n)=>{const r=v.useId();return i.jsx(gR.Provider,{value:{id:r},children:i.jsx("div",{ref:n,className:Me("space-y-2",e),...t})})});ot.displayName="FormItem";const lt=v.forwardRef(({className:e,...t},n)=>{const{error:r,formItemId:s}=Cy();return i.jsx(vs,{ref:n,className:Me(r&&"text-destructive",e),htmlFor:s,...t})});lt.displayName="FormLabel";const ct=v.forwardRef(({...e},t)=>{const{error:n,formItemId:r,formDescriptionId:s,formMessageId:a}=Cy();return i.jsx(mi,{ref:t,id:r,"aria-describedby":n?`${s} ${a}`:`${s}`,"aria-invalid":!!n,...e})});ct.displayName="FormControl";const fn=v.forwardRef(({className:e,...t},n)=>{const{formDescriptionId:r}=Cy();return i.jsx("p",{ref:n,id:r,className:Me("text-sm text-muted-foreground",e),...t})});fn.displayName="FormDescription";const ut=v.forwardRef(({className:e,children:t,...n},r)=>{const{error:s,formMessageId:a}=Cy(),o=s?String(s==null?void 0:s.message):t;return o?i.jsx("p",{ref:r,id:a,className:Me("text-sm font-medium text-destructive",e),...n,children:o}):null});ut.displayName="FormMessage";const Ot=v.forwardRef(({className:e,type:t,...n},r)=>i.jsx("input",{type:t,className:Me("flex h-10 w-full rounded-md border border-input bg-background px-3 py-2 text-base ring-offset-background 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-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50 md:text-sm",e),ref:r,...n}));Ot.displayName="Input";const nt=v.forwardRef(({className:e,...t},n)=>i.jsx("textarea",{className:Me("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",e),ref:n,...t}));nt.displayName="Textarea";function sh(e,[t,n]){return Math.min(n,Math.max(t,e))}function Qq(e,t=[]){let n=[];function r(a,o){const l=v.createContext(o),c=n.length;n=[...n,o];function u(f){const{scope:h,children:p,...g}=f,m=(h==null?void 0:h[e][c])||l,y=v.useMemo(()=>g,Object.values(g));return i.jsx(m.Provider,{value:y,children:p})}function d(f,h){const p=(h==null?void 0:h[e][c])||l,g=v.useContext(p);if(g)return g;if(o!==void 0)return o;throw new Error(`\`${f}\` must be used within \`${a}\``)}return u.displayName=a+"Provider",[u,d]}const s=()=>{const a=n.map(o=>v.createContext(o));return function(l){const c=(l==null?void 0:l[e])||a;return v.useMemo(()=>({[`__scope${e}`]:{...l,[e]:c}}),[l,c])}};return s.scopeName=e,[r,Jq(s,...t)]}function Jq(...e){const t=e[0];if(e.length===1)return t;const n=()=>{const r=e.map(s=>({useScope:s(),scopeName:s.scopeName}));return function(a){const o=r.reduce((l,{useScope:c,scopeName:u})=>{const f=c(a)[`__scope${u}`];return{...l,...f}},{});return v.useMemo(()=>({[`__scope${t.scopeName}`]:o}),[o])}};return n.scopeName=t.scopeName,n}function Ey(e){const t=e+"CollectionProvider",[n,r]=Qq(t),[s,a]=n(t,{collectionRef:{current:null},itemMap:new Map}),o=p=>{const{scope:g,children:m}=p,y=E.useRef(null),b=E.useRef(new Map).current;return i.jsx(s,{scope:g,itemMap:b,collectionRef:y,children:m})};o.displayName=t;const l=e+"CollectionSlot",c=E.forwardRef((p,g)=>{const{scope:m,children:y}=p,b=a(l,m),x=xt(g,b.collectionRef);return i.jsx(mi,{ref:x,children:y})});c.displayName=l;const u=e+"CollectionItemSlot",d="data-radix-collection-item",f=E.forwardRef((p,g)=>{const{scope:m,children:y,...b}=p,x=E.useRef(null),w=xt(g,x),j=a(u,m);return E.useEffect(()=>(j.itemMap.set(x,{ref:x,...b}),()=>void j.itemMap.delete(x))),i.jsx(mi,{[d]:"",ref:w,children:y})});f.displayName=u;function h(p){const g=a(e+"CollectionConsumer",p);return E.useCallback(()=>{const y=g.collectionRef.current;if(!y)return[];const b=Array.from(y.querySelectorAll(`[${d}]`));return Array.from(g.itemMap.values()).sort((j,S)=>b.indexOf(j.ref.current)-b.indexOf(S.ref.current))},[g.collectionRef,g.itemMap])}return[{Provider:o,Slot:c,ItemSlot:f},h,r]}var eK=v.createContext(void 0);function Xl(e){const t=v.useContext(eK);return e||t||"ltr"}var x0=0;function JS(){v.useEffect(()=>{const e=document.querySelectorAll("[data-radix-focus-guard]");return document.body.insertAdjacentElement("afterbegin",e[0]??gC()),document.body.insertAdjacentElement("beforeend",e[1]??gC()),x0++,()=>{x0===1&&document.querySelectorAll("[data-radix-focus-guard]").forEach(t=>t.remove()),x0--}},[])}function gC(){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 b0="focusScope.autoFocusOnMount",w0="focusScope.autoFocusOnUnmount",vC={bubbles:!1,cancelable:!0},tK="FocusScope",Oy=v.forwardRef((e,t)=>{const{loop:n=!1,trapped:r=!1,onMountAutoFocus:s,onUnmountAutoFocus:a,...o}=e,[l,c]=v.useState(null),u=Hn(s),d=Hn(a),f=v.useRef(null),h=xt(t,m=>c(m)),p=v.useRef({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}}).current;v.useEffect(()=>{if(r){let m=function(w){if(p.paused||!l)return;const j=w.target;l.contains(j)?f.current=j:Ii(f.current,{select:!0})},y=function(w){if(p.paused||!l)return;const j=w.relatedTarget;j!==null&&(l.contains(j)||Ii(f.current,{select:!0}))},b=function(w){if(document.activeElement===document.body)for(const S of w)S.removedNodes.length>0&&Ii(l)};document.addEventListener("focusin",m),document.addEventListener("focusout",y);const x=new MutationObserver(b);return l&&x.observe(l,{childList:!0,subtree:!0}),()=>{document.removeEventListener("focusin",m),document.removeEventListener("focusout",y),x.disconnect()}}},[r,l,p.paused]),v.useEffect(()=>{if(l){xC.add(p);const m=document.activeElement;if(!l.contains(m)){const b=new CustomEvent(b0,vC);l.addEventListener(b0,u),l.dispatchEvent(b),b.defaultPrevented||(nK(oK(vR(l)),{select:!0}),document.activeElement===m&&Ii(l))}return()=>{l.removeEventListener(b0,u),setTimeout(()=>{const b=new CustomEvent(w0,vC);l.addEventListener(w0,d),l.dispatchEvent(b),b.defaultPrevented||Ii(m??document.body,{select:!0}),l.removeEventListener(w0,d),xC.remove(p)},0)}}},[l,u,d,p]);const g=v.useCallback(m=>{if(!n&&!r||p.paused)return;const y=m.key==="Tab"&&!m.altKey&&!m.ctrlKey&&!m.metaKey,b=document.activeElement;if(y&&b){const x=m.currentTarget,[w,j]=rK(x);w&&j?!m.shiftKey&&b===j?(m.preventDefault(),n&&Ii(w,{select:!0})):m.shiftKey&&b===w&&(m.preventDefault(),n&&Ii(j,{select:!0})):b===x&&m.preventDefault()}},[n,r,p.paused]);return i.jsx(Ye.div,{tabIndex:-1,...o,ref:h,onKeyDown:g})});Oy.displayName=tK;function nK(e,{select:t=!1}={}){const n=document.activeElement;for(const r of e)if(Ii(r,{select:t}),document.activeElement!==n)return}function rK(e){const t=vR(e),n=yC(t,e),r=yC(t.reverse(),e);return[n,r]}function vR(e){const t=[],n=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,{acceptNode:r=>{const s=r.tagName==="INPUT"&&r.type==="hidden";return r.disabled||r.hidden||s?NodeFilter.FILTER_SKIP:r.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});for(;n.nextNode();)t.push(n.currentNode);return t}function yC(e,t){for(const n of e)if(!sK(n,{upTo:t}))return n}function sK(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 aK(e){return e instanceof HTMLInputElement&&"select"in e}function Ii(e,{select:t=!1}={}){if(e&&e.focus){const n=document.activeElement;e.focus({preventScroll:!0}),e!==n&&aK(e)&&t&&e.select()}}var xC=iK();function iK(){let e=[];return{add(t){const n=e[0];t!==n&&(n==null||n.pause()),e=bC(e,t),e.unshift(t)},remove(t){var n;e=bC(e,t),(n=e[0])==null||n.resume()}}}function bC(e,t){const n=[...e],r=n.indexOf(t);return r!==-1&&n.splice(r,1),n}function oK(e){return e.filter(t=>t.tagName!=="A")}function ip(e){const t=v.useRef({value:e,previous:e});return v.useMemo(()=>(t.current.value!==e&&(t.current.previous=t.current.value,t.current.value=e),t.current.previous),[e])}var lK=function(e){if(typeof document>"u")return null;var t=Array.isArray(e)?e[0]:e;return t.ownerDocument.body},ac=new WeakMap,Kp=new WeakMap,Xp={},j0=0,yR=function(e){return e&&(e.host||yR(e.parentNode))},cK=function(e,t){return t.map(function(n){if(e.contains(n))return n;var r=yR(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})},uK=function(e,t,n,r){var s=cK(t,Array.isArray(e)?e:[e]);Xp[n]||(Xp[n]=new WeakMap);var a=Xp[n],o=[],l=new Set,c=new Set(s),u=function(f){!f||l.has(f)||(l.add(f),u(f.parentNode))};s.forEach(u);var d=function(f){!f||c.has(f)||Array.prototype.forEach.call(f.children,function(h){if(l.has(h))d(h);else try{var p=h.getAttribute(r),g=p!==null&&p!=="false",m=(ac.get(h)||0)+1,y=(a.get(h)||0)+1;ac.set(h,m),a.set(h,y),o.push(h),m===1&&g&&Kp.set(h,!0),y===1&&h.setAttribute(n,"true"),g||h.setAttribute(r,"true")}catch(b){console.error("aria-hidden: cannot operate on ",h,b)}})};return d(t),l.clear(),j0++,function(){o.forEach(function(f){var h=ac.get(f)-1,p=a.get(f)-1;ac.set(f,h),a.set(f,p),h||(Kp.has(f)||f.removeAttribute(r),Kp.delete(f)),p||f.removeAttribute(n)}),j0--,j0||(ac=new WeakMap,ac=new WeakMap,Kp=new WeakMap,Xp={})}},eN=function(e,t,n){n===void 0&&(n="data-aria-hidden");var r=Array.from(Array.isArray(e)?e:[e]),s=lK(e);return s?(r.push.apply(r,Array.from(s.querySelectorAll("[aria-live]"))),uK(r,s,n,"aria-hidden")):function(){return null}},wa=function(){return wa=Object.assign||function(t){for(var n,r=1,s=arguments.length;r"u")return AK;var t=CK(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])}},OK=jR(),Bc="data-scroll-locked",kK=function(e,t,n,r){var s=e.left,a=e.top,o=e.right,l=e.gap;return n===void 0&&(n="margin"),` - .`.concat(fK,` { +Defaulting to \`null\`.`}var VI=FI,TH=zI;const al=v.forwardRef(({className:e,value:t,...n},r)=>i.jsx(VI,{ref:r,className:Oe("relative h-4 w-full overflow-hidden rounded-full bg-secondary",e),...n,children:i.jsx(TH,{className:"h-full w-full flex-1 bg-primary transition-all",style:{transform:`translateX(-${100-(t||0)}%)`}})}));al.displayName=VI.displayName;var ap=e=>e.type==="checkbox",il=e=>e instanceof Date,_r=e=>e==null;const WI=e=>typeof e=="object";var kn=e=>!_r(e)&&!Array.isArray(e)&&WI(e)&&!il(e),GI=e=>kn(e)&&e.target?ap(e.target)?e.target.checked:e.target.value:e,$H=e=>e.substring(0,e.search(/\.\d+(\.|$)/))||e,HI=(e,t)=>e.has($H(t)),MH=e=>{const t=e.constructor&&e.constructor.prototype;return kn(t)&&t.hasOwnProperty("isPrototypeOf")},QS=typeof window<"u"&&typeof window.HTMLElement<"u"&&typeof document<"u";function Ir(e){let t;const n=Array.isArray(e);if(e instanceof Date)t=new Date(e);else if(e instanceof Set)t=new Set(e);else if(!(QS&&(e instanceof Blob||e instanceof FileList))&&(n||kn(e)))if(t=n?[]:{},!n&&!MH(e))t=e;else for(const r in e)e.hasOwnProperty(r)&&(t[r]=Ir(e[r]));else return e;return t}var Ny=e=>Array.isArray(e)?e.filter(Boolean):[],Sn=e=>e===void 0,Me=(e,t,n)=>{if(!t||!kn(e))return n;const r=Ny(t.split(/[,[\].]+?/)).reduce((s,a)=>_r(s)?s:s[a],e);return Sn(r)||r===e?Sn(e[t])?n:e[t]:r},vs=e=>typeof e=="boolean",JS=e=>/^\w*$/.test(e),qI=e=>Ny(e.replace(/["|']|\]/g,"").split(/\.|\[/)),Kt=(e,t,n)=>{let r=-1;const s=JS(t)?[t]:qI(t),a=s.length,o=a-1;for(;++rE.useContext(KI),IH=e=>{const{children:t,...n}=e;return E.createElement(KI.Provider,{value:n},t)};var XI=(e,t,n,r=!0)=>{const s={defaultValues:t._defaultValues};for(const a in e)Object.defineProperty(s,a,{get:()=>{const o=a;return t._proxyFormState[o]!==Gs.all&&(t._proxyFormState[o]=!r||Gs.all),n&&(n[o]=!0),e[o]}});return s},Rr=e=>kn(e)&&!Object.keys(e).length,YI=(e,t,n,r)=>{n(e);const{name:s,...a}=e;return Rr(a)||Object.keys(a).length>=Object.keys(t).length||Object.keys(a).find(o=>t[o]===(!r||Gs.all))},cf=e=>Array.isArray(e)?e:[e],ZI=(e,t,n)=>!e||!t||e===t||cf(e).some(r=>r&&(n?r===t:r.startsWith(t)||t.startsWith(r)));function eN(e){const t=E.useRef(e);t.current=e,E.useEffect(()=>{const n=!e.disabled&&t.current.subject&&t.current.subject.subscribe({next:t.current.next});return()=>{n&&n.unsubscribe()}},[e.disabled])}function RH(e){const t=_y(),{control:n=t.control,disabled:r,name:s,exact:a}=e||{},[o,l]=E.useState(n._formState),c=E.useRef(!0),u=E.useRef({isDirty:!1,isLoading:!1,dirtyFields:!1,touchedFields:!1,validatingFields:!1,isValidating:!1,isValid:!1,errors:!1}),d=E.useRef(s);return d.current=s,eN({disabled:r,next:f=>c.current&&ZI(d.current,f.name,a)&&YI(f,u.current,n._updateFormState)&&l({...n._formState,...f}),subject:n._subjects.state}),E.useEffect(()=>(c.current=!0,u.current.isValid&&n._updateValid(!0),()=>{c.current=!1}),[n]),XI(o,n,u.current,!1)}var ja=e=>typeof e=="string",QI=(e,t,n,r,s)=>ja(e)?(r&&t.watch.add(e),Me(n,e,s)):Array.isArray(e)?e.map(a=>(r&&t.watch.add(a),Me(n,a))):(r&&(t.watchAll=!0),n);function DH(e){const t=_y(),{control:n=t.control,name:r,defaultValue:s,disabled:a,exact:o}=e||{},l=E.useRef(r);l.current=r,eN({disabled:a,subject:n._subjects.values,next:d=>{ZI(l.current,d.name,o)&&u(Ir(QI(l.current,n._names,d.values||n._formValues,!1,s)))}});const[c,u]=E.useState(n._getWatch(r,s));return E.useEffect(()=>n._removeUnmounted()),c}function LH(e){const t=_y(),{name:n,disabled:r,control:s=t.control,shouldUnregister:a}=e,o=HI(s._names.array,n),l=DH({control:s,name:n,defaultValue:Me(s._formValues,n,Me(s._defaultValues,n,e.defaultValue)),exact:!0}),c=RH({control:s,name:n,exact:!0}),u=E.useRef(s.register(n,{...e.rules,value:l,...vs(e.disabled)?{disabled:e.disabled}:{}}));return E.useEffect(()=>{const d=s._options.shouldUnregister||a,f=(h,p)=>{const g=Me(s._fields,h);g&&g._f&&(g._f.mount=p)};if(f(n,!0),d){const h=Ir(Me(s._options.defaultValues,n));Kt(s._defaultValues,n,h),Sn(Me(s._formValues,n))&&Kt(s._formValues,n,h)}return()=>{(o?d&&!s._state.action:d)?s.unregister(n):f(n,!1)}},[n,s,o,a]),E.useEffect(()=>{Me(s._fields,n)&&s._updateDisabledField({disabled:r,fields:s._fields,name:n,value:Me(s._fields,n)._f.value})},[r,n,s]),{field:{name:n,value:l,...vs(r)||c.disabled?{disabled:c.disabled||r}:{},onChange:E.useCallback(d=>u.current.onChange({target:{value:GI(d),name:n},type:yg.CHANGE}),[n]),onBlur:E.useCallback(()=>u.current.onBlur({target:{value:Me(s._formValues,n),name:n},type:yg.BLUR}),[n,s]),ref:E.useCallback(d=>{const f=Me(s._fields,n);f&&d&&(f._f.ref={focus:()=>d.focus(),select:()=>d.select(),setCustomValidity:h=>d.setCustomValidity(h),reportValidity:()=>d.reportValidity()})},[s._fields,n])},formState:c,fieldState:Object.defineProperties({},{invalid:{enumerable:!0,get:()=>!!Me(c.errors,n)},isDirty:{enumerable:!0,get:()=>!!Me(c.dirtyFields,n)},isTouched:{enumerable:!0,get:()=>!!Me(c.touchedFields,n)},isValidating:{enumerable:!0,get:()=>!!Me(c.validatingFields,n)},error:{enumerable:!0,get:()=>Me(c.errors,n)}})}}const FH=e=>e.render(LH(e));var JI=(e,t,n,r,s)=>t?{...n[e],types:{...n[e]&&n[e].types?n[e].types:{},[r]:s||!0}}:{},cC=e=>({isOnSubmit:!e||e===Gs.onSubmit,isOnBlur:e===Gs.onBlur,isOnChange:e===Gs.onChange,isOnAll:e===Gs.all,isOnTouch:e===Gs.onTouched}),uC=(e,t,n)=>!n&&(t.watchAll||t.watch.has(e)||[...t.watch].some(r=>e.startsWith(r)&&/^\.\w+/.test(e.slice(r.length))));const uf=(e,t,n,r)=>{for(const s of n||Object.keys(e)){const a=Me(e,s);if(a){const{_f:o,...l}=a;if(o){if(o.refs&&o.refs[0]&&t(o.refs[0],s)&&!r)return!0;if(o.ref&&t(o.ref,o.name)&&!r)return!0;if(uf(l,t))break}else if(kn(l)&&uf(l,t))break}}};var BH=(e,t,n)=>{const r=cf(Me(e,n));return Kt(r,"root",t[n]),Kt(e,n,r),e},tN=e=>e.type==="file",ri=e=>typeof e=="function",xg=e=>{if(!QS)return!1;const t=e?e.ownerDocument:0;return e instanceof(t&&t.defaultView?t.defaultView.HTMLElement:HTMLElement)},km=e=>ja(e),nN=e=>e.type==="radio",bg=e=>e instanceof RegExp;const dC={value:!1,isValid:!1},fC={value:!0,isValid:!0};var eR=e=>{if(Array.isArray(e)){if(e.length>1){const t=e.filter(n=>n&&n.checked&&!n.disabled).map(n=>n.value);return{value:t,isValid:!!t.length}}return e[0].checked&&!e[0].disabled?e[0].attributes&&!Sn(e[0].attributes.value)?Sn(e[0].value)||e[0].value===""?fC:{value:e[0].value,isValid:!0}:fC:dC}return dC};const hC={isValid:!1,value:null};var tR=e=>Array.isArray(e)?e.reduce((t,n)=>n&&n.checked&&!n.disabled?{isValid:!0,value:n.value}:t,hC):hC;function pC(e,t,n="validate"){if(km(e)||Array.isArray(e)&&e.every(km)||vs(e)&&!e)return{type:n,message:km(e)?e:"",ref:t}}var sc=e=>kn(e)&&!bg(e)?e:{value:e,message:""},mC=async(e,t,n,r,s)=>{const{ref:a,refs:o,required:l,maxLength:c,minLength:u,min:d,max:f,pattern:h,validate:p,name:g,valueAsNumber:m,mount:y,disabled:b}=e._f,x=Me(t,g);if(!y||b)return{};const w=o?o[0]:a,j=A=>{r&&w.reportValidity&&(w.setCustomValidity(vs(A)?"":A||""),w.reportValidity())},S={},N=nN(a),_=ap(a),P=N||_,k=(m||tN(a))&&Sn(a.value)&&Sn(x)||xg(a)&&a.value===""||x===""||Array.isArray(x)&&!x.length,O=JI.bind(null,g,n,S),M=(A,$,L,G=Wa.maxLength,D=Wa.minLength)=>{const V=A?$:L;S[g]={type:A?G:D,message:V,ref:a,...O(A?G:D,V)}};if(s?!Array.isArray(x)||!x.length:l&&(!P&&(k||_r(x))||vs(x)&&!x||_&&!eR(o).isValid||N&&!tR(o).isValid)){const{value:A,message:$}=km(l)?{value:!!l,message:l}:sc(l);if(A&&(S[g]={type:Wa.required,message:$,ref:w,...O(Wa.required,$)},!n))return j($),S}if(!k&&(!_r(d)||!_r(f))){let A,$;const L=sc(f),G=sc(d);if(!_r(x)&&!isNaN(x)){const D=a.valueAsNumber||x&&+x;_r(L.value)||(A=D>L.value),_r(G.value)||($=Dnew Date(new Date().toDateString()+" "+q),T=a.type=="time",F=a.type=="week";ja(L.value)&&x&&(A=T?V(x)>V(L.value):F?x>L.value:D>new Date(L.value)),ja(G.value)&&x&&($=T?V(x)+A.value,G=!_r($.value)&&x.length<+$.value;if((L||G)&&(M(L,A.message,$.message),!n))return j(S[g].message),S}if(h&&!k&&ja(x)){const{value:A,message:$}=sc(h);if(bg(A)&&!x.match(A)&&(S[g]={type:Wa.pattern,message:$,ref:a,...O(Wa.pattern,$)},!n))return j($),S}if(p){if(ri(p)){const A=await p(x,t),$=pC(A,w);if($&&(S[g]={...$,...O(Wa.validate,$.message)},!n))return j($.message),S}else if(kn(p)){let A={};for(const $ in p){if(!Rr(A)&&!n)break;const L=pC(await p[$](x,t),w,$);L&&(A={...L,...O($,L.message)},j(L.message),n&&(S[g]=A))}if(!Rr(A)&&(S[g]={ref:w,...A},!n))return S}}return j(!0),S};function zH(e,t){const n=t.slice(0,-1).length;let r=0;for(;r{let e=[];return{get observers(){return e},next:s=>{for(const a of e)a.next&&a.next(s)},subscribe:s=>(e.push(s),{unsubscribe:()=>{e=e.filter(a=>a!==s)}}),unsubscribe:()=>{e=[]}}},_w=e=>_r(e)||!WI(e);function Wi(e,t){if(_w(e)||_w(t))return e===t;if(il(e)&&il(t))return e.getTime()===t.getTime();const n=Object.keys(e),r=Object.keys(t);if(n.length!==r.length)return!1;for(const s of n){const a=e[s];if(!r.includes(s))return!1;if(s!=="ref"){const o=t[s];if(il(a)&&il(o)||kn(a)&&kn(o)||Array.isArray(a)&&Array.isArray(o)?!Wi(a,o):a!==o)return!1}}return!0}var nR=e=>e.type==="select-multiple",VH=e=>nN(e)||ap(e),x0=e=>xg(e)&&e.isConnected,rR=e=>{for(const t in e)if(ri(e[t]))return!0;return!1};function wg(e,t={}){const n=Array.isArray(e);if(kn(e)||n)for(const r in e)Array.isArray(e[r])||kn(e[r])&&!rR(e[r])?(t[r]=Array.isArray(e[r])?[]:{},wg(e[r],t[r])):_r(e[r])||(t[r]=!0);return t}function sR(e,t,n){const r=Array.isArray(e);if(kn(e)||r)for(const s in e)Array.isArray(e[s])||kn(e[s])&&!rR(e[s])?Sn(t)||_w(n[s])?n[s]=Array.isArray(e[s])?wg(e[s],[]):{...wg(e[s])}:sR(e[s],_r(t)?{}:t[s],n[s]):n[s]=!Wi(e[s],t[s]);return n}var Ed=(e,t)=>sR(e,t,wg(t)),aR=(e,{valueAsNumber:t,valueAsDate:n,setValueAs:r})=>Sn(e)?e:t?e===""?NaN:e&&+e:n&&ja(e)?new Date(e):r?r(e):e;function b0(e){const t=e.ref;if(!(e.refs?e.refs.every(n=>n.disabled):t.disabled))return tN(t)?t.files:nN(t)?tR(e.refs).value:nR(t)?[...t.selectedOptions].map(({value:n})=>n):ap(t)?eR(e.refs).value:aR(Sn(t.value)?e.ref.value:t.value,e)}var WH=(e,t,n,r)=>{const s={};for(const a of e){const o=Me(t,a);o&&Kt(s,a,o._f)}return{criteriaMode:n,names:[...e],fields:s,shouldUseNativeValidation:r}},Od=e=>Sn(e)?e:bg(e)?e.source:kn(e)?bg(e.value)?e.value.source:e.value:e;const gC="AsyncFunction";var GH=e=>(!e||!e.validate)&&!!(ri(e.validate)&&e.validate.constructor.name===gC||kn(e.validate)&&Object.values(e.validate).find(t=>t.constructor.name===gC)),HH=e=>e.mount&&(e.required||e.min||e.max||e.maxLength||e.minLength||e.pattern||e.validate);function vC(e,t,n){const r=Me(e,n);if(r||JS(n))return{error:r,name:n};const s=n.split(".");for(;s.length;){const a=s.join("."),o=Me(t,a),l=Me(e,a);if(o&&!Array.isArray(o)&&n!==a)return{name:n};if(l&&l.type)return{name:a,error:l};s.pop()}return{name:n}}var qH=(e,t,n,r,s)=>s.isOnAll?!1:!n&&s.isOnTouch?!(t||e):(n?r.isOnBlur:s.isOnBlur)?!e:(n?r.isOnChange:s.isOnChange)?e:!0,KH=(e,t)=>!Ny(Me(e,t)).length&&zn(e,t);const XH={mode:Gs.onSubmit,reValidateMode:Gs.onChange,shouldFocusError:!0};function YH(e={}){let t={...XH,...e},n={submitCount:0,isDirty:!1,isLoading:ri(t.defaultValues),isValidating:!1,isSubmitted:!1,isSubmitting:!1,isSubmitSuccessful:!1,isValid:!1,touchedFields:{},dirtyFields:{},validatingFields:{},errors:t.errors||{},disabled:t.disabled||!1},r={},s=kn(t.defaultValues)||kn(t.values)?Ir(t.defaultValues||t.values)||{}:{},a=t.shouldUnregister?{}:Ir(s),o={action:!1,mount:!1,watch:!1},l={mount:new Set,unMount:new Set,array:new Set,watch:new Set},c,u=0;const d={isDirty:!1,dirtyFields:!1,validatingFields:!1,touchedFields:!1,isValidating:!1,isValid:!1,errors:!1},f={values:y0(),array:y0(),state:y0()},h=cC(t.mode),p=cC(t.reValidateMode),g=t.criteriaMode===Gs.all,m=C=>R=>{clearTimeout(u),u=setTimeout(C,R)},y=async C=>{if(!e.disabled&&(d.isValid||C)){const R=t.resolver?Rr((await P()).errors):await O(r,!0);R!==n.isValid&&f.state.next({isValid:R})}},b=(C,R)=>{!e.disabled&&(d.isValidating||d.validatingFields)&&((C||Array.from(l.mount)).forEach(U=>{U&&(R?Kt(n.validatingFields,U,R):zn(n.validatingFields,U))}),f.state.next({validatingFields:n.validatingFields,isValidating:!Rr(n.validatingFields)}))},x=(C,R=[],U,X,Q=!0,z=!0)=>{if(X&&U&&!e.disabled){if(o.action=!0,z&&Array.isArray(Me(r,C))){const ee=U(Me(r,C),X.argA,X.argB);Q&&Kt(r,C,ee)}if(z&&Array.isArray(Me(n.errors,C))){const ee=U(Me(n.errors,C),X.argA,X.argB);Q&&Kt(n.errors,C,ee),KH(n.errors,C)}if(d.touchedFields&&z&&Array.isArray(Me(n.touchedFields,C))){const ee=U(Me(n.touchedFields,C),X.argA,X.argB);Q&&Kt(n.touchedFields,C,ee)}d.dirtyFields&&(n.dirtyFields=Ed(s,a)),f.state.next({name:C,isDirty:A(C,R),dirtyFields:n.dirtyFields,errors:n.errors,isValid:n.isValid})}else Kt(a,C,R)},w=(C,R)=>{Kt(n.errors,C,R),f.state.next({errors:n.errors})},j=C=>{n.errors=C,f.state.next({errors:n.errors,isValid:!1})},S=(C,R,U,X)=>{const Q=Me(r,C);if(Q){const z=Me(a,C,Sn(U)?Me(s,C):U);Sn(z)||X&&X.defaultChecked||R?Kt(a,C,R?z:b0(Q._f)):G(C,z),o.mount&&y()}},N=(C,R,U,X,Q)=>{let z=!1,ee=!1;const me={name:C};if(!e.disabled){const Se=!!(Me(r,C)&&Me(r,C)._f&&Me(r,C)._f.disabled);if(!U||X){d.isDirty&&(ee=n.isDirty,n.isDirty=me.isDirty=A(),z=ee!==me.isDirty);const Ie=Se||Wi(Me(s,C),R);ee=!!(!Se&&Me(n.dirtyFields,C)),Ie||Se?zn(n.dirtyFields,C):Kt(n.dirtyFields,C,!0),me.dirtyFields=n.dirtyFields,z=z||d.dirtyFields&&ee!==!Ie}if(U){const Ie=Me(n.touchedFields,C);Ie||(Kt(n.touchedFields,C,U),me.touchedFields=n.touchedFields,z=z||d.touchedFields&&Ie!==U)}z&&Q&&f.state.next(me)}return z?me:{}},_=(C,R,U,X)=>{const Q=Me(n.errors,C),z=d.isValid&&vs(R)&&n.isValid!==R;if(e.delayError&&U?(c=m(()=>w(C,U)),c(e.delayError)):(clearTimeout(u),c=null,U?Kt(n.errors,C,U):zn(n.errors,C)),(U?!Wi(Q,U):Q)||!Rr(X)||z){const ee={...X,...z&&vs(R)?{isValid:R}:{},errors:n.errors,name:C};n={...n,...ee},f.state.next(ee)}},P=async C=>{b(C,!0);const R=await t.resolver(a,t.context,WH(C||l.mount,r,t.criteriaMode,t.shouldUseNativeValidation));return b(C),R},k=async C=>{const{errors:R}=await P(C);if(C)for(const U of C){const X=Me(R,U);X?Kt(n.errors,U,X):zn(n.errors,U)}else n.errors=R;return R},O=async(C,R,U={valid:!0})=>{for(const X in C){const Q=C[X];if(Q){const{_f:z,...ee}=Q;if(z){const me=l.array.has(z.name),Se=Q._f&&GH(Q._f);Se&&d.validatingFields&&b([X],!0);const Ie=await mC(Q,a,g,t.shouldUseNativeValidation&&!R,me);if(Se&&d.validatingFields&&b([X]),Ie[z.name]&&(U.valid=!1,R))break;!R&&(Me(Ie,z.name)?me?BH(n.errors,Ie,z.name):Kt(n.errors,z.name,Ie[z.name]):zn(n.errors,z.name))}!Rr(ee)&&await O(ee,R,U)}}return U.valid},M=()=>{for(const C of l.unMount){const R=Me(r,C);R&&(R._f.refs?R._f.refs.every(U=>!x0(U)):!x0(R._f.ref))&&se(C)}l.unMount=new Set},A=(C,R)=>!e.disabled&&(C&&R&&Kt(a,C,R),!Wi(Z(),s)),$=(C,R,U)=>QI(C,l,{...o.mount?a:Sn(R)?s:ja(C)?{[C]:R}:R},U,R),L=C=>Ny(Me(o.mount?a:s,C,e.shouldUnregister?Me(s,C,[]):[])),G=(C,R,U={})=>{const X=Me(r,C);let Q=R;if(X){const z=X._f;z&&(!z.disabled&&Kt(a,C,aR(R,z)),Q=xg(z.ref)&&_r(R)?"":R,nR(z.ref)?[...z.ref.options].forEach(ee=>ee.selected=Q.includes(ee.value)):z.refs?ap(z.ref)?z.refs.length>1?z.refs.forEach(ee=>(!ee.defaultChecked||!ee.disabled)&&(ee.checked=Array.isArray(Q)?!!Q.find(me=>me===ee.value):Q===ee.value)):z.refs[0]&&(z.refs[0].checked=!!Q):z.refs.forEach(ee=>ee.checked=ee.value===Q):tN(z.ref)?z.ref.value="":(z.ref.value=Q,z.ref.type||f.values.next({name:C,values:{...a}})))}(U.shouldDirty||U.shouldTouch)&&N(C,Q,U.shouldTouch,U.shouldDirty,!0),U.shouldValidate&&q(C)},D=(C,R,U)=>{for(const X in R){const Q=R[X],z=`${C}.${X}`,ee=Me(r,z);(l.array.has(C)||kn(Q)||ee&&!ee._f)&&!il(Q)?D(z,Q,U):G(z,Q,U)}},V=(C,R,U={})=>{const X=Me(r,C),Q=l.array.has(C),z=Ir(R);Kt(a,C,z),Q?(f.array.next({name:C,values:{...a}}),(d.isDirty||d.dirtyFields)&&U.shouldDirty&&f.state.next({name:C,dirtyFields:Ed(s,a),isDirty:A(C,z)})):X&&!X._f&&!_r(z)?D(C,z,U):G(C,z,U),uC(C,l)&&f.state.next({...n}),f.values.next({name:o.mount?C:void 0,values:{...a}})},T=async C=>{o.mount=!0;const R=C.target;let U=R.name,X=!0;const Q=Me(r,U),z=()=>R.type?b0(Q._f):GI(C),ee=me=>{X=Number.isNaN(me)||il(me)&&isNaN(me.getTime())||Wi(me,Me(a,U,me))};if(Q){let me,Se;const Ie=z(),we=C.type===yg.BLUR||C.type===yg.FOCUS_OUT,ze=!HH(Q._f)&&!t.resolver&&!Me(n.errors,U)&&!Q._f.deps||qH(we,Me(n.touchedFields,U),n.isSubmitted,p,h),gt=uC(U,l,we);Kt(a,U,Ie),we?(Q._f.onBlur&&Q._f.onBlur(C),c&&c(0)):Q._f.onChange&&Q._f.onChange(C);const St=N(U,Ie,we,!1),He=!Rr(St)||gt;if(!we&&f.values.next({name:U,type:C.type,values:{...a}}),ze)return d.isValid&&(e.mode==="onBlur"?we&&y():y()),He&&f.state.next({name:U,...gt?{}:St});if(!we&>&&f.state.next({...n}),t.resolver){const{errors:Ze}=await P([U]);if(ee(Ie),X){const kt=vC(n.errors,r,U),Vt=vC(Ze,r,kt.name||U);me=Vt.error,U=Vt.name,Se=Rr(Ze)}}else b([U],!0),me=(await mC(Q,a,g,t.shouldUseNativeValidation))[U],b([U]),ee(Ie),X&&(me?Se=!1:d.isValid&&(Se=await O(r,!0)));X&&(Q._f.deps&&q(Q._f.deps),_(U,Se,me,St))}},F=(C,R)=>{if(Me(n.errors,R)&&C.focus)return C.focus(),1},q=async(C,R={})=>{let U,X;const Q=cf(C);if(t.resolver){const z=await k(Sn(C)?C:Q);U=Rr(z),X=C?!Q.some(ee=>Me(z,ee)):U}else C?(X=(await Promise.all(Q.map(async z=>{const ee=Me(r,z);return await O(ee&&ee._f?{[z]:ee}:ee)}))).every(Boolean),!(!X&&!n.isValid)&&y()):X=U=await O(r);return f.state.next({...!ja(C)||d.isValid&&U!==n.isValid?{}:{name:C},...t.resolver||!C?{isValid:U}:{},errors:n.errors}),R.shouldFocus&&!X&&uf(r,F,C?Q:l.mount),X},Z=C=>{const R={...o.mount?a:s};return Sn(C)?R:ja(C)?Me(R,C):C.map(U=>Me(R,U))},re=(C,R)=>({invalid:!!Me((R||n).errors,C),isDirty:!!Me((R||n).dirtyFields,C),error:Me((R||n).errors,C),isValidating:!!Me(n.validatingFields,C),isTouched:!!Me((R||n).touchedFields,C)}),ge=C=>{C&&cf(C).forEach(R=>zn(n.errors,R)),f.state.next({errors:C?n.errors:{}})},B=(C,R,U)=>{const X=(Me(r,C,{_f:{}})._f||{}).ref,Q=Me(n.errors,C)||{},{ref:z,message:ee,type:me,...Se}=Q;Kt(n.errors,C,{...Se,...R,ref:X}),f.state.next({name:C,errors:n.errors,isValid:!1}),U&&U.shouldFocus&&X&&X.focus&&X.focus()},le=(C,R)=>ri(C)?f.values.subscribe({next:U=>C($(void 0,R),U)}):$(C,R,!0),se=(C,R={})=>{for(const U of C?cf(C):l.mount)l.mount.delete(U),l.array.delete(U),R.keepValue||(zn(r,U),zn(a,U)),!R.keepError&&zn(n.errors,U),!R.keepDirty&&zn(n.dirtyFields,U),!R.keepTouched&&zn(n.touchedFields,U),!R.keepIsValidating&&zn(n.validatingFields,U),!t.shouldUnregister&&!R.keepDefaultValue&&zn(s,U);f.values.next({values:{...a}}),f.state.next({...n,...R.keepDirty?{isDirty:A()}:{}}),!R.keepIsValid&&y()},ce=({disabled:C,name:R,field:U,fields:X,value:Q})=>{if(vs(C)&&o.mount||C){const z=C?void 0:Sn(Q)?b0(U?U._f:Me(X,R)._f):Q;Kt(a,R,z),N(R,z,!1,!1,!0)}},De=(C,R={})=>{let U=Me(r,C);const X=vs(R.disabled)||vs(e.disabled);return Kt(r,C,{...U||{},_f:{...U&&U._f?U._f:{ref:{name:C}},name:C,mount:!0,...R}}),l.mount.add(C),U?ce({field:U,disabled:vs(R.disabled)?R.disabled:e.disabled,name:C,value:R.value}):S(C,!0,R.value),{...X?{disabled:R.disabled||e.disabled}:{},...t.progressive?{required:!!R.required,min:Od(R.min),max:Od(R.max),minLength:Od(R.minLength),maxLength:Od(R.maxLength),pattern:Od(R.pattern)}:{},name:C,onChange:T,onBlur:T,ref:Q=>{if(Q){De(C,R),U=Me(r,C);const z=Sn(Q.value)&&Q.querySelectorAll&&Q.querySelectorAll("input,select,textarea")[0]||Q,ee=VH(z),me=U._f.refs||[];if(ee?me.find(Se=>Se===z):z===U._f.ref)return;Kt(r,C,{_f:{...U._f,...ee?{refs:[...me.filter(x0),z,...Array.isArray(Me(s,C))?[{}]:[]],ref:{type:z.type,name:C}}:{ref:z}}}),S(C,!1,void 0,z)}else U=Me(r,C,{}),U._f&&(U._f.mount=!1),(t.shouldUnregister||R.shouldUnregister)&&!(HI(l.array,C)&&o.action)&&l.unMount.add(C)}}},de=()=>t.shouldFocusError&&uf(r,F,l.mount),be=C=>{vs(C)&&(f.state.next({disabled:C}),uf(r,(R,U)=>{const X=Me(r,U);X&&(R.disabled=X._f.disabled||C,Array.isArray(X._f.refs)&&X._f.refs.forEach(Q=>{Q.disabled=X._f.disabled||C}))},0,!1))},Pe=(C,R)=>async U=>{let X;U&&(U.preventDefault&&U.preventDefault(),U.persist&&U.persist());let Q=Ir(a);if(f.state.next({isSubmitting:!0}),t.resolver){const{errors:z,values:ee}=await P();n.errors=z,Q=ee}else await O(r);if(zn(n.errors,"root"),Rr(n.errors)){f.state.next({errors:{}});try{await C(Q,U)}catch(z){X=z}}else R&&await R({...n.errors},U),de(),setTimeout(de);if(f.state.next({isSubmitted:!0,isSubmitting:!1,isSubmitSuccessful:Rr(n.errors)&&!X,submitCount:n.submitCount+1,errors:n.errors}),X)throw X},ne=(C,R={})=>{Me(r,C)&&(Sn(R.defaultValue)?V(C,Ir(Me(s,C))):(V(C,R.defaultValue),Kt(s,C,Ir(R.defaultValue))),R.keepTouched||zn(n.touchedFields,C),R.keepDirty||(zn(n.dirtyFields,C),n.isDirty=R.defaultValue?A(C,Ir(Me(s,C))):A()),R.keepError||(zn(n.errors,C),d.isValid&&y()),f.state.next({...n}))},Je=(C,R={})=>{const U=C?Ir(C):s,X=Ir(U),Q=Rr(C),z=Q?s:X;if(R.keepDefaultValues||(s=U),!R.keepValues){if(R.keepDirtyValues){const ee=new Set([...l.mount,...Object.keys(Ed(s,a))]);for(const me of Array.from(ee))Me(n.dirtyFields,me)?Kt(z,me,Me(a,me)):V(me,Me(z,me))}else{if(QS&&Sn(C))for(const ee of l.mount){const me=Me(r,ee);if(me&&me._f){const Se=Array.isArray(me._f.refs)?me._f.refs[0]:me._f.ref;if(xg(Se)){const Ie=Se.closest("form");if(Ie){Ie.reset();break}}}}r={}}a=e.shouldUnregister?R.keepDefaultValues?Ir(s):{}:Ir(z),f.array.next({values:{...z}}),f.values.next({values:{...z}})}l={mount:R.keepDirtyValues?l.mount:new Set,unMount:new Set,array:new Set,watch:new Set,watchAll:!1,focus:""},o.mount=!d.isValid||!!R.keepIsValid||!!R.keepDirtyValues,o.watch=!!e.shouldUnregister,f.state.next({submitCount:R.keepSubmitCount?n.submitCount:0,isDirty:Q?!1:R.keepDirty?n.isDirty:!!(R.keepDefaultValues&&!Wi(C,s)),isSubmitted:R.keepIsSubmitted?n.isSubmitted:!1,dirtyFields:Q?{}:R.keepDirtyValues?R.keepDefaultValues&&a?Ed(s,a):n.dirtyFields:R.keepDefaultValues&&C?Ed(s,C):R.keepDirty?n.dirtyFields:{},touchedFields:R.keepTouched?n.touchedFields:{},errors:R.keepErrors?n.errors:{},isSubmitSuccessful:R.keepIsSubmitSuccessful?n.isSubmitSuccessful:!1,isSubmitting:!1})},ve=(C,R)=>Je(ri(C)?C(a):C,R);return{control:{register:De,unregister:se,getFieldState:re,handleSubmit:Pe,setError:B,_executeSchema:P,_getWatch:$,_getDirty:A,_updateValid:y,_removeUnmounted:M,_updateFieldArray:x,_updateDisabledField:ce,_getFieldArray:L,_reset:Je,_resetDefaultValues:()=>ri(t.defaultValues)&&t.defaultValues().then(C=>{ve(C,t.resetOptions),f.state.next({isLoading:!1})}),_updateFormState:C=>{n={...n,...C}},_disableForm:be,_subjects:f,_proxyFormState:d,_setErrors:j,get _fields(){return r},get _formValues(){return a},get _state(){return o},set _state(C){o=C},get _defaultValues(){return s},get _names(){return l},set _names(C){l=C},get _formState(){return n},set _formState(C){n=C},get _options(){return t},set _options(C){t={...t,...C}}},trigger:q,register:De,handleSubmit:Pe,watch:le,setValue:V,getValues:Z,reset:ve,resetField:ne,clearErrors:ge,unregister:se,setError:B,setFocus:(C,R={})=>{const U=Me(r,C),X=U&&U._f;if(X){const Q=X.refs?X.refs[0]:X.ref;Q.focus&&(Q.focus(),R.shouldSelect&&Q.select())}},getFieldState:re}}function Py(e={}){const t=E.useRef(),n=E.useRef(),[r,s]=E.useState({isDirty:!1,isValidating:!1,isLoading:ri(e.defaultValues),isSubmitted:!1,isSubmitting:!1,isSubmitSuccessful:!1,isValid:!1,submitCount:0,dirtyFields:{},touchedFields:{},validatingFields:{},errors:e.errors||{},disabled:e.disabled||!1,defaultValues:ri(e.defaultValues)?void 0:e.defaultValues});t.current||(t.current={...YH(e),formState:r});const a=t.current.control;return a._options=e,eN({subject:a._subjects.state,next:o=>{YI(o,a._proxyFormState,a._updateFormState,!0)&&s({...a._formState})}}),E.useEffect(()=>a._disableForm(e.disabled),[a,e.disabled]),E.useEffect(()=>{if(a._proxyFormState.isDirty){const o=a._getDirty();o!==r.isDirty&&a._subjects.state.next({isDirty:o})}},[a,r.isDirty]),E.useEffect(()=>{e.values&&!Wi(e.values,n.current)?(a._reset(e.values,a._options.resetOptions),n.current=e.values,s(o=>({...o}))):a._resetDefaultValues()},[e.values,a]),E.useEffect(()=>{e.errors&&a._setErrors(e.errors)},[e.errors,a]),E.useEffect(()=>{a._state.mount||(a._updateValid(),a._state.mount=!0),a._state.watch&&(a._state.watch=!1,a._subjects.state.next({...a._formState})),a._removeUnmounted()}),E.useEffect(()=>{e.shouldUnregister&&a._subjects.values.next({values:a._getWatch()})},[e.shouldUnregister,a]),E.useEffect(()=>{t.current&&(t.current.watch=t.current.watch.bind({}))},[r]),t.current.formState=XI(r,a),t.current}const yC=(e,t,n)=>{if(e&&"reportValidity"in e){const r=Me(n,t);e.setCustomValidity(r&&r.message||""),e.reportValidity()}},iR=(e,t)=>{for(const n in t.fields){const r=t.fields[n];r&&r.ref&&"reportValidity"in r.ref?yC(r.ref,n,e):r.refs&&r.refs.forEach(s=>yC(s,n,e))}},ZH=(e,t)=>{t.shouldUseNativeValidation&&iR(e,t);const n={};for(const r in e){const s=Me(t.fields,r),a=Object.assign(e[r]||{},{ref:s&&s.ref});if(QH(t.names||Object.keys(e),r)){const o=Object.assign({},Me(n,r));Kt(o,"root",a),Kt(n,r,o)}else Kt(n,r,a)}return n},QH=(e,t)=>e.some(n=>n.startsWith(t+"."));var JH=function(e,t){for(var n={};e.length;){var r=e[0],s=r.code,a=r.message,o=r.path.join(".");if(!n[o])if("unionErrors"in r){var l=r.unionErrors[0].errors[0];n[o]={message:l.message,type:l.code}}else n[o]={message:a,type:s};if("unionErrors"in r&&r.unionErrors.forEach(function(d){return d.errors.forEach(function(f){return e.push(f)})}),t){var c=n[o].types,u=c&&c[r.code];n[o]=JI(o,t,n,s,u?[].concat(u,r.message):r.message)}e.shift()}return n},Ay=function(e,t,n){return n===void 0&&(n={}),function(r,s,a){try{return Promise.resolve(function(o,l){try{var c=Promise.resolve(e[n.mode==="sync"?"parse":"parseAsync"](r,t)).then(function(u){return a.shouldUseNativeValidation&&iR({},a),{errors:{},values:n.raw?r:u}})}catch(u){return l(u)}return c&&c.then?c.then(void 0,l):c}(0,function(o){if(function(l){return Array.isArray(l==null?void 0:l.errors)}(o))return{values:{},errors:ZH(JH(o.errors,!a.shouldUseNativeValidation&&a.criteriaMode==="all"),a)};throw o}))}catch(o){return Promise.reject(o)}}},Bt;(function(e){e.assertEqual=s=>s;function t(s){}e.assertIs=t;function n(s){throw new Error}e.assertNever=n,e.arrayToEnum=s=>{const a={};for(const o of s)a[o]=o;return a},e.getValidEnumValues=s=>{const a=e.objectKeys(s).filter(l=>typeof s[s[l]]!="number"),o={};for(const l of a)o[l]=s[l];return e.objectValues(o)},e.objectValues=s=>e.objectKeys(s).map(function(a){return s[a]}),e.objectKeys=typeof Object.keys=="function"?s=>Object.keys(s):s=>{const a=[];for(const o in s)Object.prototype.hasOwnProperty.call(s,o)&&a.push(o);return a},e.find=(s,a)=>{for(const o of s)if(a(o))return o},e.isInteger=typeof Number.isInteger=="function"?s=>Number.isInteger(s):s=>typeof s=="number"&&isFinite(s)&&Math.floor(s)===s;function r(s,a=" | "){return s.map(o=>typeof o=="string"?`'${o}'`:o).join(a)}e.joinValues=r,e.jsonStringifyReplacer=(s,a)=>typeof a=="bigint"?a.toString():a})(Bt||(Bt={}));var Pw;(function(e){e.mergeShapes=(t,n)=>({...t,...n})})(Pw||(Pw={}));const Be=Bt.arrayToEnum(["string","nan","number","integer","float","boolean","date","bigint","symbol","function","undefined","null","array","object","unknown","promise","void","never","map","set"]),Gi=e=>{switch(typeof e){case"undefined":return Be.undefined;case"string":return Be.string;case"number":return isNaN(e)?Be.nan:Be.number;case"boolean":return Be.boolean;case"function":return Be.function;case"bigint":return Be.bigint;case"symbol":return Be.symbol;case"object":return Array.isArray(e)?Be.array:e===null?Be.null:e.then&&typeof e.then=="function"&&e.catch&&typeof e.catch=="function"?Be.promise:typeof Map<"u"&&e instanceof Map?Be.map:typeof Set<"u"&&e instanceof Set?Be.set:typeof Date<"u"&&e instanceof Date?Be.date:Be.object;default:return Be.unknown}},_e=Bt.arrayToEnum(["invalid_type","invalid_literal","custom","invalid_union","invalid_union_discriminator","invalid_enum_value","unrecognized_keys","invalid_arguments","invalid_return_type","invalid_date","invalid_string","too_small","too_big","invalid_intersection_types","not_multiple_of","not_finite"]),eq=e=>JSON.stringify(e,null,2).replace(/"([^"]+)":/g,"$1:");class os extends Error{constructor(t){super(),this.issues=[],this.addIssue=r=>{this.issues=[...this.issues,r]},this.addIssues=(r=[])=>{this.issues=[...this.issues,...r]};const n=new.target.prototype;Object.setPrototypeOf?Object.setPrototypeOf(this,n):this.__proto__=n,this.name="ZodError",this.issues=t}get errors(){return this.issues}format(t){const n=t||function(a){return a.message},r={_errors:[]},s=a=>{for(const o of a.issues)if(o.code==="invalid_union")o.unionErrors.map(s);else if(o.code==="invalid_return_type")s(o.returnTypeError);else if(o.code==="invalid_arguments")s(o.argumentsError);else if(o.path.length===0)r._errors.push(n(o));else{let l=r,c=0;for(;cn.message){const n={},r=[];for(const s of this.issues)s.path.length>0?(n[s.path[0]]=n[s.path[0]]||[],n[s.path[0]].push(t(s))):r.push(t(s));return{formErrors:r,fieldErrors:n}}get formErrors(){return this.flatten()}}os.create=e=>new os(e);const uu=(e,t)=>{let n;switch(e.code){case _e.invalid_type:e.received===Be.undefined?n="Required":n=`Expected ${e.expected}, received ${e.received}`;break;case _e.invalid_literal:n=`Invalid literal value, expected ${JSON.stringify(e.expected,Bt.jsonStringifyReplacer)}`;break;case _e.unrecognized_keys:n=`Unrecognized key(s) in object: ${Bt.joinValues(e.keys,", ")}`;break;case _e.invalid_union:n="Invalid input";break;case _e.invalid_union_discriminator:n=`Invalid discriminator value. Expected ${Bt.joinValues(e.options)}`;break;case _e.invalid_enum_value:n=`Invalid enum value. Expected ${Bt.joinValues(e.options)}, received '${e.received}'`;break;case _e.invalid_arguments:n="Invalid function arguments";break;case _e.invalid_return_type:n="Invalid function return type";break;case _e.invalid_date:n="Invalid date";break;case _e.invalid_string:typeof e.validation=="object"?"includes"in e.validation?(n=`Invalid input: must include "${e.validation.includes}"`,typeof e.validation.position=="number"&&(n=`${n} at one or more positions greater than or equal to ${e.validation.position}`)):"startsWith"in e.validation?n=`Invalid input: must start with "${e.validation.startsWith}"`:"endsWith"in e.validation?n=`Invalid input: must end with "${e.validation.endsWith}"`:Bt.assertNever(e.validation):e.validation!=="regex"?n=`Invalid ${e.validation}`:n="Invalid";break;case _e.too_small:e.type==="array"?n=`Array must contain ${e.exact?"exactly":e.inclusive?"at least":"more than"} ${e.minimum} element(s)`:e.type==="string"?n=`String must contain ${e.exact?"exactly":e.inclusive?"at least":"over"} ${e.minimum} character(s)`:e.type==="number"?n=`Number must be ${e.exact?"exactly equal to ":e.inclusive?"greater than or equal to ":"greater than "}${e.minimum}`:e.type==="date"?n=`Date must be ${e.exact?"exactly equal to ":e.inclusive?"greater than or equal to ":"greater than "}${new Date(Number(e.minimum))}`:n="Invalid input";break;case _e.too_big:e.type==="array"?n=`Array must contain ${e.exact?"exactly":e.inclusive?"at most":"less than"} ${e.maximum} element(s)`:e.type==="string"?n=`String must contain ${e.exact?"exactly":e.inclusive?"at most":"under"} ${e.maximum} character(s)`:e.type==="number"?n=`Number must be ${e.exact?"exactly":e.inclusive?"less than or equal to":"less than"} ${e.maximum}`:e.type==="bigint"?n=`BigInt must be ${e.exact?"exactly":e.inclusive?"less than or equal to":"less than"} ${e.maximum}`:e.type==="date"?n=`Date must be ${e.exact?"exactly":e.inclusive?"smaller than or equal to":"smaller than"} ${new Date(Number(e.maximum))}`:n="Invalid input";break;case _e.custom:n="Invalid input";break;case _e.invalid_intersection_types:n="Intersection results could not be merged";break;case _e.not_multiple_of:n=`Number must be a multiple of ${e.multipleOf}`;break;case _e.not_finite:n="Number must be finite";break;default:n=t.defaultError,Bt.assertNever(e)}return{message:n}};let oR=uu;function tq(e){oR=e}function jg(){return oR}const Sg=e=>{const{data:t,path:n,errorMaps:r,issueData:s}=e,a=[...n,...s.path||[]],o={...s,path:a};if(s.message!==void 0)return{...s,path:a,message:s.message};let l="";const c=r.filter(u=>!!u).slice().reverse();for(const u of c)l=u(o,{data:t,defaultError:l}).message;return{...s,path:a,message:l}},nq=[];function Fe(e,t){const n=jg(),r=Sg({issueData:t,data:e.data,path:e.path,errorMaps:[e.common.contextualErrorMap,e.schemaErrorMap,n,n===uu?void 0:uu].filter(s=>!!s)});e.common.issues.push(r)}class br{constructor(){this.value="valid"}dirty(){this.value==="valid"&&(this.value="dirty")}abort(){this.value!=="aborted"&&(this.value="aborted")}static mergeArray(t,n){const r=[];for(const s of n){if(s.status==="aborted")return yt;s.status==="dirty"&&t.dirty(),r.push(s.value)}return{status:t.value,value:r}}static async mergeObjectAsync(t,n){const r=[];for(const s of n){const a=await s.key,o=await s.value;r.push({key:a,value:o})}return br.mergeObjectSync(t,r)}static mergeObjectSync(t,n){const r={};for(const s of n){const{key:a,value:o}=s;if(a.status==="aborted"||o.status==="aborted")return yt;a.status==="dirty"&&t.dirty(),o.status==="dirty"&&t.dirty(),a.value!=="__proto__"&&(typeof o.value<"u"||s.alwaysSet)&&(r[a.value]=o.value)}return{status:t.value,value:r}}}const yt=Object.freeze({status:"aborted"}),_c=e=>({status:"dirty",value:e}),kr=e=>({status:"valid",value:e}),Aw=e=>e.status==="aborted",Cw=e=>e.status==="dirty",Gf=e=>e.status==="valid",Hf=e=>typeof Promise<"u"&&e instanceof Promise;function Ng(e,t,n,r){if(typeof t=="function"?e!==t||!r:!t.has(e))throw new TypeError("Cannot read private member from an object whose class did not declare it");return t.get(e)}function lR(e,t,n,r,s){if(typeof t=="function"?e!==t||!s:!t.has(e))throw new TypeError("Cannot write private member to an object whose class did not declare it");return t.set(e,n),n}var et;(function(e){e.errToObj=t=>typeof t=="string"?{message:t}:t||{},e.toString=t=>typeof t=="string"?t:t==null?void 0:t.message})(et||(et={}));var qd,Kd;class Ia{constructor(t,n,r,s){this._cachedPath=[],this.parent=t,this.data=n,this._path=r,this._key=s}get path(){return this._cachedPath.length||(this._key instanceof Array?this._cachedPath.push(...this._path,...this._key):this._cachedPath.push(...this._path,this._key)),this._cachedPath}}const xC=(e,t)=>{if(Gf(t))return{success:!0,data:t.value};if(!e.common.issues.length)throw new Error("Validation failed but no issues detected.");return{success:!1,get error(){if(this._error)return this._error;const n=new os(e.common.issues);return this._error=n,this._error}}};function Pt(e){if(!e)return{};const{errorMap:t,invalid_type_error:n,required_error:r,description:s}=e;if(t&&(n||r))throw new Error(`Can't use "invalid_type_error" or "required_error" in conjunction with custom error map.`);return t?{errorMap:t,description:s}:{errorMap:(o,l)=>{var c,u;const{message:d}=e;return o.code==="invalid_enum_value"?{message:d??l.defaultError}:typeof l.data>"u"?{message:(c=d??r)!==null&&c!==void 0?c:l.defaultError}:o.code!=="invalid_type"?{message:l.defaultError}:{message:(u=d??n)!==null&&u!==void 0?u:l.defaultError}},description:s}}class $t{constructor(t){this.spa=this.safeParseAsync,this._def=t,this.parse=this.parse.bind(this),this.safeParse=this.safeParse.bind(this),this.parseAsync=this.parseAsync.bind(this),this.safeParseAsync=this.safeParseAsync.bind(this),this.spa=this.spa.bind(this),this.refine=this.refine.bind(this),this.refinement=this.refinement.bind(this),this.superRefine=this.superRefine.bind(this),this.optional=this.optional.bind(this),this.nullable=this.nullable.bind(this),this.nullish=this.nullish.bind(this),this.array=this.array.bind(this),this.promise=this.promise.bind(this),this.or=this.or.bind(this),this.and=this.and.bind(this),this.transform=this.transform.bind(this),this.brand=this.brand.bind(this),this.default=this.default.bind(this),this.catch=this.catch.bind(this),this.describe=this.describe.bind(this),this.pipe=this.pipe.bind(this),this.readonly=this.readonly.bind(this),this.isNullable=this.isNullable.bind(this),this.isOptional=this.isOptional.bind(this)}get description(){return this._def.description}_getType(t){return Gi(t.data)}_getOrReturnCtx(t,n){return n||{common:t.parent.common,data:t.data,parsedType:Gi(t.data),schemaErrorMap:this._def.errorMap,path:t.path,parent:t.parent}}_processInputParams(t){return{status:new br,ctx:{common:t.parent.common,data:t.data,parsedType:Gi(t.data),schemaErrorMap:this._def.errorMap,path:t.path,parent:t.parent}}}_parseSync(t){const n=this._parse(t);if(Hf(n))throw new Error("Synchronous parse encountered promise.");return n}_parseAsync(t){const n=this._parse(t);return Promise.resolve(n)}parse(t,n){const r=this.safeParse(t,n);if(r.success)return r.data;throw r.error}safeParse(t,n){var r;const s={common:{issues:[],async:(r=n==null?void 0:n.async)!==null&&r!==void 0?r:!1,contextualErrorMap:n==null?void 0:n.errorMap},path:(n==null?void 0:n.path)||[],schemaErrorMap:this._def.errorMap,parent:null,data:t,parsedType:Gi(t)},a=this._parseSync({data:t,path:s.path,parent:s});return xC(s,a)}async parseAsync(t,n){const r=await this.safeParseAsync(t,n);if(r.success)return r.data;throw r.error}async safeParseAsync(t,n){const r={common:{issues:[],contextualErrorMap:n==null?void 0:n.errorMap,async:!0},path:(n==null?void 0:n.path)||[],schemaErrorMap:this._def.errorMap,parent:null,data:t,parsedType:Gi(t)},s=this._parse({data:t,path:r.path,parent:r}),a=await(Hf(s)?s:Promise.resolve(s));return xC(r,a)}refine(t,n){const r=s=>typeof n=="string"||typeof n>"u"?{message:n}:typeof n=="function"?n(s):n;return this._refinement((s,a)=>{const o=t(s),l=()=>a.addIssue({code:_e.custom,...r(s)});return typeof Promise<"u"&&o instanceof Promise?o.then(c=>c?!0:(l(),!1)):o?!0:(l(),!1)})}refinement(t,n){return this._refinement((r,s)=>t(r)?!0:(s.addIssue(typeof n=="function"?n(r,s):n),!1))}_refinement(t){return new ia({schema:this,typeName:mt.ZodEffects,effect:{type:"refinement",refinement:t}})}superRefine(t){return this._refinement(t)}optional(){return Aa.create(this,this._def)}nullable(){return Eo.create(this,this._def)}nullish(){return this.nullable().optional()}array(){return Qs.create(this,this._def)}promise(){return fu.create(this,this._def)}or(t){return Yf.create([this,t],this._def)}and(t){return Zf.create(this,t,this._def)}transform(t){return new ia({...Pt(this._def),schema:this,typeName:mt.ZodEffects,effect:{type:"transform",transform:t}})}default(t){const n=typeof t=="function"?t:()=>t;return new nh({...Pt(this._def),innerType:this,defaultValue:n,typeName:mt.ZodDefault})}brand(){return new rN({typeName:mt.ZodBranded,type:this,...Pt(this._def)})}catch(t){const n=typeof t=="function"?t:()=>t;return new rh({...Pt(this._def),innerType:this,catchValue:n,typeName:mt.ZodCatch})}describe(t){const n=this.constructor;return new n({...this._def,description:t})}pipe(t){return ip.create(this,t)}readonly(){return sh.create(this)}isOptional(){return this.safeParse(void 0).success}isNullable(){return this.safeParse(null).success}}const rq=/^c[^\s-]{8,}$/i,sq=/^[0-9a-z]+$/,aq=/^[0-9A-HJKMNP-TV-Z]{26}$/,iq=/^[0-9a-fA-F]{8}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{12}$/i,oq=/^[a-z0-9_-]{21}$/i,lq=/^[-+]?P(?!$)(?:(?:[-+]?\d+Y)|(?:[-+]?\d+[.,]\d+Y$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:(?:[-+]?\d+W)|(?:[-+]?\d+[.,]\d+W$))?(?:(?:[-+]?\d+D)|(?:[-+]?\d+[.,]\d+D$))?(?:T(?=[\d+-])(?:(?:[-+]?\d+H)|(?:[-+]?\d+[.,]\d+H$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:[-+]?\d+(?:[.,]\d+)?S)?)??$/,cq=/^(?!\.)(?!.*\.\.)([A-Z0-9_'+\-\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i,uq="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$";let w0;const dq=/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])$/,fq=/^(([a-f0-9]{1,4}:){7}|::([a-f0-9]{1,4}:){0,6}|([a-f0-9]{1,4}:){1}:([a-f0-9]{1,4}:){0,5}|([a-f0-9]{1,4}:){2}:([a-f0-9]{1,4}:){0,4}|([a-f0-9]{1,4}:){3}:([a-f0-9]{1,4}:){0,3}|([a-f0-9]{1,4}:){4}:([a-f0-9]{1,4}:){0,2}|([a-f0-9]{1,4}:){5}:([a-f0-9]{1,4}:){0,1})([a-f0-9]{1,4}|(((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2}))\.){3}((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2})))$/,hq=/^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/,cR="((\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-((0[13578]|1[02])-(0[1-9]|[12]\\d|3[01])|(0[469]|11)-(0[1-9]|[12]\\d|30)|(02)-(0[1-9]|1\\d|2[0-8])))",pq=new RegExp(`^${cR}$`);function uR(e){let t="([01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d";return e.precision?t=`${t}\\.\\d{${e.precision}}`:e.precision==null&&(t=`${t}(\\.\\d+)?`),t}function mq(e){return new RegExp(`^${uR(e)}$`)}function dR(e){let t=`${cR}T${uR(e)}`;const n=[];return n.push(e.local?"Z?":"Z"),e.offset&&n.push("([+-]\\d{2}:?\\d{2})"),t=`${t}(${n.join("|")})`,new RegExp(`^${t}$`)}function gq(e,t){return!!((t==="v4"||!t)&&dq.test(e)||(t==="v6"||!t)&&fq.test(e))}class qs extends $t{_parse(t){if(this._def.coerce&&(t.data=String(t.data)),this._getType(t)!==Be.string){const a=this._getOrReturnCtx(t);return Fe(a,{code:_e.invalid_type,expected:Be.string,received:a.parsedType}),yt}const r=new br;let s;for(const a of this._def.checks)if(a.kind==="min")t.data.lengtha.value&&(s=this._getOrReturnCtx(t,s),Fe(s,{code:_e.too_big,maximum:a.value,type:"string",inclusive:!0,exact:!1,message:a.message}),r.dirty());else if(a.kind==="length"){const o=t.data.length>a.value,l=t.data.lengtht.test(s),{validation:n,code:_e.invalid_string,...et.errToObj(r)})}_addCheck(t){return new qs({...this._def,checks:[...this._def.checks,t]})}email(t){return this._addCheck({kind:"email",...et.errToObj(t)})}url(t){return this._addCheck({kind:"url",...et.errToObj(t)})}emoji(t){return this._addCheck({kind:"emoji",...et.errToObj(t)})}uuid(t){return this._addCheck({kind:"uuid",...et.errToObj(t)})}nanoid(t){return this._addCheck({kind:"nanoid",...et.errToObj(t)})}cuid(t){return this._addCheck({kind:"cuid",...et.errToObj(t)})}cuid2(t){return this._addCheck({kind:"cuid2",...et.errToObj(t)})}ulid(t){return this._addCheck({kind:"ulid",...et.errToObj(t)})}base64(t){return this._addCheck({kind:"base64",...et.errToObj(t)})}ip(t){return this._addCheck({kind:"ip",...et.errToObj(t)})}datetime(t){var n,r;return typeof t=="string"?this._addCheck({kind:"datetime",precision:null,offset:!1,local:!1,message:t}):this._addCheck({kind:"datetime",precision:typeof(t==null?void 0:t.precision)>"u"?null:t==null?void 0:t.precision,offset:(n=t==null?void 0:t.offset)!==null&&n!==void 0?n:!1,local:(r=t==null?void 0:t.local)!==null&&r!==void 0?r:!1,...et.errToObj(t==null?void 0:t.message)})}date(t){return this._addCheck({kind:"date",message:t})}time(t){return typeof t=="string"?this._addCheck({kind:"time",precision:null,message:t}):this._addCheck({kind:"time",precision:typeof(t==null?void 0:t.precision)>"u"?null:t==null?void 0:t.precision,...et.errToObj(t==null?void 0:t.message)})}duration(t){return this._addCheck({kind:"duration",...et.errToObj(t)})}regex(t,n){return this._addCheck({kind:"regex",regex:t,...et.errToObj(n)})}includes(t,n){return this._addCheck({kind:"includes",value:t,position:n==null?void 0:n.position,...et.errToObj(n==null?void 0:n.message)})}startsWith(t,n){return this._addCheck({kind:"startsWith",value:t,...et.errToObj(n)})}endsWith(t,n){return this._addCheck({kind:"endsWith",value:t,...et.errToObj(n)})}min(t,n){return this._addCheck({kind:"min",value:t,...et.errToObj(n)})}max(t,n){return this._addCheck({kind:"max",value:t,...et.errToObj(n)})}length(t,n){return this._addCheck({kind:"length",value:t,...et.errToObj(n)})}nonempty(t){return this.min(1,et.errToObj(t))}trim(){return new qs({...this._def,checks:[...this._def.checks,{kind:"trim"}]})}toLowerCase(){return new qs({...this._def,checks:[...this._def.checks,{kind:"toLowerCase"}]})}toUpperCase(){return new qs({...this._def,checks:[...this._def.checks,{kind:"toUpperCase"}]})}get isDatetime(){return!!this._def.checks.find(t=>t.kind==="datetime")}get isDate(){return!!this._def.checks.find(t=>t.kind==="date")}get isTime(){return!!this._def.checks.find(t=>t.kind==="time")}get isDuration(){return!!this._def.checks.find(t=>t.kind==="duration")}get isEmail(){return!!this._def.checks.find(t=>t.kind==="email")}get isURL(){return!!this._def.checks.find(t=>t.kind==="url")}get isEmoji(){return!!this._def.checks.find(t=>t.kind==="emoji")}get isUUID(){return!!this._def.checks.find(t=>t.kind==="uuid")}get isNANOID(){return!!this._def.checks.find(t=>t.kind==="nanoid")}get isCUID(){return!!this._def.checks.find(t=>t.kind==="cuid")}get isCUID2(){return!!this._def.checks.find(t=>t.kind==="cuid2")}get isULID(){return!!this._def.checks.find(t=>t.kind==="ulid")}get isIP(){return!!this._def.checks.find(t=>t.kind==="ip")}get isBase64(){return!!this._def.checks.find(t=>t.kind==="base64")}get minLength(){let t=null;for(const n of this._def.checks)n.kind==="min"&&(t===null||n.value>t)&&(t=n.value);return t}get maxLength(){let t=null;for(const n of this._def.checks)n.kind==="max"&&(t===null||n.value{var t;return new qs({checks:[],typeName:mt.ZodString,coerce:(t=e==null?void 0:e.coerce)!==null&&t!==void 0?t:!1,...Pt(e)})};function vq(e,t){const n=(e.toString().split(".")[1]||"").length,r=(t.toString().split(".")[1]||"").length,s=n>r?n:r,a=parseInt(e.toFixed(s).replace(".","")),o=parseInt(t.toFixed(s).replace(".",""));return a%o/Math.pow(10,s)}class Po extends $t{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte,this.step=this.multipleOf}_parse(t){if(this._def.coerce&&(t.data=Number(t.data)),this._getType(t)!==Be.number){const a=this._getOrReturnCtx(t);return Fe(a,{code:_e.invalid_type,expected:Be.number,received:a.parsedType}),yt}let r;const s=new br;for(const a of this._def.checks)a.kind==="int"?Bt.isInteger(t.data)||(r=this._getOrReturnCtx(t,r),Fe(r,{code:_e.invalid_type,expected:"integer",received:"float",message:a.message}),s.dirty()):a.kind==="min"?(a.inclusive?t.dataa.value:t.data>=a.value)&&(r=this._getOrReturnCtx(t,r),Fe(r,{code:_e.too_big,maximum:a.value,type:"number",inclusive:a.inclusive,exact:!1,message:a.message}),s.dirty()):a.kind==="multipleOf"?vq(t.data,a.value)!==0&&(r=this._getOrReturnCtx(t,r),Fe(r,{code:_e.not_multiple_of,multipleOf:a.value,message:a.message}),s.dirty()):a.kind==="finite"?Number.isFinite(t.data)||(r=this._getOrReturnCtx(t,r),Fe(r,{code:_e.not_finite,message:a.message}),s.dirty()):Bt.assertNever(a);return{status:s.value,value:t.data}}gte(t,n){return this.setLimit("min",t,!0,et.toString(n))}gt(t,n){return this.setLimit("min",t,!1,et.toString(n))}lte(t,n){return this.setLimit("max",t,!0,et.toString(n))}lt(t,n){return this.setLimit("max",t,!1,et.toString(n))}setLimit(t,n,r,s){return new Po({...this._def,checks:[...this._def.checks,{kind:t,value:n,inclusive:r,message:et.toString(s)}]})}_addCheck(t){return new Po({...this._def,checks:[...this._def.checks,t]})}int(t){return this._addCheck({kind:"int",message:et.toString(t)})}positive(t){return this._addCheck({kind:"min",value:0,inclusive:!1,message:et.toString(t)})}negative(t){return this._addCheck({kind:"max",value:0,inclusive:!1,message:et.toString(t)})}nonpositive(t){return this._addCheck({kind:"max",value:0,inclusive:!0,message:et.toString(t)})}nonnegative(t){return this._addCheck({kind:"min",value:0,inclusive:!0,message:et.toString(t)})}multipleOf(t,n){return this._addCheck({kind:"multipleOf",value:t,message:et.toString(n)})}finite(t){return this._addCheck({kind:"finite",message:et.toString(t)})}safe(t){return this._addCheck({kind:"min",inclusive:!0,value:Number.MIN_SAFE_INTEGER,message:et.toString(t)})._addCheck({kind:"max",inclusive:!0,value:Number.MAX_SAFE_INTEGER,message:et.toString(t)})}get minValue(){let t=null;for(const n of this._def.checks)n.kind==="min"&&(t===null||n.value>t)&&(t=n.value);return t}get maxValue(){let t=null;for(const n of this._def.checks)n.kind==="max"&&(t===null||n.valuet.kind==="int"||t.kind==="multipleOf"&&Bt.isInteger(t.value))}get isFinite(){let t=null,n=null;for(const r of this._def.checks){if(r.kind==="finite"||r.kind==="int"||r.kind==="multipleOf")return!0;r.kind==="min"?(n===null||r.value>n)&&(n=r.value):r.kind==="max"&&(t===null||r.valuenew Po({checks:[],typeName:mt.ZodNumber,coerce:(e==null?void 0:e.coerce)||!1,...Pt(e)});class Ao extends $t{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte}_parse(t){if(this._def.coerce&&(t.data=BigInt(t.data)),this._getType(t)!==Be.bigint){const a=this._getOrReturnCtx(t);return Fe(a,{code:_e.invalid_type,expected:Be.bigint,received:a.parsedType}),yt}let r;const s=new br;for(const a of this._def.checks)a.kind==="min"?(a.inclusive?t.dataa.value:t.data>=a.value)&&(r=this._getOrReturnCtx(t,r),Fe(r,{code:_e.too_big,type:"bigint",maximum:a.value,inclusive:a.inclusive,message:a.message}),s.dirty()):a.kind==="multipleOf"?t.data%a.value!==BigInt(0)&&(r=this._getOrReturnCtx(t,r),Fe(r,{code:_e.not_multiple_of,multipleOf:a.value,message:a.message}),s.dirty()):Bt.assertNever(a);return{status:s.value,value:t.data}}gte(t,n){return this.setLimit("min",t,!0,et.toString(n))}gt(t,n){return this.setLimit("min",t,!1,et.toString(n))}lte(t,n){return this.setLimit("max",t,!0,et.toString(n))}lt(t,n){return this.setLimit("max",t,!1,et.toString(n))}setLimit(t,n,r,s){return new Ao({...this._def,checks:[...this._def.checks,{kind:t,value:n,inclusive:r,message:et.toString(s)}]})}_addCheck(t){return new Ao({...this._def,checks:[...this._def.checks,t]})}positive(t){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!1,message:et.toString(t)})}negative(t){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!1,message:et.toString(t)})}nonpositive(t){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!0,message:et.toString(t)})}nonnegative(t){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!0,message:et.toString(t)})}multipleOf(t,n){return this._addCheck({kind:"multipleOf",value:t,message:et.toString(n)})}get minValue(){let t=null;for(const n of this._def.checks)n.kind==="min"&&(t===null||n.value>t)&&(t=n.value);return t}get maxValue(){let t=null;for(const n of this._def.checks)n.kind==="max"&&(t===null||n.value{var t;return new Ao({checks:[],typeName:mt.ZodBigInt,coerce:(t=e==null?void 0:e.coerce)!==null&&t!==void 0?t:!1,...Pt(e)})};class qf extends $t{_parse(t){if(this._def.coerce&&(t.data=!!t.data),this._getType(t)!==Be.boolean){const r=this._getOrReturnCtx(t);return Fe(r,{code:_e.invalid_type,expected:Be.boolean,received:r.parsedType}),yt}return kr(t.data)}}qf.create=e=>new qf({typeName:mt.ZodBoolean,coerce:(e==null?void 0:e.coerce)||!1,...Pt(e)});class Rl extends $t{_parse(t){if(this._def.coerce&&(t.data=new Date(t.data)),this._getType(t)!==Be.date){const a=this._getOrReturnCtx(t);return Fe(a,{code:_e.invalid_type,expected:Be.date,received:a.parsedType}),yt}if(isNaN(t.data.getTime())){const a=this._getOrReturnCtx(t);return Fe(a,{code:_e.invalid_date}),yt}const r=new br;let s;for(const a of this._def.checks)a.kind==="min"?t.data.getTime()a.value&&(s=this._getOrReturnCtx(t,s),Fe(s,{code:_e.too_big,message:a.message,inclusive:!0,exact:!1,maximum:a.value,type:"date"}),r.dirty()):Bt.assertNever(a);return{status:r.value,value:new Date(t.data.getTime())}}_addCheck(t){return new Rl({...this._def,checks:[...this._def.checks,t]})}min(t,n){return this._addCheck({kind:"min",value:t.getTime(),message:et.toString(n)})}max(t,n){return this._addCheck({kind:"max",value:t.getTime(),message:et.toString(n)})}get minDate(){let t=null;for(const n of this._def.checks)n.kind==="min"&&(t===null||n.value>t)&&(t=n.value);return t!=null?new Date(t):null}get maxDate(){let t=null;for(const n of this._def.checks)n.kind==="max"&&(t===null||n.valuenew Rl({checks:[],coerce:(e==null?void 0:e.coerce)||!1,typeName:mt.ZodDate,...Pt(e)});class _g extends $t{_parse(t){if(this._getType(t)!==Be.symbol){const r=this._getOrReturnCtx(t);return Fe(r,{code:_e.invalid_type,expected:Be.symbol,received:r.parsedType}),yt}return kr(t.data)}}_g.create=e=>new _g({typeName:mt.ZodSymbol,...Pt(e)});class Kf extends $t{_parse(t){if(this._getType(t)!==Be.undefined){const r=this._getOrReturnCtx(t);return Fe(r,{code:_e.invalid_type,expected:Be.undefined,received:r.parsedType}),yt}return kr(t.data)}}Kf.create=e=>new Kf({typeName:mt.ZodUndefined,...Pt(e)});class Xf extends $t{_parse(t){if(this._getType(t)!==Be.null){const r=this._getOrReturnCtx(t);return Fe(r,{code:_e.invalid_type,expected:Be.null,received:r.parsedType}),yt}return kr(t.data)}}Xf.create=e=>new Xf({typeName:mt.ZodNull,...Pt(e)});class du extends $t{constructor(){super(...arguments),this._any=!0}_parse(t){return kr(t.data)}}du.create=e=>new du({typeName:mt.ZodAny,...Pt(e)});class bl extends $t{constructor(){super(...arguments),this._unknown=!0}_parse(t){return kr(t.data)}}bl.create=e=>new bl({typeName:mt.ZodUnknown,...Pt(e)});class bi extends $t{_parse(t){const n=this._getOrReturnCtx(t);return Fe(n,{code:_e.invalid_type,expected:Be.never,received:n.parsedType}),yt}}bi.create=e=>new bi({typeName:mt.ZodNever,...Pt(e)});class Pg extends $t{_parse(t){if(this._getType(t)!==Be.undefined){const r=this._getOrReturnCtx(t);return Fe(r,{code:_e.invalid_type,expected:Be.void,received:r.parsedType}),yt}return kr(t.data)}}Pg.create=e=>new Pg({typeName:mt.ZodVoid,...Pt(e)});class Qs extends $t{_parse(t){const{ctx:n,status:r}=this._processInputParams(t),s=this._def;if(n.parsedType!==Be.array)return Fe(n,{code:_e.invalid_type,expected:Be.array,received:n.parsedType}),yt;if(s.exactLength!==null){const o=n.data.length>s.exactLength.value,l=n.data.lengths.maxLength.value&&(Fe(n,{code:_e.too_big,maximum:s.maxLength.value,type:"array",inclusive:!0,exact:!1,message:s.maxLength.message}),r.dirty()),n.common.async)return Promise.all([...n.data].map((o,l)=>s.type._parseAsync(new Ia(n,o,n.path,l)))).then(o=>br.mergeArray(r,o));const a=[...n.data].map((o,l)=>s.type._parseSync(new Ia(n,o,n.path,l)));return br.mergeArray(r,a)}get element(){return this._def.type}min(t,n){return new Qs({...this._def,minLength:{value:t,message:et.toString(n)}})}max(t,n){return new Qs({...this._def,maxLength:{value:t,message:et.toString(n)}})}length(t,n){return new Qs({...this._def,exactLength:{value:t,message:et.toString(n)}})}nonempty(t){return this.min(1,t)}}Qs.create=(e,t)=>new Qs({type:e,minLength:null,maxLength:null,exactLength:null,typeName:mt.ZodArray,...Pt(t)});function fc(e){if(e instanceof mn){const t={};for(const n in e.shape){const r=e.shape[n];t[n]=Aa.create(fc(r))}return new mn({...e._def,shape:()=>t})}else return e instanceof Qs?new Qs({...e._def,type:fc(e.element)}):e instanceof Aa?Aa.create(fc(e.unwrap())):e instanceof Eo?Eo.create(fc(e.unwrap())):e instanceof Ra?Ra.create(e.items.map(t=>fc(t))):e}class mn extends $t{constructor(){super(...arguments),this._cached=null,this.nonstrict=this.passthrough,this.augment=this.extend}_getCached(){if(this._cached!==null)return this._cached;const t=this._def.shape(),n=Bt.objectKeys(t);return this._cached={shape:t,keys:n}}_parse(t){if(this._getType(t)!==Be.object){const u=this._getOrReturnCtx(t);return Fe(u,{code:_e.invalid_type,expected:Be.object,received:u.parsedType}),yt}const{status:r,ctx:s}=this._processInputParams(t),{shape:a,keys:o}=this._getCached(),l=[];if(!(this._def.catchall instanceof bi&&this._def.unknownKeys==="strip"))for(const u in s.data)o.includes(u)||l.push(u);const c=[];for(const u of o){const d=a[u],f=s.data[u];c.push({key:{status:"valid",value:u},value:d._parse(new Ia(s,f,s.path,u)),alwaysSet:u in s.data})}if(this._def.catchall instanceof bi){const u=this._def.unknownKeys;if(u==="passthrough")for(const d of l)c.push({key:{status:"valid",value:d},value:{status:"valid",value:s.data[d]}});else if(u==="strict")l.length>0&&(Fe(s,{code:_e.unrecognized_keys,keys:l}),r.dirty());else if(u!=="strip")throw new Error("Internal ZodObject error: invalid unknownKeys value.")}else{const u=this._def.catchall;for(const d of l){const f=s.data[d];c.push({key:{status:"valid",value:d},value:u._parse(new Ia(s,f,s.path,d)),alwaysSet:d in s.data})}}return s.common.async?Promise.resolve().then(async()=>{const u=[];for(const d of c){const f=await d.key,h=await d.value;u.push({key:f,value:h,alwaysSet:d.alwaysSet})}return u}).then(u=>br.mergeObjectSync(r,u)):br.mergeObjectSync(r,c)}get shape(){return this._def.shape()}strict(t){return et.errToObj,new mn({...this._def,unknownKeys:"strict",...t!==void 0?{errorMap:(n,r)=>{var s,a,o,l;const c=(o=(a=(s=this._def).errorMap)===null||a===void 0?void 0:a.call(s,n,r).message)!==null&&o!==void 0?o:r.defaultError;return n.code==="unrecognized_keys"?{message:(l=et.errToObj(t).message)!==null&&l!==void 0?l:c}:{message:c}}}:{}})}strip(){return new mn({...this._def,unknownKeys:"strip"})}passthrough(){return new mn({...this._def,unknownKeys:"passthrough"})}extend(t){return new mn({...this._def,shape:()=>({...this._def.shape(),...t})})}merge(t){return new mn({unknownKeys:t._def.unknownKeys,catchall:t._def.catchall,shape:()=>({...this._def.shape(),...t._def.shape()}),typeName:mt.ZodObject})}setKey(t,n){return this.augment({[t]:n})}catchall(t){return new mn({...this._def,catchall:t})}pick(t){const n={};return Bt.objectKeys(t).forEach(r=>{t[r]&&this.shape[r]&&(n[r]=this.shape[r])}),new mn({...this._def,shape:()=>n})}omit(t){const n={};return Bt.objectKeys(this.shape).forEach(r=>{t[r]||(n[r]=this.shape[r])}),new mn({...this._def,shape:()=>n})}deepPartial(){return fc(this)}partial(t){const n={};return Bt.objectKeys(this.shape).forEach(r=>{const s=this.shape[r];t&&!t[r]?n[r]=s:n[r]=s.optional()}),new mn({...this._def,shape:()=>n})}required(t){const n={};return Bt.objectKeys(this.shape).forEach(r=>{if(t&&!t[r])n[r]=this.shape[r];else{let a=this.shape[r];for(;a instanceof Aa;)a=a._def.innerType;n[r]=a}}),new mn({...this._def,shape:()=>n})}keyof(){return fR(Bt.objectKeys(this.shape))}}mn.create=(e,t)=>new mn({shape:()=>e,unknownKeys:"strip",catchall:bi.create(),typeName:mt.ZodObject,...Pt(t)});mn.strictCreate=(e,t)=>new mn({shape:()=>e,unknownKeys:"strict",catchall:bi.create(),typeName:mt.ZodObject,...Pt(t)});mn.lazycreate=(e,t)=>new mn({shape:e,unknownKeys:"strip",catchall:bi.create(),typeName:mt.ZodObject,...Pt(t)});class Yf extends $t{_parse(t){const{ctx:n}=this._processInputParams(t),r=this._def.options;function s(a){for(const l of a)if(l.result.status==="valid")return l.result;for(const l of a)if(l.result.status==="dirty")return n.common.issues.push(...l.ctx.common.issues),l.result;const o=a.map(l=>new os(l.ctx.common.issues));return Fe(n,{code:_e.invalid_union,unionErrors:o}),yt}if(n.common.async)return Promise.all(r.map(async a=>{const o={...n,common:{...n.common,issues:[]},parent:null};return{result:await a._parseAsync({data:n.data,path:n.path,parent:o}),ctx:o}})).then(s);{let a;const o=[];for(const c of r){const u={...n,common:{...n.common,issues:[]},parent:null},d=c._parseSync({data:n.data,path:n.path,parent:u});if(d.status==="valid")return d;d.status==="dirty"&&!a&&(a={result:d,ctx:u}),u.common.issues.length&&o.push(u.common.issues)}if(a)return n.common.issues.push(...a.ctx.common.issues),a.result;const l=o.map(c=>new os(c));return Fe(n,{code:_e.invalid_union,unionErrors:l}),yt}}get options(){return this._def.options}}Yf.create=(e,t)=>new Yf({options:e,typeName:mt.ZodUnion,...Pt(t)});const qa=e=>e instanceof Jf?qa(e.schema):e instanceof ia?qa(e.innerType()):e instanceof eh?[e.value]:e instanceof Co?e.options:e instanceof th?Bt.objectValues(e.enum):e instanceof nh?qa(e._def.innerType):e instanceof Kf?[void 0]:e instanceof Xf?[null]:e instanceof Aa?[void 0,...qa(e.unwrap())]:e instanceof Eo?[null,...qa(e.unwrap())]:e instanceof rN||e instanceof sh?qa(e.unwrap()):e instanceof rh?qa(e._def.innerType):[];class Cy extends $t{_parse(t){const{ctx:n}=this._processInputParams(t);if(n.parsedType!==Be.object)return Fe(n,{code:_e.invalid_type,expected:Be.object,received:n.parsedType}),yt;const r=this.discriminator,s=n.data[r],a=this.optionsMap.get(s);return a?n.common.async?a._parseAsync({data:n.data,path:n.path,parent:n}):a._parseSync({data:n.data,path:n.path,parent:n}):(Fe(n,{code:_e.invalid_union_discriminator,options:Array.from(this.optionsMap.keys()),path:[r]}),yt)}get discriminator(){return this._def.discriminator}get options(){return this._def.options}get optionsMap(){return this._def.optionsMap}static create(t,n,r){const s=new Map;for(const a of n){const o=qa(a.shape[t]);if(!o.length)throw new Error(`A discriminator value for key \`${t}\` could not be extracted from all schema options`);for(const l of o){if(s.has(l))throw new Error(`Discriminator property ${String(t)} has duplicate value ${String(l)}`);s.set(l,a)}}return new Cy({typeName:mt.ZodDiscriminatedUnion,discriminator:t,options:n,optionsMap:s,...Pt(r)})}}function Ew(e,t){const n=Gi(e),r=Gi(t);if(e===t)return{valid:!0,data:e};if(n===Be.object&&r===Be.object){const s=Bt.objectKeys(t),a=Bt.objectKeys(e).filter(l=>s.indexOf(l)!==-1),o={...e,...t};for(const l of a){const c=Ew(e[l],t[l]);if(!c.valid)return{valid:!1};o[l]=c.data}return{valid:!0,data:o}}else if(n===Be.array&&r===Be.array){if(e.length!==t.length)return{valid:!1};const s=[];for(let a=0;a{if(Aw(a)||Aw(o))return yt;const l=Ew(a.value,o.value);return l.valid?((Cw(a)||Cw(o))&&n.dirty(),{status:n.value,value:l.data}):(Fe(r,{code:_e.invalid_intersection_types}),yt)};return r.common.async?Promise.all([this._def.left._parseAsync({data:r.data,path:r.path,parent:r}),this._def.right._parseAsync({data:r.data,path:r.path,parent:r})]).then(([a,o])=>s(a,o)):s(this._def.left._parseSync({data:r.data,path:r.path,parent:r}),this._def.right._parseSync({data:r.data,path:r.path,parent:r}))}}Zf.create=(e,t,n)=>new Zf({left:e,right:t,typeName:mt.ZodIntersection,...Pt(n)});class Ra extends $t{_parse(t){const{status:n,ctx:r}=this._processInputParams(t);if(r.parsedType!==Be.array)return Fe(r,{code:_e.invalid_type,expected:Be.array,received:r.parsedType}),yt;if(r.data.lengththis._def.items.length&&(Fe(r,{code:_e.too_big,maximum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),n.dirty());const a=[...r.data].map((o,l)=>{const c=this._def.items[l]||this._def.rest;return c?c._parse(new Ia(r,o,r.path,l)):null}).filter(o=>!!o);return r.common.async?Promise.all(a).then(o=>br.mergeArray(n,o)):br.mergeArray(n,a)}get items(){return this._def.items}rest(t){return new Ra({...this._def,rest:t})}}Ra.create=(e,t)=>{if(!Array.isArray(e))throw new Error("You must pass an array of schemas to z.tuple([ ... ])");return new Ra({items:e,typeName:mt.ZodTuple,rest:null,...Pt(t)})};class Qf extends $t{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(t){const{status:n,ctx:r}=this._processInputParams(t);if(r.parsedType!==Be.object)return Fe(r,{code:_e.invalid_type,expected:Be.object,received:r.parsedType}),yt;const s=[],a=this._def.keyType,o=this._def.valueType;for(const l in r.data)s.push({key:a._parse(new Ia(r,l,r.path,l)),value:o._parse(new Ia(r,r.data[l],r.path,l)),alwaysSet:l in r.data});return r.common.async?br.mergeObjectAsync(n,s):br.mergeObjectSync(n,s)}get element(){return this._def.valueType}static create(t,n,r){return n instanceof $t?new Qf({keyType:t,valueType:n,typeName:mt.ZodRecord,...Pt(r)}):new Qf({keyType:qs.create(),valueType:t,typeName:mt.ZodRecord,...Pt(n)})}}class Ag extends $t{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(t){const{status:n,ctx:r}=this._processInputParams(t);if(r.parsedType!==Be.map)return Fe(r,{code:_e.invalid_type,expected:Be.map,received:r.parsedType}),yt;const s=this._def.keyType,a=this._def.valueType,o=[...r.data.entries()].map(([l,c],u)=>({key:s._parse(new Ia(r,l,r.path,[u,"key"])),value:a._parse(new Ia(r,c,r.path,[u,"value"]))}));if(r.common.async){const l=new Map;return Promise.resolve().then(async()=>{for(const c of o){const u=await c.key,d=await c.value;if(u.status==="aborted"||d.status==="aborted")return yt;(u.status==="dirty"||d.status==="dirty")&&n.dirty(),l.set(u.value,d.value)}return{status:n.value,value:l}})}else{const l=new Map;for(const c of o){const u=c.key,d=c.value;if(u.status==="aborted"||d.status==="aborted")return yt;(u.status==="dirty"||d.status==="dirty")&&n.dirty(),l.set(u.value,d.value)}return{status:n.value,value:l}}}}Ag.create=(e,t,n)=>new Ag({valueType:t,keyType:e,typeName:mt.ZodMap,...Pt(n)});class Dl extends $t{_parse(t){const{status:n,ctx:r}=this._processInputParams(t);if(r.parsedType!==Be.set)return Fe(r,{code:_e.invalid_type,expected:Be.set,received:r.parsedType}),yt;const s=this._def;s.minSize!==null&&r.data.sizes.maxSize.value&&(Fe(r,{code:_e.too_big,maximum:s.maxSize.value,type:"set",inclusive:!0,exact:!1,message:s.maxSize.message}),n.dirty());const a=this._def.valueType;function o(c){const u=new Set;for(const d of c){if(d.status==="aborted")return yt;d.status==="dirty"&&n.dirty(),u.add(d.value)}return{status:n.value,value:u}}const l=[...r.data.values()].map((c,u)=>a._parse(new Ia(r,c,r.path,u)));return r.common.async?Promise.all(l).then(c=>o(c)):o(l)}min(t,n){return new Dl({...this._def,minSize:{value:t,message:et.toString(n)}})}max(t,n){return new Dl({...this._def,maxSize:{value:t,message:et.toString(n)}})}size(t,n){return this.min(t,n).max(t,n)}nonempty(t){return this.min(1,t)}}Dl.create=(e,t)=>new Dl({valueType:e,minSize:null,maxSize:null,typeName:mt.ZodSet,...Pt(t)});class Fc extends $t{constructor(){super(...arguments),this.validate=this.implement}_parse(t){const{ctx:n}=this._processInputParams(t);if(n.parsedType!==Be.function)return Fe(n,{code:_e.invalid_type,expected:Be.function,received:n.parsedType}),yt;function r(l,c){return Sg({data:l,path:n.path,errorMaps:[n.common.contextualErrorMap,n.schemaErrorMap,jg(),uu].filter(u=>!!u),issueData:{code:_e.invalid_arguments,argumentsError:c}})}function s(l,c){return Sg({data:l,path:n.path,errorMaps:[n.common.contextualErrorMap,n.schemaErrorMap,jg(),uu].filter(u=>!!u),issueData:{code:_e.invalid_return_type,returnTypeError:c}})}const a={errorMap:n.common.contextualErrorMap},o=n.data;if(this._def.returns instanceof fu){const l=this;return kr(async function(...c){const u=new os([]),d=await l._def.args.parseAsync(c,a).catch(p=>{throw u.addIssue(r(c,p)),u}),f=await Reflect.apply(o,this,d);return await l._def.returns._def.type.parseAsync(f,a).catch(p=>{throw u.addIssue(s(f,p)),u})})}else{const l=this;return kr(function(...c){const u=l._def.args.safeParse(c,a);if(!u.success)throw new os([r(c,u.error)]);const d=Reflect.apply(o,this,u.data),f=l._def.returns.safeParse(d,a);if(!f.success)throw new os([s(d,f.error)]);return f.data})}}parameters(){return this._def.args}returnType(){return this._def.returns}args(...t){return new Fc({...this._def,args:Ra.create(t).rest(bl.create())})}returns(t){return new Fc({...this._def,returns:t})}implement(t){return this.parse(t)}strictImplement(t){return this.parse(t)}static create(t,n,r){return new Fc({args:t||Ra.create([]).rest(bl.create()),returns:n||bl.create(),typeName:mt.ZodFunction,...Pt(r)})}}class Jf extends $t{get schema(){return this._def.getter()}_parse(t){const{ctx:n}=this._processInputParams(t);return this._def.getter()._parse({data:n.data,path:n.path,parent:n})}}Jf.create=(e,t)=>new Jf({getter:e,typeName:mt.ZodLazy,...Pt(t)});class eh extends $t{_parse(t){if(t.data!==this._def.value){const n=this._getOrReturnCtx(t);return Fe(n,{received:n.data,code:_e.invalid_literal,expected:this._def.value}),yt}return{status:"valid",value:t.data}}get value(){return this._def.value}}eh.create=(e,t)=>new eh({value:e,typeName:mt.ZodLiteral,...Pt(t)});function fR(e,t){return new Co({values:e,typeName:mt.ZodEnum,...Pt(t)})}class Co extends $t{constructor(){super(...arguments),qd.set(this,void 0)}_parse(t){if(typeof t.data!="string"){const n=this._getOrReturnCtx(t),r=this._def.values;return Fe(n,{expected:Bt.joinValues(r),received:n.parsedType,code:_e.invalid_type}),yt}if(Ng(this,qd)||lR(this,qd,new Set(this._def.values)),!Ng(this,qd).has(t.data)){const n=this._getOrReturnCtx(t),r=this._def.values;return Fe(n,{received:n.data,code:_e.invalid_enum_value,options:r}),yt}return kr(t.data)}get options(){return this._def.values}get enum(){const t={};for(const n of this._def.values)t[n]=n;return t}get Values(){const t={};for(const n of this._def.values)t[n]=n;return t}get Enum(){const t={};for(const n of this._def.values)t[n]=n;return t}extract(t,n=this._def){return Co.create(t,{...this._def,...n})}exclude(t,n=this._def){return Co.create(this.options.filter(r=>!t.includes(r)),{...this._def,...n})}}qd=new WeakMap;Co.create=fR;class th extends $t{constructor(){super(...arguments),Kd.set(this,void 0)}_parse(t){const n=Bt.getValidEnumValues(this._def.values),r=this._getOrReturnCtx(t);if(r.parsedType!==Be.string&&r.parsedType!==Be.number){const s=Bt.objectValues(n);return Fe(r,{expected:Bt.joinValues(s),received:r.parsedType,code:_e.invalid_type}),yt}if(Ng(this,Kd)||lR(this,Kd,new Set(Bt.getValidEnumValues(this._def.values))),!Ng(this,Kd).has(t.data)){const s=Bt.objectValues(n);return Fe(r,{received:r.data,code:_e.invalid_enum_value,options:s}),yt}return kr(t.data)}get enum(){return this._def.values}}Kd=new WeakMap;th.create=(e,t)=>new th({values:e,typeName:mt.ZodNativeEnum,...Pt(t)});class fu extends $t{unwrap(){return this._def.type}_parse(t){const{ctx:n}=this._processInputParams(t);if(n.parsedType!==Be.promise&&n.common.async===!1)return Fe(n,{code:_e.invalid_type,expected:Be.promise,received:n.parsedType}),yt;const r=n.parsedType===Be.promise?n.data:Promise.resolve(n.data);return kr(r.then(s=>this._def.type.parseAsync(s,{path:n.path,errorMap:n.common.contextualErrorMap})))}}fu.create=(e,t)=>new fu({type:e,typeName:mt.ZodPromise,...Pt(t)});class ia extends $t{innerType(){return this._def.schema}sourceType(){return this._def.schema._def.typeName===mt.ZodEffects?this._def.schema.sourceType():this._def.schema}_parse(t){const{status:n,ctx:r}=this._processInputParams(t),s=this._def.effect||null,a={addIssue:o=>{Fe(r,o),o.fatal?n.abort():n.dirty()},get path(){return r.path}};if(a.addIssue=a.addIssue.bind(a),s.type==="preprocess"){const o=s.transform(r.data,a);if(r.common.async)return Promise.resolve(o).then(async l=>{if(n.value==="aborted")return yt;const c=await this._def.schema._parseAsync({data:l,path:r.path,parent:r});return c.status==="aborted"?yt:c.status==="dirty"||n.value==="dirty"?_c(c.value):c});{if(n.value==="aborted")return yt;const l=this._def.schema._parseSync({data:o,path:r.path,parent:r});return l.status==="aborted"?yt:l.status==="dirty"||n.value==="dirty"?_c(l.value):l}}if(s.type==="refinement"){const o=l=>{const c=s.refinement(l,a);if(r.common.async)return Promise.resolve(c);if(c instanceof Promise)throw new Error("Async refinement encountered during synchronous parse operation. Use .parseAsync instead.");return l};if(r.common.async===!1){const l=this._def.schema._parseSync({data:r.data,path:r.path,parent:r});return l.status==="aborted"?yt:(l.status==="dirty"&&n.dirty(),o(l.value),{status:n.value,value:l.value})}else return this._def.schema._parseAsync({data:r.data,path:r.path,parent:r}).then(l=>l.status==="aborted"?yt:(l.status==="dirty"&&n.dirty(),o(l.value).then(()=>({status:n.value,value:l.value}))))}if(s.type==="transform")if(r.common.async===!1){const o=this._def.schema._parseSync({data:r.data,path:r.path,parent:r});if(!Gf(o))return o;const l=s.transform(o.value,a);if(l instanceof Promise)throw new Error("Asynchronous transform encountered during synchronous parse operation. Use .parseAsync instead.");return{status:n.value,value:l}}else return this._def.schema._parseAsync({data:r.data,path:r.path,parent:r}).then(o=>Gf(o)?Promise.resolve(s.transform(o.value,a)).then(l=>({status:n.value,value:l})):o);Bt.assertNever(s)}}ia.create=(e,t,n)=>new ia({schema:e,typeName:mt.ZodEffects,effect:t,...Pt(n)});ia.createWithPreprocess=(e,t,n)=>new ia({schema:t,effect:{type:"preprocess",transform:e},typeName:mt.ZodEffects,...Pt(n)});class Aa extends $t{_parse(t){return this._getType(t)===Be.undefined?kr(void 0):this._def.innerType._parse(t)}unwrap(){return this._def.innerType}}Aa.create=(e,t)=>new Aa({innerType:e,typeName:mt.ZodOptional,...Pt(t)});class Eo extends $t{_parse(t){return this._getType(t)===Be.null?kr(null):this._def.innerType._parse(t)}unwrap(){return this._def.innerType}}Eo.create=(e,t)=>new Eo({innerType:e,typeName:mt.ZodNullable,...Pt(t)});class nh extends $t{_parse(t){const{ctx:n}=this._processInputParams(t);let r=n.data;return n.parsedType===Be.undefined&&(r=this._def.defaultValue()),this._def.innerType._parse({data:r,path:n.path,parent:n})}removeDefault(){return this._def.innerType}}nh.create=(e,t)=>new nh({innerType:e,typeName:mt.ZodDefault,defaultValue:typeof t.default=="function"?t.default:()=>t.default,...Pt(t)});class rh extends $t{_parse(t){const{ctx:n}=this._processInputParams(t),r={...n,common:{...n.common,issues:[]}},s=this._def.innerType._parse({data:r.data,path:r.path,parent:{...r}});return Hf(s)?s.then(a=>({status:"valid",value:a.status==="valid"?a.value:this._def.catchValue({get error(){return new os(r.common.issues)},input:r.data})})):{status:"valid",value:s.status==="valid"?s.value:this._def.catchValue({get error(){return new os(r.common.issues)},input:r.data})}}removeCatch(){return this._def.innerType}}rh.create=(e,t)=>new rh({innerType:e,typeName:mt.ZodCatch,catchValue:typeof t.catch=="function"?t.catch:()=>t.catch,...Pt(t)});class Cg extends $t{_parse(t){if(this._getType(t)!==Be.nan){const r=this._getOrReturnCtx(t);return Fe(r,{code:_e.invalid_type,expected:Be.nan,received:r.parsedType}),yt}return{status:"valid",value:t.data}}}Cg.create=e=>new Cg({typeName:mt.ZodNaN,...Pt(e)});const yq=Symbol("zod_brand");class rN extends $t{_parse(t){const{ctx:n}=this._processInputParams(t),r=n.data;return this._def.type._parse({data:r,path:n.path,parent:n})}unwrap(){return this._def.type}}class ip extends $t{_parse(t){const{status:n,ctx:r}=this._processInputParams(t);if(r.common.async)return(async()=>{const a=await this._def.in._parseAsync({data:r.data,path:r.path,parent:r});return a.status==="aborted"?yt:a.status==="dirty"?(n.dirty(),_c(a.value)):this._def.out._parseAsync({data:a.value,path:r.path,parent:r})})();{const s=this._def.in._parseSync({data:r.data,path:r.path,parent:r});return s.status==="aborted"?yt:s.status==="dirty"?(n.dirty(),{status:"dirty",value:s.value}):this._def.out._parseSync({data:s.value,path:r.path,parent:r})}}static create(t,n){return new ip({in:t,out:n,typeName:mt.ZodPipeline})}}class sh extends $t{_parse(t){const n=this._def.innerType._parse(t),r=s=>(Gf(s)&&(s.value=Object.freeze(s.value)),s);return Hf(n)?n.then(s=>r(s)):r(n)}unwrap(){return this._def.innerType}}sh.create=(e,t)=>new sh({innerType:e,typeName:mt.ZodReadonly,...Pt(t)});function hR(e,t={},n){return e?du.create().superRefine((r,s)=>{var a,o;if(!e(r)){const l=typeof t=="function"?t(r):typeof t=="string"?{message:t}:t,c=(o=(a=l.fatal)!==null&&a!==void 0?a:n)!==null&&o!==void 0?o:!0,u=typeof l=="string"?{message:l}:l;s.addIssue({code:"custom",...u,fatal:c})}}):du.create()}const xq={object:mn.lazycreate};var mt;(function(e){e.ZodString="ZodString",e.ZodNumber="ZodNumber",e.ZodNaN="ZodNaN",e.ZodBigInt="ZodBigInt",e.ZodBoolean="ZodBoolean",e.ZodDate="ZodDate",e.ZodSymbol="ZodSymbol",e.ZodUndefined="ZodUndefined",e.ZodNull="ZodNull",e.ZodAny="ZodAny",e.ZodUnknown="ZodUnknown",e.ZodNever="ZodNever",e.ZodVoid="ZodVoid",e.ZodArray="ZodArray",e.ZodObject="ZodObject",e.ZodUnion="ZodUnion",e.ZodDiscriminatedUnion="ZodDiscriminatedUnion",e.ZodIntersection="ZodIntersection",e.ZodTuple="ZodTuple",e.ZodRecord="ZodRecord",e.ZodMap="ZodMap",e.ZodSet="ZodSet",e.ZodFunction="ZodFunction",e.ZodLazy="ZodLazy",e.ZodLiteral="ZodLiteral",e.ZodEnum="ZodEnum",e.ZodEffects="ZodEffects",e.ZodNativeEnum="ZodNativeEnum",e.ZodOptional="ZodOptional",e.ZodNullable="ZodNullable",e.ZodDefault="ZodDefault",e.ZodCatch="ZodCatch",e.ZodPromise="ZodPromise",e.ZodBranded="ZodBranded",e.ZodPipeline="ZodPipeline",e.ZodReadonly="ZodReadonly"})(mt||(mt={}));const bq=(e,t={message:`Input not instance of ${e.name}`})=>hR(n=>n instanceof e,t),pR=qs.create,mR=Po.create,wq=Cg.create,jq=Ao.create,gR=qf.create,Sq=Rl.create,Nq=_g.create,_q=Kf.create,Pq=Xf.create,Aq=du.create,Cq=bl.create,Eq=bi.create,Oq=Pg.create,kq=Qs.create,Tq=mn.create,$q=mn.strictCreate,Mq=Yf.create,Iq=Cy.create,Rq=Zf.create,Dq=Ra.create,Lq=Qf.create,Fq=Ag.create,Bq=Dl.create,zq=Fc.create,Uq=Jf.create,Vq=eh.create,Wq=Co.create,Gq=th.create,Hq=fu.create,bC=ia.create,qq=Aa.create,Kq=Eo.create,Xq=ia.createWithPreprocess,Yq=ip.create,Zq=()=>pR().optional(),Qq=()=>mR().optional(),Jq=()=>gR().optional(),eK={string:e=>qs.create({...e,coerce:!0}),number:e=>Po.create({...e,coerce:!0}),boolean:e=>qf.create({...e,coerce:!0}),bigint:e=>Ao.create({...e,coerce:!0}),date:e=>Rl.create({...e,coerce:!0})},tK=yt;var $e=Object.freeze({__proto__:null,defaultErrorMap:uu,setErrorMap:tq,getErrorMap:jg,makeIssue:Sg,EMPTY_PATH:nq,addIssueToContext:Fe,ParseStatus:br,INVALID:yt,DIRTY:_c,OK:kr,isAborted:Aw,isDirty:Cw,isValid:Gf,isAsync:Hf,get util(){return Bt},get objectUtil(){return Pw},ZodParsedType:Be,getParsedType:Gi,ZodType:$t,datetimeRegex:dR,ZodString:qs,ZodNumber:Po,ZodBigInt:Ao,ZodBoolean:qf,ZodDate:Rl,ZodSymbol:_g,ZodUndefined:Kf,ZodNull:Xf,ZodAny:du,ZodUnknown:bl,ZodNever:bi,ZodVoid:Pg,ZodArray:Qs,ZodObject:mn,ZodUnion:Yf,ZodDiscriminatedUnion:Cy,ZodIntersection:Zf,ZodTuple:Ra,ZodRecord:Qf,ZodMap:Ag,ZodSet:Dl,ZodFunction:Fc,ZodLazy:Jf,ZodLiteral:eh,ZodEnum:Co,ZodNativeEnum:th,ZodPromise:fu,ZodEffects:ia,ZodTransformer:ia,ZodOptional:Aa,ZodNullable:Eo,ZodDefault:nh,ZodCatch:rh,ZodNaN:Cg,BRAND:yq,ZodBranded:rN,ZodPipeline:ip,ZodReadonly:sh,custom:hR,Schema:$t,ZodSchema:$t,late:xq,get ZodFirstPartyTypeKind(){return mt},coerce:eK,any:Aq,array:kq,bigint:jq,boolean:gR,date:Sq,discriminatedUnion:Iq,effect:bC,enum:Wq,function:zq,instanceof:bq,intersection:Rq,lazy:Uq,literal:Vq,map:Fq,nan:wq,nativeEnum:Gq,never:Eq,null:Pq,nullable:Kq,number:mR,object:Tq,oboolean:Jq,onumber:Qq,optional:qq,ostring:Zq,pipeline:Yq,preprocess:Xq,promise:Hq,record:Lq,set:Bq,strictObject:$q,string:pR,symbol:Nq,transformer:bC,tuple:Dq,undefined:_q,union:Mq,unknown:Cq,void:Oq,NEVER:tK,ZodIssueCode:_e,quotelessJson:eq,ZodError:os}),nK="Label",vR=v.forwardRef((e,t)=>i.jsx(Ye.label,{...e,ref:t,onMouseDown:n=>{var s;n.target.closest("button, input, select, textarea")||((s=e.onMouseDown)==null||s.call(e,n),!n.defaultPrevented&&n.detail>1&&n.preventDefault())}}));vR.displayName=nK;var yR=vR;const rK=KS("text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70"),ys=v.forwardRef(({className:e,...t},n)=>i.jsx(yR,{ref:n,className:Oe(rK(),e),...t}));ys.displayName=yR.displayName;const Ey=IH,xR=v.createContext({}),dt=({...e})=>i.jsx(xR.Provider,{value:{name:e.name},children:i.jsx(FH,{...e})}),Oy=()=>{const e=v.useContext(xR),t=v.useContext(bR),{getFieldState:n,formState:r}=_y(),s=n(e.name,r);if(!e)throw new Error("useFormField should be used within ");const{id:a}=t;return{id:a,name:e.name,formItemId:`${a}-form-item`,formDescriptionId:`${a}-form-item-description`,formMessageId:`${a}-form-item-message`,...s}},bR=v.createContext({}),ot=v.forwardRef(({className:e,...t},n)=>{const r=v.useId();return i.jsx(bR.Provider,{value:{id:r},children:i.jsx("div",{ref:n,className:Oe("space-y-2",e),...t})})});ot.displayName="FormItem";const lt=v.forwardRef(({className:e,...t},n)=>{const{error:r,formItemId:s}=Oy();return i.jsx(ys,{ref:n,className:Oe(r&&"text-destructive",e),htmlFor:s,...t})});lt.displayName="FormLabel";const ct=v.forwardRef(({...e},t)=>{const{error:n,formItemId:r,formDescriptionId:s,formMessageId:a}=Oy();return i.jsx(ka,{ref:t,id:r,"aria-describedby":n?`${s} ${a}`:`${s}`,"aria-invalid":!!n,...e})});ct.displayName="FormControl";const fn=v.forwardRef(({className:e,...t},n)=>{const{formDescriptionId:r}=Oy();return i.jsx("p",{ref:n,id:r,className:Oe("text-sm text-muted-foreground",e),...t})});fn.displayName="FormDescription";const ut=v.forwardRef(({className:e,children:t,...n},r)=>{const{error:s,formMessageId:a}=Oy(),o=s?String(s==null?void 0:s.message):t;return o?i.jsx("p",{ref:r,id:a,className:Oe("text-sm font-medium text-destructive",e),...n,children:o}):null});ut.displayName="FormMessage";const Ot=v.forwardRef(({className:e,type:t,...n},r)=>i.jsx("input",{type:t,className:Oe("flex h-10 w-full rounded-md border border-input bg-background px-3 py-2 text-base ring-offset-background 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-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50 md:text-sm",e),ref:r,...n}));Ot.displayName="Input";const nt=v.forwardRef(({className:e,...t},n)=>i.jsx("textarea",{className:Oe("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",e),ref:n,...t}));nt.displayName="Textarea";function ah(e,[t,n]){return Math.min(n,Math.max(t,e))}function sK(e,t=[]){let n=[];function r(a,o){const l=v.createContext(o),c=n.length;n=[...n,o];function u(f){const{scope:h,children:p,...g}=f,m=(h==null?void 0:h[e][c])||l,y=v.useMemo(()=>g,Object.values(g));return i.jsx(m.Provider,{value:y,children:p})}function d(f,h){const p=(h==null?void 0:h[e][c])||l,g=v.useContext(p);if(g)return g;if(o!==void 0)return o;throw new Error(`\`${f}\` must be used within \`${a}\``)}return u.displayName=a+"Provider",[u,d]}const s=()=>{const a=n.map(o=>v.createContext(o));return function(l){const c=(l==null?void 0:l[e])||a;return v.useMemo(()=>({[`__scope${e}`]:{...l,[e]:c}}),[l,c])}};return s.scopeName=e,[r,aK(s,...t)]}function aK(...e){const t=e[0];if(e.length===1)return t;const n=()=>{const r=e.map(s=>({useScope:s(),scopeName:s.scopeName}));return function(a){const o=r.reduce((l,{useScope:c,scopeName:u})=>{const f=c(a)[`__scope${u}`];return{...l,...f}},{});return v.useMemo(()=>({[`__scope${t.scopeName}`]:o}),[o])}};return n.scopeName=t.scopeName,n}function ky(e){const t=e+"CollectionProvider",[n,r]=sK(t),[s,a]=n(t,{collectionRef:{current:null},itemMap:new Map}),o=p=>{const{scope:g,children:m}=p,y=E.useRef(null),b=E.useRef(new Map).current;return i.jsx(s,{scope:g,itemMap:b,collectionRef:y,children:m})};o.displayName=t;const l=e+"CollectionSlot",c=E.forwardRef((p,g)=>{const{scope:m,children:y}=p,b=a(l,m),x=xt(g,b.collectionRef);return i.jsx(ka,{ref:x,children:y})});c.displayName=l;const u=e+"CollectionItemSlot",d="data-radix-collection-item",f=E.forwardRef((p,g)=>{const{scope:m,children:y,...b}=p,x=E.useRef(null),w=xt(g,x),j=a(u,m);return E.useEffect(()=>(j.itemMap.set(x,{ref:x,...b}),()=>void j.itemMap.delete(x))),i.jsx(ka,{[d]:"",ref:w,children:y})});f.displayName=u;function h(p){const g=a(e+"CollectionConsumer",p);return E.useCallback(()=>{const y=g.collectionRef.current;if(!y)return[];const b=Array.from(y.querySelectorAll(`[${d}]`));return Array.from(g.itemMap.values()).sort((j,S)=>b.indexOf(j.ref.current)-b.indexOf(S.ref.current))},[g.collectionRef,g.itemMap])}return[{Provider:o,Slot:c,ItemSlot:f},h,r]}var iK=v.createContext(void 0);function Xl(e){const t=v.useContext(iK);return e||t||"ltr"}var j0=0;function sN(){v.useEffect(()=>{const e=document.querySelectorAll("[data-radix-focus-guard]");return document.body.insertAdjacentElement("afterbegin",e[0]??wC()),document.body.insertAdjacentElement("beforeend",e[1]??wC()),j0++,()=>{j0===1&&document.querySelectorAll("[data-radix-focus-guard]").forEach(t=>t.remove()),j0--}},[])}function wC(){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 S0="focusScope.autoFocusOnMount",N0="focusScope.autoFocusOnUnmount",jC={bubbles:!1,cancelable:!0},oK="FocusScope",Ty=v.forwardRef((e,t)=>{const{loop:n=!1,trapped:r=!1,onMountAutoFocus:s,onUnmountAutoFocus:a,...o}=e,[l,c]=v.useState(null),u=Gn(s),d=Gn(a),f=v.useRef(null),h=xt(t,m=>c(m)),p=v.useRef({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}}).current;v.useEffect(()=>{if(r){let m=function(w){if(p.paused||!l)return;const j=w.target;l.contains(j)?f.current=j:Ri(f.current,{select:!0})},y=function(w){if(p.paused||!l)return;const j=w.relatedTarget;j!==null&&(l.contains(j)||Ri(f.current,{select:!0}))},b=function(w){if(document.activeElement===document.body)for(const S of w)S.removedNodes.length>0&&Ri(l)};document.addEventListener("focusin",m),document.addEventListener("focusout",y);const x=new MutationObserver(b);return l&&x.observe(l,{childList:!0,subtree:!0}),()=>{document.removeEventListener("focusin",m),document.removeEventListener("focusout",y),x.disconnect()}}},[r,l,p.paused]),v.useEffect(()=>{if(l){NC.add(p);const m=document.activeElement;if(!l.contains(m)){const b=new CustomEvent(S0,jC);l.addEventListener(S0,u),l.dispatchEvent(b),b.defaultPrevented||(lK(hK(wR(l)),{select:!0}),document.activeElement===m&&Ri(l))}return()=>{l.removeEventListener(S0,u),setTimeout(()=>{const b=new CustomEvent(N0,jC);l.addEventListener(N0,d),l.dispatchEvent(b),b.defaultPrevented||Ri(m??document.body,{select:!0}),l.removeEventListener(N0,d),NC.remove(p)},0)}}},[l,u,d,p]);const g=v.useCallback(m=>{if(!n&&!r||p.paused)return;const y=m.key==="Tab"&&!m.altKey&&!m.ctrlKey&&!m.metaKey,b=document.activeElement;if(y&&b){const x=m.currentTarget,[w,j]=cK(x);w&&j?!m.shiftKey&&b===j?(m.preventDefault(),n&&Ri(w,{select:!0})):m.shiftKey&&b===w&&(m.preventDefault(),n&&Ri(j,{select:!0})):b===x&&m.preventDefault()}},[n,r,p.paused]);return i.jsx(Ye.div,{tabIndex:-1,...o,ref:h,onKeyDown:g})});Ty.displayName=oK;function lK(e,{select:t=!1}={}){const n=document.activeElement;for(const r of e)if(Ri(r,{select:t}),document.activeElement!==n)return}function cK(e){const t=wR(e),n=SC(t,e),r=SC(t.reverse(),e);return[n,r]}function wR(e){const t=[],n=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,{acceptNode:r=>{const s=r.tagName==="INPUT"&&r.type==="hidden";return r.disabled||r.hidden||s?NodeFilter.FILTER_SKIP:r.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});for(;n.nextNode();)t.push(n.currentNode);return t}function SC(e,t){for(const n of e)if(!uK(n,{upTo:t}))return n}function uK(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 dK(e){return e instanceof HTMLInputElement&&"select"in e}function Ri(e,{select:t=!1}={}){if(e&&e.focus){const n=document.activeElement;e.focus({preventScroll:!0}),e!==n&&dK(e)&&t&&e.select()}}var NC=fK();function fK(){let e=[];return{add(t){const n=e[0];t!==n&&(n==null||n.pause()),e=_C(e,t),e.unshift(t)},remove(t){var n;e=_C(e,t),(n=e[0])==null||n.resume()}}}function _C(e,t){const n=[...e],r=n.indexOf(t);return r!==-1&&n.splice(r,1),n}function hK(e){return e.filter(t=>t.tagName!=="A")}function op(e){const t=v.useRef({value:e,previous:e});return v.useMemo(()=>(t.current.value!==e&&(t.current.previous=t.current.value,t.current.value=e),t.current.previous),[e])}var pK=function(e){if(typeof document>"u")return null;var t=Array.isArray(e)?e[0]:e;return t.ownerDocument.body},ac=new WeakMap,Xp=new WeakMap,Yp={},_0=0,jR=function(e){return e&&(e.host||jR(e.parentNode))},mK=function(e,t){return t.map(function(n){if(e.contains(n))return n;var r=jR(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})},gK=function(e,t,n,r){var s=mK(t,Array.isArray(e)?e:[e]);Yp[n]||(Yp[n]=new WeakMap);var a=Yp[n],o=[],l=new Set,c=new Set(s),u=function(f){!f||l.has(f)||(l.add(f),u(f.parentNode))};s.forEach(u);var d=function(f){!f||c.has(f)||Array.prototype.forEach.call(f.children,function(h){if(l.has(h))d(h);else try{var p=h.getAttribute(r),g=p!==null&&p!=="false",m=(ac.get(h)||0)+1,y=(a.get(h)||0)+1;ac.set(h,m),a.set(h,y),o.push(h),m===1&&g&&Xp.set(h,!0),y===1&&h.setAttribute(n,"true"),g||h.setAttribute(r,"true")}catch(b){console.error("aria-hidden: cannot operate on ",h,b)}})};return d(t),l.clear(),_0++,function(){o.forEach(function(f){var h=ac.get(f)-1,p=a.get(f)-1;ac.set(f,h),a.set(f,p),h||(Xp.has(f)||f.removeAttribute(r),Xp.delete(f)),p||f.removeAttribute(n)}),_0--,_0||(ac=new WeakMap,ac=new WeakMap,Xp=new WeakMap,Yp={})}},aN=function(e,t,n){n===void 0&&(n="data-aria-hidden");var r=Array.from(Array.isArray(e)?e:[e]),s=pK(e);return s?(r.push.apply(r,Array.from(s.querySelectorAll("[aria-live]"))),gK(r,s,n,"aria-hidden")):function(){return null}},wa=function(){return wa=Object.assign||function(t){for(var n,r=1,s=arguments.length;r"u")return $K;var t=MK(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])}},RK=PR(),Bc="data-scroll-locked",DK=function(e,t,n,r){var s=e.left,a=e.top,o=e.right,l=e.gap;return n===void 0&&(n="margin"),` + .`.concat(yK,` { overflow: hidden `).concat(r,`; padding-right: `).concat(l,"px ").concat(r,`; } @@ -508,46 +508,46 @@ Defaulting to \`null\`.`}var FI=II,PG=DI;const al=v.forwardRef(({className:e,val `),n==="padding"&&"padding-right: ".concat(l,"px ").concat(r,";")].filter(Boolean).join(""),` } - .`).concat(km,` { + .`).concat(Tm,` { right: `).concat(l,"px ").concat(r,`; } - .`).concat(Tm,` { + .`).concat($m,` { margin-right: `).concat(l,"px ").concat(r,`; } - .`).concat(km," .").concat(km,` { + .`).concat(Tm," .").concat(Tm,` { right: 0 `).concat(r,`; } - .`).concat(Tm," .").concat(Tm,` { + .`).concat($m," .").concat($m,` { margin-right: 0 `).concat(r,`; } body[`).concat(Bc,`] { - `).concat(hK,": ").concat(l,`px; + `).concat(xK,": ").concat(l,`px; } -`)},jC=function(){var e=parseInt(document.body.getAttribute(Bc)||"0",10);return isFinite(e)?e:0},TK=function(){v.useEffect(function(){return document.body.setAttribute(Bc,(jC()+1).toString()),function(){var e=jC()-1;e<=0?document.body.removeAttribute(Bc):document.body.setAttribute(Bc,e.toString())}},[])},$K=function(e){var t=e.noRelative,n=e.noImportant,r=e.gapMode,s=r===void 0?"margin":r;TK();var a=v.useMemo(function(){return EK(s)},[s]);return v.createElement(OK,{styles:kK(a,!t,s,n?"":"!important")})},Cw=!1;if(typeof window<"u")try{var Yp=Object.defineProperty({},"passive",{get:function(){return Cw=!0,!0}});window.addEventListener("test",Yp,Yp),window.removeEventListener("test",Yp,Yp)}catch{Cw=!1}var ic=Cw?{passive:!1}:!1,MK=function(e){return e.tagName==="TEXTAREA"},SR=function(e,t){if(!(e instanceof Element))return!1;var n=window.getComputedStyle(e);return n[t]!=="hidden"&&!(n.overflowY===n.overflowX&&!MK(e)&&n[t]==="visible")},IK=function(e){return SR(e,"overflowY")},RK=function(e){return SR(e,"overflowX")},SC=function(e,t){var n=t.ownerDocument,r=t;do{typeof ShadowRoot<"u"&&r instanceof ShadowRoot&&(r=r.host);var s=NR(e,r);if(s){var a=_R(e,r),o=a[1],l=a[2];if(o>l)return!0}r=r.parentNode}while(r&&r!==n.body);return!1},DK=function(e){var t=e.scrollTop,n=e.scrollHeight,r=e.clientHeight;return[t,n,r]},LK=function(e){var t=e.scrollLeft,n=e.scrollWidth,r=e.clientWidth;return[t,n,r]},NR=function(e,t){return e==="v"?IK(t):RK(t)},_R=function(e,t){return e==="v"?DK(t):LK(t)},FK=function(e,t){return e==="h"&&t==="rtl"?-1:1},BK=function(e,t,n,r,s){var a=FK(e,window.getComputedStyle(t).direction),o=a*r,l=n.target,c=t.contains(l),u=!1,d=o>0,f=0,h=0;do{var p=_R(e,l),g=p[0],m=p[1],y=p[2],b=m-y-a*g;(g||b)&&NR(e,l)&&(f+=b,h+=g),l instanceof ShadowRoot?l=l.host:l=l.parentNode}while(!c&&l!==document.body||c&&(t.contains(l)||t===l));return(d&&(Math.abs(f)<1||!s)||!d&&(Math.abs(h)<1||!s))&&(u=!0),u},Zp=function(e){return"changedTouches"in e?[e.changedTouches[0].clientX,e.changedTouches[0].clientY]:[0,0]},NC=function(e){return[e.deltaX,e.deltaY]},_C=function(e){return e&&"current"in e?e.current:e},zK=function(e,t){return e[0]===t[0]&&e[1]===t[1]},UK=function(e){return` +`)},AC=function(){var e=parseInt(document.body.getAttribute(Bc)||"0",10);return isFinite(e)?e:0},LK=function(){v.useEffect(function(){return document.body.setAttribute(Bc,(AC()+1).toString()),function(){var e=AC()-1;e<=0?document.body.removeAttribute(Bc):document.body.setAttribute(Bc,e.toString())}},[])},FK=function(e){var t=e.noRelative,n=e.noImportant,r=e.gapMode,s=r===void 0?"margin":r;LK();var a=v.useMemo(function(){return IK(s)},[s]);return v.createElement(RK,{styles:DK(a,!t,s,n?"":"!important")})},Ow=!1;if(typeof window<"u")try{var Zp=Object.defineProperty({},"passive",{get:function(){return Ow=!0,!0}});window.addEventListener("test",Zp,Zp),window.removeEventListener("test",Zp,Zp)}catch{Ow=!1}var ic=Ow?{passive:!1}:!1,BK=function(e){return e.tagName==="TEXTAREA"},AR=function(e,t){if(!(e instanceof Element))return!1;var n=window.getComputedStyle(e);return n[t]!=="hidden"&&!(n.overflowY===n.overflowX&&!BK(e)&&n[t]==="visible")},zK=function(e){return AR(e,"overflowY")},UK=function(e){return AR(e,"overflowX")},CC=function(e,t){var n=t.ownerDocument,r=t;do{typeof ShadowRoot<"u"&&r instanceof ShadowRoot&&(r=r.host);var s=CR(e,r);if(s){var a=ER(e,r),o=a[1],l=a[2];if(o>l)return!0}r=r.parentNode}while(r&&r!==n.body);return!1},VK=function(e){var t=e.scrollTop,n=e.scrollHeight,r=e.clientHeight;return[t,n,r]},WK=function(e){var t=e.scrollLeft,n=e.scrollWidth,r=e.clientWidth;return[t,n,r]},CR=function(e,t){return e==="v"?zK(t):UK(t)},ER=function(e,t){return e==="v"?VK(t):WK(t)},GK=function(e,t){return e==="h"&&t==="rtl"?-1:1},HK=function(e,t,n,r,s){var a=GK(e,window.getComputedStyle(t).direction),o=a*r,l=n.target,c=t.contains(l),u=!1,d=o>0,f=0,h=0;do{var p=ER(e,l),g=p[0],m=p[1],y=p[2],b=m-y-a*g;(g||b)&&CR(e,l)&&(f+=b,h+=g),l instanceof ShadowRoot?l=l.host:l=l.parentNode}while(!c&&l!==document.body||c&&(t.contains(l)||t===l));return(d&&(Math.abs(f)<1||!s)||!d&&(Math.abs(h)<1||!s))&&(u=!0),u},Qp=function(e){return"changedTouches"in e?[e.changedTouches[0].clientX,e.changedTouches[0].clientY]:[0,0]},EC=function(e){return[e.deltaX,e.deltaY]},OC=function(e){return e&&"current"in e?e.current:e},qK=function(e,t){return e[0]===t[0]&&e[1]===t[1]},KK=function(e){return` .block-interactivity-`.concat(e,` {pointer-events: none;} .allow-interactivity-`).concat(e,` {pointer-events: all;} -`)},VK=0,oc=[];function WK(e){var t=v.useRef([]),n=v.useRef([0,0]),r=v.useRef(),s=v.useState(VK++)[0],a=v.useState(jR)[0],o=v.useRef(e);v.useEffect(function(){o.current=e},[e]),v.useEffect(function(){if(e.inert){document.body.classList.add("block-interactivity-".concat(s));var m=dK([e.lockRef.current],(e.shards||[]).map(_C),!0).filter(Boolean);return m.forEach(function(y){return y.classList.add("allow-interactivity-".concat(s))}),function(){document.body.classList.remove("block-interactivity-".concat(s)),m.forEach(function(y){return y.classList.remove("allow-interactivity-".concat(s))})}}},[e.inert,e.lockRef.current,e.shards]);var l=v.useCallback(function(m,y){if("touches"in m&&m.touches.length===2||m.type==="wheel"&&m.ctrlKey)return!o.current.allowPinchZoom;var b=Zp(m),x=n.current,w="deltaX"in m?m.deltaX:x[0]-b[0],j="deltaY"in m?m.deltaY:x[1]-b[1],S,N=m.target,_=Math.abs(w)>Math.abs(j)?"h":"v";if("touches"in m&&_==="h"&&N.type==="range")return!1;var P=SC(_,N);if(!P)return!0;if(P?S=_:(S=_==="v"?"h":"v",P=SC(_,N)),!P)return!1;if(!r.current&&"changedTouches"in m&&(w||j)&&(r.current=S),!S)return!0;var k=r.current||S;return BK(k,y,m,k==="h"?w:j,!0)},[]),c=v.useCallback(function(m){var y=m;if(!(!oc.length||oc[oc.length-1]!==a)){var b="deltaY"in y?NC(y):Zp(y),x=t.current.filter(function(S){return S.name===y.type&&(S.target===y.target||y.target===S.shadowParent)&&zK(S.delta,b)})[0];if(x&&x.should){y.cancelable&&y.preventDefault();return}if(!x){var w=(o.current.shards||[]).map(_C).filter(Boolean).filter(function(S){return S.contains(y.target)}),j=w.length>0?l(y,w[0]):!o.current.noIsolation;j&&y.cancelable&&y.preventDefault()}}},[]),u=v.useCallback(function(m,y,b,x){var w={name:m,delta:y,target:b,should:x,shadowParent:HK(b)};t.current.push(w),setTimeout(function(){t.current=t.current.filter(function(j){return j!==w})},1)},[]),d=v.useCallback(function(m){n.current=Zp(m),r.current=void 0},[]),f=v.useCallback(function(m){u(m.type,NC(m),m.target,l(m,e.lockRef.current))},[]),h=v.useCallback(function(m){u(m.type,Zp(m),m.target,l(m,e.lockRef.current))},[]);v.useEffect(function(){return oc.push(a),e.setCallbacks({onScrollCapture:f,onWheelCapture:f,onTouchMoveCapture:h}),document.addEventListener("wheel",c,ic),document.addEventListener("touchmove",c,ic),document.addEventListener("touchstart",d,ic),function(){oc=oc.filter(function(m){return m!==a}),document.removeEventListener("wheel",c,ic),document.removeEventListener("touchmove",c,ic),document.removeEventListener("touchstart",d,ic)}},[]);var p=e.removeScrollBar,g=e.inert;return v.createElement(v.Fragment,null,g?v.createElement(a,{styles:UK(s)}):null,p?v.createElement($K,{gapMode:e.gapMode}):null)}function HK(e){for(var t=null;e!==null;)e instanceof ShadowRoot&&(t=e.host,e=e.host),e=e.parentNode;return t}const GK=bK(wR,WK);var Ty=v.forwardRef(function(e,t){return v.createElement(ky,wa({},e,{ref:t,sideCar:GK}))});Ty.classNames=ky.classNames;var qK=[" ","Enter","ArrowUp","ArrowDown"],KK=[" ","Enter"],op="Select",[$y,My,XK]=Ey(op),[Qu,PPe]=Gr(op,[XK,Gu]),Iy=Gu(),[YK,Do]=Qu(op),[ZK,QK]=Qu(op),PR=e=>{const{__scopeSelect:t,children:n,open:r,defaultOpen:s,onOpenChange:a,value:o,defaultValue:l,onValueChange:c,dir:u,name:d,autoComplete:f,disabled:h,required:p,form:g}=e,m=Iy(t),[y,b]=v.useState(null),[x,w]=v.useState(null),[j,S]=v.useState(!1),N=Xl(u),[_=!1,P]=aa({prop:r,defaultProp:s,onChange:a}),[k,O]=aa({prop:o,defaultProp:l,onChange:c}),M=v.useRef(null),A=y?g||!!y.closest("form"):!0,[$,L]=v.useState(new Set),H=Array.from($).map(D=>D.props.value).join(";");return i.jsx(NM,{...m,children:i.jsxs(YK,{required:p,scope:t,trigger:y,onTriggerChange:b,valueNode:x,onValueNodeChange:w,valueNodeHasChildren:j,onValueNodeHasChildrenChange:S,contentId:Ys(),value:k,onValueChange:O,open:_,onOpenChange:P,dir:N,triggerPointerDownPosRef:M,disabled:h,children:[i.jsx($y.Provider,{scope:t,children:i.jsx(ZK,{scope:e.__scopeSelect,onNativeOptionAdd:v.useCallback(D=>{L(V=>new Set(V).add(D))},[]),onNativeOptionRemove:v.useCallback(D=>{L(V=>{const T=new Set(V);return T.delete(D),T})},[]),children:n})}),A?i.jsxs(ZR,{"aria-hidden":!0,required:p,tabIndex:-1,name:d,autoComplete:f,value:k,onChange:D=>O(D.target.value),disabled:h,form:g,children:[k===void 0?i.jsx("option",{value:""}):null,Array.from($)]},H):null]})})};PR.displayName=op;var AR="SelectTrigger",CR=v.forwardRef((e,t)=>{const{__scopeSelect:n,disabled:r=!1,...s}=e,a=Iy(n),o=Do(AR,n),l=o.disabled||r,c=xt(t,o.onTriggerChange),u=My(n),d=v.useRef("touch"),[f,h,p]=QR(m=>{const y=u().filter(w=>!w.disabled),b=y.find(w=>w.value===o.value),x=JR(y,m,b);x!==void 0&&o.onValueChange(x.value)}),g=m=>{l||(o.onOpenChange(!0),p()),m&&(o.triggerPointerDownPosRef.current={x:Math.round(m.pageX),y:Math.round(m.pageY)})};return i.jsx(wS,{asChild:!0,...a,children:i.jsx(Ye.button,{type:"button",role:"combobox","aria-controls":o.contentId,"aria-expanded":o.open,"aria-required":o.required,"aria-autocomplete":"none",dir:o.dir,"data-state":o.open?"open":"closed",disabled:l,"data-disabled":l?"":void 0,"data-placeholder":YR(o.value)?"":void 0,...s,ref:c,onClick:Ee(s.onClick,m=>{m.currentTarget.focus(),d.current!=="mouse"&&g(m)}),onPointerDown:Ee(s.onPointerDown,m=>{d.current=m.pointerType;const y=m.target;y.hasPointerCapture(m.pointerId)&&y.releasePointerCapture(m.pointerId),m.button===0&&m.ctrlKey===!1&&m.pointerType==="mouse"&&(g(m),m.preventDefault())}),onKeyDown:Ee(s.onKeyDown,m=>{const y=f.current!=="";!(m.ctrlKey||m.altKey||m.metaKey)&&m.key.length===1&&h(m.key),!(y&&m.key===" ")&&qK.includes(m.key)&&(g(),m.preventDefault())})})})});CR.displayName=AR;var ER="SelectValue",OR=v.forwardRef((e,t)=>{const{__scopeSelect:n,className:r,style:s,children:a,placeholder:o="",...l}=e,c=Do(ER,n),{onValueNodeHasChildrenChange:u}=c,d=a!==void 0,f=xt(t,c.onValueNodeChange);return ir(()=>{u(d)},[u,d]),i.jsx(Ye.span,{...l,ref:f,style:{pointerEvents:"none"},children:YR(c.value)?i.jsx(i.Fragment,{children:o}):a})});OR.displayName=ER;var JK="SelectIcon",kR=v.forwardRef((e,t)=>{const{__scopeSelect:n,children:r,...s}=e;return i.jsx(Ye.span,{"aria-hidden":!0,...s,ref:t,children:r||"▼"})});kR.displayName=JK;var eX="SelectPortal",TR=e=>i.jsx(cy,{asChild:!0,...e});TR.displayName=eX;var Ll="SelectContent",$R=v.forwardRef((e,t)=>{const n=Do(Ll,e.__scopeSelect),[r,s]=v.useState();if(ir(()=>{s(new DocumentFragment)},[]),!n.open){const a=r;return a?Vu.createPortal(i.jsx(MR,{scope:e.__scopeSelect,children:i.jsx($y.Slot,{scope:e.__scopeSelect,children:i.jsx("div",{children:e.children})})}),a):null}return i.jsx(IR,{...e,ref:t})});$R.displayName=Ll;var Rs=10,[MR,Lo]=Qu(Ll),tX="SelectContentImpl",IR=v.forwardRef((e,t)=>{const{__scopeSelect:n,position:r="item-aligned",onCloseAutoFocus:s,onEscapeKeyDown:a,onPointerDownOutside:o,side:l,sideOffset:c,align:u,alignOffset:d,arrowPadding:f,collisionBoundary:h,collisionPadding:p,sticky:g,hideWhenDetached:m,avoidCollisions:y,...b}=e,x=Do(Ll,n),[w,j]=v.useState(null),[S,N]=v.useState(null),_=xt(t,ce=>j(ce)),[P,k]=v.useState(null),[O,M]=v.useState(null),A=My(n),[$,L]=v.useState(!1),H=v.useRef(!1);v.useEffect(()=>{if(w)return eN(w)},[w]),JS();const D=v.useCallback(ce=>{const[De,...de]=A().map(ne=>ne.ref.current),[be]=de.slice(-1),Pe=document.activeElement;for(const ne of ce)if(ne===Pe||(ne==null||ne.scrollIntoView({block:"nearest"}),ne===De&&S&&(S.scrollTop=0),ne===be&&S&&(S.scrollTop=S.scrollHeight),ne==null||ne.focus(),document.activeElement!==Pe))return},[A,S]),V=v.useCallback(()=>D([P,w]),[D,P,w]);v.useEffect(()=>{$&&V()},[$,V]);const{onOpenChange:T,triggerPointerDownPosRef:F}=x;v.useEffect(()=>{if(w){let ce={x:0,y:0};const De=be=>{var Pe,ne;ce={x:Math.abs(Math.round(be.pageX)-(((Pe=F.current)==null?void 0:Pe.x)??0)),y:Math.abs(Math.round(be.pageY)-(((ne=F.current)==null?void 0:ne.y)??0))}},de=be=>{ce.x<=10&&ce.y<=10?be.preventDefault():w.contains(be.target)||T(!1),document.removeEventListener("pointermove",De),F.current=null};return F.current!==null&&(document.addEventListener("pointermove",De),document.addEventListener("pointerup",de,{capture:!0,once:!0})),()=>{document.removeEventListener("pointermove",De),document.removeEventListener("pointerup",de,{capture:!0})}}},[w,T,F]),v.useEffect(()=>{const ce=()=>T(!1);return window.addEventListener("blur",ce),window.addEventListener("resize",ce),()=>{window.removeEventListener("blur",ce),window.removeEventListener("resize",ce)}},[T]);const[q,Z]=QR(ce=>{const De=A().filter(Pe=>!Pe.disabled),de=De.find(Pe=>Pe.ref.current===document.activeElement),be=JR(De,ce,de);be&&setTimeout(()=>be.ref.current.focus())}),re=v.useCallback((ce,De,de)=>{const be=!H.current&&!de;(x.value!==void 0&&x.value===De||be)&&(k(ce),be&&(H.current=!0))},[x.value]),ge=v.useCallback(()=>w==null?void 0:w.focus(),[w]),B=v.useCallback((ce,De,de)=>{const be=!H.current&&!de;(x.value!==void 0&&x.value===De||be)&&M(ce)},[x.value]),le=r==="popper"?Ew:RR,se=le===Ew?{side:l,sideOffset:c,align:u,alignOffset:d,arrowPadding:f,collisionBoundary:h,collisionPadding:p,sticky:g,hideWhenDetached:m,avoidCollisions:y}:{};return i.jsx(MR,{scope:n,content:w,viewport:S,onViewportChange:N,itemRefCallback:re,selectedItem:P,onItemLeave:ge,itemTextRefCallback:B,focusSelectedItem:V,selectedItemText:O,position:r,isPositioned:$,searchRef:q,children:i.jsx(Ty,{as:mi,allowPinchZoom:!0,children:i.jsx(Oy,{asChild:!0,trapped:x.open,onMountAutoFocus:ce=>{ce.preventDefault()},onUnmountAutoFocus:Ee(s,ce=>{var De;(De=x.trigger)==null||De.focus({preventScroll:!0}),ce.preventDefault()}),children:i.jsx(Jh,{asChild:!0,disableOutsidePointerEvents:!0,onEscapeKeyDown:a,onPointerDownOutside:o,onFocusOutside:ce=>ce.preventDefault(),onDismiss:()=>x.onOpenChange(!1),children:i.jsx(le,{role:"listbox",id:x.contentId,"data-state":x.open?"open":"closed",dir:x.dir,onContextMenu:ce=>ce.preventDefault(),...b,...se,onPlaced:()=>L(!0),ref:_,style:{display:"flex",flexDirection:"column",outline:"none",...b.style},onKeyDown:Ee(b.onKeyDown,ce=>{const De=ce.ctrlKey||ce.altKey||ce.metaKey;if(ce.key==="Tab"&&ce.preventDefault(),!De&&ce.key.length===1&&Z(ce.key),["ArrowUp","ArrowDown","Home","End"].includes(ce.key)){let be=A().filter(Pe=>!Pe.disabled).map(Pe=>Pe.ref.current);if(["ArrowUp","End"].includes(ce.key)&&(be=be.slice().reverse()),["ArrowUp","ArrowDown"].includes(ce.key)){const Pe=ce.target,ne=be.indexOf(Pe);be=be.slice(ne+1)}setTimeout(()=>D(be)),ce.preventDefault()}})})})})})})});IR.displayName=tX;var nX="SelectItemAlignedPosition",RR=v.forwardRef((e,t)=>{const{__scopeSelect:n,onPlaced:r,...s}=e,a=Do(Ll,n),o=Lo(Ll,n),[l,c]=v.useState(null),[u,d]=v.useState(null),f=xt(t,_=>d(_)),h=My(n),p=v.useRef(!1),g=v.useRef(!0),{viewport:m,selectedItem:y,selectedItemText:b,focusSelectedItem:x}=o,w=v.useCallback(()=>{if(a.trigger&&a.valueNode&&l&&u&&m&&y&&b){const _=a.trigger.getBoundingClientRect(),P=u.getBoundingClientRect(),k=a.valueNode.getBoundingClientRect(),O=b.getBoundingClientRect();if(a.dir!=="rtl"){const Pe=O.left-P.left,ne=k.left-Pe,Je=_.left-ne,ve=_.width+Je,at=Math.max(ve,P.width),st=window.innerWidth-Rs,Mt=sh(ne,[Rs,Math.max(Rs,st-at)]);l.style.minWidth=ve+"px",l.style.left=Mt+"px"}else{const Pe=P.right-O.right,ne=window.innerWidth-k.right-Pe,Je=window.innerWidth-_.right-ne,ve=_.width+Je,at=Math.max(ve,P.width),st=window.innerWidth-Rs,Mt=sh(ne,[Rs,Math.max(Rs,st-at)]);l.style.minWidth=ve+"px",l.style.right=Mt+"px"}const M=h(),A=window.innerHeight-Rs*2,$=m.scrollHeight,L=window.getComputedStyle(u),H=parseInt(L.borderTopWidth,10),D=parseInt(L.paddingTop,10),V=parseInt(L.borderBottomWidth,10),T=parseInt(L.paddingBottom,10),F=H+D+$+T+V,q=Math.min(y.offsetHeight*5,F),Z=window.getComputedStyle(m),re=parseInt(Z.paddingTop,10),ge=parseInt(Z.paddingBottom,10),B=_.top+_.height/2-Rs,le=A-B,se=y.offsetHeight/2,ce=y.offsetTop+se,De=H+D+ce,de=F-De;if(De<=B){const Pe=M.length>0&&y===M[M.length-1].ref.current;l.style.bottom="0px";const ne=u.clientHeight-m.offsetTop-m.offsetHeight,Je=Math.max(le,se+(Pe?ge:0)+ne+V),ve=De+Je;l.style.height=ve+"px"}else{const Pe=M.length>0&&y===M[0].ref.current;l.style.top="0px";const Je=Math.max(B,H+m.offsetTop+(Pe?re:0)+se)+de;l.style.height=Je+"px",m.scrollTop=De-B+m.offsetTop}l.style.margin=`${Rs}px 0`,l.style.minHeight=q+"px",l.style.maxHeight=A+"px",r==null||r(),requestAnimationFrame(()=>p.current=!0)}},[h,a.trigger,a.valueNode,l,u,m,y,b,a.dir,r]);ir(()=>w(),[w]);const[j,S]=v.useState();ir(()=>{u&&S(window.getComputedStyle(u).zIndex)},[u]);const N=v.useCallback(_=>{_&&g.current===!0&&(w(),x==null||x(),g.current=!1)},[w,x]);return i.jsx(sX,{scope:n,contentWrapper:l,shouldExpandOnScrollRef:p,onScrollButtonChange:N,children:i.jsx("div",{ref:c,style:{display:"flex",flexDirection:"column",position:"fixed",zIndex:j},children:i.jsx(Ye.div,{...s,ref:f,style:{boxSizing:"border-box",maxHeight:"100%",...s.style}})})})});RR.displayName=nX;var rX="SelectPopperPosition",Ew=v.forwardRef((e,t)=>{const{__scopeSelect:n,align:r="start",collisionPadding:s=Rs,...a}=e,o=Iy(n);return i.jsx(jS,{...o,...a,ref:t,align:r,collisionPadding:s,style:{boxSizing:"border-box",...a.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)"}})});Ew.displayName=rX;var[sX,tN]=Qu(Ll,{}),Ow="SelectViewport",DR=v.forwardRef((e,t)=>{const{__scopeSelect:n,nonce:r,...s}=e,a=Lo(Ow,n),o=tN(Ow,n),l=xt(t,a.onViewportChange),c=v.useRef(0);return i.jsxs(i.Fragment,{children:[i.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}),i.jsx($y.Slot,{scope:n,children:i.jsx(Ye.div,{"data-radix-select-viewport":"",role:"presentation",...s,ref:l,style:{position:"relative",flex:1,overflow:"hidden auto",...s.style},onScroll:Ee(s.onScroll,u=>{const d=u.currentTarget,{contentWrapper:f,shouldExpandOnScrollRef:h}=o;if(h!=null&&h.current&&f){const p=Math.abs(c.current-d.scrollTop);if(p>0){const g=window.innerHeight-Rs*2,m=parseFloat(f.style.minHeight),y=parseFloat(f.style.height),b=Math.max(m,y);if(b0?j:0,f.style.justifyContent="flex-end")}}}c.current=d.scrollTop})})})]})});DR.displayName=Ow;var LR="SelectGroup",[aX,iX]=Qu(LR),oX=v.forwardRef((e,t)=>{const{__scopeSelect:n,...r}=e,s=Ys();return i.jsx(aX,{scope:n,id:s,children:i.jsx(Ye.div,{role:"group","aria-labelledby":s,...r,ref:t})})});oX.displayName=LR;var FR="SelectLabel",BR=v.forwardRef((e,t)=>{const{__scopeSelect:n,...r}=e,s=iX(FR,n);return i.jsx(Ye.div,{id:s.id,...r,ref:t})});BR.displayName=FR;var Ag="SelectItem",[lX,zR]=Qu(Ag),UR=v.forwardRef((e,t)=>{const{__scopeSelect:n,value:r,disabled:s=!1,textValue:a,...o}=e,l=Do(Ag,n),c=Lo(Ag,n),u=l.value===r,[d,f]=v.useState(a??""),[h,p]=v.useState(!1),g=xt(t,x=>{var w;return(w=c.itemRefCallback)==null?void 0:w.call(c,x,r,s)}),m=Ys(),y=v.useRef("touch"),b=()=>{s||(l.onValueChange(r),l.onOpenChange(!1))};if(r==="")throw new Error("A 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 i.jsx(lX,{scope:n,value:r,disabled:s,textId:m,isSelected:u,onItemTextChange:v.useCallback(x=>{f(w=>w||((x==null?void 0:x.textContent)??"").trim())},[]),children:i.jsx($y.ItemSlot,{scope:n,value:r,disabled:s,textValue:d,children:i.jsx(Ye.div,{role:"option","aria-labelledby":m,"data-highlighted":h?"":void 0,"aria-selected":u&&h,"data-state":u?"checked":"unchecked","aria-disabled":s||void 0,"data-disabled":s?"":void 0,tabIndex:s?void 0:-1,...o,ref:g,onFocus:Ee(o.onFocus,()=>p(!0)),onBlur:Ee(o.onBlur,()=>p(!1)),onClick:Ee(o.onClick,()=>{y.current!=="mouse"&&b()}),onPointerUp:Ee(o.onPointerUp,()=>{y.current==="mouse"&&b()}),onPointerDown:Ee(o.onPointerDown,x=>{y.current=x.pointerType}),onPointerMove:Ee(o.onPointerMove,x=>{var w;y.current=x.pointerType,s?(w=c.onItemLeave)==null||w.call(c):y.current==="mouse"&&x.currentTarget.focus({preventScroll:!0})}),onPointerLeave:Ee(o.onPointerLeave,x=>{var w;x.currentTarget===document.activeElement&&((w=c.onItemLeave)==null||w.call(c))}),onKeyDown:Ee(o.onKeyDown,x=>{var j;((j=c.searchRef)==null?void 0:j.current)!==""&&x.key===" "||(KK.includes(x.key)&&b(),x.key===" "&&x.preventDefault())})})})})});UR.displayName=Ag;var Xd="SelectItemText",VR=v.forwardRef((e,t)=>{const{__scopeSelect:n,className:r,style:s,...a}=e,o=Do(Xd,n),l=Lo(Xd,n),c=zR(Xd,n),u=QK(Xd,n),[d,f]=v.useState(null),h=xt(t,b=>f(b),c.onItemTextChange,b=>{var x;return(x=l.itemTextRefCallback)==null?void 0:x.call(l,b,c.value,c.disabled)}),p=d==null?void 0:d.textContent,g=v.useMemo(()=>i.jsx("option",{value:c.value,disabled:c.disabled,children:p},c.value),[c.disabled,c.value,p]),{onNativeOptionAdd:m,onNativeOptionRemove:y}=u;return ir(()=>(m(g),()=>y(g)),[m,y,g]),i.jsxs(i.Fragment,{children:[i.jsx(Ye.span,{id:c.textId,...a,ref:h}),c.isSelected&&o.valueNode&&!o.valueNodeHasChildren?Vu.createPortal(a.children,o.valueNode):null]})});VR.displayName=Xd;var WR="SelectItemIndicator",HR=v.forwardRef((e,t)=>{const{__scopeSelect:n,...r}=e;return zR(WR,n).isSelected?i.jsx(Ye.span,{"aria-hidden":!0,...r,ref:t}):null});HR.displayName=WR;var kw="SelectScrollUpButton",GR=v.forwardRef((e,t)=>{const n=Lo(kw,e.__scopeSelect),r=tN(kw,e.__scopeSelect),[s,a]=v.useState(!1),o=xt(t,r.onScrollButtonChange);return ir(()=>{if(n.viewport&&n.isPositioned){let l=function(){const u=c.scrollTop>0;a(u)};const c=n.viewport;return l(),c.addEventListener("scroll",l),()=>c.removeEventListener("scroll",l)}},[n.viewport,n.isPositioned]),s?i.jsx(KR,{...e,ref:o,onAutoScroll:()=>{const{viewport:l,selectedItem:c}=n;l&&c&&(l.scrollTop=l.scrollTop-c.offsetHeight)}}):null});GR.displayName=kw;var Tw="SelectScrollDownButton",qR=v.forwardRef((e,t)=>{const n=Lo(Tw,e.__scopeSelect),r=tN(Tw,e.__scopeSelect),[s,a]=v.useState(!1),o=xt(t,r.onScrollButtonChange);return ir(()=>{if(n.viewport&&n.isPositioned){let l=function(){const u=c.scrollHeight-c.clientHeight,d=Math.ceil(c.scrollTop)c.removeEventListener("scroll",l)}},[n.viewport,n.isPositioned]),s?i.jsx(KR,{...e,ref:o,onAutoScroll:()=>{const{viewport:l,selectedItem:c}=n;l&&c&&(l.scrollTop=l.scrollTop+c.offsetHeight)}}):null});qR.displayName=Tw;var KR=v.forwardRef((e,t)=>{const{__scopeSelect:n,onAutoScroll:r,...s}=e,a=Lo("SelectScrollButton",n),o=v.useRef(null),l=My(n),c=v.useCallback(()=>{o.current!==null&&(window.clearInterval(o.current),o.current=null)},[]);return v.useEffect(()=>()=>c(),[c]),ir(()=>{var d;const u=l().find(f=>f.ref.current===document.activeElement);(d=u==null?void 0:u.ref.current)==null||d.scrollIntoView({block:"nearest"})},[l]),i.jsx(Ye.div,{"aria-hidden":!0,...s,ref:t,style:{flexShrink:0,...s.style},onPointerDown:Ee(s.onPointerDown,()=>{o.current===null&&(o.current=window.setInterval(r,50))}),onPointerMove:Ee(s.onPointerMove,()=>{var u;(u=a.onItemLeave)==null||u.call(a),o.current===null&&(o.current=window.setInterval(r,50))}),onPointerLeave:Ee(s.onPointerLeave,()=>{c()})})}),cX="SelectSeparator",XR=v.forwardRef((e,t)=>{const{__scopeSelect:n,...r}=e;return i.jsx(Ye.div,{"aria-hidden":!0,...r,ref:t})});XR.displayName=cX;var $w="SelectArrow",uX=v.forwardRef((e,t)=>{const{__scopeSelect:n,...r}=e,s=Iy(n),a=Do($w,n),o=Lo($w,n);return a.open&&o.position==="popper"?i.jsx(SS,{...s,...r,ref:t}):null});uX.displayName=$w;function YR(e){return e===""||e===void 0}var ZR=v.forwardRef((e,t)=>{const{value:n,...r}=e,s=v.useRef(null),a=xt(t,s),o=ip(n);return v.useEffect(()=>{const l=s.current,c=window.HTMLSelectElement.prototype,d=Object.getOwnPropertyDescriptor(c,"value").set;if(o!==n&&d){const f=new Event("change",{bubbles:!0});d.call(l,n),l.dispatchEvent(f)}},[o,n]),i.jsx(NS,{asChild:!0,children:i.jsx("select",{...r,ref:a,defaultValue:n})})});ZR.displayName="BubbleSelect";function QR(e){const t=Hn(e),n=v.useRef(""),r=v.useRef(0),s=v.useCallback(o=>{const l=n.current+o;t(l),function c(u){n.current=u,window.clearTimeout(r.current),u!==""&&(r.current=window.setTimeout(()=>c(""),1e3))}(l)},[t]),a=v.useCallback(()=>{n.current="",window.clearTimeout(r.current)},[]);return v.useEffect(()=>()=>window.clearTimeout(r.current),[]),[n,s,a]}function JR(e,t,n){const s=t.length>1&&Array.from(t).every(u=>u===t[0])?t[0]:t,a=n?e.indexOf(n):-1;let o=dX(e,Math.max(a,0));s.length===1&&(o=o.filter(u=>u!==n));const c=o.find(u=>u.textValue.toLowerCase().startsWith(s.toLowerCase()));return c!==n?c:void 0}function dX(e,t){return e.map((n,r)=>e[(t+r)%e.length])}var fX=PR,eD=CR,hX=OR,pX=kR,mX=TR,tD=$R,gX=DR,nD=BR,rD=UR,vX=VR,yX=HR,sD=GR,aD=qR,iD=XR;const Mn=fX,In=hX,Pn=v.forwardRef(({className:e,children:t,...n},r)=>i.jsxs(eD,{ref:r,className:Me("flex h-10 w-full items-center justify-between rounded-md border border-input bg-background px-3 py-2 text-sm ring-offset-background placeholder:text-muted-foreground focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50 [&>span]:line-clamp-1",e),...n,children:[t,i.jsx(pX,{asChild:!0,children:i.jsx(yi,{className:"h-4 w-4 opacity-50"})})]}));Pn.displayName=eD.displayName;const oD=v.forwardRef(({className:e,...t},n)=>i.jsx(sD,{ref:n,className:Me("flex cursor-default items-center justify-center py-1",e),...t,children:i.jsx(Tl,{className:"h-4 w-4"})}));oD.displayName=sD.displayName;const lD=v.forwardRef(({className:e,...t},n)=>i.jsx(aD,{ref:n,className:Me("flex cursor-default items-center justify-center py-1",e),...t,children:i.jsx(yi,{className:"h-4 w-4"})}));lD.displayName=aD.displayName;const An=v.forwardRef(({className:e,children:t,position:n="popper",...r},s)=>i.jsx(mX,{children:i.jsxs(tD,{ref:s,className:Me("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:[i.jsx(oD,{}),i.jsx(gX,{className:Me("p-1",n==="popper"&&"h-[var(--radix-select-trigger-height)] w-full min-w-[var(--radix-select-trigger-width)]"),children:t}),i.jsx(lD,{})]})}));An.displayName=tD.displayName;const xX=v.forwardRef(({className:e,...t},n)=>i.jsx(nD,{ref:n,className:Me("py-1.5 pl-8 pr-2 text-sm font-semibold",e),...t}));xX.displayName=nD.displayName;const fe=v.forwardRef(({className:e,children:t,...n},r)=>i.jsxs(rD,{ref:r,className:Me("relative flex w-full cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",e),...n,children:[i.jsx("span",{className:"absolute left-2 flex h-3.5 w-3.5 items-center justify-center",children:i.jsx(yX,{children:i.jsx(Ta,{className:"h-4 w-4"})})}),i.jsx(vX,{children:t})]}));fe.displayName=rD.displayName;const bX=v.forwardRef(({className:e,...t},n)=>i.jsx(iD,{ref:n,className:Me("-mx-1 my-1 h-px bg-muted",e),...t}));bX.displayName=iD.displayName;const wX=Te.object({audienceBrief:Te.string().min(10,{message:"Audience brief must be at least 10 characters."}),researchObjective:Te.string().optional(),personaCount:Te.string().min(1,{message:"Number of personas is required."}),dataFile:Te.instanceof(FileList).optional(),llm_model:Te.string().optional()});function jX({onSubmit:e,isGenerating:t}){const[n,r]=v.useState(!1),[s,a]=v.useState(!1),[o,l]=v.useState({audience_brief:[],research_objective:[]}),[c,u]=v.useState(!1),[d,f]=v.useState(null),h=Ny({resolver:_y(wX),defaultValues:{audienceBrief:"",researchObjective:"",personaCount:"5",llm_model:"gemini-2.5-pro"}}),p=h.watch("audienceBrief"),g=h.watch("researchObjective"),m=async()=>{var w,j,S,N,_,P,k,O,M,A,$;const b=p==null?void 0:p.trim(),x=g==null?void 0:g.trim();if(!b||b.length<10){oe.error("Audience brief too short",{description:"Please enter at least 10 characters in the audience brief"});return}if(!x||x.length<10){oe.error("Research objective too short",{description:"Please enter at least 10 characters in the research objective"});return}u(!0),f(null);try{const L=await Ka.enhanceAudienceBrief(b,x);l(L.data.suggestions||{audience_brief:[],research_objective:[]}),r(!0),a(!1);const H=(((j=(w=L.data.suggestions)==null?void 0:w.audience_brief)==null?void 0:j.length)||0)+(((N=(S=L.data.suggestions)==null?void 0:S.research_objective)==null?void 0:N.length)||0);oe.success("Enhancement suggestions generated",{description:`Generated ${H} suggestions to improve your research inputs`})}catch(L){console.error("Error enhancing audience brief:",L);let H="Please try again or modify your brief",D="Failed to generate suggestions";if(L&&typeof L=="object"){const V=L;V.code==="ECONNABORTED"||(_=V.message)!=null&&_.includes("timeout")?(D="Request timeout",H="The AI took too long to analyze your brief. Please try again."):((P=V.response)==null?void 0:P.status)===500?(D="Server error",H=((O=(k=V.response)==null?void 0:k.data)==null?void 0:O.message)||"The server encountered an error. Please try again later."):((M=V.response)==null?void 0:M.status)===400?(D="Invalid brief",H=(($=(A=V.response)==null?void 0:A.data)==null?void 0:$.message)||"Please check your audience brief and try again."):V.message&&(H=V.message)}else L instanceof Error&&(H=L.message);f(H),oe.error(D,{description:H,duration:5e3})}finally{u(!1)}},y=()=>{a(!s)};return i.jsx(Ay,{...h,children:i.jsxs("form",{onSubmit:h.handleSubmit(e),className:"space-y-6",children:[i.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-6",children:[i.jsxs("div",{className:"space-y-6",children:[i.jsx(dt,{control:h.control,name:"audienceBrief",render:({field:b})=>i.jsxs(ot,{children:[i.jsx(lt,{children:"Audience Brief"}),i.jsx(ct,{children:i.jsx(nt,{placeholder:"Describe your target audience and research goals...",className:"h-40",...b})}),i.jsx(fn,{children:"Provide details about the demographics, behaviors, and attitudes you want to explore"}),i.jsx(ut,{})]})}),i.jsx(dt,{control:h.control,name:"researchObjective",render:({field:b})=>i.jsxs(ot,{children:[i.jsx(lt,{children:"Research Objective"}),i.jsx(ct,{children:i.jsx(nt,{placeholder:"What is the main research topic or objective you want to explore?",className:"h-32",...b})}),i.jsx(fn,{children:"Specify your research focus to generate more targeted persona goals, frustrations, and scenarios"}),i.jsx(ut,{})]})}),i.jsx("div",{className:"space-y-3",children:i.jsx(te,{type:"button",variant:"outline",size:"sm",onClick:m,disabled:!p||p.trim().length<10||!g||g.trim().length<10||c||t,className:"flex items-center gap-2 hover-transition",children:c?i.jsxs(i.Fragment,{children:[i.jsx(Lc,{className:"h-4 w-4 animate-spin"}),"Analyzing Research Inputs..."]}):i.jsxs(i.Fragment,{children:[i.jsx(Ml,{className:"h-4 w-4"}),"Enhance Brief"]})})})]}),i.jsxs("div",{className:"space-y-6",children:[i.jsx(dt,{control:h.control,name:"dataFile",render:({field:{value:b,onChange:x,...w}})=>i.jsxs(ot,{children:[i.jsx(lt,{children:"Customer Data (Optional)"}),i.jsx(ct,{children:i.jsxs("div",{className:"border-2 border-dashed border-slate-200 rounded-lg p-6 flex flex-col items-center justify-center bg-slate-50 hover:bg-slate-100 transition cursor-pointer",children:[i.jsx(aI,{className:"h-10 w-10 text-slate-400 mb-2"}),i.jsx("p",{className:"text-sm text-slate-600 mb-1",children:"Upload customer data for more accurate personas"}),i.jsx("p",{className:"text-xs text-slate-500 mb-3",children:"Supports PDF, Office docs, images, and more"}),i.jsx(Ot,{...w,type:"file",multiple:!0,accept:".pdf,.docx,.pptx,.xlsx,.html,.xml,.rtf,.pages,.key,.epub,.txt,.csv,.jpg,.jpeg,.png",onChange:j=>{x(j.target.files)},className:"hidden",id:"data-file-input"}),i.jsxs(te,{type:"button",variant:"outline",size:"sm",onClick:()=>{var j;return(j=document.getElementById("data-file-input"))==null?void 0:j.click()},children:[i.jsx(oI,{className:"mr-2 h-4 w-4"}),"Select Files"]}),b&&b.length>0&&i.jsx("p",{className:"text-xs text-primary mt-2",children:b.length===1?b[0].name:`${b.length} files selected`})]})}),i.jsx(fn,{children:"Upload existing customer data to create more realistic personas"}),i.jsx(ut,{})]})}),i.jsxs("div",{className:"bg-muted/30 p-4 rounded-lg border border-border",children:[i.jsxs("div",{className:"flex items-center mb-2",children:[i.jsx(dw,{className:"h-5 w-5 text-muted-foreground mr-2"}),i.jsx("h3",{className:"font-sf font-medium",children:"What's included?"})]}),i.jsxs("ul",{className:"space-y-2 text-sm text-muted-foreground",children:[i.jsxs("li",{className:"flex items-center",children:[i.jsx(Gd,{className:"h-4 w-4 text-green-500 mr-2"}),"Demographic profiles based on your brief"]}),i.jsxs("li",{className:"flex items-center",children:[i.jsx(Gd,{className:"h-4 w-4 text-green-500 mr-2"}),"Personality traits and behavioral patterns"]}),i.jsxs("li",{className:"flex items-center",children:[i.jsx(Gd,{className:"h-4 w-4 text-green-500 mr-2"}),"Consumer preferences and interests"]}),i.jsxs("li",{className:"flex items-center",children:[i.jsx(Gd,{className:"h-4 w-4 text-green-500 mr-2"}),"Review and refine capabilities"]})]})]})]})]}),n&&i.jsxs("div",{className:"glass-panel rounded-lg p-4 border border-border bg-muted/30",children:[i.jsxs("div",{className:"flex items-center justify-between mb-3",children:[i.jsxs("h3",{className:"font-sf font-medium text-sm flex items-center gap-2",children:[i.jsx(Ml,{className:"h-4 w-4 text-primary"}),"Enhancement Suggestions:"]}),i.jsx(te,{type:"button",variant:"ghost",size:"sm",onClick:y,className:"h-6 w-6 p-0 hover:bg-slate-200",title:s?"Expand suggestions":"Collapse suggestions",children:s?i.jsx(yi,{className:"h-4 w-4"}):i.jsx(Tl,{className:"h-4 w-4"})})]}),!s&&i.jsx(i.Fragment,{children:d?i.jsx("div",{className:"text-sm text-red-600 bg-red-50 p-3 rounded-md",children:d}):i.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-6",children:[i.jsx("div",{children:o.audience_brief.length>0?i.jsxs("div",{children:[i.jsxs("h4",{className:"font-sf font-medium text-sm text-slate-800 mb-2 flex items-center gap-2",children:[i.jsx(or,{className:"h-4 w-4 text-blue-600"}),"Suggestions for your Audience Brief:"]}),i.jsx("ul",{className:"space-y-2 text-sm text-slate-700",children:o.audience_brief.map((b,x)=>i.jsxs("li",{className:"flex items-start gap-2",children:[i.jsx("span",{className:"text-blue-600 mt-1.5 text-xs",children:"•"}),i.jsx("span",{className:"flex-1",children:b})]},x))})]}):i.jsx("div",{className:"text-sm text-muted-foreground",children:"No audience brief suggestions available"})}),i.jsx("div",{children:o.research_objective.length>0?i.jsxs("div",{children:[i.jsxs("h4",{className:"font-sf font-medium text-sm text-slate-800 mb-2 flex items-center gap-2",children:[i.jsx(dw,{className:"h-4 w-4 text-green-600"}),"Suggestions for your Research Objective:"]}),i.jsx("ul",{className:"space-y-2 text-sm text-slate-700",children:o.research_objective.map((b,x)=>i.jsxs("li",{className:"flex items-start gap-2",children:[i.jsx("span",{className:"text-green-600 mt-1.5 text-xs",children:"•"}),i.jsx("span",{className:"flex-1",children:b})]},x))})]}):i.jsx("div",{className:"text-sm text-muted-foreground",children:"No research objective suggestions available"})}),o.audience_brief.length===0&&o.research_objective.length===0&&i.jsx("div",{className:"col-span-full text-sm text-muted-foreground text-center",children:"No suggestions available"})]})})]}),i.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-6",children:[i.jsx(dt,{control:h.control,name:"llm_model",render:({field:b})=>i.jsxs(ot,{children:[i.jsx(lt,{children:"AI Model"}),i.jsxs(Mn,{onValueChange:b.onChange,defaultValue:b.value,children:[i.jsx(ct,{children:i.jsx(Pn,{children:i.jsx(In,{placeholder:"Select AI model"})})}),i.jsxs(An,{children:[i.jsx(fe,{value:"gemini-2.5-pro",children:"Gemini 2.5 Pro"}),i.jsx(fe,{value:"gpt-4.1",children:"GPT-4.1"})]})]}),i.jsx(fn,{children:"Choose which AI model to use for generating personas"}),i.jsx(ut,{})]})}),i.jsx(dt,{control:h.control,name:"personaCount",render:({field:b})=>i.jsxs(ot,{children:[i.jsx(lt,{children:"Number of Personas to Generate"}),i.jsx(ct,{children:i.jsx(Ot,{type:"number",min:"1",max:"20",...b})}),i.jsx(fn,{children:"How many synthetic users do you need for your research?"}),i.jsx(ut,{})]})})]}),i.jsxs("div",{className:"flex flex-col items-end",children:[i.jsx(te,{type:"submit",disabled:t,className:"min-w-36",children:t?i.jsxs(i.Fragment,{children:[i.jsx(Lc,{className:"mr-2 h-4 w-4 animate-spin"}),"AI Generating..."]}):i.jsxs(i.Fragment,{children:[i.jsx(or,{className:"mr-2 h-4 w-4"}),"Generate Personas"]})}),t&&i.jsx("div",{className:"text-xs text-muted-foreground mt-2",children:"Generating multiple personas in parallel. This may take 1-2 minutes..."})]})]})})}const rt=v.forwardRef(({className:e,...t},n)=>i.jsx("div",{ref:n,className:Me("rounded-lg border bg-card text-card-foreground shadow-sm",e),...t}));rt.displayName="Card";const Dr=v.forwardRef(({className:e,...t},n)=>i.jsx("div",{ref:n,className:Me("flex flex-col space-y-1.5 p-6",e),...t}));Dr.displayName="CardHeader";const ts=v.forwardRef(({className:e,...t},n)=>i.jsx("h3",{ref:n,className:Me("text-2xl font-semibold leading-none tracking-tight",e),...t}));ts.displayName="CardTitle";const nN=v.forwardRef(({className:e,...t},n)=>i.jsx("p",{ref:n,className:Me("text-sm text-muted-foreground",e),...t}));nN.displayName="CardDescription";const bt=v.forwardRef(({className:e,...t},n)=>i.jsx("div",{ref:n,className:Me("p-6 pt-0",e),...t}));bt.displayName="CardContent";const rN=v.forwardRef(({className:e,...t},n)=>i.jsx("div",{ref:n,className:Me("flex items-center p-6 pt-0",e),...t}));rN.displayName="CardFooter";const SX=e=>{const t=e==null?void 0:e.toLowerCase(),n="/semblance/";switch(t){case"male":return`${n}male_avatar.png`;case"female":return`${n}female_avatar.png`;case"non-binary":case"nonbinary":case"non binary":return`${n}nonbinary_avatar.png`;default:return`${n}male_avatar.png`}},lp=e=>e.avatar||SX(e.gender);function sN({user:e,selected:t=!1,onClick:n,showDetailedDialog:r=!1,onSelectionToggle:s,showAddToFolderButton:a=!1,onAddToFolder:o,onViewDetails:l}){const c=Tn();v.useState(!1);const[u,d]=v.useState(e),f=e._id||e.id,h=m=>{m.stopPropagation(),c(`/synthetic-users/${f}`)};u.oceanTraits&&(u.oceanTraits.openness,u.oceanTraits.conscientiousness,u.oceanTraits.extraversion,u.oceanTraits.agreeableness,u.oceanTraits.neuroticism);const p=m=>{var x,w;const y=m.target;y.closest("button")&&((w=(x=y.closest("button"))==null?void 0:x.textContent)!=null&&w.includes("View Details"))||(s?s(m):n&&n(m))},g=m=>{m.stopPropagation(),l?l(u):h(m)};return i.jsxs("div",{className:Me("persona-card glass-card rounded-xl p-4 cursor-pointer hover:shadow-md button-transition",t&&"selected ring-2 ring-primary"),onClick:p,children:[i.jsx("div",{className:"persona-card-overlay"}),i.jsx("div",{className:"persona-card-checkmark",children:i.jsx(Ta,{className:"h-4 w-4 text-primary"})}),i.jsx("div",{className:"relative z-10",children:i.jsxs("div",{className:"flex items-start space-x-4",children:[i.jsx("div",{className:"h-12 w-12 rounded-full bg-muted flex items-center justify-center",children:i.jsx("img",{src:lp(u),alt:`${u.name} avatar`,className:"h-12 w-12 rounded-full object-cover"})}),i.jsxs("div",{className:"flex-1 min-w-0",children:[i.jsx("div",{className:"flex items-center justify-between gap-2",children:i.jsx("h3",{className:"text-sm font-medium truncate flex-1",children:u.name})}),i.jsxs("p",{className:"text-xs text-muted-foreground flex items-center gap-1",children:[u.age," • ",u.gender]}),i.jsx("p",{className:"text-xs text-muted-foreground mt-1",children:u.occupation}),i.jsx("p",{className:"text-xs text-muted-foreground",children:u.location}),i.jsx("div",{className:"mt-2",children:u.aiSynthesizedBio?i.jsxs("p",{className:"text-xs text-slate-700 line-clamp-3 leading-relaxed",children:[u.aiSynthesizedBio,u.aiSynthesizedBio.length>150&&"..."]}):i.jsxs("p",{className:"text-xs text-muted-foreground italic line-clamp-3",children:['"',u.personality,'"']})}),u.qualitativeAttributes&&u.qualitativeAttributes.length>0&&i.jsx("div",{className:"mt-3",children:i.jsx("div",{className:"flex flex-wrap gap-1",children:u.qualitativeAttributes.slice(0,3).map((m,y)=>i.jsxs("span",{className:"inline-flex items-center gap-1 px-2 py-1 bg-blue-50 text-blue-700 text-xs rounded-full",children:[i.jsx(MW,{className:"h-3 w-3"}),m]},y))})}),u.topPersonalityTraits&&u.topPersonalityTraits.length>0&&i.jsx("div",{className:"mt-2",children:i.jsx("div",{className:"flex flex-wrap gap-1",children:u.topPersonalityTraits.slice(0,3).map((m,y)=>i.jsxs("span",{className:"inline-flex items-center gap-1 px-2 py-1 bg-purple-50 text-purple-700 text-xs rounded-full",children:[i.jsx(kl,{className:"h-3 w-3"}),m]},y))})}),i.jsx("div",{className:"mt-3 flex justify-end",children:i.jsx(te,{variant:"ghost",size:"sm",onClick:g,children:"View Details"})})]})]})})]})}var aN="Collapsible",[NX,APe]=Gr(aN),[_X,iN]=NX(aN),cD=v.forwardRef((e,t)=>{const{__scopeCollapsible:n,open:r,defaultOpen:s,disabled:a,onOpenChange:o,...l}=e,[c=!1,u]=aa({prop:r,defaultProp:s,onChange:o});return i.jsx(_X,{scope:n,disabled:a,contentId:Ys(),open:c,onOpenToggle:v.useCallback(()=>u(d=>!d),[u]),children:i.jsx(Ye.div,{"data-state":lN(c),"data-disabled":a?"":void 0,...l,ref:t})})});cD.displayName=aN;var uD="CollapsibleTrigger",dD=v.forwardRef((e,t)=>{const{__scopeCollapsible:n,...r}=e,s=iN(uD,n);return i.jsx(Ye.button,{type:"button","aria-controls":s.contentId,"aria-expanded":s.open||!1,"data-state":lN(s.open),"data-disabled":s.disabled?"":void 0,disabled:s.disabled,...r,ref:t,onClick:Ee(e.onClick,s.onOpenToggle)})});dD.displayName=uD;var oN="CollapsibleContent",fD=v.forwardRef((e,t)=>{const{forceMount:n,...r}=e,s=iN(oN,e.__scopeCollapsible);return i.jsx(lr,{present:n||s.open,children:({present:a})=>i.jsx(PX,{...r,ref:t,present:a})})});fD.displayName=oN;var PX=v.forwardRef((e,t)=>{const{__scopeCollapsible:n,present:r,children:s,...a}=e,o=iN(oN,n),[l,c]=v.useState(r),u=v.useRef(null),d=xt(t,u),f=v.useRef(0),h=f.current,p=v.useRef(0),g=p.current,m=o.open||l,y=v.useRef(m),b=v.useRef();return v.useEffect(()=>{const x=requestAnimationFrame(()=>y.current=!1);return()=>cancelAnimationFrame(x)},[]),ir(()=>{const x=u.current;if(x){b.current=b.current||{transitionDuration:x.style.transitionDuration,animationName:x.style.animationName},x.style.transitionDuration="0s",x.style.animationName="none";const w=x.getBoundingClientRect();f.current=w.height,p.current=w.width,y.current||(x.style.transitionDuration=b.current.transitionDuration,x.style.animationName=b.current.animationName),c(r)}},[o.open,r]),i.jsx(Ye.div,{"data-state":lN(o.open),"data-disabled":o.disabled?"":void 0,id:o.contentId,hidden:!m,...a,ref:d,style:{"--radix-collapsible-content-height":h?`${h}px`:void 0,"--radix-collapsible-content-width":g?`${g}px`:void 0,...e.style},children:m&&s})});function lN(e){return e?"open":"closed"}var AX=cD;const cp=AX,up=dD,dp=fD;function CX({generatedPersonas:e,selectedPersonas:t,isGenerating:n,onPersonaSelection:r,onRefinePersonas:s,onApprovePersonas:a,onBackToGenerator:o}){const l=Tn(),[c,u]=v.useState(""),[d,f]=v.useState(!1),h=p=>{l(`/synthetic-users/${p}?fromReview=true`)};return i.jsxs("div",{className:"space-y-6",children:[i.jsxs("div",{className:"flex items-center justify-between",children:[i.jsx("h3",{className:"font-sf text-lg font-medium",children:"Review Generated Personas"}),i.jsxs("div",{className:"text-sm text-muted-foreground",children:[t.length," of ",e.length," selected"]})]}),i.jsx("div",{className:"space-y-4",children:e.map(p=>i.jsx(rt,{className:`border ${t.includes(p.id)?"border-primary/50 bg-primary/5":""} cursor-pointer`,onClick:()=>h(p.id),children:i.jsx(bt,{className:"p-4",children:i.jsxs("div",{className:"flex items-start justify-between",children:[i.jsx("div",{className:"flex-1",children:i.jsxs("div",{className:"flex items-center",children:[i.jsx("input",{type:"checkbox",id:`persona-${p.id}`,checked:t.includes(p.id),onChange:g=>{g.stopPropagation(),r(p.id)},className:"mr-3 h-4 w-4 rounded border-gray-300 text-primary focus:ring-primary"}),i.jsxs("div",{children:[i.jsx("h4",{className:"font-medium",children:p.name}),i.jsxs("p",{className:"text-sm text-muted-foreground",children:[p.age," • ",p.gender," • ",p.occupation]})]})]})}),i.jsx(sN,{user:p,showDetailedDialog:!1,onClick:g=>{g.stopPropagation(),h(p.id)}})]})})},p.id))}),i.jsx("div",{className:"space-y-4 pt-4 border-t",children:i.jsxs("div",{children:[i.jsx("div",{className:"flex justify-between items-start mb-4",children:i.jsxs(te,{variant:"outline",onClick:o,children:[i.jsx(zf,{className:"mr-2 h-4 w-4"}),"Back to Generator"]})}),i.jsxs(cp,{open:d,onOpenChange:f,className:"w-full space-y-4",children:[i.jsxs("div",{className:"flex justify-between items-center",children:[i.jsx(up,{asChild:!0,children:i.jsxs(te,{variant:"outline",className:"flex items-center gap-2",children:[i.jsx(Lc,{className:"h-4 w-4"}),"Refine Personas",i.jsx(yi,{className:"h-4 w-4 ml-1 transition-transform duration-200",style:{transform:d?"rotate(180deg)":"rotate(0deg)"}})]})}),i.jsxs(te,{onClick:a,disabled:t.length===0,children:[i.jsx(Gd,{className:"mr-2 h-4 w-4"}),"Approve Selected (",t.length,")"]})]}),i.jsx(dp,{children:i.jsx(rt,{className:"border shadow-sm w-full mt-4",children:i.jsx(bt,{className:"p-6",children:i.jsxs("div",{className:"space-y-4",children:[i.jsxs("div",{children:[i.jsx("label",{htmlFor:"refinement-prompt",className:"text-sm font-medium block mb-2",children:"Refinement Instructions"}),i.jsx(nt,{id:"refinement-prompt",placeholder:"Example: Make all personas 5 years younger, or ensure everyone is from different locations...",value:c,onChange:p=>u(p.target.value),className:"min-h-[100px] w-full resize-y"}),i.jsx("p",{className:"text-xs text-muted-foreground mt-2",children:"Use natural language to describe how you'd like to refine the selected personas."})]}),i.jsxs(te,{onClick:()=>s(c),disabled:n||c.trim()==="",className:"w-full",children:[n?i.jsx(Lc,{className:"mr-2 h-4 w-4 animate-spin"}):i.jsx(Lc,{className:"mr-2 h-4 w-4"}),"Apply Refinements"]})]})})})})]})]})})]})}async function EX(e,t,n,r,s,a){console.log(`generateSyntheticPersonas called with targetFolderId: ${s||"none"}`),console.log(`🔄 generateSyntheticPersonas using model: ${a||"gemini-2.5-pro"}`);try{if(console.log(`Generating ${n} synthetic personas using two-stage approach...`),e.trim().length<10)throw new Error("Audience brief is too short. Please provide more context for better persona generation.");let o;if(r&&r.length>0){console.log(`Uploading ${r.length} customer data files...`);try{o=(await Ka.uploadCustomerData(r)).data.session_id,console.log(`Customer data uploaded with session ID: ${o}`)}catch(c){throw console.error("Failed to upload customer data:",c),new Error("Failed to upload customer data files. Please try again.")}}const l=await Ka.batchGenerateWithStages(e,t,n,.8,o,a);if(l.data){const c=l.data.partial_success===!0,u=l.data.personas&&l.data.personas.length>0,d=l.data.errors&&l.data.errors.length>0;if(u){if(console.log(`Generated ${l.data.personas.length} personas with two-stage process${d?` (${l.data.errors.length} failed)`:""}`),s){const h=l.data.personas.map(p=>({...p,folderId:s}));try{const p=h.map(g=>{if(g.id||g._id){const m=g._id||g.id;return console.log(`Updating persona ${g.name||m} with folder ID: ${s}`),Dn.update(m,{...g,folderId:s}).catch(y=>(console.error(`Error updating folder ID for persona ${g.name||m}:`,y),null))}return Promise.resolve(null)});await Promise.allSettled(p),console.log(`Added ${h.length} personas to folder ID: ${s}`)}catch(p){console.error("Error updating personas with folder ID:",p)}if(o)try{await Ka.cleanupCustomerData(o),console.log(`Cleaned up customer data for session: ${o}`)}catch(p){console.warn("Failed to cleanup customer data:",p)}return c||d?{...l.data,personas:h,length:h.length}:{...l.data,personas:h}}if(o)try{await Ka.cleanupCustomerData(o),console.log(`Cleaned up customer data for session: ${o}`)}catch(f){console.warn("Failed to cleanup customer data:",f)}if(c||d)return{...l.data.personas,length:l.data.personas.length,partial_success:c,errors:l.data.errors};if(o)try{await Ka.cleanupCustomerData(o),console.log(`Cleaned up customer data for session: ${o}`)}catch(f){console.warn("Failed to cleanup customer data:",f)}return l.data.personas}else if(d){if(o)try{await Ka.cleanupCustomerData(o),console.log(`Cleaned up customer data for session: ${o}`)}catch(f){console.warn("Failed to cleanup customer data:",f)}throw new Error(`Failed to generate personas: ${l.data.errors.length} generation attempts failed.`)}else throw new Error("No personas returned from API")}else throw new Error("Invalid response format from API")}catch(o){if(customerDataSessionId)try{await Ka.cleanupCustomerData(customerDataSessionId),console.log(`Cleaned up customer data for session: ${customerDataSessionId}`)}catch(l){console.warn("Failed to cleanup customer data:",l)}throw console.error("Error generating AI personas:",o),o}}function hD(){const[e,t]=v.useState([]),n=async a=>{const o=[];for(const l of a){const c={...l};c._id&&typeof c._id=="string"&&c._id.startsWith("local-")&&delete c._id;const u=await Dn.create(c);console.log("Persona saved to database:",u.data),o.push({...l,id:u.data._id||u.data.id,_id:u.data._id||u.data.id,isDbPersona:!0})}t(o)},r=async()=>{const a=await Dn.getAll();return a&&a.data&&Array.isArray(a.data)?(console.log("Personas loaded from database:",a.data.length),a.data.map(o=>({...o,id:o._id||o.id,isDbPersona:!0}))):[]};return v.useEffect(()=>{(async()=>{const o=await r();t(o)})()},[]),{storedPersonas:e,savePersonas:n,loadPersonas:r,clearPersonas:async()=>{const a=await r();for(const o of a)o._id&&await Dn.delete(o._id);t([])}}}function OX({targetFolderId:e,targetFolderName:t}){const n=qr(),r=Tn(),{loadPersonas:s,savePersonas:a}=hD(),[o,l]=v.useState(!1),[c,u]=v.useState([]),[d,f]=v.useState([]),[h,p]=v.useState(!1),[g,m]=v.useState(0);v.useEffect(()=>{const S=new URLSearchParams(n.search),N=S.get("mode"),_=S.get("tab"),P=S.get("step");if(N==="create"&&_==="ai"&&P==="review"){const k=s();k.length>0&&(u(k),f(k.map(O=>O.id)),p(!0))}},[n,s]);async function y(S){var N,_,P,k,O,M,A,$,L,H;try{l(!0),m(0);const D=parseInt(S.personaCount);if(isNaN(D)||D<1||D>10){oe.error("Invalid number of personas",{description:"Please enter a number between 1 and 10"}),l(!1);return}m(5);const V=setInterval(()=>{m(Z=>Z<90?Z+Math.random()*5:Z)},500),T=D<=2?"30-60 seconds":D<=4?"1-2 minutes":D<=6?"2-3 minutes":"3-5 minutes";D>4&&oe.info("Generation may take longer",{description:`Generating ${D} personas at once may result in some timeouts. If this happens, the successfully created personas will still be saved.`,duration:8e3}),oe.info("Generating AI personas in parallel",{description:`Creating ${D} synthetic personas based on your brief. This may take ${T}. Please be patient.`,duration:1e4}),e&&t?(console.log(`Target folder for new personas: ID=${e}, Name=${t}`),oe.info(`Creating personas in "${t}" folder`,{duration:3e3})):console.log("No target folder specified for new personas"),console.log(`🤖 Starting persona generation with model: ${S.llm_model||"gemini-2.5-pro"}`);const F=await EX(S.audienceBrief,S.researchObjective,D,S.dataFile,e,S.llm_model),q=F.personas||F;if(clearInterval(V),m(100),q&&q.length>0)console.log(`✅ Successfully generated ${q.length} personas using model: ${S.llm_model||"gemini-2.5-pro"}`),F.partial_success||F.errors&&F.errors.length>0?(oe.success("Some personas generated successfully",{description:`${q.length} synthetic personas were created using ${S.llm_model||"Gemini 2.5 Pro"}. ${((N=F.errors)==null?void 0:N.length)||0} failed due to timeout or other errors.`,duration:8e3}),F.errors&&F.errors.length>0&&setTimeout(()=>{oe.error("Some personas failed to generate",{description:`${F.errors.length} personas timed out. The server took too long to generate them. The successfully generated personas have been saved${e?" in the selected folder":""}.`,duration:1e4})},1e3)):oe.success("Personas generated and saved successfully",{description:`${q.length} synthetic personas have been created using ${S.llm_model||"Gemini 2.5 Pro"} and saved ${e?`to the "${t}" folder`:"to the database"}.`}),r("/synthetic-users?mode=view");else throw new Error("No personas were generated")}catch(D){console.error(`❌ Error generating personas using model: ${S.llm_model||"gemini-2.5-pro"}:`,D);let V="Please try again or adjust your parameters",T="Failed to generate personas";D.code==="ECONNABORTED"||(_=D.message)!=null&&_.includes("timeout")||((P=D.response)==null?void 0:P.status)===504?(T="Generation timeout",V="AI persona generation timed out. This often happens when generating multiple complex personas. Try generating fewer personas (2-3) or try again later."):((k=D.response)==null?void 0:k.status)===500?(T="Server error",(M=(O=D.response)==null?void 0:O.data)!=null&&M.message?V=D.response.data.message:($=(A=D.response)==null?void 0:A.data)!=null&&$.error?V=D.response.data.error:V="The server encountered an error processing your request. Please try again later."):((L=D.response)==null?void 0:L.status)===401?(T="Authentication required",V="Please log in to generate personas."):(H=D.message)!=null&&H.includes("504 Deadline Exceeded")?(T="Generation timeout",V="The AI model took too long to generate personas. Try generating fewer personas or simplify your brief."):D instanceof Error&&(V=D.message),oe.error(T,{description:V,duration:6e3})}finally{setTimeout(()=>{l(!1),m(0)},500)}}const b=S=>{f(N=>N.includes(S)?N.filter(_=>_!==S):[...N,S])},x=(S,N)=>{const _=N.toLowerCase();return S.map(P=>{const k={...P};if(_.includes("younger")){const O=parseInt(k.age);k.age=(O-5).toString()}else if(_.includes("older")){const O=parseInt(k.age);k.age=(O+5).toString()}if(_.includes("different locations")&&(k.location=`${k.location} (Diversified)`),_.includes("more extroverted")?k.personality=`Extroverted, ${k.personality.toLowerCase()}`:_.includes("more introverted")&&(k.personality=`Introverted, ${k.personality.toLowerCase()}`),_.includes("diverse")){const O=["tech-savvy","traditional","innovative","conservative","creative"],M=O[Math.floor(Math.random()*O.length)];k.personality=`${M}, ${k.personality}`}return k})},w=S=>{if(!S.trim()){oe.error("Please provide refinement instructions");return}l(!0),setTimeout(()=>{try{const N=c.filter(k=>d.includes(k.id)),_=x(N,S),P=c.map(k=>_.find(M=>M.id===k.id)||k);u(P),l(!1),a(P),oe.success("Personas refined based on your instructions",{description:"Review the updated profiles"})}catch(N){console.error("Error refining personas:",N),oe.error("Failed to refine personas",{description:"Please try different instructions"}),l(!1)}},1500)},j=()=>{const S=c.filter(N=>d.includes(N.id));oe.success(`${S.length} personas approved`,{description:"Added to your synthetic persona library"}),a(S),r("/synthetic-users?mode=view")};return i.jsxs("div",{className:"glass-panel rounded-xl p-6",children:[i.jsxs("div",{className:"flex items-center gap-2 mb-6",children:[i.jsx(or,{className:"h-5 w-5 text-primary"}),i.jsx("h2",{className:"font-sf text-xl font-semibold",children:"AI Persona Recruiter"})]}),o&&i.jsxs("div",{className:"mb-6",children:[i.jsxs("div",{className:"flex justify-between items-center mb-2",children:[i.jsx("span",{className:"text-sm font-medium",children:"Generating personas in parallel..."}),i.jsxs("span",{className:"text-sm text-muted-foreground",children:[Math.round(g),"%"]})]}),i.jsx(al,{value:g,className:"h-2"})]}),h?i.jsx(CX,{generatedPersonas:c,selectedPersonas:d,isGenerating:o,onPersonaSelection:b,onRefinePersonas:w,onApprovePersonas:j,onBackToGenerator:()=>p(!1)}):i.jsx(jX,{onSubmit:y,isGenerating:o})]})}const Oo=new Map;function pD(e){const{id:t,title:n,description:r,type:s="default",duration:a}=e;let o;switch(s){case"success":o=oe.success(n,{description:r,duration:a});break;case"error":o=oe.error(n,{description:r,duration:a});break;case"warning":o=oe.warning(n,{description:r,duration:a});break;case"info":o=oe.info(n,{description:r,duration:a});break;default:o=oe(n,{description:r,duration:a});break}return Oo.set(t,o.toString()),t}function kX(e,t){const n=Oo.get(e);if(!n)return console.warn(`Toast with ID "${e}" not found. Creating new toast instead.`),pD({id:e,...t,title:t.title||"Updated"}),!1;const{title:r,description:s,type:a="default",duration:o}=t;oe.dismiss(n);let l;switch(a){case"success":l=oe.success(r,{description:s,duration:o});break;case"error":l=oe.error(r,{description:s,duration:o});break;case"warning":l=oe.warning(r,{description:s,duration:o});break;case"info":l=oe.info(r,{description:s,duration:o});break;default:l=oe(r,{description:s,duration:o});break}return Oo.set(e,l.toString()),!0}function TX(e){const t=Oo.get(e);return t?(oe.dismiss(t),Oo.delete(e),!0):(console.warn(`Toast with ID "${e}" not found.`),!1)}function $X(e){return Oo.has(e)}function MX(){Oo.forEach(e=>{oe.dismiss(e)}),Oo.clear()}const Ke={success:oe.success,error:oe.error,warning:oe.warning,info:oe.info,loading:oe.loading,dismiss:oe.dismiss,createPersistent:pD,updatePersistent:kX,dismissPersistent:TX,hasPersistent:$X,dismissAllPersistent:MX};var mD=["PageUp","PageDown"],gD=["ArrowUp","ArrowDown","ArrowLeft","ArrowRight"],vD={"from-left":["Home","PageDown","ArrowDown","ArrowLeft"],"from-right":["Home","PageDown","ArrowDown","ArrowRight"],"from-bottom":["Home","PageDown","ArrowDown","ArrowLeft"],"from-top":["Home","PageDown","ArrowUp","ArrowLeft"]},Ju="Slider",[Mw,IX,RX]=Ey(Ju),[yD,CPe]=Gr(Ju,[RX]),[DX,Ry]=yD(Ju),xD=v.forwardRef((e,t)=>{const{name:n,min:r=0,max:s=100,step:a=1,orientation:o="horizontal",disabled:l=!1,minStepsBetweenThumbs:c=0,defaultValue:u=[r],value:d,onValueChange:f=()=>{},onValueCommit:h=()=>{},inverted:p=!1,form:g,...m}=e,y=v.useRef(new Set),b=v.useRef(0),w=o==="horizontal"?LX:FX,[j=[],S]=aa({prop:d,defaultProp:u,onChange:M=>{var $;($=[...y.current][b.current])==null||$.focus(),f(M)}}),N=v.useRef(j);function _(M){const A=WX(j,M);O(M,A)}function P(M){O(M,b.current)}function k(){const M=N.current[b.current];j[b.current]!==M&&h(j)}function O(M,A,{commit:$}={commit:!1}){const L=KX(a),H=XX(Math.round((M-r)/a)*a+r,L),D=sh(H,[r,s]);S((V=[])=>{const T=UX(V,D,A);if(qX(T,c*a)){b.current=T.indexOf(D);const F=String(T)!==String(V);return F&&$&&h(T),F?T:V}else return V})}return i.jsx(DX,{scope:e.__scopeSlider,name:n,disabled:l,min:r,max:s,valueIndexToChangeRef:b,thumbs:y.current,values:j,orientation:o,form:g,children:i.jsx(Mw.Provider,{scope:e.__scopeSlider,children:i.jsx(Mw.Slot,{scope:e.__scopeSlider,children:i.jsx(w,{"aria-disabled":l,"data-disabled":l?"":void 0,...m,ref:t,onPointerDown:Ee(m.onPointerDown,()=>{l||(N.current=j)}),min:r,max:s,inverted:p,onSlideStart:l?void 0:_,onSlideMove:l?void 0:P,onSlideEnd:l?void 0:k,onHomeKeyDown:()=>!l&&O(r,0,{commit:!0}),onEndKeyDown:()=>!l&&O(s,j.length-1,{commit:!0}),onStepKeyDown:({event:M,direction:A})=>{if(!l){const H=mD.includes(M.key)||M.shiftKey&&gD.includes(M.key)?10:1,D=b.current,V=j[D],T=a*H*A;O(V+T,D,{commit:!0})}}})})})})});xD.displayName=Ju;var[bD,wD]=yD(Ju,{startEdge:"left",endEdge:"right",size:"width",direction:1}),LX=v.forwardRef((e,t)=>{const{min:n,max:r,dir:s,inverted:a,onSlideStart:o,onSlideMove:l,onSlideEnd:c,onStepKeyDown:u,...d}=e,[f,h]=v.useState(null),p=xt(t,w=>h(w)),g=v.useRef(),m=Xl(s),y=m==="ltr",b=y&&!a||!y&&a;function x(w){const j=g.current||f.getBoundingClientRect(),S=[0,j.width],_=cN(S,b?[n,r]:[r,n]);return g.current=j,_(w-j.left)}return i.jsx(bD,{scope:e.__scopeSlider,startEdge:b?"left":"right",endEdge:b?"right":"left",direction:b?1:-1,size:"width",children:i.jsx(jD,{dir:m,"data-orientation":"horizontal",...d,ref:p,style:{...d.style,"--radix-slider-thumb-transform":"translateX(-50%)"},onSlideStart:w=>{const j=x(w.clientX);o==null||o(j)},onSlideMove:w=>{const j=x(w.clientX);l==null||l(j)},onSlideEnd:()=>{g.current=void 0,c==null||c()},onStepKeyDown:w=>{const S=vD[b?"from-left":"from-right"].includes(w.key);u==null||u({event:w,direction:S?-1:1})}})})}),FX=v.forwardRef((e,t)=>{const{min:n,max:r,inverted:s,onSlideStart:a,onSlideMove:o,onSlideEnd:l,onStepKeyDown:c,...u}=e,d=v.useRef(null),f=xt(t,d),h=v.useRef(),p=!s;function g(m){const y=h.current||d.current.getBoundingClientRect(),b=[0,y.height],w=cN(b,p?[r,n]:[n,r]);return h.current=y,w(m-y.top)}return i.jsx(bD,{scope:e.__scopeSlider,startEdge:p?"bottom":"top",endEdge:p?"top":"bottom",size:"height",direction:p?1:-1,children:i.jsx(jD,{"data-orientation":"vertical",...u,ref:f,style:{...u.style,"--radix-slider-thumb-transform":"translateY(50%)"},onSlideStart:m=>{const y=g(m.clientY);a==null||a(y)},onSlideMove:m=>{const y=g(m.clientY);o==null||o(y)},onSlideEnd:()=>{h.current=void 0,l==null||l()},onStepKeyDown:m=>{const b=vD[p?"from-bottom":"from-top"].includes(m.key);c==null||c({event:m,direction:b?-1:1})}})})}),jD=v.forwardRef((e,t)=>{const{__scopeSlider:n,onSlideStart:r,onSlideMove:s,onSlideEnd:a,onHomeKeyDown:o,onEndKeyDown:l,onStepKeyDown:c,...u}=e,d=Ry(Ju,n);return i.jsx(Ye.span,{...u,ref:t,onKeyDown:Ee(e.onKeyDown,f=>{f.key==="Home"?(o(f),f.preventDefault()):f.key==="End"?(l(f),f.preventDefault()):mD.concat(gD).includes(f.key)&&(c(f),f.preventDefault())}),onPointerDown:Ee(e.onPointerDown,f=>{const h=f.target;h.setPointerCapture(f.pointerId),f.preventDefault(),d.thumbs.has(h)?h.focus():r(f)}),onPointerMove:Ee(e.onPointerMove,f=>{f.target.hasPointerCapture(f.pointerId)&&s(f)}),onPointerUp:Ee(e.onPointerUp,f=>{const h=f.target;h.hasPointerCapture(f.pointerId)&&(h.releasePointerCapture(f.pointerId),a(f))})})}),SD="SliderTrack",ND=v.forwardRef((e,t)=>{const{__scopeSlider:n,...r}=e,s=Ry(SD,n);return i.jsx(Ye.span,{"data-disabled":s.disabled?"":void 0,"data-orientation":s.orientation,...r,ref:t})});ND.displayName=SD;var Iw="SliderRange",_D=v.forwardRef((e,t)=>{const{__scopeSlider:n,...r}=e,s=Ry(Iw,n),a=wD(Iw,n),o=v.useRef(null),l=xt(t,o),c=s.values.length,u=s.values.map(h=>AD(h,s.min,s.max)),d=c>1?Math.min(...u):0,f=100-Math.max(...u);return i.jsx(Ye.span,{"data-orientation":s.orientation,"data-disabled":s.disabled?"":void 0,...r,ref:l,style:{...e.style,[a.startEdge]:d+"%",[a.endEdge]:f+"%"}})});_D.displayName=Iw;var Rw="SliderThumb",PD=v.forwardRef((e,t)=>{const n=IX(e.__scopeSlider),[r,s]=v.useState(null),a=xt(t,l=>s(l)),o=v.useMemo(()=>r?n().findIndex(l=>l.ref.current===r):-1,[n,r]);return i.jsx(BX,{...e,ref:a,index:o})}),BX=v.forwardRef((e,t)=>{const{__scopeSlider:n,index:r,name:s,...a}=e,o=Ry(Rw,n),l=wD(Rw,n),[c,u]=v.useState(null),d=xt(t,x=>u(x)),f=c?o.form||!!c.closest("form"):!0,h=tp(c),p=o.values[r],g=p===void 0?0:AD(p,o.min,o.max),m=VX(r,o.values.length),y=h==null?void 0:h[l.size],b=y?HX(y,g,l.direction):0;return v.useEffect(()=>{if(c)return o.thumbs.add(c),()=>{o.thumbs.delete(c)}},[c,o.thumbs]),i.jsxs("span",{style:{transform:"var(--radix-slider-thumb-transform)",position:"absolute",[l.startEdge]:`calc(${g}% + ${b}px)`},children:[i.jsx(Mw.ItemSlot,{scope:e.__scopeSlider,children:i.jsx(Ye.span,{role:"slider","aria-label":e["aria-label"]||m,"aria-valuemin":o.min,"aria-valuenow":p,"aria-valuemax":o.max,"aria-orientation":o.orientation,"data-orientation":o.orientation,"data-disabled":o.disabled?"":void 0,tabIndex:o.disabled?void 0:0,...a,ref:d,style:p===void 0?{display:"none"}:e.style,onFocus:Ee(e.onFocus,()=>{o.valueIndexToChangeRef.current=r})})}),f&&i.jsx(zX,{name:s??(o.name?o.name+(o.values.length>1?"[]":""):void 0),form:o.form,value:p},r)]})});PD.displayName=Rw;var zX=e=>{const{value:t,...n}=e,r=v.useRef(null),s=ip(t);return v.useEffect(()=>{const a=r.current,o=window.HTMLInputElement.prototype,c=Object.getOwnPropertyDescriptor(o,"value").set;if(s!==t&&c){const u=new Event("input",{bubbles:!0});c.call(a,t),a.dispatchEvent(u)}},[s,t]),i.jsx("input",{style:{display:"none"},...n,ref:r,defaultValue:t})};function UX(e=[],t,n){const r=[...e];return r[n]=t,r.sort((s,a)=>s-a)}function AD(e,t,n){const a=100/(n-t)*(e-t);return sh(a,[0,100])}function VX(e,t){return t>2?`Value ${e+1} of ${t}`:t===2?["Minimum","Maximum"][e]:void 0}function WX(e,t){if(e.length===1)return 0;const n=e.map(s=>Math.abs(s-t)),r=Math.min(...n);return n.indexOf(r)}function HX(e,t,n){const r=e/2,a=cN([0,50],[0,r]);return(r-a(t)*n)*n}function GX(e){return e.slice(0,-1).map((t,n)=>e[n+1]-t)}function qX(e,t){if(t>0){const n=GX(e);return Math.min(...n)>=t}return!0}function cN(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 KX(e){return(String(e).split(".")[1]||"").length}function XX(e,t){const n=Math.pow(10,t);return Math.round(e*n)/n}var CD=xD,YX=ND,ZX=_D,QX=PD;const Un=v.forwardRef(({className:e,...t},n)=>i.jsxs(CD,{ref:n,className:Me("relative flex w-full touch-none select-none items-center",e),...t,children:[i.jsx(YX,{className:"relative h-2 w-full grow overflow-hidden rounded-full bg-secondary",children:i.jsx(ZX,{className:"absolute h-full bg-primary"})}),i.jsx(QX,{className:"block h-5 w-5 rounded-full border-2 border-primary bg-background ring-offset-background transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50"})]}));Un.displayName=CD.displayName;var uN="Switch",[JX,EPe]=Gr(uN),[eY,tY]=JX(uN),ED=v.forwardRef((e,t)=>{const{__scopeSwitch:n,name:r,checked:s,defaultChecked:a,required:o,disabled:l,value:c="on",onCheckedChange:u,form:d,...f}=e,[h,p]=v.useState(null),g=xt(t,w=>p(w)),m=v.useRef(!1),y=h?d||!!h.closest("form"):!0,[b=!1,x]=aa({prop:s,defaultProp:a,onChange:u});return i.jsxs(eY,{scope:n,checked:b,disabled:l,children:[i.jsx(Ye.button,{type:"button",role:"switch","aria-checked":b,"aria-required":o,"data-state":TD(b),"data-disabled":l?"":void 0,disabled:l,value:c,...f,ref:g,onClick:Ee(e.onClick,w=>{x(j=>!j),y&&(m.current=w.isPropagationStopped(),m.current||w.stopPropagation())})}),y&&i.jsx(nY,{control:h,bubbles:!m.current,name:r,value:c,checked:b,required:o,disabled:l,form:d,style:{transform:"translateX(-100%)"}})]})});ED.displayName=uN;var OD="SwitchThumb",kD=v.forwardRef((e,t)=>{const{__scopeSwitch:n,...r}=e,s=tY(OD,n);return i.jsx(Ye.span,{"data-state":TD(s.checked),"data-disabled":s.disabled?"":void 0,...r,ref:t})});kD.displayName=OD;var nY=e=>{const{control:t,checked:n,bubbles:r=!0,...s}=e,a=v.useRef(null),o=ip(n),l=tp(t);return v.useEffect(()=>{const c=a.current,u=window.HTMLInputElement.prototype,f=Object.getOwnPropertyDescriptor(u,"checked").set;if(o!==n&&f){const h=new Event("click",{bubbles:r});f.call(c,n),c.dispatchEvent(h)}},[o,n,r]),i.jsx("input",{type:"checkbox","aria-hidden":!0,defaultChecked:n,...s,tabIndex:-1,ref:a,style:{...e.style,...l,position:"absolute",pointerEvents:"none",opacity:0,margin:0}})};function TD(e){return e?"checked":"unchecked"}var $D=ED,rY=kD;const ah=v.forwardRef(({className:e,...t},n)=>i.jsx($D,{className:Me("peer inline-flex h-6 w-11 shrink-0 cursor-pointer items-center rounded-full border-2 border-transparent 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:i.jsx(rY,{className:Me("pointer-events-none block h-5 w-5 rounded-full bg-background shadow-lg ring-0 transition-transform data-[state=checked]:translate-x-5 data-[state=unchecked]:translate-x-0")})}));ah.displayName=$D.displayName;function sY(e,t=[]){let n=[];function r(a,o){const l=v.createContext(o),c=n.length;n=[...n,o];function u(f){const{scope:h,children:p,...g}=f,m=(h==null?void 0:h[e][c])||l,y=v.useMemo(()=>g,Object.values(g));return i.jsx(m.Provider,{value:y,children:p})}function d(f,h){const p=(h==null?void 0:h[e][c])||l,g=v.useContext(p);if(g)return g;if(o!==void 0)return o;throw new Error(`\`${f}\` must be used within \`${a}\``)}return u.displayName=a+"Provider",[u,d]}const s=()=>{const a=n.map(o=>v.createContext(o));return function(l){const c=(l==null?void 0:l[e])||a;return v.useMemo(()=>({[`__scope${e}`]:{...l,[e]:c}}),[l,c])}};return s.scopeName=e,[r,aY(s,...t)]}function aY(...e){const t=e[0];if(e.length===1)return t;const n=()=>{const r=e.map(s=>({useScope:s(),scopeName:s.scopeName}));return function(a){const o=r.reduce((l,{useScope:c,scopeName:u})=>{const f=c(a)[`__scope${u}`];return{...l,...f}},{});return v.useMemo(()=>({[`__scope${t.scopeName}`]:o}),[o])}};return n.scopeName=t.scopeName,n}var P0="rovingFocusGroup.onEntryFocus",iY={bubbles:!1,cancelable:!0},Dy="RovingFocusGroup",[Dw,MD,oY]=Ey(Dy),[lY,ed]=sY(Dy,[oY]),[cY,uY]=lY(Dy),ID=v.forwardRef((e,t)=>i.jsx(Dw.Provider,{scope:e.__scopeRovingFocusGroup,children:i.jsx(Dw.Slot,{scope:e.__scopeRovingFocusGroup,children:i.jsx(dY,{...e,ref:t})})}));ID.displayName=Dy;var dY=v.forwardRef((e,t)=>{const{__scopeRovingFocusGroup:n,orientation:r,loop:s=!1,dir:a,currentTabStopId:o,defaultCurrentTabStopId:l,onCurrentTabStopIdChange:c,onEntryFocus:u,preventScrollOnEntryFocus:d=!1,...f}=e,h=v.useRef(null),p=xt(t,h),g=Xl(a),[m=null,y]=aa({prop:o,defaultProp:l,onChange:c}),[b,x]=v.useState(!1),w=Hn(u),j=MD(n),S=v.useRef(!1),[N,_]=v.useState(0);return v.useEffect(()=>{const P=h.current;if(P)return P.addEventListener(P0,w),()=>P.removeEventListener(P0,w)},[w]),i.jsx(cY,{scope:n,orientation:r,dir:g,loop:s,currentTabStopId:m,onItemFocus:v.useCallback(P=>y(P),[y]),onItemShiftTab:v.useCallback(()=>x(!0),[]),onFocusableItemAdd:v.useCallback(()=>_(P=>P+1),[]),onFocusableItemRemove:v.useCallback(()=>_(P=>P-1),[]),children:i.jsx(Ye.div,{tabIndex:b||N===0?-1:0,"data-orientation":r,...f,ref:p,style:{outline:"none",...e.style},onMouseDown:Ee(e.onMouseDown,()=>{S.current=!0}),onFocus:Ee(e.onFocus,P=>{const k=!S.current;if(P.target===P.currentTarget&&k&&!b){const O=new CustomEvent(P0,iY);if(P.currentTarget.dispatchEvent(O),!O.defaultPrevented){const M=j().filter(D=>D.focusable),A=M.find(D=>D.active),$=M.find(D=>D.id===m),H=[A,$,...M].filter(Boolean).map(D=>D.ref.current);LD(H,d)}}S.current=!1}),onBlur:Ee(e.onBlur,()=>x(!1))})})}),RD="RovingFocusGroupItem",DD=v.forwardRef((e,t)=>{const{__scopeRovingFocusGroup:n,focusable:r=!0,active:s=!1,tabStopId:a,...o}=e,l=Ys(),c=a||l,u=uY(RD,n),d=u.currentTabStopId===c,f=MD(n),{onFocusableItemAdd:h,onFocusableItemRemove:p}=u;return v.useEffect(()=>{if(r)return h(),()=>p()},[r,h,p]),i.jsx(Dw.ItemSlot,{scope:n,id:c,focusable:r,active:s,children:i.jsx(Ye.span,{tabIndex:d?0:-1,"data-orientation":u.orientation,...o,ref:t,onMouseDown:Ee(e.onMouseDown,g=>{r?u.onItemFocus(c):g.preventDefault()}),onFocus:Ee(e.onFocus,()=>u.onItemFocus(c)),onKeyDown:Ee(e.onKeyDown,g=>{if(g.key==="Tab"&&g.shiftKey){u.onItemShiftTab();return}if(g.target!==g.currentTarget)return;const m=pY(g,u.orientation,u.dir);if(m!==void 0){if(g.metaKey||g.ctrlKey||g.altKey||g.shiftKey)return;g.preventDefault();let b=f().filter(x=>x.focusable).map(x=>x.ref.current);if(m==="last")b.reverse();else if(m==="prev"||m==="next"){m==="prev"&&b.reverse();const x=b.indexOf(g.currentTarget);b=u.loop?mY(b,x+1):b.slice(x+1)}setTimeout(()=>LD(b))}})})})});DD.displayName=RD;var fY={ArrowLeft:"prev",ArrowUp:"prev",ArrowRight:"next",ArrowDown:"next",PageUp:"first",Home:"first",PageDown:"last",End:"last"};function hY(e,t){return t!=="rtl"?e:e==="ArrowLeft"?"ArrowRight":e==="ArrowRight"?"ArrowLeft":e}function pY(e,t,n){const r=hY(e.key,n);if(!(t==="vertical"&&["ArrowLeft","ArrowRight"].includes(r))&&!(t==="horizontal"&&["ArrowUp","ArrowDown"].includes(r)))return fY[r]}function LD(e,t=!1){const n=document.activeElement;for(const r of e)if(r===n||(r.focus({preventScroll:t}),document.activeElement!==n))return}function mY(e,t){return e.map((n,r)=>e[(t+r)%e.length])}var dN=ID,fN=DD,hN="Tabs",[gY,OPe]=Gr(hN,[ed]),FD=ed(),[vY,pN]=gY(hN),BD=v.forwardRef((e,t)=>{const{__scopeTabs:n,value:r,onValueChange:s,defaultValue:a,orientation:o="horizontal",dir:l,activationMode:c="automatic",...u}=e,d=Xl(l),[f,h]=aa({prop:r,onChange:s,defaultProp:a});return i.jsx(vY,{scope:n,baseId:Ys(),value:f,onValueChange:h,orientation:o,dir:d,activationMode:c,children:i.jsx(Ye.div,{dir:d,"data-orientation":o,...u,ref:t})})});BD.displayName=hN;var zD="TabsList",UD=v.forwardRef((e,t)=>{const{__scopeTabs:n,loop:r=!0,...s}=e,a=pN(zD,n),o=FD(n);return i.jsx(dN,{asChild:!0,...o,orientation:a.orientation,dir:a.dir,loop:r,children:i.jsx(Ye.div,{role:"tablist","aria-orientation":a.orientation,...s,ref:t})})});UD.displayName=zD;var VD="TabsTrigger",WD=v.forwardRef((e,t)=>{const{__scopeTabs:n,value:r,disabled:s=!1,...a}=e,o=pN(VD,n),l=FD(n),c=qD(o.baseId,r),u=KD(o.baseId,r),d=r===o.value;return i.jsx(fN,{asChild:!0,...l,focusable:!s,active:d,children:i.jsx(Ye.button,{type:"button",role:"tab","aria-selected":d,"aria-controls":u,"data-state":d?"active":"inactive","data-disabled":s?"":void 0,disabled:s,id:c,...a,ref:t,onMouseDown:Ee(e.onMouseDown,f=>{!s&&f.button===0&&f.ctrlKey===!1?o.onValueChange(r):f.preventDefault()}),onKeyDown:Ee(e.onKeyDown,f=>{[" ","Enter"].includes(f.key)&&o.onValueChange(r)}),onFocus:Ee(e.onFocus,()=>{const f=o.activationMode!=="manual";!d&&!s&&f&&o.onValueChange(r)})})})});WD.displayName=VD;var HD="TabsContent",GD=v.forwardRef((e,t)=>{const{__scopeTabs:n,value:r,forceMount:s,children:a,...o}=e,l=pN(HD,n),c=qD(l.baseId,r),u=KD(l.baseId,r),d=r===l.value,f=v.useRef(d);return v.useEffect(()=>{const h=requestAnimationFrame(()=>f.current=!1);return()=>cancelAnimationFrame(h)},[]),i.jsx(lr,{present:s||d,children:({present:h})=>i.jsx(Ye.div,{"data-state":d?"active":"inactive","data-orientation":l.orientation,role:"tabpanel","aria-labelledby":c,hidden:!h,id:u,tabIndex:0,...o,ref:t,style:{...e.style,animationDuration:f.current?"0s":void 0},children:h&&a})})});GD.displayName=HD;function qD(e,t){return`${e}-trigger-${t}`}function KD(e,t){return`${e}-content-${t}`}var yY=BD,XD=UD,YD=WD,ZD=GD;const Fo=yY,Pi=v.forwardRef(({className:e,...t},n)=>i.jsx(XD,{ref:n,className:Me("inline-flex h-10 items-center justify-center rounded-md bg-muted p-1 text-muted-foreground",e),...t}));Pi.displayName=XD.displayName;const Xt=v.forwardRef(({className:e,...t},n)=>i.jsx(YD,{ref:n,className:Me("inline-flex items-center justify-center whitespace-nowrap rounded-sm px-3 py-1.5 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-sm",e),...t}));Xt.displayName=YD.displayName;const Yt=v.forwardRef(({className:e,...t},n)=>i.jsx(ZD,{ref:n,className:Me("mt-2 ring-offset-background focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2",e),...t}));Yt.displayName=ZD.displayName;const xY=Te.object({name:Te.string().min(2,{message:"Name must be at least 2 characters."}),age:Te.string().min(1,{message:"Age is required."}),gender:Te.string().min(1,{message:"Gender is required."}),occupation:Te.string().min(2,{message:"Occupation is required."}),education:Te.string().min(1,{message:"Education is required."}),location:Te.string().min(2,{message:"Location is required."}),ethnicity:Te.string().optional(),personality:Te.string(),interests:Te.string(),hasPurchasingPower:Te.boolean().optional(),hasChildren:Te.boolean().optional(),techSavviness:Te.number().min(0).max(100),brandLoyalty:Te.number().min(0).max(100),priceConsciousness:Te.number().min(0).max(100),environmentalConcern:Te.number().min(0).max(100),socialGrade:Te.string().optional(),householdIncome:Te.string().optional(),householdComposition:Te.string().optional(),livingSituation:Te.string().optional(),goals:Te.array(Te.string()).optional(),frustrations:Te.array(Te.string()).optional(),motivations:Te.array(Te.string()).optional(),scenarios:Te.array(Te.string()).optional(),scenarioType:Te.string().optional(),oceanTraits:Te.object({openness:Te.number().min(0).max(100),conscientiousness:Te.number().min(0).max(100),extraversion:Te.number().min(0).max(100),agreeableness:Te.number().min(0).max(100),neuroticism:Te.number().min(0).max(100)}).optional(),thinkFeelDo:Te.object({thinks:Te.array(Te.string()),feels:Te.array(Te.string()),does:Te.array(Te.string())}).optional(),mediaConsumption:Te.string().optional(),deviceUsage:Te.string().optional(),shoppingHabits:Te.string().optional(),brandPreferences:Te.string().optional(),communicationPreferences:Te.string().optional(),paymentMethods:Te.string().optional(),purchaseBehaviour:Te.string().optional(),coreValues:Te.string().optional(),lifestyleChoices:Te.string().optional(),socialActivities:Te.string().optional(),categoryKnowledge:Te.string().optional(),decisionInfluences:Te.string().optional(),painPoints:Te.string().optional(),journeyContext:Te.string().optional(),keyTouchpoints:Te.string().optional(),selfDeterminationNeeds:Te.object({autonomy:Te.string(),competence:Te.string(),relatedness:Te.string()}).optional(),fears:Te.array(Te.string()).optional(),narrative:Te.string().optional(),additionalInformation:Te.string().optional()});function bY({targetFolderId:e,targetFolderName:t}){const[n,r]=v.useState(1),[s,a]=v.useState(!1),[o,l]=v.useState(!1),[c,u]=v.useState(0),d=Tn(),{isAuthenticated:f,login:h}=Kl();v.useEffect(()=>{u(0)},[]),v.useEffect(()=>{(async()=>{if(!f&&!o){l(!0);try{console.log("Attempting auto login with default credentials"),await h("user","pass"),console.log("Auto login successful");const _=localStorage.getItem("auth_token");_?(console.log("Token successfully stored:",_.substring(0,10)+"..."),Ke.success("Logged in automatically with default account")):(console.error("Token not stored after successful login"),Ke.error("Authentication problem, token not stored"))}catch(_){console.error("Auto login failed:",_)}finally{l(!1)}}})()},[]);const p=Ny({resolver:_y(xY),defaultValues:{name:"",age:"",gender:"",occupation:"",education:"",location:"",ethnicity:"",personality:"",interests:"",hasPurchasingPower:!1,hasChildren:!1,techSavviness:50,brandLoyalty:50,priceConsciousness:50,environmentalConcern:50,socialGrade:"",householdIncome:"",householdComposition:"",livingSituation:"",goals:[],frustrations:[],motivations:[],scenarios:[],scenarioType:"",oceanTraits:{openness:50,conscientiousness:50,extraversion:50,agreeableness:50,neuroticism:50},thinkFeelDo:{thinks:[],feels:[],does:[]},mediaConsumption:"",deviceUsage:"",shoppingHabits:"",brandPreferences:"",communicationPreferences:"",paymentMethods:"",purchaseBehaviour:"",coreValues:"",lifestyleChoices:"",socialActivities:"",categoryKnowledge:"",decisionInfluences:"",painPoints:"",journeyContext:"",keyTouchpoints:"",selfDeterminationNeeds:{autonomy:"",competence:"",relatedness:""},fears:[],narrative:"",additionalInformation:""}}),g=N=>{const _=p.getValues(N)||[];p.setValue(N,[..._,""])},m=(N,_,P)=>{const O=[...p.getValues(N)||[]];O[_]=P,p.setValue(N,O)},y=(N,_)=>{const k=[...p.getValues(N)||[]];k.splice(_,1),p.setValue(N,k)},b=N=>{const _=p.getValues("thinkFeelDo")||{thinks:[],feels:[],does:[]},P={..._,[N]:[..._[N]||[],""]};p.setValue("thinkFeelDo",P)},x=(N,_,P)=>{const k=p.getValues("thinkFeelDo")||{thinks:[],feels:[],does:[]},O=[...k[N]||[]];O[_]=P;const M={...k,[N]:O};p.setValue("thinkFeelDo",M)},w=(N,_)=>{const P=p.getValues("thinkFeelDo")||{thinks:[],feels:[],does:[]},k=[...P[N]||[]];k.splice(_,1);const O={...P,[N]:k};p.setValue("thinkFeelDo",O)},j=(N,_)=>{const k={...p.getValues("oceanTraits")||{openness:50,conscientiousness:50,extraversion:50,agreeableness:50,neuroticism:50},[N]:_};p.setValue("oceanTraits",k)};async function S(N,_=!1){var P,k,O,M,A;if(_&&c>=1){console.log("Max retry attempts reached, stopping retry loop"),Ke.error("Authentication failed after multiple attempts",{description:"Please try logging in manually (user/pass)"}),d("/login",{state:{from:"/synthetic-users"}}),a(!1);return}_?(u($=>$+1),console.log(`Retry attempt ${c+1}`)):u(0),a(!0);try{if(!f)try{console.log("Not authenticated, attempting login with default credentials before submission"),await h("user","pass"),console.log("Login successful before persona creation")}catch(F){console.error("Login failed before persona creation:",F),Ke.error("Authentication required",{description:"Please log in before creating personas. Default: user/pass"}),d("/login",{state:{from:"/synthetic-users"}}),a(!1);return}const $=`persona-generation-${Date.now()}`,L=e&&t?` in "${t}" folder`:"",H=n>1?`${n} personas`:"persona";console.log(`UserCreator - Creating ${H}${L}`),Ke.createPersistent({id:$,title:`Generating ${H}...`,description:`Creating synthetic user profile${n>1?"s":""}${L}`,type:"info"});const D={...N,oceanTraits:N.oceanTraits||{openness:50,conscientiousness:50,extraversion:50,agreeableness:50,neuroticism:50},thinkFeelDo:N.thinkFeelDo||{thinks:[],feels:[],does:[]},folderId:e||void 0},V={id:`temp-${Date.now()}`,...D},T=JSON.parse(localStorage.getItem("tempPersonas")||"[]");if(T.push(V),localStorage.setItem("tempPersonas",JSON.stringify(T)),n===1)try{if(!localStorage.getItem("auth_token")){console.error("No authentication token found"),Ke.error("Authentication required",{description:"No valid token found. Please log in again."});try{console.log("No token found, attempting new login"),await h("user","pass"),console.log("Login successful, token:",((P=localStorage.getItem("auth_token"))==null?void 0:P.substring(0,10))+"...")}catch(Z){throw console.error("Login retry failed:",Z),new Error("Authentication failed after retry")}}console.log("Sending persona creation request to API with auth token");const q=await Dn.create(D);console.log("Persona created successfully:",q),Ke.updatePersistent($,{title:"Synthetic user created successfully",description:`Created profile for ${N.name}`,type:"success"})}catch(F){throw console.error("Error creating persona via API:",F),F.response&&F.response.status===401&&Ke.error("Authentication error",{description:"Failed to authenticate with server. Please try again."}),F}else{const F=[];F.push(D);for(let q=1;q{d("/synthetic-users?mode=view")},300)}catch($){if(console.error("Error creating personas:",$),$.response&&$.response.status===401||$.message&&$.message.includes("Authentication failed")&&c<1)try{console.log("Got auth error, attempting login retry with default credentials"),localStorage.removeItem("auth_token");const L=await jw.login("user","pass");if((O=L==null?void 0:L.data)!=null&&O.access_token){localStorage.setItem("auth_token",L.data.access_token),localStorage.setItem("user",JSON.stringify(L.data.user)),console.log("Manual login successful, got new token:",L.data.access_token.substring(0,10)+"..."),Ke.info("Logged in with default account, retrying submission..."),setTimeout(()=>{S(N,!0)},500);return}else throw new Error("No access token received")}catch(L){console.error("Login retry failed:",L),Ke.error("Authentication error",{description:"Cannot authenticate with server. Please contact support."})}else Ke.updatePersistent(generationToastId,{title:"Failed to create synthetic users",description:((A=(M=$.response)==null?void 0:M.data)==null?void 0:A.message)||$.message||"An unexpected error occurred",type:"error"})}finally{a(!1)}}return i.jsxs("div",{className:"glass-panel rounded-xl p-6",children:[i.jsxs("div",{className:"flex items-center justify-between mb-6",children:[i.jsx("h2",{className:"text-2xl font-sf font-semibold",children:"Create Synthetic Users"}),i.jsxs("div",{className:"flex items-center space-x-2",children:[i.jsx(te,{variant:"outline",size:"sm",onClick:()=>r(Math.max(1,n-1)),children:"-"}),i.jsxs("div",{className:"flex items-center space-x-2",children:[i.jsx(or,{size:16,className:"text-muted-foreground"}),i.jsx("span",{className:"text-sm font-medium",children:n})]}),i.jsx(te,{variant:"outline",size:"sm",onClick:()=>r(n+1),children:"+"})]})]}),i.jsx(Ay,{...p,children:i.jsxs("form",{onSubmit:p.handleSubmit(S),className:"space-y-6",children:[i.jsxs(Fo,{defaultValue:"basic",children:[i.jsxs(Pi,{className:"grid w-full grid-cols-6",children:[i.jsx(Xt,{value:"basic",children:"Basic"}),i.jsx(Xt,{value:"cooper",children:"Cooper"}),i.jsx(Xt,{value:"personality",children:"Personality"}),i.jsx(Xt,{value:"demographics",children:"Demographics"}),i.jsx(Xt,{value:"lifestyle",children:"Lifestyle"}),i.jsx(Xt,{value:"extended",children:"Extended"})]}),i.jsx(Yt,{value:"basic",className:"mt-6",children:i.jsx(rt,{children:i.jsx(bt,{className:"p-6",children:i.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-6",children:[i.jsxs("div",{className:"space-y-4",children:[i.jsx(dt,{control:p.control,name:"name",render:({field:N})=>i.jsxs(ot,{children:[i.jsx(lt,{children:"Name"}),i.jsx(ct,{children:i.jsx(Ot,{placeholder:"Jane Smith",...N})}),i.jsx(ut,{})]})}),i.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[i.jsx(dt,{control:p.control,name:"age",render:({field:N})=>i.jsxs(ot,{children:[i.jsx(lt,{children:"Age Range"}),i.jsxs(Mn,{onValueChange:N.onChange,defaultValue:N.value,children:[i.jsx(ct,{children:i.jsx(Pn,{children:i.jsx(In,{placeholder:"Select age range"})})}),i.jsxs(An,{children:[i.jsx(fe,{value:"18-24",children:"18-24"}),i.jsx(fe,{value:"25-34",children:"25-34"}),i.jsx(fe,{value:"35-44",children:"35-44"}),i.jsx(fe,{value:"45-54",children:"45-54"}),i.jsx(fe,{value:"55-64",children:"55-64"}),i.jsx(fe,{value:"65+",children:"65+"})]})]}),i.jsx(ut,{})]})}),i.jsx(dt,{control:p.control,name:"gender",render:({field:N})=>i.jsxs(ot,{children:[i.jsx(lt,{children:"Gender"}),i.jsxs(Mn,{onValueChange:N.onChange,defaultValue:N.value,children:[i.jsx(ct,{children:i.jsx(Pn,{children:i.jsx(In,{placeholder:"Select gender"})})}),i.jsxs(An,{children:[i.jsx(fe,{value:"Male",children:"Male"}),i.jsx(fe,{value:"Female",children:"Female"}),i.jsx(fe,{value:"Non-binary",children:"Non-binary"}),i.jsx(fe,{value:"Other",children:"Other"})]})]}),i.jsx(ut,{})]})})]}),i.jsx(dt,{control:p.control,name:"occupation",render:({field:N})=>i.jsxs(ot,{children:[i.jsx(lt,{children:"Occupation"}),i.jsx(ct,{children:i.jsx(Ot,{placeholder:"Software Engineer",...N})}),i.jsx(ut,{})]})}),i.jsx(dt,{control:p.control,name:"education",render:({field:N})=>i.jsxs(ot,{children:[i.jsx(lt,{children:"Education"}),i.jsxs(Mn,{onValueChange:N.onChange,defaultValue:N.value,children:[i.jsx(ct,{children:i.jsx(Pn,{children:i.jsx(In,{placeholder:"Select education level"})})}),i.jsxs(An,{children:[i.jsx(fe,{value:"High School",children:"High School"}),i.jsx(fe,{value:"Some College",children:"Some College"}),i.jsx(fe,{value:"Associate's Degree",children:"Associate's Degree"}),i.jsx(fe,{value:"Bachelor's Degree",children:"Bachelor's Degree"}),i.jsx(fe,{value:"Master's Degree",children:"Master's Degree"}),i.jsx(fe,{value:"PhD",children:"PhD"})]})]}),i.jsx(ut,{})]})}),i.jsx(dt,{control:p.control,name:"location",render:({field:N})=>i.jsxs(ot,{children:[i.jsx(lt,{children:"Location"}),i.jsx(ct,{children:i.jsx(Ot,{placeholder:"New York, USA",...N})}),i.jsx(ut,{})]})}),i.jsx(dt,{control:p.control,name:"ethnicity",render:({field:N})=>i.jsxs(ot,{children:[i.jsx(lt,{children:"Ethnicity (Optional)"}),i.jsxs(Mn,{onValueChange:N.onChange,defaultValue:N.value,children:[i.jsx(ct,{children:i.jsx(Pn,{children:i.jsx(In,{placeholder:"Select ethnicity"})})}),i.jsxs(An,{children:[i.jsx(fe,{value:"white",children:"White"}),i.jsx(fe,{value:"black",children:"Black"}),i.jsx(fe,{value:"asian",children:"Asian"}),i.jsx(fe,{value:"hispanic",children:"Hispanic/Latino"}),i.jsx(fe,{value:"native-american",children:"Native American"}),i.jsx(fe,{value:"middle-eastern",children:"Middle Eastern"}),i.jsx(fe,{value:"mixed",children:"Mixed"}),i.jsx(fe,{value:"other",children:"Other"}),i.jsx(fe,{value:"prefer-not-to-say",children:"Prefer not to say"})]})]}),i.jsx(ut,{})]})})]}),i.jsxs("div",{className:"space-y-4",children:[i.jsx(dt,{control:p.control,name:"personality",render:({field:N})=>i.jsxs(ot,{children:[i.jsx(lt,{children:"Personality Traits"}),i.jsx(ct,{children:i.jsx(nt,{placeholder:"Curious, analytical, detail-oriented",...N,rows:3})}),i.jsx(fn,{children:"Describe key personality traits that define this user"}),i.jsx(ut,{})]})}),i.jsx(dt,{control:p.control,name:"interests",render:({field:N})=>i.jsxs(ot,{children:[i.jsx(lt,{children:"Interests"}),i.jsx(ct,{children:i.jsx(nt,{placeholder:"Technology, fitness, cooking, travel",...N,rows:3})}),i.jsx(fn,{children:"List interests, hobbies and activities this user enjoys"}),i.jsx(ut,{})]})}),i.jsxs("div",{className:"space-y-4",children:[i.jsx("h3",{className:"font-medium text-sm",children:"Behavioral Attributes"}),i.jsx(dt,{control:p.control,name:"techSavviness",render:({field:N})=>i.jsxs(ot,{children:[i.jsxs("div",{className:"flex items-center justify-between mb-2",children:[i.jsx(lt,{children:"Tech Savviness"}),i.jsxs("span",{className:"text-sm text-muted-foreground",children:[N.value,"%"]})]}),i.jsx(ct,{children:i.jsx(Un,{min:0,max:100,step:1,value:[N.value],onValueChange:_=>N.onChange(_[0])})}),i.jsx(ut,{})]})}),i.jsx(dt,{control:p.control,name:"brandLoyalty",render:({field:N})=>i.jsxs(ot,{children:[i.jsxs("div",{className:"flex items-center justify-between mb-2",children:[i.jsx(lt,{children:"Brand Loyalty"}),i.jsxs("span",{className:"text-sm text-muted-foreground",children:[N.value,"%"]})]}),i.jsx(ct,{children:i.jsx(Un,{min:0,max:100,step:1,value:[N.value],onValueChange:_=>N.onChange(_[0])})}),i.jsx(ut,{})]})}),i.jsx(dt,{control:p.control,name:"priceConsciousness",render:({field:N})=>i.jsxs(ot,{children:[i.jsxs("div",{className:"flex items-center justify-between mb-2",children:[i.jsx(lt,{children:"Price Consciousness"}),i.jsxs("span",{className:"text-sm text-muted-foreground",children:[N.value,"%"]})]}),i.jsx(ct,{children:i.jsx(Un,{min:0,max:100,step:1,value:[N.value],onValueChange:_=>N.onChange(_[0])})}),i.jsx(ut,{})]})}),i.jsx(dt,{control:p.control,name:"environmentalConcern",render:({field:N})=>i.jsxs(ot,{children:[i.jsxs("div",{className:"flex items-center justify-between mb-2",children:[i.jsx(lt,{children:"Environmental Concern"}),i.jsxs("span",{className:"text-sm text-muted-foreground",children:[N.value,"%"]})]}),i.jsx(ct,{children:i.jsx(Un,{min:0,max:100,step:1,value:[N.value],onValueChange:_=>N.onChange(_[0])})}),i.jsx(ut,{})]})}),i.jsxs("div",{className:"grid grid-cols-2 gap-4 pt-2",children:[i.jsx(dt,{control:p.control,name:"hasPurchasingPower",render:({field:N})=>i.jsxs(ot,{className:"flex items-center justify-between",children:[i.jsx(lt,{children:"Purchasing Power"}),i.jsx(ct,{children:i.jsx(ah,{checked:N.value,onCheckedChange:N.onChange})}),i.jsx(ut,{})]})}),i.jsx(dt,{control:p.control,name:"hasChildren",render:({field:N})=>i.jsxs(ot,{className:"flex items-center justify-between",children:[i.jsx(lt,{children:"Has Children"}),i.jsx(ct,{children:i.jsx(ah,{checked:N.value,onCheckedChange:N.onChange})}),i.jsx(ut,{})]})})]})]})]})]})})})}),i.jsxs(Yt,{value:"cooper",className:"mt-6 space-y-6",children:[i.jsx(rt,{children:i.jsxs(bt,{className:"p-6",children:[i.jsxs("div",{className:"mb-4",children:[i.jsx("h3",{className:"font-medium text-lg mb-3",children:"Goals"}),(p.watch("goals")||[]).map((N,_)=>i.jsxs("div",{className:"flex items-center gap-2 mb-2",children:[i.jsx(Ot,{value:N,onChange:P=>m("goals",_,P.target.value),placeholder:"Enter a goal"}),i.jsx(te,{variant:"ghost",size:"icon",type:"button",onClick:()=>y("goals",_),children:i.jsx(_n,{className:"h-4 w-4 text-muted-foreground"})})]},_)),i.jsxs(te,{variant:"outline",size:"sm",type:"button",onClick:()=>g("goals"),className:"mt-2",children:[i.jsx(pr,{className:"h-4 w-4 mr-2"}),"Add Goal"]})]}),i.jsxs("div",{className:"mb-4 pt-4 border-t",children:[i.jsx("h3",{className:"font-medium text-lg mb-3",children:"Frustrations"}),(p.watch("frustrations")||[]).map((N,_)=>i.jsxs("div",{className:"flex items-center gap-2 mb-2",children:[i.jsx(Ot,{value:N,onChange:P=>m("frustrations",_,P.target.value),placeholder:"Enter a frustration"}),i.jsx(te,{variant:"ghost",size:"icon",type:"button",onClick:()=>y("frustrations",_),children:i.jsx(_n,{className:"h-4 w-4 text-muted-foreground"})})]},_)),i.jsxs(te,{variant:"outline",size:"sm",type:"button",onClick:()=>g("frustrations"),className:"mt-2",children:[i.jsx(pr,{className:"h-4 w-4 mr-2"}),"Add Frustration"]})]}),i.jsxs("div",{className:"mb-4 pt-4 border-t",children:[i.jsx("h3",{className:"font-medium text-lg mb-3",children:"Motivations"}),(p.watch("motivations")||[]).map((N,_)=>i.jsxs("div",{className:"flex items-center gap-2 mb-2",children:[i.jsx(Ot,{value:N,onChange:P=>m("motivations",_,P.target.value),placeholder:"Enter a motivation"}),i.jsx(te,{variant:"ghost",size:"icon",type:"button",onClick:()=>y("motivations",_),children:i.jsx(_n,{className:"h-4 w-4 text-muted-foreground"})})]},_)),i.jsxs(te,{variant:"outline",size:"sm",type:"button",onClick:()=>g("motivations"),className:"mt-2",children:[i.jsx(pr,{className:"h-4 w-4 mr-2"}),"Add Motivation"]})]})]})}),i.jsx(rt,{children:i.jsxs(bt,{className:"p-6",children:[i.jsx("h3",{className:"font-medium text-lg mb-4",children:"Think, Feel, Do"}),i.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-3 gap-6",children:[i.jsxs("div",{children:[i.jsx("h4",{className:"font-medium text-sm mb-3",children:"Thinks"}),((p.watch("thinkFeelDo")||{thinks:[],feels:[],does:[]}).thinks||[]).map((N,_)=>i.jsxs("div",{className:"flex items-center gap-2 mb-2",children:[i.jsx(Ot,{value:N,onChange:P=>x("thinks",_,P.target.value),placeholder:"What they think"}),i.jsx(te,{variant:"ghost",size:"icon",type:"button",onClick:()=>w("thinks",_),children:i.jsx(_n,{className:"h-4 w-4 text-muted-foreground"})})]},_)),i.jsxs(te,{variant:"outline",size:"sm",type:"button",onClick:()=>b("thinks"),className:"mt-2",children:[i.jsx(pr,{className:"h-4 w-4 mr-2"}),"Add Thought"]})]}),i.jsxs("div",{children:[i.jsx("h4",{className:"font-medium text-sm mb-3",children:"Feels"}),((p.watch("thinkFeelDo")||{thinks:[],feels:[],does:[]}).feels||[]).map((N,_)=>i.jsxs("div",{className:"flex items-center gap-2 mb-2",children:[i.jsx(Ot,{value:N,onChange:P=>x("feels",_,P.target.value),placeholder:"What they feel"}),i.jsx(te,{variant:"ghost",size:"icon",type:"button",onClick:()=>w("feels",_),children:i.jsx(_n,{className:"h-4 w-4 text-muted-foreground"})})]},_)),i.jsxs(te,{variant:"outline",size:"sm",type:"button",onClick:()=>b("feels"),className:"mt-2",children:[i.jsx(pr,{className:"h-4 w-4 mr-2"}),"Add Feeling"]})]}),i.jsxs("div",{children:[i.jsx("h4",{className:"font-medium text-sm mb-3",children:"Does"}),((p.watch("thinkFeelDo")||{thinks:[],feels:[],does:[]}).does||[]).map((N,_)=>i.jsxs("div",{className:"flex items-center gap-2 mb-2",children:[i.jsx(Ot,{value:N,onChange:P=>x("does",_,P.target.value),placeholder:"What they do"}),i.jsx(te,{variant:"ghost",size:"icon",type:"button",onClick:()=>w("does",_),children:i.jsx(_n,{className:"h-4 w-4 text-muted-foreground"})})]},_)),i.jsxs(te,{variant:"outline",size:"sm",type:"button",onClick:()=>b("does"),className:"mt-2",children:[i.jsx(pr,{className:"h-4 w-4 mr-2"}),"Add Action"]})]})]})]})}),i.jsx(rt,{children:i.jsx(bt,{className:"p-6",children:i.jsxs("div",{className:"space-y-4",children:[i.jsx(dt,{control:p.control,name:"scenarioType",render:({field:N})=>i.jsxs(ot,{children:[i.jsx(lt,{children:"Scenario Section Title"}),i.jsx(ct,{children:i.jsx(Ot,{placeholder:"Life Scenarios",...N})}),i.jsx(fn,{children:'Custom title for the scenarios section (e.g., "Customer Journey", "Use Cases")'}),i.jsx(ut,{})]})}),i.jsxs("div",{children:[i.jsx("h3",{className:"font-medium text-lg mb-3",children:"Usage Scenarios"}),(p.watch("scenarios")||[]).map((N,_)=>i.jsxs("div",{className:"flex items-start gap-2 mb-2",children:[i.jsx(nt,{value:N,onChange:P=>m("scenarios",_,P.target.value),rows:2,placeholder:"Describe a usage scenario"}),i.jsx(te,{variant:"ghost",size:"icon",type:"button",onClick:()=>y("scenarios",_),className:"mt-2",children:i.jsx(_n,{className:"h-4 w-4 text-muted-foreground"})})]},_)),i.jsxs(te,{variant:"outline",size:"sm",type:"button",onClick:()=>g("scenarios"),className:"mt-2",children:[i.jsx(pr,{className:"h-4 w-4 mr-2"}),"Add Scenario"]})]})]})})})]}),i.jsx(Yt,{value:"personality",className:"mt-6",children:i.jsx(rt,{children:i.jsxs(bt,{className:"p-6",children:[i.jsx("h3",{className:"font-medium text-lg mb-4",children:"OCEAN Personality Traits"}),i.jsxs("div",{className:"space-y-6",children:[i.jsxs("div",{children:[i.jsxs("div",{className:"flex justify-between mb-1",children:[i.jsx("label",{className:"text-sm font-medium",children:"Openness to Experience"}),i.jsxs("span",{className:"text-sm",children:[(p.watch("oceanTraits")||{openness:50}).openness||50,"%"]})]}),i.jsx(Un,{value:[(p.watch("oceanTraits")||{openness:50}).openness||50],onValueChange:N=>j("openness",N[0]),max:100,step:1}),i.jsx("p",{className:"text-xs text-muted-foreground mt-1",children:"Creativity, curiosity, and openness to new ideas"})]}),i.jsxs("div",{children:[i.jsxs("div",{className:"flex justify-between mb-1",children:[i.jsx("label",{className:"text-sm font-medium",children:"Conscientiousness"}),i.jsxs("span",{className:"text-sm",children:[(p.watch("oceanTraits")||{conscientiousness:50}).conscientiousness||50,"%"]})]}),i.jsx(Un,{value:[(p.watch("oceanTraits")||{conscientiousness:50}).conscientiousness||50],onValueChange:N=>j("conscientiousness",N[0]),max:100,step:1}),i.jsx("p",{className:"text-xs text-muted-foreground mt-1",children:"Organization, responsibility, and self-discipline"})]}),i.jsxs("div",{children:[i.jsxs("div",{className:"flex justify-between mb-1",children:[i.jsx("label",{className:"text-sm font-medium",children:"Extraversion"}),i.jsxs("span",{className:"text-sm",children:[(p.watch("oceanTraits")||{extraversion:50}).extraversion||50,"%"]})]}),i.jsx(Un,{value:[(p.watch("oceanTraits")||{extraversion:50}).extraversion||50],onValueChange:N=>j("extraversion",N[0]),max:100,step:1}),i.jsx("p",{className:"text-xs text-muted-foreground mt-1",children:"Sociability, assertiveness, and talkativeness"})]}),i.jsxs("div",{children:[i.jsxs("div",{className:"flex justify-between mb-1",children:[i.jsx("label",{className:"text-sm font-medium",children:"Agreeableness"}),i.jsxs("span",{className:"text-sm",children:[(p.watch("oceanTraits")||{agreeableness:50}).agreeableness||50,"%"]})]}),i.jsx(Un,{value:[(p.watch("oceanTraits")||{agreeableness:50}).agreeableness||50],onValueChange:N=>j("agreeableness",N[0]),max:100,step:1}),i.jsx("p",{className:"text-xs text-muted-foreground mt-1",children:"Compassion, cooperation, and concern for others"})]}),i.jsxs("div",{children:[i.jsxs("div",{className:"flex justify-between mb-1",children:[i.jsx("label",{className:"text-sm font-medium",children:"Neuroticism"}),i.jsxs("span",{className:"text-sm",children:[(p.watch("oceanTraits")||{neuroticism:50}).neuroticism||50,"%"]})]}),i.jsx(Un,{value:[(p.watch("oceanTraits")||{neuroticism:50}).neuroticism||50],onValueChange:N=>j("neuroticism",N[0]),max:100,step:1}),i.jsx("p",{className:"text-xs text-muted-foreground mt-1",children:"Emotional reactivity, anxiety, and sensitivity to stress"})]})]})]})})}),i.jsx(Yt,{value:"demographics",className:"mt-6",children:i.jsx(rt,{children:i.jsxs(bt,{className:"p-6",children:[i.jsx("h3",{className:"font-medium text-lg mb-4",children:"Demographic Information"}),i.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-6",children:[i.jsxs("div",{className:"space-y-4",children:[i.jsx(dt,{control:p.control,name:"socialGrade",render:({field:N})=>i.jsxs(ot,{children:[i.jsx(lt,{children:"Social Grade"}),i.jsxs(Mn,{onValueChange:N.onChange,defaultValue:N.value,children:[i.jsx(ct,{children:i.jsx(Pn,{children:i.jsx(In,{placeholder:"Select social grade"})})}),i.jsxs(An,{children:[i.jsx(fe,{value:"A",children:"A - Higher managerial"}),i.jsx(fe,{value:"B",children:"B - Intermediate managerial"}),i.jsx(fe,{value:"C1",children:"C1 - Supervisory or clerical"}),i.jsx(fe,{value:"C2",children:"C2 - Skilled manual workers"}),i.jsx(fe,{value:"D",children:"D - Semi and unskilled manual workers"}),i.jsx(fe,{value:"E",children:"E - State pensioners, unemployed"})]})]}),i.jsx(ut,{})]})}),i.jsx(dt,{control:p.control,name:"householdIncome",render:({field:N})=>i.jsxs(ot,{children:[i.jsx(lt,{children:"Household Income"}),i.jsxs(Mn,{onValueChange:N.onChange,defaultValue:N.value,children:[i.jsx(ct,{children:i.jsx(Pn,{children:i.jsx(In,{placeholder:"Select income range"})})}),i.jsxs(An,{children:[i.jsx(fe,{value:"Under $25k",children:"Under $25,000"}),i.jsx(fe,{value:"$25k-$50k",children:"$25,000 - $50,000"}),i.jsx(fe,{value:"$50k-$75k",children:"$50,000 - $75,000"}),i.jsx(fe,{value:"$75k-$100k",children:"$75,000 - $100,000"}),i.jsx(fe,{value:"$100k-$150k",children:"$100,000 - $150,000"}),i.jsx(fe,{value:"$150k-$250k",children:"$150,000 - $250,000"}),i.jsx(fe,{value:"Over $250k",children:"Over $250,000"}),i.jsx(fe,{value:"Prefer not to say",children:"Prefer not to say"})]})]}),i.jsx(ut,{})]})})]}),i.jsxs("div",{className:"space-y-4",children:[i.jsx(dt,{control:p.control,name:"householdComposition",render:({field:N})=>i.jsxs(ot,{children:[i.jsx(lt,{children:"Household Composition"}),i.jsxs(Mn,{onValueChange:N.onChange,defaultValue:N.value,children:[i.jsx(ct,{children:i.jsx(Pn,{children:i.jsx(In,{placeholder:"Select household type"})})}),i.jsxs(An,{children:[i.jsx(fe,{value:"Single person",children:"Single person"}),i.jsx(fe,{value:"Couple without children",children:"Couple without children"}),i.jsx(fe,{value:"Couple with children",children:"Couple with children"}),i.jsx(fe,{value:"Single parent",children:"Single parent"}),i.jsx(fe,{value:"Multi-generational",children:"Multi-generational"}),i.jsx(fe,{value:"Shared housing",children:"Shared housing"}),i.jsx(fe,{value:"Other",children:"Other"})]})]}),i.jsx(ut,{})]})}),i.jsx(dt,{control:p.control,name:"livingSituation",render:({field:N})=>i.jsxs(ot,{children:[i.jsx(lt,{children:"Living Situation"}),i.jsxs(Mn,{onValueChange:N.onChange,defaultValue:N.value,children:[i.jsx(ct,{children:i.jsx(Pn,{children:i.jsx(In,{placeholder:"Select living situation"})})}),i.jsxs(An,{children:[i.jsx(fe,{value:"Own home",children:"Own home"}),i.jsx(fe,{value:"Rent apartment",children:"Rent apartment"}),i.jsx(fe,{value:"Rent house",children:"Rent house"}),i.jsx(fe,{value:"Live with family",children:"Live with family"}),i.jsx(fe,{value:"Student housing",children:"Student housing"}),i.jsx(fe,{value:"Assisted living",children:"Assisted living"}),i.jsx(fe,{value:"Other",children:"Other"})]})]}),i.jsx(ut,{})]})})]})]})]})})}),i.jsx(Yt,{value:"lifestyle",className:"mt-6",children:i.jsx(rt,{children:i.jsxs(bt,{className:"p-6",children:[i.jsx("h3",{className:"font-medium text-lg mb-4",children:"Lifestyle & Behavior"}),i.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-6",children:[i.jsxs("div",{className:"space-y-4",children:[i.jsx(dt,{control:p.control,name:"mediaConsumption",render:({field:N})=>i.jsxs(ot,{children:[i.jsx(lt,{children:"Media Consumption"}),i.jsx(ct,{children:i.jsx(nt,{placeholder:"TV shows, podcasts, news sources, social media platforms",...N,rows:3})}),i.jsx(fn,{children:"Describe media consumption habits and preferences"}),i.jsx(ut,{})]})}),i.jsx(dt,{control:p.control,name:"deviceUsage",render:({field:N})=>i.jsxs(ot,{children:[i.jsx(lt,{children:"Device Usage"}),i.jsx(ct,{children:i.jsx(nt,{placeholder:"Smartphone, laptop, tablet, smart TV, gaming console",...N,rows:3})}),i.jsx(fn,{children:"Primary devices and usage patterns"}),i.jsx(ut,{})]})}),i.jsx(dt,{control:p.control,name:"shoppingHabits",render:({field:N})=>i.jsxs(ot,{children:[i.jsx(lt,{children:"Shopping Habits"}),i.jsx(ct,{children:i.jsx(nt,{placeholder:"Online vs in-store, frequency, preferred retailers",...N,rows:3})}),i.jsx(fn,{children:"Shopping behavior and preferences"}),i.jsx(ut,{})]})}),i.jsx(dt,{control:p.control,name:"brandPreferences",render:({field:N})=>i.jsxs(ot,{children:[i.jsx(lt,{children:"Brand Preferences"}),i.jsx(ct,{children:i.jsx(nt,{placeholder:"Favorite brands, brand values alignment",...N,rows:3})}),i.jsx(fn,{children:"Preferred brands and reasoning"}),i.jsx(ut,{})]})})]}),i.jsxs("div",{className:"space-y-4",children:[i.jsx(dt,{control:p.control,name:"communicationPreferences",render:({field:N})=>i.jsxs(ot,{children:[i.jsx(lt,{children:"Communication Preferences"}),i.jsx(ct,{children:i.jsx(nt,{placeholder:"Email, phone, text, video calls, in-person",...N,rows:3})}),i.jsx(fn,{children:"Preferred communication methods and channels"}),i.jsx(ut,{})]})}),i.jsx(dt,{control:p.control,name:"paymentMethods",render:({field:N})=>i.jsxs(ot,{children:[i.jsx(lt,{children:"Payment Methods"}),i.jsx(ct,{children:i.jsx(nt,{placeholder:"Credit cards, digital wallets, cash, BNPL",...N,rows:3})}),i.jsx(fn,{children:"Preferred payment methods and financial tools"}),i.jsx(ut,{})]})}),i.jsx(dt,{control:p.control,name:"purchaseBehaviour",render:({field:N})=>i.jsxs(ot,{children:[i.jsx(lt,{children:"Purchase Behavior"}),i.jsx(ct,{children:i.jsx(nt,{placeholder:"Research habits, decision factors, impulse vs planned buying",...N,rows:3})}),i.jsx(fn,{children:"How they approach making purchase decisions"}),i.jsx(ut,{})]})})]})]})]})})}),i.jsxs(Yt,{value:"extended",className:"mt-6 space-y-6",children:[i.jsx(rt,{children:i.jsxs(bt,{className:"p-6",children:[i.jsx("h3",{className:"font-medium text-lg mb-4",children:"Extended Profile"}),i.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-6",children:[i.jsxs("div",{className:"space-y-4",children:[i.jsx(dt,{control:p.control,name:"coreValues",render:({field:N})=>i.jsxs(ot,{children:[i.jsx(lt,{children:"Core Values"}),i.jsx(ct,{children:i.jsx(nt,{placeholder:"Key principles and values that guide decisions",...N,rows:3})}),i.jsx(ut,{})]})}),i.jsx(dt,{control:p.control,name:"lifestyleChoices",render:({field:N})=>i.jsxs(ot,{children:[i.jsx(lt,{children:"Lifestyle Choices"}),i.jsx(ct,{children:i.jsx(nt,{placeholder:"Health, fitness, diet, work-life balance preferences",...N,rows:3})}),i.jsx(ut,{})]})}),i.jsx(dt,{control:p.control,name:"socialActivities",render:({field:N})=>i.jsxs(ot,{children:[i.jsx(lt,{children:"Social Activities"}),i.jsx(ct,{children:i.jsx(nt,{placeholder:"Social hobbies, community involvement, networking",...N,rows:3})}),i.jsx(ut,{})]})}),i.jsx(dt,{control:p.control,name:"categoryKnowledge",render:({field:N})=>i.jsxs(ot,{children:[i.jsx(lt,{children:"Category Knowledge"}),i.jsx(ct,{children:i.jsx(nt,{placeholder:"Expertise in specific product/service categories",...N,rows:3})}),i.jsx(ut,{})]})}),i.jsx(dt,{control:p.control,name:"decisionInfluences",render:({field:N})=>i.jsxs(ot,{children:[i.jsx(lt,{children:"Decision Influences"}),i.jsx(ct,{children:i.jsx(nt,{placeholder:"What factors most influence their decisions",...N,rows:3})}),i.jsx(ut,{})]})}),i.jsx(dt,{control:p.control,name:"painPoints",render:({field:N})=>i.jsxs(ot,{children:[i.jsx(lt,{children:"Pain Points"}),i.jsx(ct,{children:i.jsx(nt,{placeholder:"Common challenges and friction points",...N,rows:3})}),i.jsx(ut,{})]})})]}),i.jsxs("div",{className:"space-y-4",children:[i.jsx(dt,{control:p.control,name:"journeyContext",render:({field:N})=>i.jsxs(ot,{children:[i.jsx(lt,{children:"Journey Context"}),i.jsx(ct,{children:i.jsx(nt,{placeholder:"Current life stage and contextual factors",...N,rows:3})}),i.jsx(ut,{})]})}),i.jsx(dt,{control:p.control,name:"keyTouchpoints",render:({field:N})=>i.jsxs(ot,{children:[i.jsx(lt,{children:"Key Touchpoints"}),i.jsx(ct,{children:i.jsx(nt,{placeholder:"Important interaction points and channels",...N,rows:3})}),i.jsx(ut,{})]})}),i.jsxs("div",{className:"space-y-4",children:[i.jsx("h4",{className:"font-medium text-sm",children:"Self-Determination Needs"}),i.jsx(dt,{control:p.control,name:"selfDeterminationNeeds.autonomy",render:({field:N})=>i.jsxs(ot,{children:[i.jsx(lt,{children:"Autonomy"}),i.jsx(ct,{children:i.jsx(nt,{placeholder:"Need for independence and self-direction",...N,rows:2})}),i.jsx(ut,{})]})}),i.jsx(dt,{control:p.control,name:"selfDeterminationNeeds.competence",render:({field:N})=>i.jsxs(ot,{children:[i.jsx(lt,{children:"Competence"}),i.jsx(ct,{children:i.jsx(nt,{placeholder:"Need to feel capable and effective",...N,rows:2})}),i.jsx(ut,{})]})}),i.jsx(dt,{control:p.control,name:"selfDeterminationNeeds.relatedness",render:({field:N})=>i.jsxs(ot,{children:[i.jsx(lt,{children:"Relatedness"}),i.jsx(ct,{children:i.jsx(nt,{placeholder:"Need for connection and belonging",...N,rows:2})}),i.jsx(ut,{})]})})]})]})]})]})}),i.jsx(rt,{children:i.jsx(bt,{className:"p-6",children:i.jsxs("div",{className:"space-y-4",children:[i.jsxs("div",{children:[i.jsx("h3",{className:"font-medium text-lg mb-3",children:"Fears & Concerns"}),(p.watch("fears")||[]).map((N,_)=>i.jsxs("div",{className:"flex items-center gap-2 mb-2",children:[i.jsx(Ot,{value:N,onChange:P=>m("fears",_,P.target.value),placeholder:"Enter a fear or concern"}),i.jsx(te,{variant:"ghost",size:"icon",type:"button",onClick:()=>y("fears",_),children:i.jsx(_n,{className:"h-4 w-4 text-muted-foreground"})})]},_)),i.jsxs(te,{variant:"outline",size:"sm",type:"button",onClick:()=>g("fears"),className:"mt-2",children:[i.jsx(pr,{className:"h-4 w-4 mr-2"}),"Add Fear/Concern"]})]}),i.jsx(dt,{control:p.control,name:"narrative",render:({field:N})=>i.jsxs(ot,{children:[i.jsx(lt,{children:"Personal Narrative"}),i.jsx(ct,{children:i.jsx(nt,{placeholder:"Personal story, background, key life experiences",...N,rows:4})}),i.jsx(fn,{children:"A brief narrative that captures their personal story"}),i.jsx(ut,{})]})}),i.jsx(dt,{control:p.control,name:"additionalInformation",render:({field:N})=>i.jsxs(ot,{children:[i.jsx(lt,{children:"Additional Information"}),i.jsx(ct,{children:i.jsx(nt,{placeholder:"Any other relevant details or context",...N,rows:4})}),i.jsx(fn,{children:"Additional context or details not covered elsewhere"}),i.jsx(ut,{})]})})]})})})]})]}),i.jsxs("div",{className:"flex justify-end space-x-2",children:[i.jsx(te,{variant:"outline",type:"button",onClick:()=>p.reset(),children:"Reset"}),i.jsxs(te,{type:"submit",disabled:s,children:[s?i.jsx(jW,{className:"mr-2 h-4 w-4 animate-spin"}):i.jsx(RS,{className:"mr-2 h-4 w-4"}),s?"Creating...":`Create ${n>1?`${n} Users`:"User"}`]})]})]})})]})}var Lw=["Enter"," "],wY=["ArrowDown","PageUp","Home"],QD=["ArrowUp","PageDown","End"],jY=[...wY,...QD],SY={ltr:[...Lw,"ArrowRight"],rtl:[...Lw,"ArrowLeft"]},NY={ltr:["ArrowLeft"],rtl:["ArrowRight"]},fp="Menu",[ih,_Y,PY]=Ey(fp),[Yl,JD]=Gr(fp,[PY,Gu,ed]),Ly=Gu(),e4=ed(),[AY,Zl]=Yl(fp),[CY,hp]=Yl(fp),t4=e=>{const{__scopeMenu:t,open:n=!1,children:r,dir:s,onOpenChange:a,modal:o=!0}=e,l=Ly(t),[c,u]=v.useState(null),d=v.useRef(!1),f=Hn(a),h=Xl(s);return v.useEffect(()=>{const p=()=>{d.current=!0,document.addEventListener("pointerdown",g,{capture:!0,once:!0}),document.addEventListener("pointermove",g,{capture:!0,once:!0})},g=()=>d.current=!1;return document.addEventListener("keydown",p,{capture:!0}),()=>{document.removeEventListener("keydown",p,{capture:!0}),document.removeEventListener("pointerdown",g,{capture:!0}),document.removeEventListener("pointermove",g,{capture:!0})}},[]),i.jsx(NM,{...l,children:i.jsx(AY,{scope:t,open:n,onOpenChange:f,content:c,onContentChange:u,children:i.jsx(CY,{scope:t,onClose:v.useCallback(()=>f(!1),[f]),isUsingKeyboardRef:d,dir:h,modal:o,children:r})})})};t4.displayName=fp;var EY="MenuAnchor",mN=v.forwardRef((e,t)=>{const{__scopeMenu:n,...r}=e,s=Ly(n);return i.jsx(wS,{...s,...r,ref:t})});mN.displayName=EY;var gN="MenuPortal",[OY,n4]=Yl(gN,{forceMount:void 0}),r4=e=>{const{__scopeMenu:t,forceMount:n,children:r,container:s}=e,a=Zl(gN,t);return i.jsx(OY,{scope:t,forceMount:n,children:i.jsx(lr,{present:n||a.open,children:i.jsx(cy,{asChild:!0,container:s,children:r})})})};r4.displayName=gN;var _s="MenuContent",[kY,vN]=Yl(_s),s4=v.forwardRef((e,t)=>{const n=n4(_s,e.__scopeMenu),{forceMount:r=n.forceMount,...s}=e,a=Zl(_s,e.__scopeMenu),o=hp(_s,e.__scopeMenu);return i.jsx(ih.Provider,{scope:e.__scopeMenu,children:i.jsx(lr,{present:r||a.open,children:i.jsx(ih.Slot,{scope:e.__scopeMenu,children:o.modal?i.jsx(TY,{...s,ref:t}):i.jsx($Y,{...s,ref:t})})})})}),TY=v.forwardRef((e,t)=>{const n=Zl(_s,e.__scopeMenu),r=v.useRef(null),s=xt(t,r);return v.useEffect(()=>{const a=r.current;if(a)return eN(a)},[]),i.jsx(yN,{...e,ref:s,trapFocus:n.open,disableOutsidePointerEvents:n.open,disableOutsideScroll:!0,onFocusOutside:Ee(e.onFocusOutside,a=>a.preventDefault(),{checkForDefaultPrevented:!1}),onDismiss:()=>n.onOpenChange(!1)})}),$Y=v.forwardRef((e,t)=>{const n=Zl(_s,e.__scopeMenu);return i.jsx(yN,{...e,ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,disableOutsideScroll:!1,onDismiss:()=>n.onOpenChange(!1)})}),yN=v.forwardRef((e,t)=>{const{__scopeMenu:n,loop:r=!1,trapFocus:s,onOpenAutoFocus:a,onCloseAutoFocus:o,disableOutsidePointerEvents:l,onEntryFocus:c,onEscapeKeyDown:u,onPointerDownOutside:d,onFocusOutside:f,onInteractOutside:h,onDismiss:p,disableOutsideScroll:g,...m}=e,y=Zl(_s,n),b=hp(_s,n),x=Ly(n),w=e4(n),j=_Y(n),[S,N]=v.useState(null),_=v.useRef(null),P=xt(t,_,y.onContentChange),k=v.useRef(0),O=v.useRef(""),M=v.useRef(0),A=v.useRef(null),$=v.useRef("right"),L=v.useRef(0),H=g?Ty:v.Fragment,D=g?{as:mi,allowPinchZoom:!0}:void 0,V=F=>{var ce,De;const q=O.current+F,Z=j().filter(de=>!de.disabled),re=document.activeElement,ge=(ce=Z.find(de=>de.ref.current===re))==null?void 0:ce.textValue,B=Z.map(de=>de.textValue),le=HY(B,q,ge),se=(De=Z.find(de=>de.textValue===le))==null?void 0:De.ref.current;(function de(be){O.current=be,window.clearTimeout(k.current),be!==""&&(k.current=window.setTimeout(()=>de(""),1e3))})(q),se&&setTimeout(()=>se.focus())};v.useEffect(()=>()=>window.clearTimeout(k.current),[]),JS();const T=v.useCallback(F=>{var Z,re;return $.current===((Z=A.current)==null?void 0:Z.side)&&qY(F,(re=A.current)==null?void 0:re.area)},[]);return i.jsx(kY,{scope:n,searchRef:O,onItemEnter:v.useCallback(F=>{T(F)&&F.preventDefault()},[T]),onItemLeave:v.useCallback(F=>{var q;T(F)||((q=_.current)==null||q.focus(),N(null))},[T]),onTriggerLeave:v.useCallback(F=>{T(F)&&F.preventDefault()},[T]),pointerGraceTimerRef:M,onPointerGraceIntentChange:v.useCallback(F=>{A.current=F},[]),children:i.jsx(H,{...D,children:i.jsx(Oy,{asChild:!0,trapped:s,onMountAutoFocus:Ee(a,F=>{var q;F.preventDefault(),(q=_.current)==null||q.focus({preventScroll:!0})}),onUnmountAutoFocus:o,children:i.jsx(Jh,{asChild:!0,disableOutsidePointerEvents:l,onEscapeKeyDown:u,onPointerDownOutside:d,onFocusOutside:f,onInteractOutside:h,onDismiss:p,children:i.jsx(dN,{asChild:!0,...w,dir:b.dir,orientation:"vertical",loop:r,currentTabStopId:S,onCurrentTabStopIdChange:N,onEntryFocus:Ee(c,F=>{b.isUsingKeyboardRef.current||F.preventDefault()}),preventScrollOnEntryFocus:!0,children:i.jsx(jS,{role:"menu","aria-orientation":"vertical","data-state":b4(y.open),"data-radix-menu-content":"",dir:b.dir,...x,...m,ref:P,style:{outline:"none",...m.style},onKeyDown:Ee(m.onKeyDown,F=>{const Z=F.target.closest("[data-radix-menu-content]")===F.currentTarget,re=F.ctrlKey||F.altKey||F.metaKey,ge=F.key.length===1;Z&&(F.key==="Tab"&&F.preventDefault(),!re&&ge&&V(F.key));const B=_.current;if(F.target!==B||!jY.includes(F.key))return;F.preventDefault();const se=j().filter(ce=>!ce.disabled).map(ce=>ce.ref.current);QD.includes(F.key)&&se.reverse(),VY(se)}),onBlur:Ee(e.onBlur,F=>{F.currentTarget.contains(F.target)||(window.clearTimeout(k.current),O.current="")}),onPointerMove:Ee(e.onPointerMove,oh(F=>{const q=F.target,Z=L.current!==F.clientX;if(F.currentTarget.contains(q)&&Z){const re=F.clientX>L.current?"right":"left";$.current=re,L.current=F.clientX}}))})})})})})})});s4.displayName=_s;var MY="MenuGroup",xN=v.forwardRef((e,t)=>{const{__scopeMenu:n,...r}=e;return i.jsx(Ye.div,{role:"group",...r,ref:t})});xN.displayName=MY;var IY="MenuLabel",a4=v.forwardRef((e,t)=>{const{__scopeMenu:n,...r}=e;return i.jsx(Ye.div,{...r,ref:t})});a4.displayName=IY;var Cg="MenuItem",PC="menu.itemSelect",Fy=v.forwardRef((e,t)=>{const{disabled:n=!1,onSelect:r,...s}=e,a=v.useRef(null),o=hp(Cg,e.__scopeMenu),l=vN(Cg,e.__scopeMenu),c=xt(t,a),u=v.useRef(!1),d=()=>{const f=a.current;if(!n&&f){const h=new CustomEvent(PC,{bubbles:!0,cancelable:!0});f.addEventListener(PC,p=>r==null?void 0:r(p),{once:!0}),rM(f,h),h.defaultPrevented?u.current=!1:o.onClose()}};return i.jsx(i4,{...s,ref:c,disabled:n,onClick:Ee(e.onClick,d),onPointerDown:f=>{var h;(h=e.onPointerDown)==null||h.call(e,f),u.current=!0},onPointerUp:Ee(e.onPointerUp,f=>{var h;u.current||(h=f.currentTarget)==null||h.click()}),onKeyDown:Ee(e.onKeyDown,f=>{const h=l.searchRef.current!=="";n||h&&f.key===" "||Lw.includes(f.key)&&(f.currentTarget.click(),f.preventDefault())})})});Fy.displayName=Cg;var i4=v.forwardRef((e,t)=>{const{__scopeMenu:n,disabled:r=!1,textValue:s,...a}=e,o=vN(Cg,n),l=e4(n),c=v.useRef(null),u=xt(t,c),[d,f]=v.useState(!1),[h,p]=v.useState("");return v.useEffect(()=>{const g=c.current;g&&p((g.textContent??"").trim())},[a.children]),i.jsx(ih.ItemSlot,{scope:n,disabled:r,textValue:s??h,children:i.jsx(fN,{asChild:!0,...l,focusable:!r,children:i.jsx(Ye.div,{role:"menuitem","data-highlighted":d?"":void 0,"aria-disabled":r||void 0,"data-disabled":r?"":void 0,...a,ref:u,onPointerMove:Ee(e.onPointerMove,oh(g=>{r?o.onItemLeave(g):(o.onItemEnter(g),g.defaultPrevented||g.currentTarget.focus({preventScroll:!0}))})),onPointerLeave:Ee(e.onPointerLeave,oh(g=>o.onItemLeave(g))),onFocus:Ee(e.onFocus,()=>f(!0)),onBlur:Ee(e.onBlur,()=>f(!1))})})})}),RY="MenuCheckboxItem",o4=v.forwardRef((e,t)=>{const{checked:n=!1,onCheckedChange:r,...s}=e;return i.jsx(f4,{scope:e.__scopeMenu,checked:n,children:i.jsx(Fy,{role:"menuitemcheckbox","aria-checked":Eg(n)?"mixed":n,...s,ref:t,"data-state":wN(n),onSelect:Ee(s.onSelect,()=>r==null?void 0:r(Eg(n)?!0:!n),{checkForDefaultPrevented:!1})})})});o4.displayName=RY;var l4="MenuRadioGroup",[DY,LY]=Yl(l4,{value:void 0,onValueChange:()=>{}}),c4=v.forwardRef((e,t)=>{const{value:n,onValueChange:r,...s}=e,a=Hn(r);return i.jsx(DY,{scope:e.__scopeMenu,value:n,onValueChange:a,children:i.jsx(xN,{...s,ref:t})})});c4.displayName=l4;var u4="MenuRadioItem",d4=v.forwardRef((e,t)=>{const{value:n,...r}=e,s=LY(u4,e.__scopeMenu),a=n===s.value;return i.jsx(f4,{scope:e.__scopeMenu,checked:a,children:i.jsx(Fy,{role:"menuitemradio","aria-checked":a,...r,ref:t,"data-state":wN(a),onSelect:Ee(r.onSelect,()=>{var o;return(o=s.onValueChange)==null?void 0:o.call(s,n)},{checkForDefaultPrevented:!1})})})});d4.displayName=u4;var bN="MenuItemIndicator",[f4,FY]=Yl(bN,{checked:!1}),h4=v.forwardRef((e,t)=>{const{__scopeMenu:n,forceMount:r,...s}=e,a=FY(bN,n);return i.jsx(lr,{present:r||Eg(a.checked)||a.checked===!0,children:i.jsx(Ye.span,{...s,ref:t,"data-state":wN(a.checked)})})});h4.displayName=bN;var BY="MenuSeparator",p4=v.forwardRef((e,t)=>{const{__scopeMenu:n,...r}=e;return i.jsx(Ye.div,{role:"separator","aria-orientation":"horizontal",...r,ref:t})});p4.displayName=BY;var zY="MenuArrow",m4=v.forwardRef((e,t)=>{const{__scopeMenu:n,...r}=e,s=Ly(n);return i.jsx(SS,{...s,...r,ref:t})});m4.displayName=zY;var UY="MenuSub",[kPe,g4]=Yl(UY),Yd="MenuSubTrigger",v4=v.forwardRef((e,t)=>{const n=Zl(Yd,e.__scopeMenu),r=hp(Yd,e.__scopeMenu),s=g4(Yd,e.__scopeMenu),a=vN(Yd,e.__scopeMenu),o=v.useRef(null),{pointerGraceTimerRef:l,onPointerGraceIntentChange:c}=a,u={__scopeMenu:e.__scopeMenu},d=v.useCallback(()=>{o.current&&window.clearTimeout(o.current),o.current=null},[]);return v.useEffect(()=>d,[d]),v.useEffect(()=>{const f=l.current;return()=>{window.clearTimeout(f),c(null)}},[l,c]),i.jsx(mN,{asChild:!0,...u,children:i.jsx(i4,{id:s.triggerId,"aria-haspopup":"menu","aria-expanded":n.open,"aria-controls":s.contentId,"data-state":b4(n.open),...e,ref:ay(t,s.onTriggerChange),onClick:f=>{var h;(h=e.onClick)==null||h.call(e,f),!(e.disabled||f.defaultPrevented)&&(f.currentTarget.focus(),n.open||n.onOpenChange(!0))},onPointerMove:Ee(e.onPointerMove,oh(f=>{a.onItemEnter(f),!f.defaultPrevented&&!e.disabled&&!n.open&&!o.current&&(a.onPointerGraceIntentChange(null),o.current=window.setTimeout(()=>{n.onOpenChange(!0),d()},100))})),onPointerLeave:Ee(e.onPointerLeave,oh(f=>{var p,g;d();const h=(p=n.content)==null?void 0:p.getBoundingClientRect();if(h){const m=(g=n.content)==null?void 0:g.dataset.side,y=m==="right",b=y?-5:5,x=h[y?"left":"right"],w=h[y?"right":"left"];a.onPointerGraceIntentChange({area:[{x:f.clientX+b,y:f.clientY},{x,y:h.top},{x:w,y:h.top},{x:w,y:h.bottom},{x,y:h.bottom}],side:m}),window.clearTimeout(l.current),l.current=window.setTimeout(()=>a.onPointerGraceIntentChange(null),300)}else{if(a.onTriggerLeave(f),f.defaultPrevented)return;a.onPointerGraceIntentChange(null)}})),onKeyDown:Ee(e.onKeyDown,f=>{var p;const h=a.searchRef.current!=="";e.disabled||h&&f.key===" "||SY[r.dir].includes(f.key)&&(n.onOpenChange(!0),(p=n.content)==null||p.focus(),f.preventDefault())})})})});v4.displayName=Yd;var y4="MenuSubContent",x4=v.forwardRef((e,t)=>{const n=n4(_s,e.__scopeMenu),{forceMount:r=n.forceMount,...s}=e,a=Zl(_s,e.__scopeMenu),o=hp(_s,e.__scopeMenu),l=g4(y4,e.__scopeMenu),c=v.useRef(null),u=xt(t,c);return i.jsx(ih.Provider,{scope:e.__scopeMenu,children:i.jsx(lr,{present:r||a.open,children:i.jsx(ih.Slot,{scope:e.__scopeMenu,children:i.jsx(yN,{id:l.contentId,"aria-labelledby":l.triggerId,...s,ref:u,align:"start",side:o.dir==="rtl"?"left":"right",disableOutsidePointerEvents:!1,disableOutsideScroll:!1,trapFocus:!1,onOpenAutoFocus:d=>{var f;o.isUsingKeyboardRef.current&&((f=c.current)==null||f.focus()),d.preventDefault()},onCloseAutoFocus:d=>d.preventDefault(),onFocusOutside:Ee(e.onFocusOutside,d=>{d.target!==l.trigger&&a.onOpenChange(!1)}),onEscapeKeyDown:Ee(e.onEscapeKeyDown,d=>{o.onClose(),d.preventDefault()}),onKeyDown:Ee(e.onKeyDown,d=>{var p;const f=d.currentTarget.contains(d.target),h=NY[o.dir].includes(d.key);f&&h&&(a.onOpenChange(!1),(p=l.trigger)==null||p.focus(),d.preventDefault())})})})})})});x4.displayName=y4;function b4(e){return e?"open":"closed"}function Eg(e){return e==="indeterminate"}function wN(e){return Eg(e)?"indeterminate":e?"checked":"unchecked"}function VY(e){const t=document.activeElement;for(const n of e)if(n===t||(n.focus(),document.activeElement!==t))return}function WY(e,t){return e.map((n,r)=>e[(t+r)%e.length])}function HY(e,t,n){const s=t.length>1&&Array.from(t).every(u=>u===t[0])?t[0]:t,a=n?e.indexOf(n):-1;let o=WY(e,Math.max(a,0));s.length===1&&(o=o.filter(u=>u!==n));const c=o.find(u=>u.toLowerCase().startsWith(s.toLowerCase()));return c!==n?c:void 0}function GY(e,t){const{x:n,y:r}=e;let s=!1;for(let a=0,o=t.length-1;ar!=d>r&&n<(u-l)*(r-c)/(d-c)+l&&(s=!s)}return s}function qY(e,t){if(!t)return!1;const n={x:e.clientX,y:e.clientY};return GY(n,t)}function oh(e){return t=>t.pointerType==="mouse"?e(t):void 0}var KY=t4,XY=mN,YY=r4,ZY=s4,QY=xN,JY=a4,eZ=Fy,tZ=o4,nZ=c4,rZ=d4,sZ=h4,aZ=p4,iZ=m4,oZ=v4,lZ=x4,jN="DropdownMenu",[cZ,TPe]=Gr(jN,[JD]),Mr=JD(),[uZ,w4]=cZ(jN),j4=e=>{const{__scopeDropdownMenu:t,children:n,dir:r,open:s,defaultOpen:a,onOpenChange:o,modal:l=!0}=e,c=Mr(t),u=v.useRef(null),[d=!1,f]=aa({prop:s,defaultProp:a,onChange:o});return i.jsx(uZ,{scope:t,triggerId:Ys(),triggerRef:u,contentId:Ys(),open:d,onOpenChange:f,onOpenToggle:v.useCallback(()=>f(h=>!h),[f]),modal:l,children:i.jsx(KY,{...c,open:d,onOpenChange:f,dir:r,modal:l,children:n})})};j4.displayName=jN;var S4="DropdownMenuTrigger",N4=v.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,disabled:r=!1,...s}=e,a=w4(S4,n),o=Mr(n);return i.jsx(XY,{asChild:!0,...o,children:i.jsx(Ye.button,{type:"button",id:a.triggerId,"aria-haspopup":"menu","aria-expanded":a.open,"aria-controls":a.open?a.contentId:void 0,"data-state":a.open?"open":"closed","data-disabled":r?"":void 0,disabled:r,...s,ref:ay(t,a.triggerRef),onPointerDown:Ee(e.onPointerDown,l=>{!r&&l.button===0&&l.ctrlKey===!1&&(a.onOpenToggle(),a.open||l.preventDefault())}),onKeyDown:Ee(e.onKeyDown,l=>{r||(["Enter"," "].includes(l.key)&&a.onOpenToggle(),l.key==="ArrowDown"&&a.onOpenChange(!0),["Enter"," ","ArrowDown"].includes(l.key)&&l.preventDefault())})})})});N4.displayName=S4;var dZ="DropdownMenuPortal",_4=e=>{const{__scopeDropdownMenu:t,...n}=e,r=Mr(t);return i.jsx(YY,{...r,...n})};_4.displayName=dZ;var P4="DropdownMenuContent",A4=v.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,s=w4(P4,n),a=Mr(n),o=v.useRef(!1);return i.jsx(ZY,{id:s.contentId,"aria-labelledby":s.triggerId,...a,...r,ref:t,onCloseAutoFocus:Ee(e.onCloseAutoFocus,l=>{var c;o.current||(c=s.triggerRef.current)==null||c.focus(),o.current=!1,l.preventDefault()}),onInteractOutside:Ee(e.onInteractOutside,l=>{const c=l.detail.originalEvent,u=c.button===0&&c.ctrlKey===!0,d=c.button===2||u;(!s.modal||d)&&(o.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)"}})});A4.displayName=P4;var fZ="DropdownMenuGroup",hZ=v.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,s=Mr(n);return i.jsx(QY,{...s,...r,ref:t})});hZ.displayName=fZ;var pZ="DropdownMenuLabel",C4=v.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,s=Mr(n);return i.jsx(JY,{...s,...r,ref:t})});C4.displayName=pZ;var mZ="DropdownMenuItem",E4=v.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,s=Mr(n);return i.jsx(eZ,{...s,...r,ref:t})});E4.displayName=mZ;var gZ="DropdownMenuCheckboxItem",O4=v.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,s=Mr(n);return i.jsx(tZ,{...s,...r,ref:t})});O4.displayName=gZ;var vZ="DropdownMenuRadioGroup",yZ=v.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,s=Mr(n);return i.jsx(nZ,{...s,...r,ref:t})});yZ.displayName=vZ;var xZ="DropdownMenuRadioItem",k4=v.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,s=Mr(n);return i.jsx(rZ,{...s,...r,ref:t})});k4.displayName=xZ;var bZ="DropdownMenuItemIndicator",T4=v.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,s=Mr(n);return i.jsx(sZ,{...s,...r,ref:t})});T4.displayName=bZ;var wZ="DropdownMenuSeparator",$4=v.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,s=Mr(n);return i.jsx(aZ,{...s,...r,ref:t})});$4.displayName=wZ;var jZ="DropdownMenuArrow",SZ=v.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,s=Mr(n);return i.jsx(iZ,{...s,...r,ref:t})});SZ.displayName=jZ;var NZ="DropdownMenuSubTrigger",M4=v.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,s=Mr(n);return i.jsx(oZ,{...s,...r,ref:t})});M4.displayName=NZ;var _Z="DropdownMenuSubContent",I4=v.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,s=Mr(n);return i.jsx(lZ,{...s,...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)"}})});I4.displayName=_Z;var PZ=j4,AZ=N4,CZ=_4,R4=A4,D4=C4,L4=E4,F4=O4,B4=k4,z4=T4,U4=$4,V4=M4,W4=I4;const Fw=PZ,Bw=AZ,EZ=v.forwardRef(({className:e,inset:t,children:n,...r},s)=>i.jsxs(V4,{ref:s,className:Me("flex cursor-default select-none items-center rounded-sm px-2 py-1.5 text-sm outline-none focus:bg-accent data-[state=open]:bg-accent",t&&"pl-8",e),...r,children:[n,i.jsx(zs,{className:"ml-auto h-4 w-4"})]}));EZ.displayName=V4.displayName;const OZ=v.forwardRef(({className:e,...t},n)=>i.jsx(W4,{ref:n,className:Me("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}));OZ.displayName=W4.displayName;const Og=v.forwardRef(({className:e,sideOffset:t=4,...n},r)=>i.jsx(CZ,{children:i.jsx(R4,{ref:r,sideOffset:t,className:Me("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})}));Og.displayName=R4.displayName;const Fi=v.forwardRef(({className:e,inset:t,...n},r)=>i.jsx(L4,{ref:r,className:Me("relative flex cursor-default select-none items-center 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",t&&"pl-8",e),...n}));Fi.displayName=L4.displayName;const kZ=v.forwardRef(({className:e,children:t,checked:n,...r},s)=>i.jsxs(F4,{ref:s,className:Me("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:[i.jsx("span",{className:"absolute left-2 flex h-3.5 w-3.5 items-center justify-center",children:i.jsx(z4,{children:i.jsx(Ta,{className:"h-4 w-4"})})}),t]}));kZ.displayName=F4.displayName;const TZ=v.forwardRef(({className:e,children:t,...n},r)=>i.jsxs(B4,{ref:r,className:Me("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:[i.jsx("span",{className:"absolute left-2 flex h-3.5 w-3.5 items-center justify-center",children:i.jsx(z4,{children:i.jsx(MS,{className:"h-2 w-2 fill-current"})})}),t]}));TZ.displayName=B4.displayName;const $Z=v.forwardRef(({className:e,inset:t,...n},r)=>i.jsx(D4,{ref:r,className:Me("px-2 py-1.5 text-sm font-semibold",t&&"pl-8",e),...n}));$Z.displayName=D4.displayName;const MZ=v.forwardRef(({className:e,...t},n)=>i.jsx(U4,{ref:n,className:Me("-mx-1 my-1 h-px bg-muted",e),...t}));MZ.displayName=U4.displayName;var SN="Dialog",[H4,G4]=Gr(SN),[IZ,ca]=H4(SN),q4=e=>{const{__scopeDialog:t,children:n,open:r,defaultOpen:s,onOpenChange:a,modal:o=!0}=e,l=v.useRef(null),c=v.useRef(null),[u=!1,d]=aa({prop:r,defaultProp:s,onChange:a});return i.jsx(IZ,{scope:t,triggerRef:l,contentRef:c,contentId:Ys(),titleId:Ys(),descriptionId:Ys(),open:u,onOpenChange:d,onOpenToggle:v.useCallback(()=>d(f=>!f),[d]),modal:o,children:n})};q4.displayName=SN;var K4="DialogTrigger",X4=v.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,s=ca(K4,n),a=xt(t,s.triggerRef);return i.jsx(Ye.button,{type:"button","aria-haspopup":"dialog","aria-expanded":s.open,"aria-controls":s.contentId,"data-state":PN(s.open),...r,ref:a,onClick:Ee(e.onClick,s.onOpenToggle)})});X4.displayName=K4;var NN="DialogPortal",[RZ,Y4]=H4(NN,{forceMount:void 0}),Z4=e=>{const{__scopeDialog:t,forceMount:n,children:r,container:s}=e,a=ca(NN,t);return i.jsx(RZ,{scope:t,forceMount:n,children:v.Children.map(r,o=>i.jsx(lr,{present:n||a.open,children:i.jsx(cy,{asChild:!0,container:s,children:o})}))})};Z4.displayName=NN;var kg="DialogOverlay",Q4=v.forwardRef((e,t)=>{const n=Y4(kg,e.__scopeDialog),{forceMount:r=n.forceMount,...s}=e,a=ca(kg,e.__scopeDialog);return a.modal?i.jsx(lr,{present:r||a.open,children:i.jsx(DZ,{...s,ref:t})}):null});Q4.displayName=kg;var DZ=v.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,s=ca(kg,n);return i.jsx(Ty,{as:mi,allowPinchZoom:!0,shards:[s.contentRef],children:i.jsx(Ye.div,{"data-state":PN(s.open),...r,ref:t,style:{pointerEvents:"auto",...r.style}})})}),Fl="DialogContent",J4=v.forwardRef((e,t)=>{const n=Y4(Fl,e.__scopeDialog),{forceMount:r=n.forceMount,...s}=e,a=ca(Fl,e.__scopeDialog);return i.jsx(lr,{present:r||a.open,children:a.modal?i.jsx(LZ,{...s,ref:t}):i.jsx(FZ,{...s,ref:t})})});J4.displayName=Fl;var LZ=v.forwardRef((e,t)=>{const n=ca(Fl,e.__scopeDialog),r=v.useRef(null),s=xt(t,n.contentRef,r);return v.useEffect(()=>{const a=r.current;if(a)return eN(a)},[]),i.jsx(eL,{...e,ref:s,trapFocus:n.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:Ee(e.onCloseAutoFocus,a=>{var o;a.preventDefault(),(o=n.triggerRef.current)==null||o.focus()}),onPointerDownOutside:Ee(e.onPointerDownOutside,a=>{const o=a.detail.originalEvent,l=o.button===0&&o.ctrlKey===!0;(o.button===2||l)&&a.preventDefault()}),onFocusOutside:Ee(e.onFocusOutside,a=>a.preventDefault())})}),FZ=v.forwardRef((e,t)=>{const n=ca(Fl,e.__scopeDialog),r=v.useRef(!1),s=v.useRef(!1);return i.jsx(eL,{...e,ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:a=>{var o,l;(o=e.onCloseAutoFocus)==null||o.call(e,a),a.defaultPrevented||(r.current||(l=n.triggerRef.current)==null||l.focus(),a.preventDefault()),r.current=!1,s.current=!1},onInteractOutside:a=>{var c,u;(c=e.onInteractOutside)==null||c.call(e,a),a.defaultPrevented||(r.current=!0,a.detail.originalEvent.type==="pointerdown"&&(s.current=!0));const o=a.target;((u=n.triggerRef.current)==null?void 0:u.contains(o))&&a.preventDefault(),a.detail.originalEvent.type==="focusin"&&s.current&&a.preventDefault()}})}),eL=v.forwardRef((e,t)=>{const{__scopeDialog:n,trapFocus:r,onOpenAutoFocus:s,onCloseAutoFocus:a,...o}=e,l=ca(Fl,n),c=v.useRef(null),u=xt(t,c);return JS(),i.jsxs(i.Fragment,{children:[i.jsx(Oy,{asChild:!0,loop:!0,trapped:r,onMountAutoFocus:s,onUnmountAutoFocus:a,children:i.jsx(Jh,{role:"dialog",id:l.contentId,"aria-describedby":l.descriptionId,"aria-labelledby":l.titleId,"data-state":PN(l.open),...o,ref:u,onDismiss:()=>l.onOpenChange(!1)})}),i.jsxs(i.Fragment,{children:[i.jsx(zZ,{titleId:l.titleId}),i.jsx(VZ,{contentRef:c,descriptionId:l.descriptionId})]})]})}),_N="DialogTitle",tL=v.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,s=ca(_N,n);return i.jsx(Ye.h2,{id:s.titleId,...r,ref:t})});tL.displayName=_N;var nL="DialogDescription",rL=v.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,s=ca(nL,n);return i.jsx(Ye.p,{id:s.descriptionId,...r,ref:t})});rL.displayName=nL;var sL="DialogClose",aL=v.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,s=ca(sL,n);return i.jsx(Ye.button,{type:"button",...r,ref:t,onClick:Ee(e.onClick,()=>s.onOpenChange(!1))})});aL.displayName=sL;function PN(e){return e?"open":"closed"}var iL="DialogTitleWarning",[BZ,oL]=dU(iL,{contentName:Fl,titleName:_N,docsSlug:"dialog"}),zZ=({titleId:e})=>{const t=oL(iL),n=`\`${t.contentName}\` requires a \`${t.titleName}\` for the component to be accessible for screen reader users. +`)},XK=0,oc=[];function YK(e){var t=v.useRef([]),n=v.useRef([0,0]),r=v.useRef(),s=v.useState(XK++)[0],a=v.useState(PR)[0],o=v.useRef(e);v.useEffect(function(){o.current=e},[e]),v.useEffect(function(){if(e.inert){document.body.classList.add("block-interactivity-".concat(s));var m=vK([e.lockRef.current],(e.shards||[]).map(OC),!0).filter(Boolean);return m.forEach(function(y){return y.classList.add("allow-interactivity-".concat(s))}),function(){document.body.classList.remove("block-interactivity-".concat(s)),m.forEach(function(y){return y.classList.remove("allow-interactivity-".concat(s))})}}},[e.inert,e.lockRef.current,e.shards]);var l=v.useCallback(function(m,y){if("touches"in m&&m.touches.length===2||m.type==="wheel"&&m.ctrlKey)return!o.current.allowPinchZoom;var b=Qp(m),x=n.current,w="deltaX"in m?m.deltaX:x[0]-b[0],j="deltaY"in m?m.deltaY:x[1]-b[1],S,N=m.target,_=Math.abs(w)>Math.abs(j)?"h":"v";if("touches"in m&&_==="h"&&N.type==="range")return!1;var P=CC(_,N);if(!P)return!0;if(P?S=_:(S=_==="v"?"h":"v",P=CC(_,N)),!P)return!1;if(!r.current&&"changedTouches"in m&&(w||j)&&(r.current=S),!S)return!0;var k=r.current||S;return HK(k,y,m,k==="h"?w:j,!0)},[]),c=v.useCallback(function(m){var y=m;if(!(!oc.length||oc[oc.length-1]!==a)){var b="deltaY"in y?EC(y):Qp(y),x=t.current.filter(function(S){return S.name===y.type&&(S.target===y.target||y.target===S.shadowParent)&&qK(S.delta,b)})[0];if(x&&x.should){y.cancelable&&y.preventDefault();return}if(!x){var w=(o.current.shards||[]).map(OC).filter(Boolean).filter(function(S){return S.contains(y.target)}),j=w.length>0?l(y,w[0]):!o.current.noIsolation;j&&y.cancelable&&y.preventDefault()}}},[]),u=v.useCallback(function(m,y,b,x){var w={name:m,delta:y,target:b,should:x,shadowParent:ZK(b)};t.current.push(w),setTimeout(function(){t.current=t.current.filter(function(j){return j!==w})},1)},[]),d=v.useCallback(function(m){n.current=Qp(m),r.current=void 0},[]),f=v.useCallback(function(m){u(m.type,EC(m),m.target,l(m,e.lockRef.current))},[]),h=v.useCallback(function(m){u(m.type,Qp(m),m.target,l(m,e.lockRef.current))},[]);v.useEffect(function(){return oc.push(a),e.setCallbacks({onScrollCapture:f,onWheelCapture:f,onTouchMoveCapture:h}),document.addEventListener("wheel",c,ic),document.addEventListener("touchmove",c,ic),document.addEventListener("touchstart",d,ic),function(){oc=oc.filter(function(m){return m!==a}),document.removeEventListener("wheel",c,ic),document.removeEventListener("touchmove",c,ic),document.removeEventListener("touchstart",d,ic)}},[]);var p=e.removeScrollBar,g=e.inert;return v.createElement(v.Fragment,null,g?v.createElement(a,{styles:KK(s)}):null,p?v.createElement(FK,{gapMode:e.gapMode}):null)}function ZK(e){for(var t=null;e!==null;)e instanceof ShadowRoot&&(t=e.host,e=e.host),e=e.parentNode;return t}const QK=PK(_R,YK);var My=v.forwardRef(function(e,t){return v.createElement($y,wa({},e,{ref:t,sideCar:QK}))});My.classNames=$y.classNames;var JK=[" ","Enter","ArrowUp","ArrowDown"],eX=[" ","Enter"],lp="Select",[Iy,Ry,tX]=ky(lp),[Qu,TPe]=Hr(lp,[tX,Hu]),Dy=Hu(),[nX,Do]=Qu(lp),[rX,sX]=Qu(lp),OR=e=>{const{__scopeSelect:t,children:n,open:r,defaultOpen:s,onOpenChange:a,value:o,defaultValue:l,onValueChange:c,dir:u,name:d,autoComplete:f,disabled:h,required:p,form:g}=e,m=Dy(t),[y,b]=v.useState(null),[x,w]=v.useState(null),[j,S]=v.useState(!1),N=Xl(u),[_=!1,P]=aa({prop:r,defaultProp:s,onChange:a}),[k,O]=aa({prop:o,defaultProp:l,onChange:c}),M=v.useRef(null),A=y?g||!!y.closest("form"):!0,[$,L]=v.useState(new Set),G=Array.from($).map(D=>D.props.value).join(";");return i.jsx(EM,{...m,children:i.jsxs(nX,{required:p,scope:t,trigger:y,onTriggerChange:b,valueNode:x,onValueNodeChange:w,valueNodeHasChildren:j,onValueNodeHasChildrenChange:S,contentId:Ys(),value:k,onValueChange:O,open:_,onOpenChange:P,dir:N,triggerPointerDownPosRef:M,disabled:h,children:[i.jsx(Iy.Provider,{scope:t,children:i.jsx(rX,{scope:e.__scopeSelect,onNativeOptionAdd:v.useCallback(D=>{L(V=>new Set(V).add(D))},[]),onNativeOptionRemove:v.useCallback(D=>{L(V=>{const T=new Set(V);return T.delete(D),T})},[]),children:n})}),A?i.jsxs(tD,{"aria-hidden":!0,required:p,tabIndex:-1,name:d,autoComplete:f,value:k,onChange:D=>O(D.target.value),disabled:h,form:g,children:[k===void 0?i.jsx("option",{value:""}):null,Array.from($)]},G):null]})})};OR.displayName=lp;var kR="SelectTrigger",TR=v.forwardRef((e,t)=>{const{__scopeSelect:n,disabled:r=!1,...s}=e,a=Dy(n),o=Do(kR,n),l=o.disabled||r,c=xt(t,o.onTriggerChange),u=Ry(n),d=v.useRef("touch"),[f,h,p]=nD(m=>{const y=u().filter(w=>!w.disabled),b=y.find(w=>w.value===o.value),x=rD(y,m,b);x!==void 0&&o.onValueChange(x.value)}),g=m=>{l||(o.onOpenChange(!0),p()),m&&(o.triggerPointerDownPosRef.current={x:Math.round(m.pageX),y:Math.round(m.pageY)})};return i.jsx(_S,{asChild:!0,...a,children:i.jsx(Ye.button,{type:"button",role:"combobox","aria-controls":o.contentId,"aria-expanded":o.open,"aria-required":o.required,"aria-autocomplete":"none",dir:o.dir,"data-state":o.open?"open":"closed",disabled:l,"data-disabled":l?"":void 0,"data-placeholder":eD(o.value)?"":void 0,...s,ref:c,onClick:Ee(s.onClick,m=>{m.currentTarget.focus(),d.current!=="mouse"&&g(m)}),onPointerDown:Ee(s.onPointerDown,m=>{d.current=m.pointerType;const y=m.target;y.hasPointerCapture(m.pointerId)&&y.releasePointerCapture(m.pointerId),m.button===0&&m.ctrlKey===!1&&m.pointerType==="mouse"&&(g(m),m.preventDefault())}),onKeyDown:Ee(s.onKeyDown,m=>{const y=f.current!=="";!(m.ctrlKey||m.altKey||m.metaKey)&&m.key.length===1&&h(m.key),!(y&&m.key===" ")&&JK.includes(m.key)&&(g(),m.preventDefault())})})})});TR.displayName=kR;var $R="SelectValue",MR=v.forwardRef((e,t)=>{const{__scopeSelect:n,className:r,style:s,children:a,placeholder:o="",...l}=e,c=Do($R,n),{onValueNodeHasChildrenChange:u}=c,d=a!==void 0,f=xt(t,c.onValueNodeChange);return or(()=>{u(d)},[u,d]),i.jsx(Ye.span,{...l,ref:f,style:{pointerEvents:"none"},children:eD(c.value)?i.jsx(i.Fragment,{children:o}):a})});MR.displayName=$R;var aX="SelectIcon",IR=v.forwardRef((e,t)=>{const{__scopeSelect:n,children:r,...s}=e;return i.jsx(Ye.span,{"aria-hidden":!0,...s,ref:t,children:r||"▼"})});IR.displayName=aX;var iX="SelectPortal",RR=e=>i.jsx(dy,{asChild:!0,...e});RR.displayName=iX;var Ll="SelectContent",DR=v.forwardRef((e,t)=>{const n=Do(Ll,e.__scopeSelect),[r,s]=v.useState();if(or(()=>{s(new DocumentFragment)},[]),!n.open){const a=r;return a?Vu.createPortal(i.jsx(LR,{scope:e.__scopeSelect,children:i.jsx(Iy.Slot,{scope:e.__scopeSelect,children:i.jsx("div",{children:e.children})})}),a):null}return i.jsx(FR,{...e,ref:t})});DR.displayName=Ll;var Ds=10,[LR,Lo]=Qu(Ll),oX="SelectContentImpl",FR=v.forwardRef((e,t)=>{const{__scopeSelect:n,position:r="item-aligned",onCloseAutoFocus:s,onEscapeKeyDown:a,onPointerDownOutside:o,side:l,sideOffset:c,align:u,alignOffset:d,arrowPadding:f,collisionBoundary:h,collisionPadding:p,sticky:g,hideWhenDetached:m,avoidCollisions:y,...b}=e,x=Do(Ll,n),[w,j]=v.useState(null),[S,N]=v.useState(null),_=xt(t,ce=>j(ce)),[P,k]=v.useState(null),[O,M]=v.useState(null),A=Ry(n),[$,L]=v.useState(!1),G=v.useRef(!1);v.useEffect(()=>{if(w)return aN(w)},[w]),sN();const D=v.useCallback(ce=>{const[De,...de]=A().map(ne=>ne.ref.current),[be]=de.slice(-1),Pe=document.activeElement;for(const ne of ce)if(ne===Pe||(ne==null||ne.scrollIntoView({block:"nearest"}),ne===De&&S&&(S.scrollTop=0),ne===be&&S&&(S.scrollTop=S.scrollHeight),ne==null||ne.focus(),document.activeElement!==Pe))return},[A,S]),V=v.useCallback(()=>D([P,w]),[D,P,w]);v.useEffect(()=>{$&&V()},[$,V]);const{onOpenChange:T,triggerPointerDownPosRef:F}=x;v.useEffect(()=>{if(w){let ce={x:0,y:0};const De=be=>{var Pe,ne;ce={x:Math.abs(Math.round(be.pageX)-(((Pe=F.current)==null?void 0:Pe.x)??0)),y:Math.abs(Math.round(be.pageY)-(((ne=F.current)==null?void 0:ne.y)??0))}},de=be=>{ce.x<=10&&ce.y<=10?be.preventDefault():w.contains(be.target)||T(!1),document.removeEventListener("pointermove",De),F.current=null};return F.current!==null&&(document.addEventListener("pointermove",De),document.addEventListener("pointerup",de,{capture:!0,once:!0})),()=>{document.removeEventListener("pointermove",De),document.removeEventListener("pointerup",de,{capture:!0})}}},[w,T,F]),v.useEffect(()=>{const ce=()=>T(!1);return window.addEventListener("blur",ce),window.addEventListener("resize",ce),()=>{window.removeEventListener("blur",ce),window.removeEventListener("resize",ce)}},[T]);const[q,Z]=nD(ce=>{const De=A().filter(Pe=>!Pe.disabled),de=De.find(Pe=>Pe.ref.current===document.activeElement),be=rD(De,ce,de);be&&setTimeout(()=>be.ref.current.focus())}),re=v.useCallback((ce,De,de)=>{const be=!G.current&&!de;(x.value!==void 0&&x.value===De||be)&&(k(ce),be&&(G.current=!0))},[x.value]),ge=v.useCallback(()=>w==null?void 0:w.focus(),[w]),B=v.useCallback((ce,De,de)=>{const be=!G.current&&!de;(x.value!==void 0&&x.value===De||be)&&M(ce)},[x.value]),le=r==="popper"?kw:BR,se=le===kw?{side:l,sideOffset:c,align:u,alignOffset:d,arrowPadding:f,collisionBoundary:h,collisionPadding:p,sticky:g,hideWhenDetached:m,avoidCollisions:y}:{};return i.jsx(LR,{scope:n,content:w,viewport:S,onViewportChange:N,itemRefCallback:re,selectedItem:P,onItemLeave:ge,itemTextRefCallback:B,focusSelectedItem:V,selectedItemText:O,position:r,isPositioned:$,searchRef:q,children:i.jsx(My,{as:ka,allowPinchZoom:!0,children:i.jsx(Ty,{asChild:!0,trapped:x.open,onMountAutoFocus:ce=>{ce.preventDefault()},onUnmountAutoFocus:Ee(s,ce=>{var De;(De=x.trigger)==null||De.focus({preventScroll:!0}),ce.preventDefault()}),children:i.jsx(ep,{asChild:!0,disableOutsidePointerEvents:!0,onEscapeKeyDown:a,onPointerDownOutside:o,onFocusOutside:ce=>ce.preventDefault(),onDismiss:()=>x.onOpenChange(!1),children:i.jsx(le,{role:"listbox",id:x.contentId,"data-state":x.open?"open":"closed",dir:x.dir,onContextMenu:ce=>ce.preventDefault(),...b,...se,onPlaced:()=>L(!0),ref:_,style:{display:"flex",flexDirection:"column",outline:"none",...b.style},onKeyDown:Ee(b.onKeyDown,ce=>{const De=ce.ctrlKey||ce.altKey||ce.metaKey;if(ce.key==="Tab"&&ce.preventDefault(),!De&&ce.key.length===1&&Z(ce.key),["ArrowUp","ArrowDown","Home","End"].includes(ce.key)){let be=A().filter(Pe=>!Pe.disabled).map(Pe=>Pe.ref.current);if(["ArrowUp","End"].includes(ce.key)&&(be=be.slice().reverse()),["ArrowUp","ArrowDown"].includes(ce.key)){const Pe=ce.target,ne=be.indexOf(Pe);be=be.slice(ne+1)}setTimeout(()=>D(be)),ce.preventDefault()}})})})})})})});FR.displayName=oX;var lX="SelectItemAlignedPosition",BR=v.forwardRef((e,t)=>{const{__scopeSelect:n,onPlaced:r,...s}=e,a=Do(Ll,n),o=Lo(Ll,n),[l,c]=v.useState(null),[u,d]=v.useState(null),f=xt(t,_=>d(_)),h=Ry(n),p=v.useRef(!1),g=v.useRef(!0),{viewport:m,selectedItem:y,selectedItemText:b,focusSelectedItem:x}=o,w=v.useCallback(()=>{if(a.trigger&&a.valueNode&&l&&u&&m&&y&&b){const _=a.trigger.getBoundingClientRect(),P=u.getBoundingClientRect(),k=a.valueNode.getBoundingClientRect(),O=b.getBoundingClientRect();if(a.dir!=="rtl"){const Pe=O.left-P.left,ne=k.left-Pe,Je=_.left-ne,ve=_.width+Je,at=Math.max(ve,P.width),st=window.innerWidth-Ds,Mt=ah(ne,[Ds,Math.max(Ds,st-at)]);l.style.minWidth=ve+"px",l.style.left=Mt+"px"}else{const Pe=P.right-O.right,ne=window.innerWidth-k.right-Pe,Je=window.innerWidth-_.right-ne,ve=_.width+Je,at=Math.max(ve,P.width),st=window.innerWidth-Ds,Mt=ah(ne,[Ds,Math.max(Ds,st-at)]);l.style.minWidth=ve+"px",l.style.right=Mt+"px"}const M=h(),A=window.innerHeight-Ds*2,$=m.scrollHeight,L=window.getComputedStyle(u),G=parseInt(L.borderTopWidth,10),D=parseInt(L.paddingTop,10),V=parseInt(L.borderBottomWidth,10),T=parseInt(L.paddingBottom,10),F=G+D+$+T+V,q=Math.min(y.offsetHeight*5,F),Z=window.getComputedStyle(m),re=parseInt(Z.paddingTop,10),ge=parseInt(Z.paddingBottom,10),B=_.top+_.height/2-Ds,le=A-B,se=y.offsetHeight/2,ce=y.offsetTop+se,De=G+D+ce,de=F-De;if(De<=B){const Pe=M.length>0&&y===M[M.length-1].ref.current;l.style.bottom="0px";const ne=u.clientHeight-m.offsetTop-m.offsetHeight,Je=Math.max(le,se+(Pe?ge:0)+ne+V),ve=De+Je;l.style.height=ve+"px"}else{const Pe=M.length>0&&y===M[0].ref.current;l.style.top="0px";const Je=Math.max(B,G+m.offsetTop+(Pe?re:0)+se)+de;l.style.height=Je+"px",m.scrollTop=De-B+m.offsetTop}l.style.margin=`${Ds}px 0`,l.style.minHeight=q+"px",l.style.maxHeight=A+"px",r==null||r(),requestAnimationFrame(()=>p.current=!0)}},[h,a.trigger,a.valueNode,l,u,m,y,b,a.dir,r]);or(()=>w(),[w]);const[j,S]=v.useState();or(()=>{u&&S(window.getComputedStyle(u).zIndex)},[u]);const N=v.useCallback(_=>{_&&g.current===!0&&(w(),x==null||x(),g.current=!1)},[w,x]);return i.jsx(uX,{scope:n,contentWrapper:l,shouldExpandOnScrollRef:p,onScrollButtonChange:N,children:i.jsx("div",{ref:c,style:{display:"flex",flexDirection:"column",position:"fixed",zIndex:j},children:i.jsx(Ye.div,{...s,ref:f,style:{boxSizing:"border-box",maxHeight:"100%",...s.style}})})})});BR.displayName=lX;var cX="SelectPopperPosition",kw=v.forwardRef((e,t)=>{const{__scopeSelect:n,align:r="start",collisionPadding:s=Ds,...a}=e,o=Dy(n);return i.jsx(PS,{...o,...a,ref:t,align:r,collisionPadding:s,style:{boxSizing:"border-box",...a.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)"}})});kw.displayName=cX;var[uX,iN]=Qu(Ll,{}),Tw="SelectViewport",zR=v.forwardRef((e,t)=>{const{__scopeSelect:n,nonce:r,...s}=e,a=Lo(Tw,n),o=iN(Tw,n),l=xt(t,a.onViewportChange),c=v.useRef(0);return i.jsxs(i.Fragment,{children:[i.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}),i.jsx(Iy.Slot,{scope:n,children:i.jsx(Ye.div,{"data-radix-select-viewport":"",role:"presentation",...s,ref:l,style:{position:"relative",flex:1,overflow:"hidden auto",...s.style},onScroll:Ee(s.onScroll,u=>{const d=u.currentTarget,{contentWrapper:f,shouldExpandOnScrollRef:h}=o;if(h!=null&&h.current&&f){const p=Math.abs(c.current-d.scrollTop);if(p>0){const g=window.innerHeight-Ds*2,m=parseFloat(f.style.minHeight),y=parseFloat(f.style.height),b=Math.max(m,y);if(b0?j:0,f.style.justifyContent="flex-end")}}}c.current=d.scrollTop})})})]})});zR.displayName=Tw;var UR="SelectGroup",[dX,fX]=Qu(UR),hX=v.forwardRef((e,t)=>{const{__scopeSelect:n,...r}=e,s=Ys();return i.jsx(dX,{scope:n,id:s,children:i.jsx(Ye.div,{role:"group","aria-labelledby":s,...r,ref:t})})});hX.displayName=UR;var VR="SelectLabel",WR=v.forwardRef((e,t)=>{const{__scopeSelect:n,...r}=e,s=fX(VR,n);return i.jsx(Ye.div,{id:s.id,...r,ref:t})});WR.displayName=VR;var Eg="SelectItem",[pX,GR]=Qu(Eg),HR=v.forwardRef((e,t)=>{const{__scopeSelect:n,value:r,disabled:s=!1,textValue:a,...o}=e,l=Do(Eg,n),c=Lo(Eg,n),u=l.value===r,[d,f]=v.useState(a??""),[h,p]=v.useState(!1),g=xt(t,x=>{var w;return(w=c.itemRefCallback)==null?void 0:w.call(c,x,r,s)}),m=Ys(),y=v.useRef("touch"),b=()=>{s||(l.onValueChange(r),l.onOpenChange(!1))};if(r==="")throw new Error("A 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 i.jsx(pX,{scope:n,value:r,disabled:s,textId:m,isSelected:u,onItemTextChange:v.useCallback(x=>{f(w=>w||((x==null?void 0:x.textContent)??"").trim())},[]),children:i.jsx(Iy.ItemSlot,{scope:n,value:r,disabled:s,textValue:d,children:i.jsx(Ye.div,{role:"option","aria-labelledby":m,"data-highlighted":h?"":void 0,"aria-selected":u&&h,"data-state":u?"checked":"unchecked","aria-disabled":s||void 0,"data-disabled":s?"":void 0,tabIndex:s?void 0:-1,...o,ref:g,onFocus:Ee(o.onFocus,()=>p(!0)),onBlur:Ee(o.onBlur,()=>p(!1)),onClick:Ee(o.onClick,()=>{y.current!=="mouse"&&b()}),onPointerUp:Ee(o.onPointerUp,()=>{y.current==="mouse"&&b()}),onPointerDown:Ee(o.onPointerDown,x=>{y.current=x.pointerType}),onPointerMove:Ee(o.onPointerMove,x=>{var w;y.current=x.pointerType,s?(w=c.onItemLeave)==null||w.call(c):y.current==="mouse"&&x.currentTarget.focus({preventScroll:!0})}),onPointerLeave:Ee(o.onPointerLeave,x=>{var w;x.currentTarget===document.activeElement&&((w=c.onItemLeave)==null||w.call(c))}),onKeyDown:Ee(o.onKeyDown,x=>{var j;((j=c.searchRef)==null?void 0:j.current)!==""&&x.key===" "||(eX.includes(x.key)&&b(),x.key===" "&&x.preventDefault())})})})})});HR.displayName=Eg;var Xd="SelectItemText",qR=v.forwardRef((e,t)=>{const{__scopeSelect:n,className:r,style:s,...a}=e,o=Do(Xd,n),l=Lo(Xd,n),c=GR(Xd,n),u=sX(Xd,n),[d,f]=v.useState(null),h=xt(t,b=>f(b),c.onItemTextChange,b=>{var x;return(x=l.itemTextRefCallback)==null?void 0:x.call(l,b,c.value,c.disabled)}),p=d==null?void 0:d.textContent,g=v.useMemo(()=>i.jsx("option",{value:c.value,disabled:c.disabled,children:p},c.value),[c.disabled,c.value,p]),{onNativeOptionAdd:m,onNativeOptionRemove:y}=u;return or(()=>(m(g),()=>y(g)),[m,y,g]),i.jsxs(i.Fragment,{children:[i.jsx(Ye.span,{id:c.textId,...a,ref:h}),c.isSelected&&o.valueNode&&!o.valueNodeHasChildren?Vu.createPortal(a.children,o.valueNode):null]})});qR.displayName=Xd;var KR="SelectItemIndicator",XR=v.forwardRef((e,t)=>{const{__scopeSelect:n,...r}=e;return GR(KR,n).isSelected?i.jsx(Ye.span,{"aria-hidden":!0,...r,ref:t}):null});XR.displayName=KR;var $w="SelectScrollUpButton",YR=v.forwardRef((e,t)=>{const n=Lo($w,e.__scopeSelect),r=iN($w,e.__scopeSelect),[s,a]=v.useState(!1),o=xt(t,r.onScrollButtonChange);return or(()=>{if(n.viewport&&n.isPositioned){let l=function(){const u=c.scrollTop>0;a(u)};const c=n.viewport;return l(),c.addEventListener("scroll",l),()=>c.removeEventListener("scroll",l)}},[n.viewport,n.isPositioned]),s?i.jsx(QR,{...e,ref:o,onAutoScroll:()=>{const{viewport:l,selectedItem:c}=n;l&&c&&(l.scrollTop=l.scrollTop-c.offsetHeight)}}):null});YR.displayName=$w;var Mw="SelectScrollDownButton",ZR=v.forwardRef((e,t)=>{const n=Lo(Mw,e.__scopeSelect),r=iN(Mw,e.__scopeSelect),[s,a]=v.useState(!1),o=xt(t,r.onScrollButtonChange);return or(()=>{if(n.viewport&&n.isPositioned){let l=function(){const u=c.scrollHeight-c.clientHeight,d=Math.ceil(c.scrollTop)c.removeEventListener("scroll",l)}},[n.viewport,n.isPositioned]),s?i.jsx(QR,{...e,ref:o,onAutoScroll:()=>{const{viewport:l,selectedItem:c}=n;l&&c&&(l.scrollTop=l.scrollTop+c.offsetHeight)}}):null});ZR.displayName=Mw;var QR=v.forwardRef((e,t)=>{const{__scopeSelect:n,onAutoScroll:r,...s}=e,a=Lo("SelectScrollButton",n),o=v.useRef(null),l=Ry(n),c=v.useCallback(()=>{o.current!==null&&(window.clearInterval(o.current),o.current=null)},[]);return v.useEffect(()=>()=>c(),[c]),or(()=>{var d;const u=l().find(f=>f.ref.current===document.activeElement);(d=u==null?void 0:u.ref.current)==null||d.scrollIntoView({block:"nearest"})},[l]),i.jsx(Ye.div,{"aria-hidden":!0,...s,ref:t,style:{flexShrink:0,...s.style},onPointerDown:Ee(s.onPointerDown,()=>{o.current===null&&(o.current=window.setInterval(r,50))}),onPointerMove:Ee(s.onPointerMove,()=>{var u;(u=a.onItemLeave)==null||u.call(a),o.current===null&&(o.current=window.setInterval(r,50))}),onPointerLeave:Ee(s.onPointerLeave,()=>{c()})})}),mX="SelectSeparator",JR=v.forwardRef((e,t)=>{const{__scopeSelect:n,...r}=e;return i.jsx(Ye.div,{"aria-hidden":!0,...r,ref:t})});JR.displayName=mX;var Iw="SelectArrow",gX=v.forwardRef((e,t)=>{const{__scopeSelect:n,...r}=e,s=Dy(n),a=Do(Iw,n),o=Lo(Iw,n);return a.open&&o.position==="popper"?i.jsx(AS,{...s,...r,ref:t}):null});gX.displayName=Iw;function eD(e){return e===""||e===void 0}var tD=v.forwardRef((e,t)=>{const{value:n,...r}=e,s=v.useRef(null),a=xt(t,s),o=op(n);return v.useEffect(()=>{const l=s.current,c=window.HTMLSelectElement.prototype,d=Object.getOwnPropertyDescriptor(c,"value").set;if(o!==n&&d){const f=new Event("change",{bubbles:!0});d.call(l,n),l.dispatchEvent(f)}},[o,n]),i.jsx(CS,{asChild:!0,children:i.jsx("select",{...r,ref:a,defaultValue:n})})});tD.displayName="BubbleSelect";function nD(e){const t=Gn(e),n=v.useRef(""),r=v.useRef(0),s=v.useCallback(o=>{const l=n.current+o;t(l),function c(u){n.current=u,window.clearTimeout(r.current),u!==""&&(r.current=window.setTimeout(()=>c(""),1e3))}(l)},[t]),a=v.useCallback(()=>{n.current="",window.clearTimeout(r.current)},[]);return v.useEffect(()=>()=>window.clearTimeout(r.current),[]),[n,s,a]}function rD(e,t,n){const s=t.length>1&&Array.from(t).every(u=>u===t[0])?t[0]:t,a=n?e.indexOf(n):-1;let o=vX(e,Math.max(a,0));s.length===1&&(o=o.filter(u=>u!==n));const c=o.find(u=>u.textValue.toLowerCase().startsWith(s.toLowerCase()));return c!==n?c:void 0}function vX(e,t){return e.map((n,r)=>e[(t+r)%e.length])}var yX=OR,sD=TR,xX=MR,bX=IR,wX=RR,aD=DR,jX=zR,iD=WR,oD=HR,SX=qR,NX=XR,lD=YR,cD=ZR,uD=JR;const Mn=yX,In=xX,Pn=v.forwardRef(({className:e,children:t,...n},r)=>i.jsxs(sD,{ref:r,className:Oe("flex h-10 w-full items-center justify-between rounded-md border border-input bg-background px-3 py-2 text-sm ring-offset-background placeholder:text-muted-foreground focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50 [&>span]:line-clamp-1",e),...n,children:[t,i.jsx(bX,{asChild:!0,children:i.jsx(xi,{className:"h-4 w-4 opacity-50"})})]}));Pn.displayName=sD.displayName;const dD=v.forwardRef(({className:e,...t},n)=>i.jsx(lD,{ref:n,className:Oe("flex cursor-default items-center justify-center py-1",e),...t,children:i.jsx(Tl,{className:"h-4 w-4"})}));dD.displayName=lD.displayName;const fD=v.forwardRef(({className:e,...t},n)=>i.jsx(cD,{ref:n,className:Oe("flex cursor-default items-center justify-center py-1",e),...t,children:i.jsx(xi,{className:"h-4 w-4"})}));fD.displayName=cD.displayName;const An=v.forwardRef(({className:e,children:t,position:n="popper",...r},s)=>i.jsx(wX,{children:i.jsxs(aD,{ref:s,className:Oe("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:[i.jsx(dD,{}),i.jsx(jX,{className:Oe("p-1",n==="popper"&&"h-[var(--radix-select-trigger-height)] w-full min-w-[var(--radix-select-trigger-width)]"),children:t}),i.jsx(fD,{})]})}));An.displayName=aD.displayName;const _X=v.forwardRef(({className:e,...t},n)=>i.jsx(iD,{ref:n,className:Oe("py-1.5 pl-8 pr-2 text-sm font-semibold",e),...t}));_X.displayName=iD.displayName;const fe=v.forwardRef(({className:e,children:t,...n},r)=>i.jsxs(oD,{ref:r,className:Oe("relative flex w-full cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",e),...n,children:[i.jsx("span",{className:"absolute left-2 flex h-3.5 w-3.5 items-center justify-center",children:i.jsx(NX,{children:i.jsx($a,{className:"h-4 w-4"})})}),i.jsx(SX,{children:t})]}));fe.displayName=oD.displayName;const PX=v.forwardRef(({className:e,...t},n)=>i.jsx(uD,{ref:n,className:Oe("-mx-1 my-1 h-px bg-muted",e),...t}));PX.displayName=uD.displayName;const AX=$e.object({audienceBrief:$e.string().min(10,{message:"Audience brief must be at least 10 characters."}),researchObjective:$e.string().optional(),personaCount:$e.string().min(1,{message:"Number of personas is required."}),dataFile:$e.instanceof(FileList).optional(),llm_model:$e.string().optional()});function CX({onSubmit:e,isGenerating:t}){const[n,r]=v.useState(!1),[s,a]=v.useState(!1),[o,l]=v.useState({audience_brief:[],research_objective:[]}),[c,u]=v.useState(!1),[d,f]=v.useState(null),h=Py({resolver:Ay(AX),defaultValues:{audienceBrief:"",researchObjective:"",personaCount:"5",llm_model:"gemini-2.5-pro"}}),p=h.watch("audienceBrief"),g=h.watch("researchObjective"),m=async()=>{var w,j,S,N,_,P,k,O,M,A,$;const b=p==null?void 0:p.trim(),x=g==null?void 0:g.trim();if(!b||b.length<10){oe.error("Audience brief too short",{description:"Please enter at least 10 characters in the audience brief"});return}if(!x||x.length<10){oe.error("Research objective too short",{description:"Please enter at least 10 characters in the research objective"});return}u(!0),f(null);try{const L=await Xa.enhanceAudienceBrief(b,x);l(L.data.suggestions||{audience_brief:[],research_objective:[]}),r(!0),a(!1);const G=(((j=(w=L.data.suggestions)==null?void 0:w.audience_brief)==null?void 0:j.length)||0)+(((N=(S=L.data.suggestions)==null?void 0:S.research_objective)==null?void 0:N.length)||0);oe.success("Enhancement suggestions generated",{description:`Generated ${G} suggestions to improve your research inputs`})}catch(L){console.error("Error enhancing audience brief:",L);let G="Please try again or modify your brief",D="Failed to generate suggestions";if(L&&typeof L=="object"){const V=L;V.code==="ECONNABORTED"||(_=V.message)!=null&&_.includes("timeout")?(D="Request timeout",G="The AI took too long to analyze your brief. Please try again."):((P=V.response)==null?void 0:P.status)===500?(D="Server error",G=((O=(k=V.response)==null?void 0:k.data)==null?void 0:O.message)||"The server encountered an error. Please try again later."):((M=V.response)==null?void 0:M.status)===400?(D="Invalid brief",G=(($=(A=V.response)==null?void 0:A.data)==null?void 0:$.message)||"Please check your audience brief and try again."):V.message&&(G=V.message)}else L instanceof Error&&(G=L.message);f(G),oe.error(D,{description:G,duration:5e3})}finally{u(!1)}},y=()=>{a(!s)};return i.jsx(Ey,{...h,children:i.jsxs("form",{onSubmit:h.handleSubmit(e),className:"space-y-6",children:[i.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-6",children:[i.jsxs("div",{className:"space-y-6",children:[i.jsx(dt,{control:h.control,name:"audienceBrief",render:({field:b})=>i.jsxs(ot,{children:[i.jsx(lt,{children:"Audience Brief"}),i.jsx(ct,{children:i.jsx(nt,{placeholder:"Describe your target audience and research goals...",className:"h-40",...b})}),i.jsx(fn,{children:"Provide details about the demographics, behaviors, and attitudes you want to explore"}),i.jsx(ut,{})]})}),i.jsx(dt,{control:h.control,name:"researchObjective",render:({field:b})=>i.jsxs(ot,{children:[i.jsx(lt,{children:"Research Objective"}),i.jsx(ct,{children:i.jsx(nt,{placeholder:"What is the main research topic or objective you want to explore?",className:"h-32",...b})}),i.jsx(fn,{children:"Specify your research focus to generate more targeted persona goals, frustrations, and scenarios"}),i.jsx(ut,{})]})}),i.jsx("div",{className:"space-y-3",children:i.jsx(te,{type:"button",variant:"outline",size:"sm",onClick:m,disabled:!p||p.trim().length<10||!g||g.trim().length<10||c||t,className:"flex items-center gap-2 hover-transition",children:c?i.jsxs(i.Fragment,{children:[i.jsx(Lc,{className:"h-4 w-4 animate-spin"}),"Analyzing Research Inputs..."]}):i.jsxs(i.Fragment,{children:[i.jsx(Ml,{className:"h-4 w-4"}),"Enhance Brief"]})})})]}),i.jsxs("div",{className:"space-y-6",children:[i.jsx(dt,{control:h.control,name:"dataFile",render:({field:{value:b,onChange:x,...w}})=>i.jsxs(ot,{children:[i.jsx(lt,{children:"Customer Data (Optional)"}),i.jsx(ct,{children:i.jsxs("div",{className:"border-2 border-dashed border-slate-200 rounded-lg p-6 flex flex-col items-center justify-center bg-slate-50 hover:bg-slate-100 transition cursor-pointer",children:[i.jsx(cI,{className:"h-10 w-10 text-slate-400 mb-2"}),i.jsx("p",{className:"text-sm text-slate-600 mb-1",children:"Upload customer data for more accurate personas"}),i.jsx("p",{className:"text-xs text-slate-500 mb-3",children:"Supports PDF, Office docs, images, and more"}),i.jsx(Ot,{...w,type:"file",multiple:!0,accept:".pdf,.docx,.pptx,.xlsx,.html,.xml,.rtf,.pages,.key,.epub,.txt,.csv,.jpg,.jpeg,.png",onChange:j=>{x(j.target.files)},className:"hidden",id:"data-file-input"}),i.jsxs(te,{type:"button",variant:"outline",size:"sm",onClick:()=>{var j;return(j=document.getElementById("data-file-input"))==null?void 0:j.click()},children:[i.jsx(dI,{className:"mr-2 h-4 w-4"}),"Select Files"]}),b&&b.length>0&&i.jsx("p",{className:"text-xs text-primary mt-2",children:b.length===1?b[0].name:`${b.length} files selected`})]})}),i.jsx(fn,{children:"Upload existing customer data to create more realistic personas"}),i.jsx(ut,{})]})}),i.jsxs("div",{className:"bg-muted/30 p-4 rounded-lg border border-border",children:[i.jsxs("div",{className:"flex items-center mb-2",children:[i.jsx(pw,{className:"h-5 w-5 text-muted-foreground mr-2"}),i.jsx("h3",{className:"font-sf font-medium",children:"What's included?"})]}),i.jsxs("ul",{className:"space-y-2 text-sm text-muted-foreground",children:[i.jsxs("li",{className:"flex items-center",children:[i.jsx(Hd,{className:"h-4 w-4 text-green-500 mr-2"}),"Demographic profiles based on your brief"]}),i.jsxs("li",{className:"flex items-center",children:[i.jsx(Hd,{className:"h-4 w-4 text-green-500 mr-2"}),"Personality traits and behavioral patterns"]}),i.jsxs("li",{className:"flex items-center",children:[i.jsx(Hd,{className:"h-4 w-4 text-green-500 mr-2"}),"Consumer preferences and interests"]}),i.jsxs("li",{className:"flex items-center",children:[i.jsx(Hd,{className:"h-4 w-4 text-green-500 mr-2"}),"Review and refine capabilities"]})]})]})]})]}),n&&i.jsxs("div",{className:"glass-panel rounded-lg p-4 border border-border bg-muted/30",children:[i.jsxs("div",{className:"flex items-center justify-between mb-3",children:[i.jsxs("h3",{className:"font-sf font-medium text-sm flex items-center gap-2",children:[i.jsx(Ml,{className:"h-4 w-4 text-primary"}),"Enhancement Suggestions:"]}),i.jsx(te,{type:"button",variant:"ghost",size:"sm",onClick:y,className:"h-6 w-6 p-0 hover:bg-slate-200",title:s?"Expand suggestions":"Collapse suggestions",children:s?i.jsx(xi,{className:"h-4 w-4"}):i.jsx(Tl,{className:"h-4 w-4"})})]}),!s&&i.jsx(i.Fragment,{children:d?i.jsx("div",{className:"text-sm text-red-600 bg-red-50 p-3 rounded-md",children:d}):i.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-6",children:[i.jsx("div",{children:o.audience_brief.length>0?i.jsxs("div",{children:[i.jsxs("h4",{className:"font-sf font-medium text-sm text-slate-800 mb-2 flex items-center gap-2",children:[i.jsx(tr,{className:"h-4 w-4 text-blue-600"}),"Suggestions for your Audience Brief:"]}),i.jsx("ul",{className:"space-y-2 text-sm text-slate-700",children:o.audience_brief.map((b,x)=>i.jsxs("li",{className:"flex items-start gap-2",children:[i.jsx("span",{className:"text-blue-600 mt-1.5 text-xs",children:"•"}),i.jsx("span",{className:"flex-1",children:b})]},x))})]}):i.jsx("div",{className:"text-sm text-muted-foreground",children:"No audience brief suggestions available"})}),i.jsx("div",{children:o.research_objective.length>0?i.jsxs("div",{children:[i.jsxs("h4",{className:"font-sf font-medium text-sm text-slate-800 mb-2 flex items-center gap-2",children:[i.jsx(pw,{className:"h-4 w-4 text-green-600"}),"Suggestions for your Research Objective:"]}),i.jsx("ul",{className:"space-y-2 text-sm text-slate-700",children:o.research_objective.map((b,x)=>i.jsxs("li",{className:"flex items-start gap-2",children:[i.jsx("span",{className:"text-green-600 mt-1.5 text-xs",children:"•"}),i.jsx("span",{className:"flex-1",children:b})]},x))})]}):i.jsx("div",{className:"text-sm text-muted-foreground",children:"No research objective suggestions available"})}),o.audience_brief.length===0&&o.research_objective.length===0&&i.jsx("div",{className:"col-span-full text-sm text-muted-foreground text-center",children:"No suggestions available"})]})})]}),i.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-6",children:[i.jsx(dt,{control:h.control,name:"llm_model",render:({field:b})=>i.jsxs(ot,{children:[i.jsx(lt,{children:"AI Model"}),i.jsxs(Mn,{onValueChange:b.onChange,defaultValue:b.value,children:[i.jsx(ct,{children:i.jsx(Pn,{children:i.jsx(In,{placeholder:"Select AI model"})})}),i.jsxs(An,{children:[i.jsx(fe,{value:"gemini-2.5-pro",children:"Gemini 2.5 Pro"}),i.jsx(fe,{value:"gpt-4.1",children:"GPT-4.1"})]})]}),i.jsx(fn,{children:"Choose which AI model to use for generating personas"}),i.jsx(ut,{})]})}),i.jsx(dt,{control:h.control,name:"personaCount",render:({field:b})=>i.jsxs(ot,{children:[i.jsx(lt,{children:"Number of Personas to Generate"}),i.jsx(ct,{children:i.jsx(Ot,{type:"number",min:"1",max:"20",...b})}),i.jsx(fn,{children:"How many synthetic users do you need for your research?"}),i.jsx(ut,{})]})})]}),i.jsxs("div",{className:"flex flex-col items-end",children:[i.jsx(te,{type:"submit",disabled:t,className:"min-w-36",children:t?i.jsxs(i.Fragment,{children:[i.jsx(Lc,{className:"mr-2 h-4 w-4 animate-spin"}),"AI Generating..."]}):i.jsxs(i.Fragment,{children:[i.jsx(tr,{className:"mr-2 h-4 w-4"}),"Generate Personas"]})}),t&&i.jsx("div",{className:"text-xs text-muted-foreground mt-2",children:"Generating multiple personas in parallel. This may take 1-2 minutes..."})]})]})})}const rt=v.forwardRef(({className:e,...t},n)=>i.jsx("div",{ref:n,className:Oe("rounded-lg border bg-card text-card-foreground shadow-sm",e),...t}));rt.displayName="Card";const Dr=v.forwardRef(({className:e,...t},n)=>i.jsx("div",{ref:n,className:Oe("flex flex-col space-y-1.5 p-6",e),...t}));Dr.displayName="CardHeader";const ts=v.forwardRef(({className:e,...t},n)=>i.jsx("h3",{ref:n,className:Oe("text-2xl font-semibold leading-none tracking-tight",e),...t}));ts.displayName="CardTitle";const oN=v.forwardRef(({className:e,...t},n)=>i.jsx("p",{ref:n,className:Oe("text-sm text-muted-foreground",e),...t}));oN.displayName="CardDescription";const wt=v.forwardRef(({className:e,...t},n)=>i.jsx("div",{ref:n,className:Oe("p-6 pt-0",e),...t}));wt.displayName="CardContent";const lN=v.forwardRef(({className:e,...t},n)=>i.jsx("div",{ref:n,className:Oe("flex items-center p-6 pt-0",e),...t}));lN.displayName="CardFooter";const EX=e=>{const t=e==null?void 0:e.toLowerCase(),n="/semblance/";switch(t){case"male":return`${n}male_avatar.png`;case"female":return`${n}female_avatar.png`;case"non-binary":case"nonbinary":case"non binary":return`${n}nonbinary_avatar.png`;default:return`${n}male_avatar.png`}},cp=e=>e.avatar||EX(e.gender);function cN({user:e,selected:t=!1,onClick:n,showDetailedDialog:r=!1,onSelectionToggle:s,showAddToFolderButton:a=!1,onAddToFolder:o,onViewDetails:l}){const c=Tn();v.useState(!1);const[u,d]=v.useState(e),f=e._id||e.id,h=m=>{m.stopPropagation(),c(`/synthetic-users/${f}`)};u.oceanTraits&&(u.oceanTraits.openness,u.oceanTraits.conscientiousness,u.oceanTraits.extraversion,u.oceanTraits.agreeableness,u.oceanTraits.neuroticism);const p=m=>{var x,w;const y=m.target;y.closest("button")&&((w=(x=y.closest("button"))==null?void 0:x.textContent)!=null&&w.includes("View Details"))||(s?s(m):n&&n(m))},g=m=>{m.stopPropagation(),l?l(u):h(m)};return i.jsxs("div",{className:Oe("persona-card glass-card rounded-xl p-4 cursor-pointer hover:shadow-md button-transition",t&&"selected ring-2 ring-primary"),onClick:p,children:[i.jsx("div",{className:"persona-card-overlay"}),i.jsx("div",{className:"persona-card-checkmark",children:i.jsx($a,{className:"h-4 w-4 text-primary"})}),i.jsx("div",{className:"relative z-10",children:i.jsxs("div",{className:"flex items-start space-x-4",children:[i.jsx("div",{className:"h-12 w-12 rounded-full bg-muted flex items-center justify-center",children:i.jsx("img",{src:cp(u),alt:`${u.name} avatar`,className:"h-12 w-12 rounded-full object-cover"})}),i.jsxs("div",{className:"flex-1 min-w-0",children:[i.jsx("div",{className:"flex items-center justify-between gap-2",children:i.jsx("h3",{className:"text-sm font-medium truncate flex-1",children:u.name})}),i.jsxs("p",{className:"text-xs text-muted-foreground flex items-center gap-1",children:[u.age," • ",u.gender]}),i.jsx("p",{className:"text-xs text-muted-foreground mt-1",children:u.occupation}),i.jsx("p",{className:"text-xs text-muted-foreground",children:u.location}),i.jsx("div",{className:"mt-2",children:u.aiSynthesizedBio?i.jsxs("p",{className:"text-xs text-slate-700 line-clamp-3 leading-relaxed",children:[u.aiSynthesizedBio,u.aiSynthesizedBio.length>150&&"..."]}):i.jsxs("p",{className:"text-xs text-muted-foreground italic line-clamp-3",children:['"',u.personality,'"']})}),u.qualitativeAttributes&&u.qualitativeAttributes.length>0&&i.jsx("div",{className:"mt-3",children:i.jsx("div",{className:"flex flex-wrap gap-1",children:u.qualitativeAttributes.slice(0,3).map((m,y)=>i.jsxs("span",{className:"inline-flex items-center gap-1 px-2 py-1 bg-blue-50 text-blue-700 text-xs rounded-full",children:[i.jsx(BW,{className:"h-3 w-3"}),m]},y))})}),u.topPersonalityTraits&&u.topPersonalityTraits.length>0&&i.jsx("div",{className:"mt-2",children:i.jsx("div",{className:"flex flex-wrap gap-1",children:u.topPersonalityTraits.slice(0,3).map((m,y)=>i.jsxs("span",{className:"inline-flex items-center gap-1 px-2 py-1 bg-purple-50 text-purple-700 text-xs rounded-full",children:[i.jsx(kl,{className:"h-3 w-3"}),m]},y))})}),i.jsx("div",{className:"mt-3 flex justify-end",children:i.jsx(te,{variant:"ghost",size:"sm",onClick:g,children:"View Details"})})]})]})})]})}var uN="Collapsible",[OX,$Pe]=Hr(uN),[kX,dN]=OX(uN),hD=v.forwardRef((e,t)=>{const{__scopeCollapsible:n,open:r,defaultOpen:s,disabled:a,onOpenChange:o,...l}=e,[c=!1,u]=aa({prop:r,defaultProp:s,onChange:o});return i.jsx(kX,{scope:n,disabled:a,contentId:Ys(),open:c,onOpenToggle:v.useCallback(()=>u(d=>!d),[u]),children:i.jsx(Ye.div,{"data-state":hN(c),"data-disabled":a?"":void 0,...l,ref:t})})});hD.displayName=uN;var pD="CollapsibleTrigger",mD=v.forwardRef((e,t)=>{const{__scopeCollapsible:n,...r}=e,s=dN(pD,n);return i.jsx(Ye.button,{type:"button","aria-controls":s.contentId,"aria-expanded":s.open||!1,"data-state":hN(s.open),"data-disabled":s.disabled?"":void 0,disabled:s.disabled,...r,ref:t,onClick:Ee(e.onClick,s.onOpenToggle)})});mD.displayName=pD;var fN="CollapsibleContent",gD=v.forwardRef((e,t)=>{const{forceMount:n,...r}=e,s=dN(fN,e.__scopeCollapsible);return i.jsx(lr,{present:n||s.open,children:({present:a})=>i.jsx(TX,{...r,ref:t,present:a})})});gD.displayName=fN;var TX=v.forwardRef((e,t)=>{const{__scopeCollapsible:n,present:r,children:s,...a}=e,o=dN(fN,n),[l,c]=v.useState(r),u=v.useRef(null),d=xt(t,u),f=v.useRef(0),h=f.current,p=v.useRef(0),g=p.current,m=o.open||l,y=v.useRef(m),b=v.useRef();return v.useEffect(()=>{const x=requestAnimationFrame(()=>y.current=!1);return()=>cancelAnimationFrame(x)},[]),or(()=>{const x=u.current;if(x){b.current=b.current||{transitionDuration:x.style.transitionDuration,animationName:x.style.animationName},x.style.transitionDuration="0s",x.style.animationName="none";const w=x.getBoundingClientRect();f.current=w.height,p.current=w.width,y.current||(x.style.transitionDuration=b.current.transitionDuration,x.style.animationName=b.current.animationName),c(r)}},[o.open,r]),i.jsx(Ye.div,{"data-state":hN(o.open),"data-disabled":o.disabled?"":void 0,id:o.contentId,hidden:!m,...a,ref:d,style:{"--radix-collapsible-content-height":h?`${h}px`:void 0,"--radix-collapsible-content-width":g?`${g}px`:void 0,...e.style},children:m&&s})});function hN(e){return e?"open":"closed"}var $X=hD;const up=$X,dp=mD,fp=gD;function MX({generatedPersonas:e,selectedPersonas:t,isGenerating:n,onPersonaSelection:r,onRefinePersonas:s,onApprovePersonas:a,onBackToGenerator:o}){const l=Tn(),[c,u]=v.useState(""),[d,f]=v.useState(!1),h=p=>{l(`/synthetic-users/${p}?fromReview=true`)};return i.jsxs("div",{className:"space-y-6",children:[i.jsxs("div",{className:"flex items-center justify-between",children:[i.jsx("h3",{className:"font-sf text-lg font-medium",children:"Review Generated Personas"}),i.jsxs("div",{className:"text-sm text-muted-foreground",children:[t.length," of ",e.length," selected"]})]}),i.jsx("div",{className:"space-y-4",children:e.map(p=>i.jsx(rt,{className:`border ${t.includes(p.id)?"border-primary/50 bg-primary/5":""} cursor-pointer`,onClick:()=>h(p.id),children:i.jsx(wt,{className:"p-4",children:i.jsxs("div",{className:"flex items-start justify-between",children:[i.jsx("div",{className:"flex-1",children:i.jsxs("div",{className:"flex items-center",children:[i.jsx("input",{type:"checkbox",id:`persona-${p.id}`,checked:t.includes(p.id),onChange:g=>{g.stopPropagation(),r(p.id)},className:"mr-3 h-4 w-4 rounded border-gray-300 text-primary focus:ring-primary"}),i.jsxs("div",{children:[i.jsx("h4",{className:"font-medium",children:p.name}),i.jsxs("p",{className:"text-sm text-muted-foreground",children:[p.age," • ",p.gender," • ",p.occupation]})]})]})}),i.jsx(cN,{user:p,showDetailedDialog:!1,onClick:g=>{g.stopPropagation(),h(p.id)}})]})})},p.id))}),i.jsx("div",{className:"space-y-4 pt-4 border-t",children:i.jsxs("div",{children:[i.jsx("div",{className:"flex justify-between items-start mb-4",children:i.jsxs(te,{variant:"outline",onClick:o,children:[i.jsx(zf,{className:"mr-2 h-4 w-4"}),"Back to Generator"]})}),i.jsxs(up,{open:d,onOpenChange:f,className:"w-full space-y-4",children:[i.jsxs("div",{className:"flex justify-between items-center",children:[i.jsx(dp,{asChild:!0,children:i.jsxs(te,{variant:"outline",className:"flex items-center gap-2",children:[i.jsx(Lc,{className:"h-4 w-4"}),"Refine Personas",i.jsx(xi,{className:"h-4 w-4 ml-1 transition-transform duration-200",style:{transform:d?"rotate(180deg)":"rotate(0deg)"}})]})}),i.jsxs(te,{onClick:a,disabled:t.length===0,children:[i.jsx(Hd,{className:"mr-2 h-4 w-4"}),"Approve Selected (",t.length,")"]})]}),i.jsx(fp,{children:i.jsx(rt,{className:"border shadow-sm w-full mt-4",children:i.jsx(wt,{className:"p-6",children:i.jsxs("div",{className:"space-y-4",children:[i.jsxs("div",{children:[i.jsx("label",{htmlFor:"refinement-prompt",className:"text-sm font-medium block mb-2",children:"Refinement Instructions"}),i.jsx(nt,{id:"refinement-prompt",placeholder:"Example: Make all personas 5 years younger, or ensure everyone is from different locations...",value:c,onChange:p=>u(p.target.value),className:"min-h-[100px] w-full resize-y"}),i.jsx("p",{className:"text-xs text-muted-foreground mt-2",children:"Use natural language to describe how you'd like to refine the selected personas."})]}),i.jsxs(te,{onClick:()=>s(c),disabled:n||c.trim()==="",className:"w-full",children:[n?i.jsx(Lc,{className:"mr-2 h-4 w-4 animate-spin"}):i.jsx(Lc,{className:"mr-2 h-4 w-4"}),"Apply Refinements"]})]})})})})]})]})})]})}async function IX(e,t,n,r,s,a){console.log(`generateSyntheticPersonas called with targetFolderId: ${s||"none"}`),console.log(`🔄 generateSyntheticPersonas using model: ${a||"gemini-2.5-pro"}`);try{if(console.log(`Generating ${n} synthetic personas using two-stage approach...`),e.trim().length<10)throw new Error("Audience brief is too short. Please provide more context for better persona generation.");let o;if(r&&r.length>0){console.log(`Uploading ${r.length} customer data files...`);try{o=(await Xa.uploadCustomerData(r)).data.session_id,console.log(`Customer data uploaded with session ID: ${o}`)}catch(c){throw console.error("Failed to upload customer data:",c),new Error("Failed to upload customer data files. Please try again.")}}const l=await Xa.batchGenerateWithStages(e,t,n,.8,o,a);if(l.data){const c=l.data.partial_success===!0,u=l.data.personas&&l.data.personas.length>0,d=l.data.errors&&l.data.errors.length>0;if(u){if(console.log(`Generated ${l.data.personas.length} personas with two-stage process${d?` (${l.data.errors.length} failed)`:""}`),s){const h=l.data.personas.map(p=>({...p,folderId:s}));try{const p=h.map(g=>{if(g.id||g._id){const m=g._id||g.id;return console.log(`Updating persona ${g.name||m} with folder ID: ${s}`),Dn.update(m,{...g,folderId:s}).catch(y=>(console.error(`Error updating folder ID for persona ${g.name||m}:`,y),null))}return Promise.resolve(null)});await Promise.allSettled(p),console.log(`Added ${h.length} personas to folder ID: ${s}`)}catch(p){console.error("Error updating personas with folder ID:",p)}if(o)try{await Xa.cleanupCustomerData(o),console.log(`Cleaned up customer data for session: ${o}`)}catch(p){console.warn("Failed to cleanup customer data:",p)}return c||d?{...l.data,personas:h,length:h.length}:{...l.data,personas:h}}if(o)try{await Xa.cleanupCustomerData(o),console.log(`Cleaned up customer data for session: ${o}`)}catch(f){console.warn("Failed to cleanup customer data:",f)}if(c||d)return{...l.data.personas,length:l.data.personas.length,partial_success:c,errors:l.data.errors};if(o)try{await Xa.cleanupCustomerData(o),console.log(`Cleaned up customer data for session: ${o}`)}catch(f){console.warn("Failed to cleanup customer data:",f)}return l.data.personas}else if(d){if(o)try{await Xa.cleanupCustomerData(o),console.log(`Cleaned up customer data for session: ${o}`)}catch(f){console.warn("Failed to cleanup customer data:",f)}throw new Error(`Failed to generate personas: ${l.data.errors.length} generation attempts failed.`)}else throw new Error("No personas returned from API")}else throw new Error("Invalid response format from API")}catch(o){if(customerDataSessionId)try{await Xa.cleanupCustomerData(customerDataSessionId),console.log(`Cleaned up customer data for session: ${customerDataSessionId}`)}catch(l){console.warn("Failed to cleanup customer data:",l)}throw console.error("Error generating AI personas:",o),o}}function vD(){const[e,t]=v.useState([]),n=async a=>{const o=[];for(const l of a){const c={...l};c._id&&typeof c._id=="string"&&c._id.startsWith("local-")&&delete c._id;const u=await Dn.create(c);console.log("Persona saved to database:",u.data),o.push({...l,id:u.data._id||u.data.id,_id:u.data._id||u.data.id,isDbPersona:!0})}t(o)},r=async()=>{const a=await Dn.getAll();return a&&a.data&&Array.isArray(a.data)?(console.log("Personas loaded from database:",a.data.length),a.data.map(o=>({...o,id:o._id||o.id,isDbPersona:!0}))):[]};return v.useEffect(()=>{(async()=>{const o=await r();t(o)})()},[]),{storedPersonas:e,savePersonas:n,loadPersonas:r,clearPersonas:async()=>{const a=await r();for(const o of a)o._id&&await Dn.delete(o._id);t([])}}}function RX({targetFolderId:e,targetFolderName:t}){const n=qr(),r=Tn(),{loadPersonas:s,savePersonas:a}=vD(),[o,l]=v.useState(!1),[c,u]=v.useState([]),[d,f]=v.useState([]),[h,p]=v.useState(!1),[g,m]=v.useState(0);v.useEffect(()=>{const S=new URLSearchParams(n.search),N=S.get("mode"),_=S.get("tab"),P=S.get("step");if(N==="create"&&_==="ai"&&P==="review"){const k=s();k.length>0&&(u(k),f(k.map(O=>O.id)),p(!0))}},[n,s]);async function y(S){var N,_,P,k,O,M,A,$,L,G;try{l(!0),m(0);const D=parseInt(S.personaCount);if(isNaN(D)||D<1||D>10){oe.error("Invalid number of personas",{description:"Please enter a number between 1 and 10"}),l(!1);return}m(5);const V=setInterval(()=>{m(Z=>Z<90?Z+Math.random()*5:Z)},500),T=D<=2?"30-60 seconds":D<=4?"1-2 minutes":D<=6?"2-3 minutes":"3-5 minutes";D>4&&oe.info("Generation may take longer",{description:`Generating ${D} personas at once may result in some timeouts. If this happens, the successfully created personas will still be saved.`,duration:8e3}),oe.info("Generating AI personas in parallel",{description:`Creating ${D} synthetic personas based on your brief. This may take ${T}. Please be patient.`,duration:1e4}),e&&t?(console.log(`Target folder for new personas: ID=${e}, Name=${t}`),oe.info(`Creating personas in "${t}" folder`,{duration:3e3})):console.log("No target folder specified for new personas"),console.log(`🤖 Starting persona generation with model: ${S.llm_model||"gemini-2.5-pro"}`);const F=await IX(S.audienceBrief,S.researchObjective,D,S.dataFile,e,S.llm_model),q=F.personas||F;if(clearInterval(V),m(100),q&&q.length>0)console.log(`✅ Successfully generated ${q.length} personas using model: ${S.llm_model||"gemini-2.5-pro"}`),F.partial_success||F.errors&&F.errors.length>0?(oe.success("Some personas generated successfully",{description:`${q.length} synthetic personas were created using ${S.llm_model||"Gemini 2.5 Pro"}. ${((N=F.errors)==null?void 0:N.length)||0} failed due to timeout or other errors.`,duration:8e3}),F.errors&&F.errors.length>0&&setTimeout(()=>{oe.error("Some personas failed to generate",{description:`${F.errors.length} personas timed out. The server took too long to generate them. The successfully generated personas have been saved${e?" in the selected folder":""}.`,duration:1e4})},1e3)):oe.success("Personas generated and saved successfully",{description:`${q.length} synthetic personas have been created using ${S.llm_model||"Gemini 2.5 Pro"} and saved ${e?`to the "${t}" folder`:"to the database"}.`}),r("/synthetic-users?mode=view");else throw new Error("No personas were generated")}catch(D){console.error(`❌ Error generating personas using model: ${S.llm_model||"gemini-2.5-pro"}:`,D);let V="Please try again or adjust your parameters",T="Failed to generate personas";D.code==="ECONNABORTED"||(_=D.message)!=null&&_.includes("timeout")||((P=D.response)==null?void 0:P.status)===504?(T="Generation timeout",V="AI persona generation timed out. This often happens when generating multiple complex personas. Try generating fewer personas (2-3) or try again later."):((k=D.response)==null?void 0:k.status)===500?(T="Server error",(M=(O=D.response)==null?void 0:O.data)!=null&&M.message?V=D.response.data.message:($=(A=D.response)==null?void 0:A.data)!=null&&$.error?V=D.response.data.error:V="The server encountered an error processing your request. Please try again later."):((L=D.response)==null?void 0:L.status)===401?(T="Authentication required",V="Please log in to generate personas."):(G=D.message)!=null&&G.includes("504 Deadline Exceeded")?(T="Generation timeout",V="The AI model took too long to generate personas. Try generating fewer personas or simplify your brief."):D instanceof Error&&(V=D.message),oe.error(T,{description:V,duration:6e3})}finally{setTimeout(()=>{l(!1),m(0)},500)}}const b=S=>{f(N=>N.includes(S)?N.filter(_=>_!==S):[...N,S])},x=(S,N)=>{const _=N.toLowerCase();return S.map(P=>{const k={...P};if(_.includes("younger")){const O=parseInt(k.age);k.age=(O-5).toString()}else if(_.includes("older")){const O=parseInt(k.age);k.age=(O+5).toString()}if(_.includes("different locations")&&(k.location=`${k.location} (Diversified)`),_.includes("more extroverted")?k.personality=`Extroverted, ${k.personality.toLowerCase()}`:_.includes("more introverted")&&(k.personality=`Introverted, ${k.personality.toLowerCase()}`),_.includes("diverse")){const O=["tech-savvy","traditional","innovative","conservative","creative"],M=O[Math.floor(Math.random()*O.length)];k.personality=`${M}, ${k.personality}`}return k})},w=S=>{if(!S.trim()){oe.error("Please provide refinement instructions");return}l(!0),setTimeout(()=>{try{const N=c.filter(k=>d.includes(k.id)),_=x(N,S),P=c.map(k=>_.find(M=>M.id===k.id)||k);u(P),l(!1),a(P),oe.success("Personas refined based on your instructions",{description:"Review the updated profiles"})}catch(N){console.error("Error refining personas:",N),oe.error("Failed to refine personas",{description:"Please try different instructions"}),l(!1)}},1500)},j=()=>{const S=c.filter(N=>d.includes(N.id));oe.success(`${S.length} personas approved`,{description:"Added to your synthetic persona library"}),a(S),r("/synthetic-users?mode=view")};return i.jsxs("div",{className:"glass-panel rounded-xl p-6",children:[i.jsxs("div",{className:"flex items-center gap-2 mb-6",children:[i.jsx(tr,{className:"h-5 w-5 text-primary"}),i.jsx("h2",{className:"font-sf text-xl font-semibold",children:"AI Persona Recruiter"})]}),o&&i.jsxs("div",{className:"mb-6",children:[i.jsxs("div",{className:"flex justify-between items-center mb-2",children:[i.jsx("span",{className:"text-sm font-medium",children:"Generating personas in parallel..."}),i.jsxs("span",{className:"text-sm text-muted-foreground",children:[Math.round(g),"%"]})]}),i.jsx(al,{value:g,className:"h-2"})]}),h?i.jsx(MX,{generatedPersonas:c,selectedPersonas:d,isGenerating:o,onPersonaSelection:b,onRefinePersonas:w,onApprovePersonas:j,onBackToGenerator:()=>p(!1)}):i.jsx(CX,{onSubmit:y,isGenerating:o})]})}const Oo=new Map;function yD(e){const{id:t,title:n,description:r,type:s="default",duration:a}=e;let o;switch(s){case"success":o=oe.success(n,{description:r,duration:a});break;case"error":o=oe.error(n,{description:r,duration:a});break;case"warning":o=oe.warning(n,{description:r,duration:a});break;case"info":o=oe.info(n,{description:r,duration:a});break;default:o=oe(n,{description:r,duration:a});break}return Oo.set(t,o.toString()),t}function DX(e,t){const n=Oo.get(e);if(!n)return console.warn(`Toast with ID "${e}" not found. Creating new toast instead.`),yD({id:e,...t,title:t.title||"Updated"}),!1;const{title:r,description:s,type:a="default",duration:o}=t;oe.dismiss(n);let l;switch(a){case"success":l=oe.success(r,{description:s,duration:o});break;case"error":l=oe.error(r,{description:s,duration:o});break;case"warning":l=oe.warning(r,{description:s,duration:o});break;case"info":l=oe.info(r,{description:s,duration:o});break;default:l=oe(r,{description:s,duration:o});break}return Oo.set(e,l.toString()),!0}function LX(e){const t=Oo.get(e);return t?(oe.dismiss(t),Oo.delete(e),!0):(console.warn(`Toast with ID "${e}" not found.`),!1)}function FX(e){return Oo.has(e)}function BX(){Oo.forEach(e=>{oe.dismiss(e)}),Oo.clear()}const Ke={success:oe.success,error:oe.error,warning:oe.warning,info:oe.info,loading:oe.loading,dismiss:oe.dismiss,createPersistent:yD,updatePersistent:DX,dismissPersistent:LX,hasPersistent:FX,dismissAllPersistent:BX};var xD=["PageUp","PageDown"],bD=["ArrowUp","ArrowDown","ArrowLeft","ArrowRight"],wD={"from-left":["Home","PageDown","ArrowDown","ArrowLeft"],"from-right":["Home","PageDown","ArrowDown","ArrowRight"],"from-bottom":["Home","PageDown","ArrowDown","ArrowLeft"],"from-top":["Home","PageDown","ArrowUp","ArrowLeft"]},Ju="Slider",[Rw,zX,UX]=ky(Ju),[jD,MPe]=Hr(Ju,[UX]),[VX,Ly]=jD(Ju),SD=v.forwardRef((e,t)=>{const{name:n,min:r=0,max:s=100,step:a=1,orientation:o="horizontal",disabled:l=!1,minStepsBetweenThumbs:c=0,defaultValue:u=[r],value:d,onValueChange:f=()=>{},onValueCommit:h=()=>{},inverted:p=!1,form:g,...m}=e,y=v.useRef(new Set),b=v.useRef(0),w=o==="horizontal"?WX:GX,[j=[],S]=aa({prop:d,defaultProp:u,onChange:M=>{var $;($=[...y.current][b.current])==null||$.focus(),f(M)}}),N=v.useRef(j);function _(M){const A=YX(j,M);O(M,A)}function P(M){O(M,b.current)}function k(){const M=N.current[b.current];j[b.current]!==M&&h(j)}function O(M,A,{commit:$}={commit:!1}){const L=eY(a),G=tY(Math.round((M-r)/a)*a+r,L),D=ah(G,[r,s]);S((V=[])=>{const T=KX(V,D,A);if(JX(T,c*a)){b.current=T.indexOf(D);const F=String(T)!==String(V);return F&&$&&h(T),F?T:V}else return V})}return i.jsx(VX,{scope:e.__scopeSlider,name:n,disabled:l,min:r,max:s,valueIndexToChangeRef:b,thumbs:y.current,values:j,orientation:o,form:g,children:i.jsx(Rw.Provider,{scope:e.__scopeSlider,children:i.jsx(Rw.Slot,{scope:e.__scopeSlider,children:i.jsx(w,{"aria-disabled":l,"data-disabled":l?"":void 0,...m,ref:t,onPointerDown:Ee(m.onPointerDown,()=>{l||(N.current=j)}),min:r,max:s,inverted:p,onSlideStart:l?void 0:_,onSlideMove:l?void 0:P,onSlideEnd:l?void 0:k,onHomeKeyDown:()=>!l&&O(r,0,{commit:!0}),onEndKeyDown:()=>!l&&O(s,j.length-1,{commit:!0}),onStepKeyDown:({event:M,direction:A})=>{if(!l){const G=xD.includes(M.key)||M.shiftKey&&bD.includes(M.key)?10:1,D=b.current,V=j[D],T=a*G*A;O(V+T,D,{commit:!0})}}})})})})});SD.displayName=Ju;var[ND,_D]=jD(Ju,{startEdge:"left",endEdge:"right",size:"width",direction:1}),WX=v.forwardRef((e,t)=>{const{min:n,max:r,dir:s,inverted:a,onSlideStart:o,onSlideMove:l,onSlideEnd:c,onStepKeyDown:u,...d}=e,[f,h]=v.useState(null),p=xt(t,w=>h(w)),g=v.useRef(),m=Xl(s),y=m==="ltr",b=y&&!a||!y&&a;function x(w){const j=g.current||f.getBoundingClientRect(),S=[0,j.width],_=pN(S,b?[n,r]:[r,n]);return g.current=j,_(w-j.left)}return i.jsx(ND,{scope:e.__scopeSlider,startEdge:b?"left":"right",endEdge:b?"right":"left",direction:b?1:-1,size:"width",children:i.jsx(PD,{dir:m,"data-orientation":"horizontal",...d,ref:p,style:{...d.style,"--radix-slider-thumb-transform":"translateX(-50%)"},onSlideStart:w=>{const j=x(w.clientX);o==null||o(j)},onSlideMove:w=>{const j=x(w.clientX);l==null||l(j)},onSlideEnd:()=>{g.current=void 0,c==null||c()},onStepKeyDown:w=>{const S=wD[b?"from-left":"from-right"].includes(w.key);u==null||u({event:w,direction:S?-1:1})}})})}),GX=v.forwardRef((e,t)=>{const{min:n,max:r,inverted:s,onSlideStart:a,onSlideMove:o,onSlideEnd:l,onStepKeyDown:c,...u}=e,d=v.useRef(null),f=xt(t,d),h=v.useRef(),p=!s;function g(m){const y=h.current||d.current.getBoundingClientRect(),b=[0,y.height],w=pN(b,p?[r,n]:[n,r]);return h.current=y,w(m-y.top)}return i.jsx(ND,{scope:e.__scopeSlider,startEdge:p?"bottom":"top",endEdge:p?"top":"bottom",size:"height",direction:p?1:-1,children:i.jsx(PD,{"data-orientation":"vertical",...u,ref:f,style:{...u.style,"--radix-slider-thumb-transform":"translateY(50%)"},onSlideStart:m=>{const y=g(m.clientY);a==null||a(y)},onSlideMove:m=>{const y=g(m.clientY);o==null||o(y)},onSlideEnd:()=>{h.current=void 0,l==null||l()},onStepKeyDown:m=>{const b=wD[p?"from-bottom":"from-top"].includes(m.key);c==null||c({event:m,direction:b?-1:1})}})})}),PD=v.forwardRef((e,t)=>{const{__scopeSlider:n,onSlideStart:r,onSlideMove:s,onSlideEnd:a,onHomeKeyDown:o,onEndKeyDown:l,onStepKeyDown:c,...u}=e,d=Ly(Ju,n);return i.jsx(Ye.span,{...u,ref:t,onKeyDown:Ee(e.onKeyDown,f=>{f.key==="Home"?(o(f),f.preventDefault()):f.key==="End"?(l(f),f.preventDefault()):xD.concat(bD).includes(f.key)&&(c(f),f.preventDefault())}),onPointerDown:Ee(e.onPointerDown,f=>{const h=f.target;h.setPointerCapture(f.pointerId),f.preventDefault(),d.thumbs.has(h)?h.focus():r(f)}),onPointerMove:Ee(e.onPointerMove,f=>{f.target.hasPointerCapture(f.pointerId)&&s(f)}),onPointerUp:Ee(e.onPointerUp,f=>{const h=f.target;h.hasPointerCapture(f.pointerId)&&(h.releasePointerCapture(f.pointerId),a(f))})})}),AD="SliderTrack",CD=v.forwardRef((e,t)=>{const{__scopeSlider:n,...r}=e,s=Ly(AD,n);return i.jsx(Ye.span,{"data-disabled":s.disabled?"":void 0,"data-orientation":s.orientation,...r,ref:t})});CD.displayName=AD;var Dw="SliderRange",ED=v.forwardRef((e,t)=>{const{__scopeSlider:n,...r}=e,s=Ly(Dw,n),a=_D(Dw,n),o=v.useRef(null),l=xt(t,o),c=s.values.length,u=s.values.map(h=>kD(h,s.min,s.max)),d=c>1?Math.min(...u):0,f=100-Math.max(...u);return i.jsx(Ye.span,{"data-orientation":s.orientation,"data-disabled":s.disabled?"":void 0,...r,ref:l,style:{...e.style,[a.startEdge]:d+"%",[a.endEdge]:f+"%"}})});ED.displayName=Dw;var Lw="SliderThumb",OD=v.forwardRef((e,t)=>{const n=zX(e.__scopeSlider),[r,s]=v.useState(null),a=xt(t,l=>s(l)),o=v.useMemo(()=>r?n().findIndex(l=>l.ref.current===r):-1,[n,r]);return i.jsx(HX,{...e,ref:a,index:o})}),HX=v.forwardRef((e,t)=>{const{__scopeSlider:n,index:r,name:s,...a}=e,o=Ly(Lw,n),l=_D(Lw,n),[c,u]=v.useState(null),d=xt(t,x=>u(x)),f=c?o.form||!!c.closest("form"):!0,h=np(c),p=o.values[r],g=p===void 0?0:kD(p,o.min,o.max),m=XX(r,o.values.length),y=h==null?void 0:h[l.size],b=y?ZX(y,g,l.direction):0;return v.useEffect(()=>{if(c)return o.thumbs.add(c),()=>{o.thumbs.delete(c)}},[c,o.thumbs]),i.jsxs("span",{style:{transform:"var(--radix-slider-thumb-transform)",position:"absolute",[l.startEdge]:`calc(${g}% + ${b}px)`},children:[i.jsx(Rw.ItemSlot,{scope:e.__scopeSlider,children:i.jsx(Ye.span,{role:"slider","aria-label":e["aria-label"]||m,"aria-valuemin":o.min,"aria-valuenow":p,"aria-valuemax":o.max,"aria-orientation":o.orientation,"data-orientation":o.orientation,"data-disabled":o.disabled?"":void 0,tabIndex:o.disabled?void 0:0,...a,ref:d,style:p===void 0?{display:"none"}:e.style,onFocus:Ee(e.onFocus,()=>{o.valueIndexToChangeRef.current=r})})}),f&&i.jsx(qX,{name:s??(o.name?o.name+(o.values.length>1?"[]":""):void 0),form:o.form,value:p},r)]})});OD.displayName=Lw;var qX=e=>{const{value:t,...n}=e,r=v.useRef(null),s=op(t);return v.useEffect(()=>{const a=r.current,o=window.HTMLInputElement.prototype,c=Object.getOwnPropertyDescriptor(o,"value").set;if(s!==t&&c){const u=new Event("input",{bubbles:!0});c.call(a,t),a.dispatchEvent(u)}},[s,t]),i.jsx("input",{style:{display:"none"},...n,ref:r,defaultValue:t})};function KX(e=[],t,n){const r=[...e];return r[n]=t,r.sort((s,a)=>s-a)}function kD(e,t,n){const a=100/(n-t)*(e-t);return ah(a,[0,100])}function XX(e,t){return t>2?`Value ${e+1} of ${t}`:t===2?["Minimum","Maximum"][e]:void 0}function YX(e,t){if(e.length===1)return 0;const n=e.map(s=>Math.abs(s-t)),r=Math.min(...n);return n.indexOf(r)}function ZX(e,t,n){const r=e/2,a=pN([0,50],[0,r]);return(r-a(t)*n)*n}function QX(e){return e.slice(0,-1).map((t,n)=>e[n+1]-t)}function JX(e,t){if(t>0){const n=QX(e);return Math.min(...n)>=t}return!0}function pN(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 eY(e){return(String(e).split(".")[1]||"").length}function tY(e,t){const n=Math.pow(10,t);return Math.round(e*n)/n}var TD=SD,nY=CD,rY=ED,sY=OD;const Un=v.forwardRef(({className:e,...t},n)=>i.jsxs(TD,{ref:n,className:Oe("relative flex w-full touch-none select-none items-center",e),...t,children:[i.jsx(nY,{className:"relative h-2 w-full grow overflow-hidden rounded-full bg-secondary",children:i.jsx(rY,{className:"absolute h-full bg-primary"})}),i.jsx(sY,{className:"block h-5 w-5 rounded-full border-2 border-primary bg-background ring-offset-background transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50"})]}));Un.displayName=TD.displayName;var mN="Switch",[aY,IPe]=Hr(mN),[iY,oY]=aY(mN),$D=v.forwardRef((e,t)=>{const{__scopeSwitch:n,name:r,checked:s,defaultChecked:a,required:o,disabled:l,value:c="on",onCheckedChange:u,form:d,...f}=e,[h,p]=v.useState(null),g=xt(t,w=>p(w)),m=v.useRef(!1),y=h?d||!!h.closest("form"):!0,[b=!1,x]=aa({prop:s,defaultProp:a,onChange:u});return i.jsxs(iY,{scope:n,checked:b,disabled:l,children:[i.jsx(Ye.button,{type:"button",role:"switch","aria-checked":b,"aria-required":o,"data-state":RD(b),"data-disabled":l?"":void 0,disabled:l,value:c,...f,ref:g,onClick:Ee(e.onClick,w=>{x(j=>!j),y&&(m.current=w.isPropagationStopped(),m.current||w.stopPropagation())})}),y&&i.jsx(lY,{control:h,bubbles:!m.current,name:r,value:c,checked:b,required:o,disabled:l,form:d,style:{transform:"translateX(-100%)"}})]})});$D.displayName=mN;var MD="SwitchThumb",ID=v.forwardRef((e,t)=>{const{__scopeSwitch:n,...r}=e,s=oY(MD,n);return i.jsx(Ye.span,{"data-state":RD(s.checked),"data-disabled":s.disabled?"":void 0,...r,ref:t})});ID.displayName=MD;var lY=e=>{const{control:t,checked:n,bubbles:r=!0,...s}=e,a=v.useRef(null),o=op(n),l=np(t);return v.useEffect(()=>{const c=a.current,u=window.HTMLInputElement.prototype,f=Object.getOwnPropertyDescriptor(u,"checked").set;if(o!==n&&f){const h=new Event("click",{bubbles:r});f.call(c,n),c.dispatchEvent(h)}},[o,n,r]),i.jsx("input",{type:"checkbox","aria-hidden":!0,defaultChecked:n,...s,tabIndex:-1,ref:a,style:{...e.style,...l,position:"absolute",pointerEvents:"none",opacity:0,margin:0}})};function RD(e){return e?"checked":"unchecked"}var DD=$D,cY=ID;const ih=v.forwardRef(({className:e,...t},n)=>i.jsx(DD,{className:Oe("peer inline-flex h-6 w-11 shrink-0 cursor-pointer items-center rounded-full border-2 border-transparent 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:i.jsx(cY,{className:Oe("pointer-events-none block h-5 w-5 rounded-full bg-background shadow-lg ring-0 transition-transform data-[state=checked]:translate-x-5 data-[state=unchecked]:translate-x-0")})}));ih.displayName=DD.displayName;function uY(e,t=[]){let n=[];function r(a,o){const l=v.createContext(o),c=n.length;n=[...n,o];function u(f){const{scope:h,children:p,...g}=f,m=(h==null?void 0:h[e][c])||l,y=v.useMemo(()=>g,Object.values(g));return i.jsx(m.Provider,{value:y,children:p})}function d(f,h){const p=(h==null?void 0:h[e][c])||l,g=v.useContext(p);if(g)return g;if(o!==void 0)return o;throw new Error(`\`${f}\` must be used within \`${a}\``)}return u.displayName=a+"Provider",[u,d]}const s=()=>{const a=n.map(o=>v.createContext(o));return function(l){const c=(l==null?void 0:l[e])||a;return v.useMemo(()=>({[`__scope${e}`]:{...l,[e]:c}}),[l,c])}};return s.scopeName=e,[r,dY(s,...t)]}function dY(...e){const t=e[0];if(e.length===1)return t;const n=()=>{const r=e.map(s=>({useScope:s(),scopeName:s.scopeName}));return function(a){const o=r.reduce((l,{useScope:c,scopeName:u})=>{const f=c(a)[`__scope${u}`];return{...l,...f}},{});return v.useMemo(()=>({[`__scope${t.scopeName}`]:o}),[o])}};return n.scopeName=t.scopeName,n}var E0="rovingFocusGroup.onEntryFocus",fY={bubbles:!1,cancelable:!0},Fy="RovingFocusGroup",[Fw,LD,hY]=ky(Fy),[pY,ed]=uY(Fy,[hY]),[mY,gY]=pY(Fy),FD=v.forwardRef((e,t)=>i.jsx(Fw.Provider,{scope:e.__scopeRovingFocusGroup,children:i.jsx(Fw.Slot,{scope:e.__scopeRovingFocusGroup,children:i.jsx(vY,{...e,ref:t})})}));FD.displayName=Fy;var vY=v.forwardRef((e,t)=>{const{__scopeRovingFocusGroup:n,orientation:r,loop:s=!1,dir:a,currentTabStopId:o,defaultCurrentTabStopId:l,onCurrentTabStopIdChange:c,onEntryFocus:u,preventScrollOnEntryFocus:d=!1,...f}=e,h=v.useRef(null),p=xt(t,h),g=Xl(a),[m=null,y]=aa({prop:o,defaultProp:l,onChange:c}),[b,x]=v.useState(!1),w=Gn(u),j=LD(n),S=v.useRef(!1),[N,_]=v.useState(0);return v.useEffect(()=>{const P=h.current;if(P)return P.addEventListener(E0,w),()=>P.removeEventListener(E0,w)},[w]),i.jsx(mY,{scope:n,orientation:r,dir:g,loop:s,currentTabStopId:m,onItemFocus:v.useCallback(P=>y(P),[y]),onItemShiftTab:v.useCallback(()=>x(!0),[]),onFocusableItemAdd:v.useCallback(()=>_(P=>P+1),[]),onFocusableItemRemove:v.useCallback(()=>_(P=>P-1),[]),children:i.jsx(Ye.div,{tabIndex:b||N===0?-1:0,"data-orientation":r,...f,ref:p,style:{outline:"none",...e.style},onMouseDown:Ee(e.onMouseDown,()=>{S.current=!0}),onFocus:Ee(e.onFocus,P=>{const k=!S.current;if(P.target===P.currentTarget&&k&&!b){const O=new CustomEvent(E0,fY);if(P.currentTarget.dispatchEvent(O),!O.defaultPrevented){const M=j().filter(D=>D.focusable),A=M.find(D=>D.active),$=M.find(D=>D.id===m),G=[A,$,...M].filter(Boolean).map(D=>D.ref.current);UD(G,d)}}S.current=!1}),onBlur:Ee(e.onBlur,()=>x(!1))})})}),BD="RovingFocusGroupItem",zD=v.forwardRef((e,t)=>{const{__scopeRovingFocusGroup:n,focusable:r=!0,active:s=!1,tabStopId:a,...o}=e,l=Ys(),c=a||l,u=gY(BD,n),d=u.currentTabStopId===c,f=LD(n),{onFocusableItemAdd:h,onFocusableItemRemove:p}=u;return v.useEffect(()=>{if(r)return h(),()=>p()},[r,h,p]),i.jsx(Fw.ItemSlot,{scope:n,id:c,focusable:r,active:s,children:i.jsx(Ye.span,{tabIndex:d?0:-1,"data-orientation":u.orientation,...o,ref:t,onMouseDown:Ee(e.onMouseDown,g=>{r?u.onItemFocus(c):g.preventDefault()}),onFocus:Ee(e.onFocus,()=>u.onItemFocus(c)),onKeyDown:Ee(e.onKeyDown,g=>{if(g.key==="Tab"&&g.shiftKey){u.onItemShiftTab();return}if(g.target!==g.currentTarget)return;const m=bY(g,u.orientation,u.dir);if(m!==void 0){if(g.metaKey||g.ctrlKey||g.altKey||g.shiftKey)return;g.preventDefault();let b=f().filter(x=>x.focusable).map(x=>x.ref.current);if(m==="last")b.reverse();else if(m==="prev"||m==="next"){m==="prev"&&b.reverse();const x=b.indexOf(g.currentTarget);b=u.loop?wY(b,x+1):b.slice(x+1)}setTimeout(()=>UD(b))}})})})});zD.displayName=BD;var yY={ArrowLeft:"prev",ArrowUp:"prev",ArrowRight:"next",ArrowDown:"next",PageUp:"first",Home:"first",PageDown:"last",End:"last"};function xY(e,t){return t!=="rtl"?e:e==="ArrowLeft"?"ArrowRight":e==="ArrowRight"?"ArrowLeft":e}function bY(e,t,n){const r=xY(e.key,n);if(!(t==="vertical"&&["ArrowLeft","ArrowRight"].includes(r))&&!(t==="horizontal"&&["ArrowUp","ArrowDown"].includes(r)))return yY[r]}function UD(e,t=!1){const n=document.activeElement;for(const r of e)if(r===n||(r.focus({preventScroll:t}),document.activeElement!==n))return}function wY(e,t){return e.map((n,r)=>e[(t+r)%e.length])}var gN=FD,vN=zD,yN="Tabs",[jY,RPe]=Hr(yN,[ed]),VD=ed(),[SY,xN]=jY(yN),WD=v.forwardRef((e,t)=>{const{__scopeTabs:n,value:r,onValueChange:s,defaultValue:a,orientation:o="horizontal",dir:l,activationMode:c="automatic",...u}=e,d=Xl(l),[f,h]=aa({prop:r,onChange:s,defaultProp:a});return i.jsx(SY,{scope:n,baseId:Ys(),value:f,onValueChange:h,orientation:o,dir:d,activationMode:c,children:i.jsx(Ye.div,{dir:d,"data-orientation":o,...u,ref:t})})});WD.displayName=yN;var GD="TabsList",HD=v.forwardRef((e,t)=>{const{__scopeTabs:n,loop:r=!0,...s}=e,a=xN(GD,n),o=VD(n);return i.jsx(gN,{asChild:!0,...o,orientation:a.orientation,dir:a.dir,loop:r,children:i.jsx(Ye.div,{role:"tablist","aria-orientation":a.orientation,...s,ref:t})})});HD.displayName=GD;var qD="TabsTrigger",KD=v.forwardRef((e,t)=>{const{__scopeTabs:n,value:r,disabled:s=!1,...a}=e,o=xN(qD,n),l=VD(n),c=ZD(o.baseId,r),u=QD(o.baseId,r),d=r===o.value;return i.jsx(vN,{asChild:!0,...l,focusable:!s,active:d,children:i.jsx(Ye.button,{type:"button",role:"tab","aria-selected":d,"aria-controls":u,"data-state":d?"active":"inactive","data-disabled":s?"":void 0,disabled:s,id:c,...a,ref:t,onMouseDown:Ee(e.onMouseDown,f=>{!s&&f.button===0&&f.ctrlKey===!1?o.onValueChange(r):f.preventDefault()}),onKeyDown:Ee(e.onKeyDown,f=>{[" ","Enter"].includes(f.key)&&o.onValueChange(r)}),onFocus:Ee(e.onFocus,()=>{const f=o.activationMode!=="manual";!d&&!s&&f&&o.onValueChange(r)})})})});KD.displayName=qD;var XD="TabsContent",YD=v.forwardRef((e,t)=>{const{__scopeTabs:n,value:r,forceMount:s,children:a,...o}=e,l=xN(XD,n),c=ZD(l.baseId,r),u=QD(l.baseId,r),d=r===l.value,f=v.useRef(d);return v.useEffect(()=>{const h=requestAnimationFrame(()=>f.current=!1);return()=>cancelAnimationFrame(h)},[]),i.jsx(lr,{present:s||d,children:({present:h})=>i.jsx(Ye.div,{"data-state":d?"active":"inactive","data-orientation":l.orientation,role:"tabpanel","aria-labelledby":c,hidden:!h,id:u,tabIndex:0,...o,ref:t,style:{...e.style,animationDuration:f.current?"0s":void 0},children:h&&a})})});YD.displayName=XD;function ZD(e,t){return`${e}-trigger-${t}`}function QD(e,t){return`${e}-content-${t}`}var NY=WD,JD=HD,e4=KD,t4=YD;const Fo=NY,Ai=v.forwardRef(({className:e,...t},n)=>i.jsx(JD,{ref:n,className:Oe("inline-flex h-10 items-center justify-center rounded-md bg-muted p-1 text-muted-foreground",e),...t}));Ai.displayName=JD.displayName;const Xt=v.forwardRef(({className:e,...t},n)=>i.jsx(e4,{ref:n,className:Oe("inline-flex items-center justify-center whitespace-nowrap rounded-sm px-3 py-1.5 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-sm",e),...t}));Xt.displayName=e4.displayName;const Yt=v.forwardRef(({className:e,...t},n)=>i.jsx(t4,{ref:n,className:Oe("mt-2 ring-offset-background focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2",e),...t}));Yt.displayName=t4.displayName;const _Y=$e.object({name:$e.string().min(2,{message:"Name must be at least 2 characters."}),age:$e.string().min(1,{message:"Age is required."}),gender:$e.string().min(1,{message:"Gender is required."}),occupation:$e.string().min(2,{message:"Occupation is required."}),education:$e.string().min(1,{message:"Education is required."}),location:$e.string().min(2,{message:"Location is required."}),ethnicity:$e.string().optional(),personality:$e.string(),interests:$e.string(),hasPurchasingPower:$e.boolean().optional(),hasChildren:$e.boolean().optional(),techSavviness:$e.number().min(0).max(100),brandLoyalty:$e.number().min(0).max(100),priceConsciousness:$e.number().min(0).max(100),environmentalConcern:$e.number().min(0).max(100),socialGrade:$e.string().optional(),householdIncome:$e.string().optional(),householdComposition:$e.string().optional(),livingSituation:$e.string().optional(),goals:$e.array($e.string()).optional(),frustrations:$e.array($e.string()).optional(),motivations:$e.array($e.string()).optional(),scenarios:$e.array($e.string()).optional(),scenarioType:$e.string().optional(),oceanTraits:$e.object({openness:$e.number().min(0).max(100),conscientiousness:$e.number().min(0).max(100),extraversion:$e.number().min(0).max(100),agreeableness:$e.number().min(0).max(100),neuroticism:$e.number().min(0).max(100)}).optional(),thinkFeelDo:$e.object({thinks:$e.array($e.string()),feels:$e.array($e.string()),does:$e.array($e.string())}).optional(),mediaConsumption:$e.string().optional(),deviceUsage:$e.string().optional(),shoppingHabits:$e.string().optional(),brandPreferences:$e.string().optional(),communicationPreferences:$e.string().optional(),paymentMethods:$e.string().optional(),purchaseBehaviour:$e.string().optional(),coreValues:$e.string().optional(),lifestyleChoices:$e.string().optional(),socialActivities:$e.string().optional(),categoryKnowledge:$e.string().optional(),decisionInfluences:$e.string().optional(),painPoints:$e.string().optional(),journeyContext:$e.string().optional(),keyTouchpoints:$e.string().optional(),selfDeterminationNeeds:$e.object({autonomy:$e.string(),competence:$e.string(),relatedness:$e.string()}).optional(),fears:$e.array($e.string()).optional(),narrative:$e.string().optional(),additionalInformation:$e.string().optional()});function PY({targetFolderId:e,targetFolderName:t}){const[n,r]=v.useState(1),[s,a]=v.useState(!1),[o,l]=v.useState(!1),[c,u]=v.useState(0),d=Tn(),{isAuthenticated:f,login:h}=Kl();v.useEffect(()=>{u(0)},[]),v.useEffect(()=>{(async()=>{if(!f&&!o){l(!0);try{console.log("Attempting auto login with default credentials"),await h("user","pass"),console.log("Auto login successful");const _=localStorage.getItem("auth_token");_?(console.log("Token successfully stored:",_.substring(0,10)+"..."),Ke.success("Logged in automatically with default account")):(console.error("Token not stored after successful login"),Ke.error("Authentication problem, token not stored"))}catch(_){console.error("Auto login failed:",_)}finally{l(!1)}}})()},[]);const p=Py({resolver:Ay(_Y),defaultValues:{name:"",age:"",gender:"",occupation:"",education:"",location:"",ethnicity:"",personality:"",interests:"",hasPurchasingPower:!1,hasChildren:!1,techSavviness:50,brandLoyalty:50,priceConsciousness:50,environmentalConcern:50,socialGrade:"",householdIncome:"",householdComposition:"",livingSituation:"",goals:[],frustrations:[],motivations:[],scenarios:[],scenarioType:"",oceanTraits:{openness:50,conscientiousness:50,extraversion:50,agreeableness:50,neuroticism:50},thinkFeelDo:{thinks:[],feels:[],does:[]},mediaConsumption:"",deviceUsage:"",shoppingHabits:"",brandPreferences:"",communicationPreferences:"",paymentMethods:"",purchaseBehaviour:"",coreValues:"",lifestyleChoices:"",socialActivities:"",categoryKnowledge:"",decisionInfluences:"",painPoints:"",journeyContext:"",keyTouchpoints:"",selfDeterminationNeeds:{autonomy:"",competence:"",relatedness:""},fears:[],narrative:"",additionalInformation:""}}),g=N=>{const _=p.getValues(N)||[];p.setValue(N,[..._,""])},m=(N,_,P)=>{const O=[...p.getValues(N)||[]];O[_]=P,p.setValue(N,O)},y=(N,_)=>{const k=[...p.getValues(N)||[]];k.splice(_,1),p.setValue(N,k)},b=N=>{const _=p.getValues("thinkFeelDo")||{thinks:[],feels:[],does:[]},P={..._,[N]:[..._[N]||[],""]};p.setValue("thinkFeelDo",P)},x=(N,_,P)=>{const k=p.getValues("thinkFeelDo")||{thinks:[],feels:[],does:[]},O=[...k[N]||[]];O[_]=P;const M={...k,[N]:O};p.setValue("thinkFeelDo",M)},w=(N,_)=>{const P=p.getValues("thinkFeelDo")||{thinks:[],feels:[],does:[]},k=[...P[N]||[]];k.splice(_,1);const O={...P,[N]:k};p.setValue("thinkFeelDo",O)},j=(N,_)=>{const k={...p.getValues("oceanTraits")||{openness:50,conscientiousness:50,extraversion:50,agreeableness:50,neuroticism:50},[N]:_};p.setValue("oceanTraits",k)};async function S(N,_=!1){var P,k,O,M,A;if(_&&c>=1){console.log("Max retry attempts reached, stopping retry loop"),Ke.error("Authentication failed after multiple attempts",{description:"Please try logging in manually (user/pass)"}),d("/login",{state:{from:"/synthetic-users"}}),a(!1);return}_?(u($=>$+1),console.log(`Retry attempt ${c+1}`)):u(0),a(!0);try{if(!f)try{console.log("Not authenticated, attempting login with default credentials before submission"),await h("user","pass"),console.log("Login successful before persona creation")}catch(F){console.error("Login failed before persona creation:",F),Ke.error("Authentication required",{description:"Please log in before creating personas. Default: user/pass"}),d("/login",{state:{from:"/synthetic-users"}}),a(!1);return}const $=`persona-generation-${Date.now()}`,L=e&&t?` in "${t}" folder`:"",G=n>1?`${n} personas`:"persona";console.log(`UserCreator - Creating ${G}${L}`),Ke.createPersistent({id:$,title:`Generating ${G}...`,description:`Creating synthetic user profile${n>1?"s":""}${L}`,type:"info"});const D={...N,oceanTraits:N.oceanTraits||{openness:50,conscientiousness:50,extraversion:50,agreeableness:50,neuroticism:50},thinkFeelDo:N.thinkFeelDo||{thinks:[],feels:[],does:[]},folderId:e||void 0},V={id:`temp-${Date.now()}`,...D},T=JSON.parse(localStorage.getItem("tempPersonas")||"[]");if(T.push(V),localStorage.setItem("tempPersonas",JSON.stringify(T)),n===1)try{if(!localStorage.getItem("auth_token")){console.error("No authentication token found"),Ke.error("Authentication required",{description:"No valid token found. Please log in again."});try{console.log("No token found, attempting new login"),await h("user","pass"),console.log("Login successful, token:",((P=localStorage.getItem("auth_token"))==null?void 0:P.substring(0,10))+"...")}catch(Z){throw console.error("Login retry failed:",Z),new Error("Authentication failed after retry")}}console.log("Sending persona creation request to API with auth token");const q=await Dn.create(D);console.log("Persona created successfully:",q),Ke.updatePersistent($,{title:"Synthetic user created successfully",description:`Created profile for ${N.name}`,type:"success"})}catch(F){throw console.error("Error creating persona via API:",F),F.response&&F.response.status===401&&Ke.error("Authentication error",{description:"Failed to authenticate with server. Please try again."}),F}else{const F=[];F.push(D);for(let q=1;q{d("/synthetic-users?mode=view")},300)}catch($){if(console.error("Error creating personas:",$),$.response&&$.response.status===401||$.message&&$.message.includes("Authentication failed")&&c<1)try{console.log("Got auth error, attempting login retry with default credentials"),localStorage.removeItem("auth_token");const L=await Nw.login("user","pass");if((O=L==null?void 0:L.data)!=null&&O.access_token){localStorage.setItem("auth_token",L.data.access_token),localStorage.setItem("user",JSON.stringify(L.data.user)),console.log("Manual login successful, got new token:",L.data.access_token.substring(0,10)+"..."),Ke.info("Logged in with default account, retrying submission..."),setTimeout(()=>{S(N,!0)},500);return}else throw new Error("No access token received")}catch(L){console.error("Login retry failed:",L),Ke.error("Authentication error",{description:"Cannot authenticate with server. Please contact support."})}else Ke.updatePersistent(generationToastId,{title:"Failed to create synthetic users",description:((A=(M=$.response)==null?void 0:M.data)==null?void 0:A.message)||$.message||"An unexpected error occurred",type:"error"})}finally{a(!1)}}return i.jsxs("div",{className:"glass-panel rounded-xl p-6",children:[i.jsxs("div",{className:"flex items-center justify-between mb-6",children:[i.jsx("h2",{className:"text-2xl font-sf font-semibold",children:"Create Synthetic Users"}),i.jsxs("div",{className:"flex items-center space-x-2",children:[i.jsx(te,{variant:"outline",size:"sm",onClick:()=>r(Math.max(1,n-1)),children:"-"}),i.jsxs("div",{className:"flex items-center space-x-2",children:[i.jsx(tr,{size:16,className:"text-muted-foreground"}),i.jsx("span",{className:"text-sm font-medium",children:n})]}),i.jsx(te,{variant:"outline",size:"sm",onClick:()=>r(n+1),children:"+"})]})]}),i.jsx(Ey,{...p,children:i.jsxs("form",{onSubmit:p.handleSubmit(S),className:"space-y-6",children:[i.jsxs(Fo,{defaultValue:"basic",children:[i.jsxs(Ai,{className:"grid w-full grid-cols-6",children:[i.jsx(Xt,{value:"basic",children:"Basic"}),i.jsx(Xt,{value:"cooper",children:"Cooper"}),i.jsx(Xt,{value:"personality",children:"Personality"}),i.jsx(Xt,{value:"demographics",children:"Demographics"}),i.jsx(Xt,{value:"lifestyle",children:"Lifestyle"}),i.jsx(Xt,{value:"extended",children:"Extended"})]}),i.jsx(Yt,{value:"basic",className:"mt-6",children:i.jsx(rt,{children:i.jsx(wt,{className:"p-6",children:i.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-6",children:[i.jsxs("div",{className:"space-y-4",children:[i.jsx(dt,{control:p.control,name:"name",render:({field:N})=>i.jsxs(ot,{children:[i.jsx(lt,{children:"Name"}),i.jsx(ct,{children:i.jsx(Ot,{placeholder:"Jane Smith",...N})}),i.jsx(ut,{})]})}),i.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[i.jsx(dt,{control:p.control,name:"age",render:({field:N})=>i.jsxs(ot,{children:[i.jsx(lt,{children:"Age Range"}),i.jsxs(Mn,{onValueChange:N.onChange,defaultValue:N.value,children:[i.jsx(ct,{children:i.jsx(Pn,{children:i.jsx(In,{placeholder:"Select age range"})})}),i.jsxs(An,{children:[i.jsx(fe,{value:"18-24",children:"18-24"}),i.jsx(fe,{value:"25-34",children:"25-34"}),i.jsx(fe,{value:"35-44",children:"35-44"}),i.jsx(fe,{value:"45-54",children:"45-54"}),i.jsx(fe,{value:"55-64",children:"55-64"}),i.jsx(fe,{value:"65+",children:"65+"})]})]}),i.jsx(ut,{})]})}),i.jsx(dt,{control:p.control,name:"gender",render:({field:N})=>i.jsxs(ot,{children:[i.jsx(lt,{children:"Gender"}),i.jsxs(Mn,{onValueChange:N.onChange,defaultValue:N.value,children:[i.jsx(ct,{children:i.jsx(Pn,{children:i.jsx(In,{placeholder:"Select gender"})})}),i.jsxs(An,{children:[i.jsx(fe,{value:"Male",children:"Male"}),i.jsx(fe,{value:"Female",children:"Female"}),i.jsx(fe,{value:"Non-binary",children:"Non-binary"}),i.jsx(fe,{value:"Other",children:"Other"})]})]}),i.jsx(ut,{})]})})]}),i.jsx(dt,{control:p.control,name:"occupation",render:({field:N})=>i.jsxs(ot,{children:[i.jsx(lt,{children:"Occupation"}),i.jsx(ct,{children:i.jsx(Ot,{placeholder:"Software Engineer",...N})}),i.jsx(ut,{})]})}),i.jsx(dt,{control:p.control,name:"education",render:({field:N})=>i.jsxs(ot,{children:[i.jsx(lt,{children:"Education"}),i.jsxs(Mn,{onValueChange:N.onChange,defaultValue:N.value,children:[i.jsx(ct,{children:i.jsx(Pn,{children:i.jsx(In,{placeholder:"Select education level"})})}),i.jsxs(An,{children:[i.jsx(fe,{value:"High School",children:"High School"}),i.jsx(fe,{value:"Some College",children:"Some College"}),i.jsx(fe,{value:"Associate's Degree",children:"Associate's Degree"}),i.jsx(fe,{value:"Bachelor's Degree",children:"Bachelor's Degree"}),i.jsx(fe,{value:"Master's Degree",children:"Master's Degree"}),i.jsx(fe,{value:"PhD",children:"PhD"})]})]}),i.jsx(ut,{})]})}),i.jsx(dt,{control:p.control,name:"location",render:({field:N})=>i.jsxs(ot,{children:[i.jsx(lt,{children:"Location"}),i.jsx(ct,{children:i.jsx(Ot,{placeholder:"New York, USA",...N})}),i.jsx(ut,{})]})}),i.jsx(dt,{control:p.control,name:"ethnicity",render:({field:N})=>i.jsxs(ot,{children:[i.jsx(lt,{children:"Ethnicity (Optional)"}),i.jsxs(Mn,{onValueChange:N.onChange,defaultValue:N.value,children:[i.jsx(ct,{children:i.jsx(Pn,{children:i.jsx(In,{placeholder:"Select ethnicity"})})}),i.jsxs(An,{children:[i.jsx(fe,{value:"white",children:"White"}),i.jsx(fe,{value:"black",children:"Black"}),i.jsx(fe,{value:"asian",children:"Asian"}),i.jsx(fe,{value:"hispanic",children:"Hispanic/Latino"}),i.jsx(fe,{value:"native-american",children:"Native American"}),i.jsx(fe,{value:"middle-eastern",children:"Middle Eastern"}),i.jsx(fe,{value:"mixed",children:"Mixed"}),i.jsx(fe,{value:"other",children:"Other"}),i.jsx(fe,{value:"prefer-not-to-say",children:"Prefer not to say"})]})]}),i.jsx(ut,{})]})})]}),i.jsxs("div",{className:"space-y-4",children:[i.jsx(dt,{control:p.control,name:"personality",render:({field:N})=>i.jsxs(ot,{children:[i.jsx(lt,{children:"Personality Traits"}),i.jsx(ct,{children:i.jsx(nt,{placeholder:"Curious, analytical, detail-oriented",...N,rows:3})}),i.jsx(fn,{children:"Describe key personality traits that define this user"}),i.jsx(ut,{})]})}),i.jsx(dt,{control:p.control,name:"interests",render:({field:N})=>i.jsxs(ot,{children:[i.jsx(lt,{children:"Interests"}),i.jsx(ct,{children:i.jsx(nt,{placeholder:"Technology, fitness, cooking, travel",...N,rows:3})}),i.jsx(fn,{children:"List interests, hobbies and activities this user enjoys"}),i.jsx(ut,{})]})}),i.jsxs("div",{className:"space-y-4",children:[i.jsx("h3",{className:"font-medium text-sm",children:"Behavioral Attributes"}),i.jsx(dt,{control:p.control,name:"techSavviness",render:({field:N})=>i.jsxs(ot,{children:[i.jsxs("div",{className:"flex items-center justify-between mb-2",children:[i.jsx(lt,{children:"Tech Savviness"}),i.jsxs("span",{className:"text-sm text-muted-foreground",children:[N.value,"%"]})]}),i.jsx(ct,{children:i.jsx(Un,{min:0,max:100,step:1,value:[N.value],onValueChange:_=>N.onChange(_[0])})}),i.jsx(ut,{})]})}),i.jsx(dt,{control:p.control,name:"brandLoyalty",render:({field:N})=>i.jsxs(ot,{children:[i.jsxs("div",{className:"flex items-center justify-between mb-2",children:[i.jsx(lt,{children:"Brand Loyalty"}),i.jsxs("span",{className:"text-sm text-muted-foreground",children:[N.value,"%"]})]}),i.jsx(ct,{children:i.jsx(Un,{min:0,max:100,step:1,value:[N.value],onValueChange:_=>N.onChange(_[0])})}),i.jsx(ut,{})]})}),i.jsx(dt,{control:p.control,name:"priceConsciousness",render:({field:N})=>i.jsxs(ot,{children:[i.jsxs("div",{className:"flex items-center justify-between mb-2",children:[i.jsx(lt,{children:"Price Consciousness"}),i.jsxs("span",{className:"text-sm text-muted-foreground",children:[N.value,"%"]})]}),i.jsx(ct,{children:i.jsx(Un,{min:0,max:100,step:1,value:[N.value],onValueChange:_=>N.onChange(_[0])})}),i.jsx(ut,{})]})}),i.jsx(dt,{control:p.control,name:"environmentalConcern",render:({field:N})=>i.jsxs(ot,{children:[i.jsxs("div",{className:"flex items-center justify-between mb-2",children:[i.jsx(lt,{children:"Environmental Concern"}),i.jsxs("span",{className:"text-sm text-muted-foreground",children:[N.value,"%"]})]}),i.jsx(ct,{children:i.jsx(Un,{min:0,max:100,step:1,value:[N.value],onValueChange:_=>N.onChange(_[0])})}),i.jsx(ut,{})]})}),i.jsxs("div",{className:"grid grid-cols-2 gap-4 pt-2",children:[i.jsx(dt,{control:p.control,name:"hasPurchasingPower",render:({field:N})=>i.jsxs(ot,{className:"flex items-center justify-between",children:[i.jsx(lt,{children:"Purchasing Power"}),i.jsx(ct,{children:i.jsx(ih,{checked:N.value,onCheckedChange:N.onChange})}),i.jsx(ut,{})]})}),i.jsx(dt,{control:p.control,name:"hasChildren",render:({field:N})=>i.jsxs(ot,{className:"flex items-center justify-between",children:[i.jsx(lt,{children:"Has Children"}),i.jsx(ct,{children:i.jsx(ih,{checked:N.value,onCheckedChange:N.onChange})}),i.jsx(ut,{})]})})]})]})]})]})})})}),i.jsxs(Yt,{value:"cooper",className:"mt-6 space-y-6",children:[i.jsx(rt,{children:i.jsxs(wt,{className:"p-6",children:[i.jsxs("div",{className:"mb-4",children:[i.jsx("h3",{className:"font-medium text-lg mb-3",children:"Goals"}),(p.watch("goals")||[]).map((N,_)=>i.jsxs("div",{className:"flex items-center gap-2 mb-2",children:[i.jsx(Ot,{value:N,onChange:P=>m("goals",_,P.target.value),placeholder:"Enter a goal"}),i.jsx(te,{variant:"ghost",size:"icon",type:"button",onClick:()=>y("goals",_),children:i.jsx(_n,{className:"h-4 w-4 text-muted-foreground"})})]},_)),i.jsxs(te,{variant:"outline",size:"sm",type:"button",onClick:()=>g("goals"),className:"mt-2",children:[i.jsx(pr,{className:"h-4 w-4 mr-2"}),"Add Goal"]})]}),i.jsxs("div",{className:"mb-4 pt-4 border-t",children:[i.jsx("h3",{className:"font-medium text-lg mb-3",children:"Frustrations"}),(p.watch("frustrations")||[]).map((N,_)=>i.jsxs("div",{className:"flex items-center gap-2 mb-2",children:[i.jsx(Ot,{value:N,onChange:P=>m("frustrations",_,P.target.value),placeholder:"Enter a frustration"}),i.jsx(te,{variant:"ghost",size:"icon",type:"button",onClick:()=>y("frustrations",_),children:i.jsx(_n,{className:"h-4 w-4 text-muted-foreground"})})]},_)),i.jsxs(te,{variant:"outline",size:"sm",type:"button",onClick:()=>g("frustrations"),className:"mt-2",children:[i.jsx(pr,{className:"h-4 w-4 mr-2"}),"Add Frustration"]})]}),i.jsxs("div",{className:"mb-4 pt-4 border-t",children:[i.jsx("h3",{className:"font-medium text-lg mb-3",children:"Motivations"}),(p.watch("motivations")||[]).map((N,_)=>i.jsxs("div",{className:"flex items-center gap-2 mb-2",children:[i.jsx(Ot,{value:N,onChange:P=>m("motivations",_,P.target.value),placeholder:"Enter a motivation"}),i.jsx(te,{variant:"ghost",size:"icon",type:"button",onClick:()=>y("motivations",_),children:i.jsx(_n,{className:"h-4 w-4 text-muted-foreground"})})]},_)),i.jsxs(te,{variant:"outline",size:"sm",type:"button",onClick:()=>g("motivations"),className:"mt-2",children:[i.jsx(pr,{className:"h-4 w-4 mr-2"}),"Add Motivation"]})]})]})}),i.jsx(rt,{children:i.jsxs(wt,{className:"p-6",children:[i.jsx("h3",{className:"font-medium text-lg mb-4",children:"Think, Feel, Do"}),i.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-3 gap-6",children:[i.jsxs("div",{children:[i.jsx("h4",{className:"font-medium text-sm mb-3",children:"Thinks"}),((p.watch("thinkFeelDo")||{thinks:[],feels:[],does:[]}).thinks||[]).map((N,_)=>i.jsxs("div",{className:"flex items-center gap-2 mb-2",children:[i.jsx(Ot,{value:N,onChange:P=>x("thinks",_,P.target.value),placeholder:"What they think"}),i.jsx(te,{variant:"ghost",size:"icon",type:"button",onClick:()=>w("thinks",_),children:i.jsx(_n,{className:"h-4 w-4 text-muted-foreground"})})]},_)),i.jsxs(te,{variant:"outline",size:"sm",type:"button",onClick:()=>b("thinks"),className:"mt-2",children:[i.jsx(pr,{className:"h-4 w-4 mr-2"}),"Add Thought"]})]}),i.jsxs("div",{children:[i.jsx("h4",{className:"font-medium text-sm mb-3",children:"Feels"}),((p.watch("thinkFeelDo")||{thinks:[],feels:[],does:[]}).feels||[]).map((N,_)=>i.jsxs("div",{className:"flex items-center gap-2 mb-2",children:[i.jsx(Ot,{value:N,onChange:P=>x("feels",_,P.target.value),placeholder:"What they feel"}),i.jsx(te,{variant:"ghost",size:"icon",type:"button",onClick:()=>w("feels",_),children:i.jsx(_n,{className:"h-4 w-4 text-muted-foreground"})})]},_)),i.jsxs(te,{variant:"outline",size:"sm",type:"button",onClick:()=>b("feels"),className:"mt-2",children:[i.jsx(pr,{className:"h-4 w-4 mr-2"}),"Add Feeling"]})]}),i.jsxs("div",{children:[i.jsx("h4",{className:"font-medium text-sm mb-3",children:"Does"}),((p.watch("thinkFeelDo")||{thinks:[],feels:[],does:[]}).does||[]).map((N,_)=>i.jsxs("div",{className:"flex items-center gap-2 mb-2",children:[i.jsx(Ot,{value:N,onChange:P=>x("does",_,P.target.value),placeholder:"What they do"}),i.jsx(te,{variant:"ghost",size:"icon",type:"button",onClick:()=>w("does",_),children:i.jsx(_n,{className:"h-4 w-4 text-muted-foreground"})})]},_)),i.jsxs(te,{variant:"outline",size:"sm",type:"button",onClick:()=>b("does"),className:"mt-2",children:[i.jsx(pr,{className:"h-4 w-4 mr-2"}),"Add Action"]})]})]})]})}),i.jsx(rt,{children:i.jsx(wt,{className:"p-6",children:i.jsxs("div",{className:"space-y-4",children:[i.jsx(dt,{control:p.control,name:"scenarioType",render:({field:N})=>i.jsxs(ot,{children:[i.jsx(lt,{children:"Scenario Section Title"}),i.jsx(ct,{children:i.jsx(Ot,{placeholder:"Life Scenarios",...N})}),i.jsx(fn,{children:'Custom title for the scenarios section (e.g., "Customer Journey", "Use Cases")'}),i.jsx(ut,{})]})}),i.jsxs("div",{children:[i.jsx("h3",{className:"font-medium text-lg mb-3",children:"Usage Scenarios"}),(p.watch("scenarios")||[]).map((N,_)=>i.jsxs("div",{className:"flex items-start gap-2 mb-2",children:[i.jsx(nt,{value:N,onChange:P=>m("scenarios",_,P.target.value),rows:2,placeholder:"Describe a usage scenario"}),i.jsx(te,{variant:"ghost",size:"icon",type:"button",onClick:()=>y("scenarios",_),className:"mt-2",children:i.jsx(_n,{className:"h-4 w-4 text-muted-foreground"})})]},_)),i.jsxs(te,{variant:"outline",size:"sm",type:"button",onClick:()=>g("scenarios"),className:"mt-2",children:[i.jsx(pr,{className:"h-4 w-4 mr-2"}),"Add Scenario"]})]})]})})})]}),i.jsx(Yt,{value:"personality",className:"mt-6",children:i.jsx(rt,{children:i.jsxs(wt,{className:"p-6",children:[i.jsx("h3",{className:"font-medium text-lg mb-4",children:"OCEAN Personality Traits"}),i.jsxs("div",{className:"space-y-6",children:[i.jsxs("div",{children:[i.jsxs("div",{className:"flex justify-between mb-1",children:[i.jsx("label",{className:"text-sm font-medium",children:"Openness to Experience"}),i.jsxs("span",{className:"text-sm",children:[(p.watch("oceanTraits")||{openness:50}).openness||50,"%"]})]}),i.jsx(Un,{value:[(p.watch("oceanTraits")||{openness:50}).openness||50],onValueChange:N=>j("openness",N[0]),max:100,step:1}),i.jsx("p",{className:"text-xs text-muted-foreground mt-1",children:"Creativity, curiosity, and openness to new ideas"})]}),i.jsxs("div",{children:[i.jsxs("div",{className:"flex justify-between mb-1",children:[i.jsx("label",{className:"text-sm font-medium",children:"Conscientiousness"}),i.jsxs("span",{className:"text-sm",children:[(p.watch("oceanTraits")||{conscientiousness:50}).conscientiousness||50,"%"]})]}),i.jsx(Un,{value:[(p.watch("oceanTraits")||{conscientiousness:50}).conscientiousness||50],onValueChange:N=>j("conscientiousness",N[0]),max:100,step:1}),i.jsx("p",{className:"text-xs text-muted-foreground mt-1",children:"Organization, responsibility, and self-discipline"})]}),i.jsxs("div",{children:[i.jsxs("div",{className:"flex justify-between mb-1",children:[i.jsx("label",{className:"text-sm font-medium",children:"Extraversion"}),i.jsxs("span",{className:"text-sm",children:[(p.watch("oceanTraits")||{extraversion:50}).extraversion||50,"%"]})]}),i.jsx(Un,{value:[(p.watch("oceanTraits")||{extraversion:50}).extraversion||50],onValueChange:N=>j("extraversion",N[0]),max:100,step:1}),i.jsx("p",{className:"text-xs text-muted-foreground mt-1",children:"Sociability, assertiveness, and talkativeness"})]}),i.jsxs("div",{children:[i.jsxs("div",{className:"flex justify-between mb-1",children:[i.jsx("label",{className:"text-sm font-medium",children:"Agreeableness"}),i.jsxs("span",{className:"text-sm",children:[(p.watch("oceanTraits")||{agreeableness:50}).agreeableness||50,"%"]})]}),i.jsx(Un,{value:[(p.watch("oceanTraits")||{agreeableness:50}).agreeableness||50],onValueChange:N=>j("agreeableness",N[0]),max:100,step:1}),i.jsx("p",{className:"text-xs text-muted-foreground mt-1",children:"Compassion, cooperation, and concern for others"})]}),i.jsxs("div",{children:[i.jsxs("div",{className:"flex justify-between mb-1",children:[i.jsx("label",{className:"text-sm font-medium",children:"Neuroticism"}),i.jsxs("span",{className:"text-sm",children:[(p.watch("oceanTraits")||{neuroticism:50}).neuroticism||50,"%"]})]}),i.jsx(Un,{value:[(p.watch("oceanTraits")||{neuroticism:50}).neuroticism||50],onValueChange:N=>j("neuroticism",N[0]),max:100,step:1}),i.jsx("p",{className:"text-xs text-muted-foreground mt-1",children:"Emotional reactivity, anxiety, and sensitivity to stress"})]})]})]})})}),i.jsx(Yt,{value:"demographics",className:"mt-6",children:i.jsx(rt,{children:i.jsxs(wt,{className:"p-6",children:[i.jsx("h3",{className:"font-medium text-lg mb-4",children:"Demographic Information"}),i.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-6",children:[i.jsxs("div",{className:"space-y-4",children:[i.jsx(dt,{control:p.control,name:"socialGrade",render:({field:N})=>i.jsxs(ot,{children:[i.jsx(lt,{children:"Social Grade"}),i.jsxs(Mn,{onValueChange:N.onChange,defaultValue:N.value,children:[i.jsx(ct,{children:i.jsx(Pn,{children:i.jsx(In,{placeholder:"Select social grade"})})}),i.jsxs(An,{children:[i.jsx(fe,{value:"A",children:"A - Higher managerial"}),i.jsx(fe,{value:"B",children:"B - Intermediate managerial"}),i.jsx(fe,{value:"C1",children:"C1 - Supervisory or clerical"}),i.jsx(fe,{value:"C2",children:"C2 - Skilled manual workers"}),i.jsx(fe,{value:"D",children:"D - Semi and unskilled manual workers"}),i.jsx(fe,{value:"E",children:"E - State pensioners, unemployed"})]})]}),i.jsx(ut,{})]})}),i.jsx(dt,{control:p.control,name:"householdIncome",render:({field:N})=>i.jsxs(ot,{children:[i.jsx(lt,{children:"Household Income"}),i.jsxs(Mn,{onValueChange:N.onChange,defaultValue:N.value,children:[i.jsx(ct,{children:i.jsx(Pn,{children:i.jsx(In,{placeholder:"Select income range"})})}),i.jsxs(An,{children:[i.jsx(fe,{value:"Under $25k",children:"Under $25,000"}),i.jsx(fe,{value:"$25k-$50k",children:"$25,000 - $50,000"}),i.jsx(fe,{value:"$50k-$75k",children:"$50,000 - $75,000"}),i.jsx(fe,{value:"$75k-$100k",children:"$75,000 - $100,000"}),i.jsx(fe,{value:"$100k-$150k",children:"$100,000 - $150,000"}),i.jsx(fe,{value:"$150k-$250k",children:"$150,000 - $250,000"}),i.jsx(fe,{value:"Over $250k",children:"Over $250,000"}),i.jsx(fe,{value:"Prefer not to say",children:"Prefer not to say"})]})]}),i.jsx(ut,{})]})})]}),i.jsxs("div",{className:"space-y-4",children:[i.jsx(dt,{control:p.control,name:"householdComposition",render:({field:N})=>i.jsxs(ot,{children:[i.jsx(lt,{children:"Household Composition"}),i.jsxs(Mn,{onValueChange:N.onChange,defaultValue:N.value,children:[i.jsx(ct,{children:i.jsx(Pn,{children:i.jsx(In,{placeholder:"Select household type"})})}),i.jsxs(An,{children:[i.jsx(fe,{value:"Single person",children:"Single person"}),i.jsx(fe,{value:"Couple without children",children:"Couple without children"}),i.jsx(fe,{value:"Couple with children",children:"Couple with children"}),i.jsx(fe,{value:"Single parent",children:"Single parent"}),i.jsx(fe,{value:"Multi-generational",children:"Multi-generational"}),i.jsx(fe,{value:"Shared housing",children:"Shared housing"}),i.jsx(fe,{value:"Other",children:"Other"})]})]}),i.jsx(ut,{})]})}),i.jsx(dt,{control:p.control,name:"livingSituation",render:({field:N})=>i.jsxs(ot,{children:[i.jsx(lt,{children:"Living Situation"}),i.jsxs(Mn,{onValueChange:N.onChange,defaultValue:N.value,children:[i.jsx(ct,{children:i.jsx(Pn,{children:i.jsx(In,{placeholder:"Select living situation"})})}),i.jsxs(An,{children:[i.jsx(fe,{value:"Own home",children:"Own home"}),i.jsx(fe,{value:"Rent apartment",children:"Rent apartment"}),i.jsx(fe,{value:"Rent house",children:"Rent house"}),i.jsx(fe,{value:"Live with family",children:"Live with family"}),i.jsx(fe,{value:"Student housing",children:"Student housing"}),i.jsx(fe,{value:"Assisted living",children:"Assisted living"}),i.jsx(fe,{value:"Other",children:"Other"})]})]}),i.jsx(ut,{})]})})]})]})]})})}),i.jsx(Yt,{value:"lifestyle",className:"mt-6",children:i.jsx(rt,{children:i.jsxs(wt,{className:"p-6",children:[i.jsx("h3",{className:"font-medium text-lg mb-4",children:"Lifestyle & Behavior"}),i.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-6",children:[i.jsxs("div",{className:"space-y-4",children:[i.jsx(dt,{control:p.control,name:"mediaConsumption",render:({field:N})=>i.jsxs(ot,{children:[i.jsx(lt,{children:"Media Consumption"}),i.jsx(ct,{children:i.jsx(nt,{placeholder:"TV shows, podcasts, news sources, social media platforms",...N,rows:3})}),i.jsx(fn,{children:"Describe media consumption habits and preferences"}),i.jsx(ut,{})]})}),i.jsx(dt,{control:p.control,name:"deviceUsage",render:({field:N})=>i.jsxs(ot,{children:[i.jsx(lt,{children:"Device Usage"}),i.jsx(ct,{children:i.jsx(nt,{placeholder:"Smartphone, laptop, tablet, smart TV, gaming console",...N,rows:3})}),i.jsx(fn,{children:"Primary devices and usage patterns"}),i.jsx(ut,{})]})}),i.jsx(dt,{control:p.control,name:"shoppingHabits",render:({field:N})=>i.jsxs(ot,{children:[i.jsx(lt,{children:"Shopping Habits"}),i.jsx(ct,{children:i.jsx(nt,{placeholder:"Online vs in-store, frequency, preferred retailers",...N,rows:3})}),i.jsx(fn,{children:"Shopping behavior and preferences"}),i.jsx(ut,{})]})}),i.jsx(dt,{control:p.control,name:"brandPreferences",render:({field:N})=>i.jsxs(ot,{children:[i.jsx(lt,{children:"Brand Preferences"}),i.jsx(ct,{children:i.jsx(nt,{placeholder:"Favorite brands, brand values alignment",...N,rows:3})}),i.jsx(fn,{children:"Preferred brands and reasoning"}),i.jsx(ut,{})]})})]}),i.jsxs("div",{className:"space-y-4",children:[i.jsx(dt,{control:p.control,name:"communicationPreferences",render:({field:N})=>i.jsxs(ot,{children:[i.jsx(lt,{children:"Communication Preferences"}),i.jsx(ct,{children:i.jsx(nt,{placeholder:"Email, phone, text, video calls, in-person",...N,rows:3})}),i.jsx(fn,{children:"Preferred communication methods and channels"}),i.jsx(ut,{})]})}),i.jsx(dt,{control:p.control,name:"paymentMethods",render:({field:N})=>i.jsxs(ot,{children:[i.jsx(lt,{children:"Payment Methods"}),i.jsx(ct,{children:i.jsx(nt,{placeholder:"Credit cards, digital wallets, cash, BNPL",...N,rows:3})}),i.jsx(fn,{children:"Preferred payment methods and financial tools"}),i.jsx(ut,{})]})}),i.jsx(dt,{control:p.control,name:"purchaseBehaviour",render:({field:N})=>i.jsxs(ot,{children:[i.jsx(lt,{children:"Purchase Behavior"}),i.jsx(ct,{children:i.jsx(nt,{placeholder:"Research habits, decision factors, impulse vs planned buying",...N,rows:3})}),i.jsx(fn,{children:"How they approach making purchase decisions"}),i.jsx(ut,{})]})})]})]})]})})}),i.jsxs(Yt,{value:"extended",className:"mt-6 space-y-6",children:[i.jsx(rt,{children:i.jsxs(wt,{className:"p-6",children:[i.jsx("h3",{className:"font-medium text-lg mb-4",children:"Extended Profile"}),i.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-6",children:[i.jsxs("div",{className:"space-y-4",children:[i.jsx(dt,{control:p.control,name:"coreValues",render:({field:N})=>i.jsxs(ot,{children:[i.jsx(lt,{children:"Core Values"}),i.jsx(ct,{children:i.jsx(nt,{placeholder:"Key principles and values that guide decisions",...N,rows:3})}),i.jsx(ut,{})]})}),i.jsx(dt,{control:p.control,name:"lifestyleChoices",render:({field:N})=>i.jsxs(ot,{children:[i.jsx(lt,{children:"Lifestyle Choices"}),i.jsx(ct,{children:i.jsx(nt,{placeholder:"Health, fitness, diet, work-life balance preferences",...N,rows:3})}),i.jsx(ut,{})]})}),i.jsx(dt,{control:p.control,name:"socialActivities",render:({field:N})=>i.jsxs(ot,{children:[i.jsx(lt,{children:"Social Activities"}),i.jsx(ct,{children:i.jsx(nt,{placeholder:"Social hobbies, community involvement, networking",...N,rows:3})}),i.jsx(ut,{})]})}),i.jsx(dt,{control:p.control,name:"categoryKnowledge",render:({field:N})=>i.jsxs(ot,{children:[i.jsx(lt,{children:"Category Knowledge"}),i.jsx(ct,{children:i.jsx(nt,{placeholder:"Expertise in specific product/service categories",...N,rows:3})}),i.jsx(ut,{})]})}),i.jsx(dt,{control:p.control,name:"decisionInfluences",render:({field:N})=>i.jsxs(ot,{children:[i.jsx(lt,{children:"Decision Influences"}),i.jsx(ct,{children:i.jsx(nt,{placeholder:"What factors most influence their decisions",...N,rows:3})}),i.jsx(ut,{})]})}),i.jsx(dt,{control:p.control,name:"painPoints",render:({field:N})=>i.jsxs(ot,{children:[i.jsx(lt,{children:"Pain Points"}),i.jsx(ct,{children:i.jsx(nt,{placeholder:"Common challenges and friction points",...N,rows:3})}),i.jsx(ut,{})]})})]}),i.jsxs("div",{className:"space-y-4",children:[i.jsx(dt,{control:p.control,name:"journeyContext",render:({field:N})=>i.jsxs(ot,{children:[i.jsx(lt,{children:"Journey Context"}),i.jsx(ct,{children:i.jsx(nt,{placeholder:"Current life stage and contextual factors",...N,rows:3})}),i.jsx(ut,{})]})}),i.jsx(dt,{control:p.control,name:"keyTouchpoints",render:({field:N})=>i.jsxs(ot,{children:[i.jsx(lt,{children:"Key Touchpoints"}),i.jsx(ct,{children:i.jsx(nt,{placeholder:"Important interaction points and channels",...N,rows:3})}),i.jsx(ut,{})]})}),i.jsxs("div",{className:"space-y-4",children:[i.jsx("h4",{className:"font-medium text-sm",children:"Self-Determination Needs"}),i.jsx(dt,{control:p.control,name:"selfDeterminationNeeds.autonomy",render:({field:N})=>i.jsxs(ot,{children:[i.jsx(lt,{children:"Autonomy"}),i.jsx(ct,{children:i.jsx(nt,{placeholder:"Need for independence and self-direction",...N,rows:2})}),i.jsx(ut,{})]})}),i.jsx(dt,{control:p.control,name:"selfDeterminationNeeds.competence",render:({field:N})=>i.jsxs(ot,{children:[i.jsx(lt,{children:"Competence"}),i.jsx(ct,{children:i.jsx(nt,{placeholder:"Need to feel capable and effective",...N,rows:2})}),i.jsx(ut,{})]})}),i.jsx(dt,{control:p.control,name:"selfDeterminationNeeds.relatedness",render:({field:N})=>i.jsxs(ot,{children:[i.jsx(lt,{children:"Relatedness"}),i.jsx(ct,{children:i.jsx(nt,{placeholder:"Need for connection and belonging",...N,rows:2})}),i.jsx(ut,{})]})})]})]})]})]})}),i.jsx(rt,{children:i.jsx(wt,{className:"p-6",children:i.jsxs("div",{className:"space-y-4",children:[i.jsxs("div",{children:[i.jsx("h3",{className:"font-medium text-lg mb-3",children:"Fears & Concerns"}),(p.watch("fears")||[]).map((N,_)=>i.jsxs("div",{className:"flex items-center gap-2 mb-2",children:[i.jsx(Ot,{value:N,onChange:P=>m("fears",_,P.target.value),placeholder:"Enter a fear or concern"}),i.jsx(te,{variant:"ghost",size:"icon",type:"button",onClick:()=>y("fears",_),children:i.jsx(_n,{className:"h-4 w-4 text-muted-foreground"})})]},_)),i.jsxs(te,{variant:"outline",size:"sm",type:"button",onClick:()=>g("fears"),className:"mt-2",children:[i.jsx(pr,{className:"h-4 w-4 mr-2"}),"Add Fear/Concern"]})]}),i.jsx(dt,{control:p.control,name:"narrative",render:({field:N})=>i.jsxs(ot,{children:[i.jsx(lt,{children:"Personal Narrative"}),i.jsx(ct,{children:i.jsx(nt,{placeholder:"Personal story, background, key life experiences",...N,rows:4})}),i.jsx(fn,{children:"A brief narrative that captures their personal story"}),i.jsx(ut,{})]})}),i.jsx(dt,{control:p.control,name:"additionalInformation",render:({field:N})=>i.jsxs(ot,{children:[i.jsx(lt,{children:"Additional Information"}),i.jsx(ct,{children:i.jsx(nt,{placeholder:"Any other relevant details or context",...N,rows:4})}),i.jsx(fn,{children:"Additional context or details not covered elsewhere"}),i.jsx(ut,{})]})})]})})})]})]}),i.jsxs("div",{className:"flex justify-end space-x-2",children:[i.jsx(te,{variant:"outline",type:"button",onClick:()=>p.reset(),children:"Reset"}),i.jsxs(te,{type:"submit",disabled:s,children:[s?i.jsx(CW,{className:"mr-2 h-4 w-4 animate-spin"}):i.jsx(zS,{className:"mr-2 h-4 w-4"}),s?"Creating...":`Create ${n>1?`${n} Users`:"User"}`]})]})]})})]})}var Bw=["Enter"," "],AY=["ArrowDown","PageUp","Home"],n4=["ArrowUp","PageDown","End"],CY=[...AY,...n4],EY={ltr:[...Bw,"ArrowRight"],rtl:[...Bw,"ArrowLeft"]},OY={ltr:["ArrowLeft"],rtl:["ArrowRight"]},hp="Menu",[oh,kY,TY]=ky(hp),[Yl,r4]=Hr(hp,[TY,Hu,ed]),By=Hu(),s4=ed(),[$Y,Zl]=Yl(hp),[MY,pp]=Yl(hp),a4=e=>{const{__scopeMenu:t,open:n=!1,children:r,dir:s,onOpenChange:a,modal:o=!0}=e,l=By(t),[c,u]=v.useState(null),d=v.useRef(!1),f=Gn(a),h=Xl(s);return v.useEffect(()=>{const p=()=>{d.current=!0,document.addEventListener("pointerdown",g,{capture:!0,once:!0}),document.addEventListener("pointermove",g,{capture:!0,once:!0})},g=()=>d.current=!1;return document.addEventListener("keydown",p,{capture:!0}),()=>{document.removeEventListener("keydown",p,{capture:!0}),document.removeEventListener("pointerdown",g,{capture:!0}),document.removeEventListener("pointermove",g,{capture:!0})}},[]),i.jsx(EM,{...l,children:i.jsx($Y,{scope:t,open:n,onOpenChange:f,content:c,onContentChange:u,children:i.jsx(MY,{scope:t,onClose:v.useCallback(()=>f(!1),[f]),isUsingKeyboardRef:d,dir:h,modal:o,children:r})})})};a4.displayName=hp;var IY="MenuAnchor",bN=v.forwardRef((e,t)=>{const{__scopeMenu:n,...r}=e,s=By(n);return i.jsx(_S,{...s,...r,ref:t})});bN.displayName=IY;var wN="MenuPortal",[RY,i4]=Yl(wN,{forceMount:void 0}),o4=e=>{const{__scopeMenu:t,forceMount:n,children:r,container:s}=e,a=Zl(wN,t);return i.jsx(RY,{scope:t,forceMount:n,children:i.jsx(lr,{present:n||a.open,children:i.jsx(dy,{asChild:!0,container:s,children:r})})})};o4.displayName=wN;var Ps="MenuContent",[DY,jN]=Yl(Ps),l4=v.forwardRef((e,t)=>{const n=i4(Ps,e.__scopeMenu),{forceMount:r=n.forceMount,...s}=e,a=Zl(Ps,e.__scopeMenu),o=pp(Ps,e.__scopeMenu);return i.jsx(oh.Provider,{scope:e.__scopeMenu,children:i.jsx(lr,{present:r||a.open,children:i.jsx(oh.Slot,{scope:e.__scopeMenu,children:o.modal?i.jsx(LY,{...s,ref:t}):i.jsx(FY,{...s,ref:t})})})})}),LY=v.forwardRef((e,t)=>{const n=Zl(Ps,e.__scopeMenu),r=v.useRef(null),s=xt(t,r);return v.useEffect(()=>{const a=r.current;if(a)return aN(a)},[]),i.jsx(SN,{...e,ref:s,trapFocus:n.open,disableOutsidePointerEvents:n.open,disableOutsideScroll:!0,onFocusOutside:Ee(e.onFocusOutside,a=>a.preventDefault(),{checkForDefaultPrevented:!1}),onDismiss:()=>n.onOpenChange(!1)})}),FY=v.forwardRef((e,t)=>{const n=Zl(Ps,e.__scopeMenu);return i.jsx(SN,{...e,ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,disableOutsideScroll:!1,onDismiss:()=>n.onOpenChange(!1)})}),SN=v.forwardRef((e,t)=>{const{__scopeMenu:n,loop:r=!1,trapFocus:s,onOpenAutoFocus:a,onCloseAutoFocus:o,disableOutsidePointerEvents:l,onEntryFocus:c,onEscapeKeyDown:u,onPointerDownOutside:d,onFocusOutside:f,onInteractOutside:h,onDismiss:p,disableOutsideScroll:g,...m}=e,y=Zl(Ps,n),b=pp(Ps,n),x=By(n),w=s4(n),j=kY(n),[S,N]=v.useState(null),_=v.useRef(null),P=xt(t,_,y.onContentChange),k=v.useRef(0),O=v.useRef(""),M=v.useRef(0),A=v.useRef(null),$=v.useRef("right"),L=v.useRef(0),G=g?My:v.Fragment,D=g?{as:ka,allowPinchZoom:!0}:void 0,V=F=>{var ce,De;const q=O.current+F,Z=j().filter(de=>!de.disabled),re=document.activeElement,ge=(ce=Z.find(de=>de.ref.current===re))==null?void 0:ce.textValue,B=Z.map(de=>de.textValue),le=ZY(B,q,ge),se=(De=Z.find(de=>de.textValue===le))==null?void 0:De.ref.current;(function de(be){O.current=be,window.clearTimeout(k.current),be!==""&&(k.current=window.setTimeout(()=>de(""),1e3))})(q),se&&setTimeout(()=>se.focus())};v.useEffect(()=>()=>window.clearTimeout(k.current),[]),sN();const T=v.useCallback(F=>{var Z,re;return $.current===((Z=A.current)==null?void 0:Z.side)&&JY(F,(re=A.current)==null?void 0:re.area)},[]);return i.jsx(DY,{scope:n,searchRef:O,onItemEnter:v.useCallback(F=>{T(F)&&F.preventDefault()},[T]),onItemLeave:v.useCallback(F=>{var q;T(F)||((q=_.current)==null||q.focus(),N(null))},[T]),onTriggerLeave:v.useCallback(F=>{T(F)&&F.preventDefault()},[T]),pointerGraceTimerRef:M,onPointerGraceIntentChange:v.useCallback(F=>{A.current=F},[]),children:i.jsx(G,{...D,children:i.jsx(Ty,{asChild:!0,trapped:s,onMountAutoFocus:Ee(a,F=>{var q;F.preventDefault(),(q=_.current)==null||q.focus({preventScroll:!0})}),onUnmountAutoFocus:o,children:i.jsx(ep,{asChild:!0,disableOutsidePointerEvents:l,onEscapeKeyDown:u,onPointerDownOutside:d,onFocusOutside:f,onInteractOutside:h,onDismiss:p,children:i.jsx(gN,{asChild:!0,...w,dir:b.dir,orientation:"vertical",loop:r,currentTabStopId:S,onCurrentTabStopIdChange:N,onEntryFocus:Ee(c,F=>{b.isUsingKeyboardRef.current||F.preventDefault()}),preventScrollOnEntryFocus:!0,children:i.jsx(PS,{role:"menu","aria-orientation":"vertical","data-state":N4(y.open),"data-radix-menu-content":"",dir:b.dir,...x,...m,ref:P,style:{outline:"none",...m.style},onKeyDown:Ee(m.onKeyDown,F=>{const Z=F.target.closest("[data-radix-menu-content]")===F.currentTarget,re=F.ctrlKey||F.altKey||F.metaKey,ge=F.key.length===1;Z&&(F.key==="Tab"&&F.preventDefault(),!re&&ge&&V(F.key));const B=_.current;if(F.target!==B||!CY.includes(F.key))return;F.preventDefault();const se=j().filter(ce=>!ce.disabled).map(ce=>ce.ref.current);n4.includes(F.key)&&se.reverse(),XY(se)}),onBlur:Ee(e.onBlur,F=>{F.currentTarget.contains(F.target)||(window.clearTimeout(k.current),O.current="")}),onPointerMove:Ee(e.onPointerMove,lh(F=>{const q=F.target,Z=L.current!==F.clientX;if(F.currentTarget.contains(q)&&Z){const re=F.clientX>L.current?"right":"left";$.current=re,L.current=F.clientX}}))})})})})})})});l4.displayName=Ps;var BY="MenuGroup",NN=v.forwardRef((e,t)=>{const{__scopeMenu:n,...r}=e;return i.jsx(Ye.div,{role:"group",...r,ref:t})});NN.displayName=BY;var zY="MenuLabel",c4=v.forwardRef((e,t)=>{const{__scopeMenu:n,...r}=e;return i.jsx(Ye.div,{...r,ref:t})});c4.displayName=zY;var Og="MenuItem",kC="menu.itemSelect",zy=v.forwardRef((e,t)=>{const{disabled:n=!1,onSelect:r,...s}=e,a=v.useRef(null),o=pp(Og,e.__scopeMenu),l=jN(Og,e.__scopeMenu),c=xt(t,a),u=v.useRef(!1),d=()=>{const f=a.current;if(!n&&f){const h=new CustomEvent(kC,{bubbles:!0,cancelable:!0});f.addEventListener(kC,p=>r==null?void 0:r(p),{once:!0}),lM(f,h),h.defaultPrevented?u.current=!1:o.onClose()}};return i.jsx(u4,{...s,ref:c,disabled:n,onClick:Ee(e.onClick,d),onPointerDown:f=>{var h;(h=e.onPointerDown)==null||h.call(e,f),u.current=!0},onPointerUp:Ee(e.onPointerUp,f=>{var h;u.current||(h=f.currentTarget)==null||h.click()}),onKeyDown:Ee(e.onKeyDown,f=>{const h=l.searchRef.current!=="";n||h&&f.key===" "||Bw.includes(f.key)&&(f.currentTarget.click(),f.preventDefault())})})});zy.displayName=Og;var u4=v.forwardRef((e,t)=>{const{__scopeMenu:n,disabled:r=!1,textValue:s,...a}=e,o=jN(Og,n),l=s4(n),c=v.useRef(null),u=xt(t,c),[d,f]=v.useState(!1),[h,p]=v.useState("");return v.useEffect(()=>{const g=c.current;g&&p((g.textContent??"").trim())},[a.children]),i.jsx(oh.ItemSlot,{scope:n,disabled:r,textValue:s??h,children:i.jsx(vN,{asChild:!0,...l,focusable:!r,children:i.jsx(Ye.div,{role:"menuitem","data-highlighted":d?"":void 0,"aria-disabled":r||void 0,"data-disabled":r?"":void 0,...a,ref:u,onPointerMove:Ee(e.onPointerMove,lh(g=>{r?o.onItemLeave(g):(o.onItemEnter(g),g.defaultPrevented||g.currentTarget.focus({preventScroll:!0}))})),onPointerLeave:Ee(e.onPointerLeave,lh(g=>o.onItemLeave(g))),onFocus:Ee(e.onFocus,()=>f(!0)),onBlur:Ee(e.onBlur,()=>f(!1))})})})}),UY="MenuCheckboxItem",d4=v.forwardRef((e,t)=>{const{checked:n=!1,onCheckedChange:r,...s}=e;return i.jsx(g4,{scope:e.__scopeMenu,checked:n,children:i.jsx(zy,{role:"menuitemcheckbox","aria-checked":kg(n)?"mixed":n,...s,ref:t,"data-state":PN(n),onSelect:Ee(s.onSelect,()=>r==null?void 0:r(kg(n)?!0:!n),{checkForDefaultPrevented:!1})})})});d4.displayName=UY;var f4="MenuRadioGroup",[VY,WY]=Yl(f4,{value:void 0,onValueChange:()=>{}}),h4=v.forwardRef((e,t)=>{const{value:n,onValueChange:r,...s}=e,a=Gn(r);return i.jsx(VY,{scope:e.__scopeMenu,value:n,onValueChange:a,children:i.jsx(NN,{...s,ref:t})})});h4.displayName=f4;var p4="MenuRadioItem",m4=v.forwardRef((e,t)=>{const{value:n,...r}=e,s=WY(p4,e.__scopeMenu),a=n===s.value;return i.jsx(g4,{scope:e.__scopeMenu,checked:a,children:i.jsx(zy,{role:"menuitemradio","aria-checked":a,...r,ref:t,"data-state":PN(a),onSelect:Ee(r.onSelect,()=>{var o;return(o=s.onValueChange)==null?void 0:o.call(s,n)},{checkForDefaultPrevented:!1})})})});m4.displayName=p4;var _N="MenuItemIndicator",[g4,GY]=Yl(_N,{checked:!1}),v4=v.forwardRef((e,t)=>{const{__scopeMenu:n,forceMount:r,...s}=e,a=GY(_N,n);return i.jsx(lr,{present:r||kg(a.checked)||a.checked===!0,children:i.jsx(Ye.span,{...s,ref:t,"data-state":PN(a.checked)})})});v4.displayName=_N;var HY="MenuSeparator",y4=v.forwardRef((e,t)=>{const{__scopeMenu:n,...r}=e;return i.jsx(Ye.div,{role:"separator","aria-orientation":"horizontal",...r,ref:t})});y4.displayName=HY;var qY="MenuArrow",x4=v.forwardRef((e,t)=>{const{__scopeMenu:n,...r}=e,s=By(n);return i.jsx(AS,{...s,...r,ref:t})});x4.displayName=qY;var KY="MenuSub",[DPe,b4]=Yl(KY),Yd="MenuSubTrigger",w4=v.forwardRef((e,t)=>{const n=Zl(Yd,e.__scopeMenu),r=pp(Yd,e.__scopeMenu),s=b4(Yd,e.__scopeMenu),a=jN(Yd,e.__scopeMenu),o=v.useRef(null),{pointerGraceTimerRef:l,onPointerGraceIntentChange:c}=a,u={__scopeMenu:e.__scopeMenu},d=v.useCallback(()=>{o.current&&window.clearTimeout(o.current),o.current=null},[]);return v.useEffect(()=>d,[d]),v.useEffect(()=>{const f=l.current;return()=>{window.clearTimeout(f),c(null)}},[l,c]),i.jsx(bN,{asChild:!0,...u,children:i.jsx(u4,{id:s.triggerId,"aria-haspopup":"menu","aria-expanded":n.open,"aria-controls":s.contentId,"data-state":N4(n.open),...e,ref:oy(t,s.onTriggerChange),onClick:f=>{var h;(h=e.onClick)==null||h.call(e,f),!(e.disabled||f.defaultPrevented)&&(f.currentTarget.focus(),n.open||n.onOpenChange(!0))},onPointerMove:Ee(e.onPointerMove,lh(f=>{a.onItemEnter(f),!f.defaultPrevented&&!e.disabled&&!n.open&&!o.current&&(a.onPointerGraceIntentChange(null),o.current=window.setTimeout(()=>{n.onOpenChange(!0),d()},100))})),onPointerLeave:Ee(e.onPointerLeave,lh(f=>{var p,g;d();const h=(p=n.content)==null?void 0:p.getBoundingClientRect();if(h){const m=(g=n.content)==null?void 0:g.dataset.side,y=m==="right",b=y?-5:5,x=h[y?"left":"right"],w=h[y?"right":"left"];a.onPointerGraceIntentChange({area:[{x:f.clientX+b,y:f.clientY},{x,y:h.top},{x:w,y:h.top},{x:w,y:h.bottom},{x,y:h.bottom}],side:m}),window.clearTimeout(l.current),l.current=window.setTimeout(()=>a.onPointerGraceIntentChange(null),300)}else{if(a.onTriggerLeave(f),f.defaultPrevented)return;a.onPointerGraceIntentChange(null)}})),onKeyDown:Ee(e.onKeyDown,f=>{var p;const h=a.searchRef.current!=="";e.disabled||h&&f.key===" "||EY[r.dir].includes(f.key)&&(n.onOpenChange(!0),(p=n.content)==null||p.focus(),f.preventDefault())})})})});w4.displayName=Yd;var j4="MenuSubContent",S4=v.forwardRef((e,t)=>{const n=i4(Ps,e.__scopeMenu),{forceMount:r=n.forceMount,...s}=e,a=Zl(Ps,e.__scopeMenu),o=pp(Ps,e.__scopeMenu),l=b4(j4,e.__scopeMenu),c=v.useRef(null),u=xt(t,c);return i.jsx(oh.Provider,{scope:e.__scopeMenu,children:i.jsx(lr,{present:r||a.open,children:i.jsx(oh.Slot,{scope:e.__scopeMenu,children:i.jsx(SN,{id:l.contentId,"aria-labelledby":l.triggerId,...s,ref:u,align:"start",side:o.dir==="rtl"?"left":"right",disableOutsidePointerEvents:!1,disableOutsideScroll:!1,trapFocus:!1,onOpenAutoFocus:d=>{var f;o.isUsingKeyboardRef.current&&((f=c.current)==null||f.focus()),d.preventDefault()},onCloseAutoFocus:d=>d.preventDefault(),onFocusOutside:Ee(e.onFocusOutside,d=>{d.target!==l.trigger&&a.onOpenChange(!1)}),onEscapeKeyDown:Ee(e.onEscapeKeyDown,d=>{o.onClose(),d.preventDefault()}),onKeyDown:Ee(e.onKeyDown,d=>{var p;const f=d.currentTarget.contains(d.target),h=OY[o.dir].includes(d.key);f&&h&&(a.onOpenChange(!1),(p=l.trigger)==null||p.focus(),d.preventDefault())})})})})})});S4.displayName=j4;function N4(e){return e?"open":"closed"}function kg(e){return e==="indeterminate"}function PN(e){return kg(e)?"indeterminate":e?"checked":"unchecked"}function XY(e){const t=document.activeElement;for(const n of e)if(n===t||(n.focus(),document.activeElement!==t))return}function YY(e,t){return e.map((n,r)=>e[(t+r)%e.length])}function ZY(e,t,n){const s=t.length>1&&Array.from(t).every(u=>u===t[0])?t[0]:t,a=n?e.indexOf(n):-1;let o=YY(e,Math.max(a,0));s.length===1&&(o=o.filter(u=>u!==n));const c=o.find(u=>u.toLowerCase().startsWith(s.toLowerCase()));return c!==n?c:void 0}function QY(e,t){const{x:n,y:r}=e;let s=!1;for(let a=0,o=t.length-1;ar!=d>r&&n<(u-l)*(r-c)/(d-c)+l&&(s=!s)}return s}function JY(e,t){if(!t)return!1;const n={x:e.clientX,y:e.clientY};return QY(n,t)}function lh(e){return t=>t.pointerType==="mouse"?e(t):void 0}var eZ=a4,tZ=bN,nZ=o4,rZ=l4,sZ=NN,aZ=c4,iZ=zy,oZ=d4,lZ=h4,cZ=m4,uZ=v4,dZ=y4,fZ=x4,hZ=w4,pZ=S4,AN="DropdownMenu",[mZ,LPe]=Hr(AN,[r4]),Mr=r4(),[gZ,_4]=mZ(AN),P4=e=>{const{__scopeDropdownMenu:t,children:n,dir:r,open:s,defaultOpen:a,onOpenChange:o,modal:l=!0}=e,c=Mr(t),u=v.useRef(null),[d=!1,f]=aa({prop:s,defaultProp:a,onChange:o});return i.jsx(gZ,{scope:t,triggerId:Ys(),triggerRef:u,contentId:Ys(),open:d,onOpenChange:f,onOpenToggle:v.useCallback(()=>f(h=>!h),[f]),modal:l,children:i.jsx(eZ,{...c,open:d,onOpenChange:f,dir:r,modal:l,children:n})})};P4.displayName=AN;var A4="DropdownMenuTrigger",C4=v.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,disabled:r=!1,...s}=e,a=_4(A4,n),o=Mr(n);return i.jsx(tZ,{asChild:!0,...o,children:i.jsx(Ye.button,{type:"button",id:a.triggerId,"aria-haspopup":"menu","aria-expanded":a.open,"aria-controls":a.open?a.contentId:void 0,"data-state":a.open?"open":"closed","data-disabled":r?"":void 0,disabled:r,...s,ref:oy(t,a.triggerRef),onPointerDown:Ee(e.onPointerDown,l=>{!r&&l.button===0&&l.ctrlKey===!1&&(a.onOpenToggle(),a.open||l.preventDefault())}),onKeyDown:Ee(e.onKeyDown,l=>{r||(["Enter"," "].includes(l.key)&&a.onOpenToggle(),l.key==="ArrowDown"&&a.onOpenChange(!0),["Enter"," ","ArrowDown"].includes(l.key)&&l.preventDefault())})})})});C4.displayName=A4;var vZ="DropdownMenuPortal",E4=e=>{const{__scopeDropdownMenu:t,...n}=e,r=Mr(t);return i.jsx(nZ,{...r,...n})};E4.displayName=vZ;var O4="DropdownMenuContent",k4=v.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,s=_4(O4,n),a=Mr(n),o=v.useRef(!1);return i.jsx(rZ,{id:s.contentId,"aria-labelledby":s.triggerId,...a,...r,ref:t,onCloseAutoFocus:Ee(e.onCloseAutoFocus,l=>{var c;o.current||(c=s.triggerRef.current)==null||c.focus(),o.current=!1,l.preventDefault()}),onInteractOutside:Ee(e.onInteractOutside,l=>{const c=l.detail.originalEvent,u=c.button===0&&c.ctrlKey===!0,d=c.button===2||u;(!s.modal||d)&&(o.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)"}})});k4.displayName=O4;var yZ="DropdownMenuGroup",xZ=v.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,s=Mr(n);return i.jsx(sZ,{...s,...r,ref:t})});xZ.displayName=yZ;var bZ="DropdownMenuLabel",T4=v.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,s=Mr(n);return i.jsx(aZ,{...s,...r,ref:t})});T4.displayName=bZ;var wZ="DropdownMenuItem",$4=v.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,s=Mr(n);return i.jsx(iZ,{...s,...r,ref:t})});$4.displayName=wZ;var jZ="DropdownMenuCheckboxItem",M4=v.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,s=Mr(n);return i.jsx(oZ,{...s,...r,ref:t})});M4.displayName=jZ;var SZ="DropdownMenuRadioGroup",NZ=v.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,s=Mr(n);return i.jsx(lZ,{...s,...r,ref:t})});NZ.displayName=SZ;var _Z="DropdownMenuRadioItem",I4=v.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,s=Mr(n);return i.jsx(cZ,{...s,...r,ref:t})});I4.displayName=_Z;var PZ="DropdownMenuItemIndicator",R4=v.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,s=Mr(n);return i.jsx(uZ,{...s,...r,ref:t})});R4.displayName=PZ;var AZ="DropdownMenuSeparator",D4=v.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,s=Mr(n);return i.jsx(dZ,{...s,...r,ref:t})});D4.displayName=AZ;var CZ="DropdownMenuArrow",EZ=v.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,s=Mr(n);return i.jsx(fZ,{...s,...r,ref:t})});EZ.displayName=CZ;var OZ="DropdownMenuSubTrigger",L4=v.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,s=Mr(n);return i.jsx(hZ,{...s,...r,ref:t})});L4.displayName=OZ;var kZ="DropdownMenuSubContent",F4=v.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,s=Mr(n);return i.jsx(pZ,{...s,...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)"}})});F4.displayName=kZ;var TZ=P4,$Z=C4,MZ=E4,B4=k4,z4=T4,U4=$4,V4=M4,W4=I4,G4=R4,H4=D4,q4=L4,K4=F4;const zw=TZ,Uw=$Z,IZ=v.forwardRef(({className:e,inset:t,children:n,...r},s)=>i.jsxs(q4,{ref:s,className:Oe("flex cursor-default select-none items-center rounded-sm px-2 py-1.5 text-sm outline-none focus:bg-accent data-[state=open]:bg-accent",t&&"pl-8",e),...r,children:[n,i.jsx(gs,{className:"ml-auto h-4 w-4"})]}));IZ.displayName=q4.displayName;const RZ=v.forwardRef(({className:e,...t},n)=>i.jsx(K4,{ref:n,className:Oe("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}));RZ.displayName=K4.displayName;const Tg=v.forwardRef(({className:e,sideOffset:t=4,...n},r)=>i.jsx(MZ,{children:i.jsx(B4,{ref:r,sideOffset:t,className:Oe("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})}));Tg.displayName=B4.displayName;const Bi=v.forwardRef(({className:e,inset:t,...n},r)=>i.jsx(U4,{ref:r,className:Oe("relative flex cursor-default select-none items-center 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",t&&"pl-8",e),...n}));Bi.displayName=U4.displayName;const DZ=v.forwardRef(({className:e,children:t,checked:n,...r},s)=>i.jsxs(V4,{ref:s,className:Oe("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:[i.jsx("span",{className:"absolute left-2 flex h-3.5 w-3.5 items-center justify-center",children:i.jsx(G4,{children:i.jsx($a,{className:"h-4 w-4"})})}),t]}));DZ.displayName=V4.displayName;const LZ=v.forwardRef(({className:e,children:t,...n},r)=>i.jsxs(W4,{ref:r,className:Oe("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:[i.jsx("span",{className:"absolute left-2 flex h-3.5 w-3.5 items-center justify-center",children:i.jsx(G4,{children:i.jsx(FS,{className:"h-2 w-2 fill-current"})})}),t]}));LZ.displayName=W4.displayName;const FZ=v.forwardRef(({className:e,inset:t,...n},r)=>i.jsx(z4,{ref:r,className:Oe("px-2 py-1.5 text-sm font-semibold",t&&"pl-8",e),...n}));FZ.displayName=z4.displayName;const BZ=v.forwardRef(({className:e,...t},n)=>i.jsx(H4,{ref:n,className:Oe("-mx-1 my-1 h-px bg-muted",e),...t}));BZ.displayName=H4.displayName;var CN="Dialog",[X4,Y4]=Hr(CN),[zZ,ca]=X4(CN),Z4=e=>{const{__scopeDialog:t,children:n,open:r,defaultOpen:s,onOpenChange:a,modal:o=!0}=e,l=v.useRef(null),c=v.useRef(null),[u=!1,d]=aa({prop:r,defaultProp:s,onChange:a});return i.jsx(zZ,{scope:t,triggerRef:l,contentRef:c,contentId:Ys(),titleId:Ys(),descriptionId:Ys(),open:u,onOpenChange:d,onOpenToggle:v.useCallback(()=>d(f=>!f),[d]),modal:o,children:n})};Z4.displayName=CN;var Q4="DialogTrigger",J4=v.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,s=ca(Q4,n),a=xt(t,s.triggerRef);return i.jsx(Ye.button,{type:"button","aria-haspopup":"dialog","aria-expanded":s.open,"aria-controls":s.contentId,"data-state":kN(s.open),...r,ref:a,onClick:Ee(e.onClick,s.onOpenToggle)})});J4.displayName=Q4;var EN="DialogPortal",[UZ,eL]=X4(EN,{forceMount:void 0}),tL=e=>{const{__scopeDialog:t,forceMount:n,children:r,container:s}=e,a=ca(EN,t);return i.jsx(UZ,{scope:t,forceMount:n,children:v.Children.map(r,o=>i.jsx(lr,{present:n||a.open,children:i.jsx(dy,{asChild:!0,container:s,children:o})}))})};tL.displayName=EN;var $g="DialogOverlay",nL=v.forwardRef((e,t)=>{const n=eL($g,e.__scopeDialog),{forceMount:r=n.forceMount,...s}=e,a=ca($g,e.__scopeDialog);return a.modal?i.jsx(lr,{present:r||a.open,children:i.jsx(VZ,{...s,ref:t})}):null});nL.displayName=$g;var VZ=v.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,s=ca($g,n);return i.jsx(My,{as:ka,allowPinchZoom:!0,shards:[s.contentRef],children:i.jsx(Ye.div,{"data-state":kN(s.open),...r,ref:t,style:{pointerEvents:"auto",...r.style}})})}),Fl="DialogContent",rL=v.forwardRef((e,t)=>{const n=eL(Fl,e.__scopeDialog),{forceMount:r=n.forceMount,...s}=e,a=ca(Fl,e.__scopeDialog);return i.jsx(lr,{present:r||a.open,children:a.modal?i.jsx(WZ,{...s,ref:t}):i.jsx(GZ,{...s,ref:t})})});rL.displayName=Fl;var WZ=v.forwardRef((e,t)=>{const n=ca(Fl,e.__scopeDialog),r=v.useRef(null),s=xt(t,n.contentRef,r);return v.useEffect(()=>{const a=r.current;if(a)return aN(a)},[]),i.jsx(sL,{...e,ref:s,trapFocus:n.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:Ee(e.onCloseAutoFocus,a=>{var o;a.preventDefault(),(o=n.triggerRef.current)==null||o.focus()}),onPointerDownOutside:Ee(e.onPointerDownOutside,a=>{const o=a.detail.originalEvent,l=o.button===0&&o.ctrlKey===!0;(o.button===2||l)&&a.preventDefault()}),onFocusOutside:Ee(e.onFocusOutside,a=>a.preventDefault())})}),GZ=v.forwardRef((e,t)=>{const n=ca(Fl,e.__scopeDialog),r=v.useRef(!1),s=v.useRef(!1);return i.jsx(sL,{...e,ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:a=>{var o,l;(o=e.onCloseAutoFocus)==null||o.call(e,a),a.defaultPrevented||(r.current||(l=n.triggerRef.current)==null||l.focus(),a.preventDefault()),r.current=!1,s.current=!1},onInteractOutside:a=>{var c,u;(c=e.onInteractOutside)==null||c.call(e,a),a.defaultPrevented||(r.current=!0,a.detail.originalEvent.type==="pointerdown"&&(s.current=!0));const o=a.target;((u=n.triggerRef.current)==null?void 0:u.contains(o))&&a.preventDefault(),a.detail.originalEvent.type==="focusin"&&s.current&&a.preventDefault()}})}),sL=v.forwardRef((e,t)=>{const{__scopeDialog:n,trapFocus:r,onOpenAutoFocus:s,onCloseAutoFocus:a,...o}=e,l=ca(Fl,n),c=v.useRef(null),u=xt(t,c);return sN(),i.jsxs(i.Fragment,{children:[i.jsx(Ty,{asChild:!0,loop:!0,trapped:r,onMountAutoFocus:s,onUnmountAutoFocus:a,children:i.jsx(ep,{role:"dialog",id:l.contentId,"aria-describedby":l.descriptionId,"aria-labelledby":l.titleId,"data-state":kN(l.open),...o,ref:u,onDismiss:()=>l.onOpenChange(!1)})}),i.jsxs(i.Fragment,{children:[i.jsx(qZ,{titleId:l.titleId}),i.jsx(XZ,{contentRef:c,descriptionId:l.descriptionId})]})]})}),ON="DialogTitle",aL=v.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,s=ca(ON,n);return i.jsx(Ye.h2,{id:s.titleId,...r,ref:t})});aL.displayName=ON;var iL="DialogDescription",oL=v.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,s=ca(iL,n);return i.jsx(Ye.p,{id:s.descriptionId,...r,ref:t})});oL.displayName=iL;var lL="DialogClose",cL=v.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,s=ca(lL,n);return i.jsx(Ye.button,{type:"button",...r,ref:t,onClick:Ee(e.onClick,()=>s.onOpenChange(!1))})});cL.displayName=lL;function kN(e){return e?"open":"closed"}var uL="DialogTitleWarning",[HZ,dL]=vU(uL,{contentName:Fl,titleName:ON,docsSlug:"dialog"}),qZ=({titleId:e})=>{const t=dL(uL),n=`\`${t.contentName}\` requires a \`${t.titleName}\` for the component to be accessible for screen reader users. If you want to hide the \`${t.titleName}\`, you can wrap it with our VisuallyHidden component. -For more information, see https://radix-ui.com/primitives/docs/components/${t.docsSlug}`;return v.useEffect(()=>{e&&(document.getElementById(e)||console.error(n))},[n,e]),null},UZ="DialogDescriptionWarning",VZ=({contentRef:e,descriptionId:t})=>{const r=`Warning: Missing \`Description\` or \`aria-describedby={undefined}\` for {${oL(UZ).contentName}}.`;return v.useEffect(()=>{var a;const s=(a=e.current)==null?void 0:a.getAttribute("aria-describedby");t&&s&&(document.getElementById(t)||console.warn(r))},[r,e,t]),null},lL=q4,WZ=X4,cL=Z4,AN=Q4,CN=J4,EN=tL,ON=rL,kN=aL,uL="AlertDialog",[HZ,$Pe]=Gr(uL,[G4]),Ai=G4(),dL=e=>{const{__scopeAlertDialog:t,...n}=e,r=Ai(t);return i.jsx(lL,{...r,...n,modal:!0})};dL.displayName=uL;var GZ="AlertDialogTrigger",qZ=v.forwardRef((e,t)=>{const{__scopeAlertDialog:n,...r}=e,s=Ai(n);return i.jsx(WZ,{...s,...r,ref:t})});qZ.displayName=GZ;var KZ="AlertDialogPortal",fL=e=>{const{__scopeAlertDialog:t,...n}=e,r=Ai(t);return i.jsx(cL,{...r,...n})};fL.displayName=KZ;var XZ="AlertDialogOverlay",hL=v.forwardRef((e,t)=>{const{__scopeAlertDialog:n,...r}=e,s=Ai(n);return i.jsx(AN,{...s,...r,ref:t})});hL.displayName=XZ;var zc="AlertDialogContent",[YZ,ZZ]=HZ(zc),pL=v.forwardRef((e,t)=>{const{__scopeAlertDialog:n,children:r,...s}=e,a=Ai(n),o=v.useRef(null),l=xt(t,o),c=v.useRef(null);return i.jsx(BZ,{contentName:zc,titleName:mL,docsSlug:"alert-dialog",children:i.jsx(YZ,{scope:n,cancelRef:c,children:i.jsxs(CN,{role:"alertdialog",...a,...s,ref:l,onOpenAutoFocus:Ee(s.onOpenAutoFocus,u=>{var d;u.preventDefault(),(d=c.current)==null||d.focus({preventScroll:!0})}),onPointerDownOutside:u=>u.preventDefault(),onInteractOutside:u=>u.preventDefault(),children:[i.jsx(fS,{children:r}),i.jsx(JZ,{contentRef:o})]})})})});pL.displayName=zc;var mL="AlertDialogTitle",gL=v.forwardRef((e,t)=>{const{__scopeAlertDialog:n,...r}=e,s=Ai(n);return i.jsx(EN,{...s,...r,ref:t})});gL.displayName=mL;var vL="AlertDialogDescription",yL=v.forwardRef((e,t)=>{const{__scopeAlertDialog:n,...r}=e,s=Ai(n);return i.jsx(ON,{...s,...r,ref:t})});yL.displayName=vL;var QZ="AlertDialogAction",xL=v.forwardRef((e,t)=>{const{__scopeAlertDialog:n,...r}=e,s=Ai(n);return i.jsx(kN,{...s,...r,ref:t})});xL.displayName=QZ;var bL="AlertDialogCancel",wL=v.forwardRef((e,t)=>{const{__scopeAlertDialog:n,...r}=e,{cancelRef:s}=ZZ(bL,n),a=Ai(n),o=xt(t,s);return i.jsx(kN,{...a,...r,ref:o})});wL.displayName=bL;var JZ=({contentRef:e})=>{const t=`\`${zc}\` requires a description for the component to be accessible for screen reader users. +For more information, see https://radix-ui.com/primitives/docs/components/${t.docsSlug}`;return v.useEffect(()=>{e&&(document.getElementById(e)||console.error(n))},[n,e]),null},KZ="DialogDescriptionWarning",XZ=({contentRef:e,descriptionId:t})=>{const r=`Warning: Missing \`Description\` or \`aria-describedby={undefined}\` for {${dL(KZ).contentName}}.`;return v.useEffect(()=>{var a;const s=(a=e.current)==null?void 0:a.getAttribute("aria-describedby");t&&s&&(document.getElementById(t)||console.warn(r))},[r,e,t]),null},fL=Z4,YZ=J4,hL=tL,TN=nL,$N=rL,MN=aL,IN=oL,RN=cL,pL="AlertDialog",[ZZ,FPe]=Hr(pL,[Y4]),Ci=Y4(),mL=e=>{const{__scopeAlertDialog:t,...n}=e,r=Ci(t);return i.jsx(fL,{...r,...n,modal:!0})};mL.displayName=pL;var QZ="AlertDialogTrigger",JZ=v.forwardRef((e,t)=>{const{__scopeAlertDialog:n,...r}=e,s=Ci(n);return i.jsx(YZ,{...s,...r,ref:t})});JZ.displayName=QZ;var eQ="AlertDialogPortal",gL=e=>{const{__scopeAlertDialog:t,...n}=e,r=Ci(t);return i.jsx(hL,{...r,...n})};gL.displayName=eQ;var tQ="AlertDialogOverlay",vL=v.forwardRef((e,t)=>{const{__scopeAlertDialog:n,...r}=e,s=Ci(n);return i.jsx(TN,{...s,...r,ref:t})});vL.displayName=tQ;var zc="AlertDialogContent",[nQ,rQ]=ZZ(zc),yL=v.forwardRef((e,t)=>{const{__scopeAlertDialog:n,children:r,...s}=e,a=Ci(n),o=v.useRef(null),l=xt(t,o),c=v.useRef(null);return i.jsx(HZ,{contentName:zc,titleName:xL,docsSlug:"alert-dialog",children:i.jsx(nQ,{scope:n,cancelRef:c,children:i.jsxs($N,{role:"alertdialog",...a,...s,ref:l,onOpenAutoFocus:Ee(s.onOpenAutoFocus,u=>{var d;u.preventDefault(),(d=c.current)==null||d.focus({preventScroll:!0})}),onPointerDownOutside:u=>u.preventDefault(),onInteractOutside:u=>u.preventDefault(),children:[i.jsx(gS,{children:r}),i.jsx(aQ,{contentRef:o})]})})})});yL.displayName=zc;var xL="AlertDialogTitle",bL=v.forwardRef((e,t)=>{const{__scopeAlertDialog:n,...r}=e,s=Ci(n);return i.jsx(MN,{...s,...r,ref:t})});bL.displayName=xL;var wL="AlertDialogDescription",jL=v.forwardRef((e,t)=>{const{__scopeAlertDialog:n,...r}=e,s=Ci(n);return i.jsx(IN,{...s,...r,ref:t})});jL.displayName=wL;var sQ="AlertDialogAction",SL=v.forwardRef((e,t)=>{const{__scopeAlertDialog:n,...r}=e,s=Ci(n);return i.jsx(RN,{...s,...r,ref:t})});SL.displayName=sQ;var NL="AlertDialogCancel",_L=v.forwardRef((e,t)=>{const{__scopeAlertDialog:n,...r}=e,{cancelRef:s}=rQ(NL,n),a=Ci(n),o=xt(t,s);return i.jsx(RN,{...a,...r,ref:o})});_L.displayName=NL;var aQ=({contentRef:e})=>{const t=`\`${zc}\` requires a description for the component to be accessible for screen reader users. -You can add a description to the \`${zc}\` by passing a \`${vL}\` component as a child, which also benefits sighted users by adding visible context to the dialog. +You can add a description to the \`${zc}\` by passing a \`${wL}\` component as a child, which also benefits sighted users by adding visible context to the dialog. Alternatively, you can use your own component as a description by assigning it an \`id\` and passing the same value to the \`aria-describedby\` prop in \`${zc}\`. If the description is confusing or duplicative for sighted users, you can use the \`@radix-ui/react-visually-hidden\` primitive as a wrapper around your description component. -For more information, see https://radix-ui.com/primitives/docs/components/alert-dialog`;return v.useEffect(()=>{var r;document.getElementById((r=e.current)==null?void 0:r.getAttribute("aria-describedby"))||console.warn(t)},[t,e]),null},eQ=dL,tQ=fL,jL=hL,SL=pL,NL=xL,_L=wL,PL=gL,AL=yL;const zw=eQ,nQ=tQ,CL=v.forwardRef(({className:e,...t},n)=>i.jsx(jL,{className:Me("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,ref:n}));CL.displayName=jL.displayName;const Tg=v.forwardRef(({className:e,...t},n)=>i.jsxs(nQ,{children:[i.jsx(CL,{}),i.jsx(SL,{ref:n,className:Me("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),...t})]}));Tg.displayName=SL.displayName;const $g=({className:e,...t})=>i.jsx("div",{className:Me("flex flex-col space-y-2 text-center sm:text-left",e),...t});$g.displayName="AlertDialogHeader";const Mg=({className:e,...t})=>i.jsx("div",{className:Me("flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2",e),...t});Mg.displayName="AlertDialogFooter";const Ig=v.forwardRef(({className:e,...t},n)=>i.jsx(PL,{ref:n,className:Me("text-lg font-semibold",e),...t}));Ig.displayName=PL.displayName;const Rg=v.forwardRef(({className:e,...t},n)=>i.jsx(AL,{ref:n,className:Me("text-sm text-muted-foreground",e),...t}));Rg.displayName=AL.displayName;const Dg=v.forwardRef(({className:e,...t},n)=>i.jsx(NL,{ref:n,className:Me(WS(),e),...t}));Dg.displayName=NL.displayName;const Lg=v.forwardRef(({className:e,...t},n)=>i.jsx(_L,{ref:n,className:Me(WS({variant:"outline"}),"mt-2 sm:mt-0",e),...t}));Lg.displayName=_L.displayName;const wl=lL,rQ=cL,EL=v.forwardRef(({className:e,...t},n)=>i.jsx(AN,{ref:n,className:Me("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}));EL.displayName=AN.displayName;const ho=v.forwardRef(({className:e,children:t,...n},r)=>i.jsxs(rQ,{children:[i.jsx(EL,{}),i.jsxs(CN,{ref:r,className:Me("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,i.jsxs(kN,{className:"absolute right-4 top-4 z-[100] 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:[i.jsx(Zs,{className:"h-4 w-4"}),i.jsx("span",{className:"sr-only",children:"Close"})]})]})]}));ho.displayName=CN.displayName;const po=({className:e,...t})=>i.jsx("div",{className:Me("flex flex-col space-y-1.5 text-center sm:text-left",e),...t});po.displayName="DialogHeader";const mo=({className:e,...t})=>i.jsx("div",{className:Me("flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2",e),...t});mo.displayName="DialogFooter";const go=v.forwardRef(({className:e,...t},n)=>i.jsx(EN,{ref:n,className:Me("text-lg font-semibold leading-none tracking-tight",e),...t}));go.displayName=EN.displayName;const jl=v.forwardRef(({className:e,...t},n)=>i.jsx(ON,{ref:n,className:Me("text-sm text-muted-foreground",e),...t}));jl.displayName=ON.displayName;var TN="Radio",[sQ,OL]=Gr(TN),[aQ,iQ]=sQ(TN),kL=v.forwardRef((e,t)=>{const{__scopeRadio:n,name:r,checked:s=!1,required:a,disabled:o,value:l="on",onCheck:c,form:u,...d}=e,[f,h]=v.useState(null),p=xt(t,y=>h(y)),g=v.useRef(!1),m=f?u||!!f.closest("form"):!0;return i.jsxs(aQ,{scope:n,checked:s,disabled:o,children:[i.jsx(Ye.button,{type:"button",role:"radio","aria-checked":s,"data-state":ML(s),"data-disabled":o?"":void 0,disabled:o,value:l,...d,ref:p,onClick:Ee(e.onClick,y=>{s||c==null||c(),m&&(g.current=y.isPropagationStopped(),g.current||y.stopPropagation())})}),m&&i.jsx(oQ,{control:f,bubbles:!g.current,name:r,value:l,checked:s,required:a,disabled:o,form:u,style:{transform:"translateX(-100%)"}})]})});kL.displayName=TN;var TL="RadioIndicator",$L=v.forwardRef((e,t)=>{const{__scopeRadio:n,forceMount:r,...s}=e,a=iQ(TL,n);return i.jsx(lr,{present:r||a.checked,children:i.jsx(Ye.span,{"data-state":ML(a.checked),"data-disabled":a.disabled?"":void 0,...s,ref:t})})});$L.displayName=TL;var oQ=e=>{const{control:t,checked:n,bubbles:r=!0,...s}=e,a=v.useRef(null),o=ip(n),l=tp(t);return v.useEffect(()=>{const c=a.current,u=window.HTMLInputElement.prototype,f=Object.getOwnPropertyDescriptor(u,"checked").set;if(o!==n&&f){const h=new Event("click",{bubbles:r});f.call(c,n),c.dispatchEvent(h)}},[o,n,r]),i.jsx("input",{type:"radio","aria-hidden":!0,defaultChecked:n,...s,tabIndex:-1,ref:a,style:{...e.style,...l,position:"absolute",pointerEvents:"none",opacity:0,margin:0}})};function ML(e){return e?"checked":"unchecked"}var lQ=["ArrowUp","ArrowDown","ArrowLeft","ArrowRight"],$N="RadioGroup",[cQ,MPe]=Gr($N,[ed,OL]),IL=ed(),RL=OL(),[uQ,dQ]=cQ($N),DL=v.forwardRef((e,t)=>{const{__scopeRadioGroup:n,name:r,defaultValue:s,value:a,required:o=!1,disabled:l=!1,orientation:c,dir:u,loop:d=!0,onValueChange:f,...h}=e,p=IL(n),g=Xl(u),[m,y]=aa({prop:a,defaultProp:s,onChange:f});return i.jsx(uQ,{scope:n,name:r,required:o,disabled:l,value:m,onValueChange:y,children:i.jsx(dN,{asChild:!0,...p,orientation:c,dir:g,loop:d,children:i.jsx(Ye.div,{role:"radiogroup","aria-required":o,"aria-orientation":c,"data-disabled":l?"":void 0,dir:g,...h,ref:t})})})});DL.displayName=$N;var LL="RadioGroupItem",FL=v.forwardRef((e,t)=>{const{__scopeRadioGroup:n,disabled:r,...s}=e,a=dQ(LL,n),o=a.disabled||r,l=IL(n),c=RL(n),u=v.useRef(null),d=xt(t,u),f=a.value===s.value,h=v.useRef(!1);return v.useEffect(()=>{const p=m=>{lQ.includes(m.key)&&(h.current=!0)},g=()=>h.current=!1;return document.addEventListener("keydown",p),document.addEventListener("keyup",g),()=>{document.removeEventListener("keydown",p),document.removeEventListener("keyup",g)}},[]),i.jsx(fN,{asChild:!0,...l,focusable:!o,active:f,children:i.jsx(kL,{disabled:o,required:a.required,checked:f,...c,...s,name:a.name,ref:d,onCheck:()=>a.onValueChange(s.value),onKeyDown:Ee(p=>{p.key==="Enter"&&p.preventDefault()}),onFocus:Ee(s.onFocus,()=>{var p;h.current&&((p=u.current)==null||p.click())})})})});FL.displayName=LL;var fQ="RadioGroupIndicator",BL=v.forwardRef((e,t)=>{const{__scopeRadioGroup:n,...r}=e,s=RL(n);return i.jsx($L,{...s,...r,ref:t})});BL.displayName=fQ;var zL=DL,UL=FL,hQ=BL;const Uw=v.forwardRef(({className:e,...t},n)=>i.jsx(zL,{className:Me("grid gap-2",e),...t,ref:n}));Uw.displayName=zL.displayName;const Zd=v.forwardRef(({className:e,...t},n)=>i.jsx(UL,{ref:n,className:Me("aspect-square h-4 w-4 rounded-full border border-primary text-primary ring-offset-background focus:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50",e),...t,children:i.jsx(hQ,{className:"flex items-center justify-center",children:i.jsx(MS,{className:"h-2.5 w-2.5 fill-current text-current"})})}));Zd.displayName=UL.displayName;var MN="Checkbox",[pQ,IPe]=Gr(MN),[mQ,gQ]=pQ(MN),VL=v.forwardRef((e,t)=>{const{__scopeCheckbox:n,name:r,checked:s,defaultChecked:a,required:o,disabled:l,value:c="on",onCheckedChange:u,form:d,...f}=e,[h,p]=v.useState(null),g=xt(t,j=>p(j)),m=v.useRef(!1),y=h?d||!!h.closest("form"):!0,[b=!1,x]=aa({prop:s,defaultProp:a,onChange:u}),w=v.useRef(b);return v.useEffect(()=>{const j=h==null?void 0:h.form;if(j){const S=()=>x(w.current);return j.addEventListener("reset",S),()=>j.removeEventListener("reset",S)}},[h,x]),i.jsxs(mQ,{scope:n,state:b,disabled:l,children:[i.jsx(Ye.button,{type:"button",role:"checkbox","aria-checked":vo(b)?"mixed":b,"aria-required":o,"data-state":GL(b),"data-disabled":l?"":void 0,disabled:l,value:c,...f,ref:g,onKeyDown:Ee(e.onKeyDown,j=>{j.key==="Enter"&&j.preventDefault()}),onClick:Ee(e.onClick,j=>{x(S=>vo(S)?!0:!S),y&&(m.current=j.isPropagationStopped(),m.current||j.stopPropagation())})}),y&&i.jsx(vQ,{control:h,bubbles:!m.current,name:r,value:c,checked:b,required:o,disabled:l,form:d,style:{transform:"translateX(-100%)"},defaultChecked:vo(a)?!1:a})]})});VL.displayName=MN;var WL="CheckboxIndicator",HL=v.forwardRef((e,t)=>{const{__scopeCheckbox:n,forceMount:r,...s}=e,a=gQ(WL,n);return i.jsx(lr,{present:r||vo(a.state)||a.state===!0,children:i.jsx(Ye.span,{"data-state":GL(a.state),"data-disabled":a.disabled?"":void 0,...s,ref:t,style:{pointerEvents:"none",...e.style}})})});HL.displayName=WL;var vQ=e=>{const{control:t,checked:n,bubbles:r=!0,defaultChecked:s,...a}=e,o=v.useRef(null),l=ip(n),c=tp(t);v.useEffect(()=>{const d=o.current,f=window.HTMLInputElement.prototype,p=Object.getOwnPropertyDescriptor(f,"checked").set;if(l!==n&&p){const g=new Event("click",{bubbles:r});d.indeterminate=vo(n),p.call(d,vo(n)?!1:n),d.dispatchEvent(g)}},[l,n,r]);const u=v.useRef(vo(n)?!1:n);return i.jsx("input",{type:"checkbox","aria-hidden":!0,defaultChecked:s??u.current,...a,tabIndex:-1,ref:o,style:{...e.style,...c,position:"absolute",pointerEvents:"none",opacity:0,margin:0}})};function vo(e){return e==="indeterminate"}function GL(e){return vo(e)?"indeterminate":e?"checked":"unchecked"}var qL=VL,yQ=HL;const ol=v.forwardRef(({className:e,...t},n)=>i.jsx(qL,{ref:n,className:Me("peer h-4 w-4 shrink-0 rounded-sm border border-primary ring-offset-background focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50 data-[state=checked]:bg-primary data-[state=checked]:text-primary-foreground",e),...t,children:i.jsx(yQ,{className:Me("flex items-center justify-center text-current"),children:i.jsx(Ta,{className:"h-4 w-4"})})}));ol.displayName=qL.displayName;const IN=({isActive:e,isComplete:t,hasError:n,label:r,onComplete:s,className:a})=>{const[o,l]=v.useState(0),[c,u]=v.useState("progressing"),[d,f]=v.useState(!1),h=v.useRef(null),p=v.useRef(null),g=()=>{h.current&&(clearInterval(h.current),h.current=null),p.current&&(clearTimeout(p.current),p.current=null)},m=()=>{g(),l(0),u("progressing"),f(!1)},y=j=>{g(),u("completing");const S=100-j,N=50,_=500/N,P=S/_;let k=0;h.current=setInterval(()=>{k++;const O=j+P*k;O>=100||k>=_?(l(100),u("completed"),g(),p.current=setTimeout(()=>{u("hiding"),setTimeout(()=>{m(),s==null||s()},300)},2e3)):l(O)},N)},b=()=>{c==="progressing"&&y(o)},x=()=>{c==="waiting"&&y(90)},w=()=>{g()};return v.useEffect(()=>{if(e&&!d){f(!0),l(0),u("progressing");const j=90/540;let S=0;h.current=setInterval(()=>{S+=j,S>=90?(l(90),u("waiting"),g()):l(S)},100)}return t&&c==="progressing"&&b(),t&&c==="waiting"&&x(),n&&(c==="progressing"||c==="waiting")&&w(),!e&&d&&m(),()=>{e||g()}},[e,t,n,c,d]),v.useEffect(()=>()=>{g()},[]),d?i.jsxs("div",{className:Me("w-full space-y-2",a),children:[r&&i.jsxs("div",{className:"flex justify-between items-center text-sm text-muted-foreground",children:[i.jsx("span",{children:c==="waiting"?`${r} - finalizing...`:r}),i.jsxs("span",{children:[Math.round(o),"%"]})]}),i.jsx(al,{value:o,className:Me("w-full transition-all duration-200",n&&"opacity-75",c==="completed"&&"bg-green-100")}),n&&i.jsx("div",{className:"text-sm text-red-600",children:"Generation failed. Please try again."}),c==="completed"&&!n&&i.jsx("div",{className:"text-sm text-green-600",children:"Generation completed successfully!"})]}):null},xn="all",xQ=()=>{var Lt,tn,Xr,za;const e=v.useCallback(()=>{document.body.style.pointerEvents==="none"&&(console.log("ensureBodyInteractive: Fixing body pointer-events..."),document.body.style.pointerEvents="auto")},[]),t=Tn(),[n]=iW(),{loadPersonas:r}=hD(),[s,a]=v.useState("view"),[o,l]=v.useState("ai"),[c,u]=v.useState("");v.useState(null);const[d,f]=v.useState(xn),[h,p]=v.useState(!1),[g,m]=v.useState("");v.useEffect(()=>{const G=n.get("mode");(G==="view"||G==="create")&&a(G)},[n]);const[y,b]=v.useState([]),[x,w]=v.useState([]),[j,S]=v.useState(!0);v.useState(null);const[N,_]=v.useState(new Set),[P,k]=v.useState(!1),[O,M]=v.useState(null),[A,$]=v.useState(""),[L,H]=v.useState(!1),[D,V]=v.useState(null),[T,F]=v.useState(!1),[q,Z]=v.useState(null),[re,ge]=v.useState(!1),[B,le]=v.useState({age:[],gender:[],occupation:[],location:[],techSavviness:[],ethnicity:[],folderStatus:[]}),[se,ce]=v.useState({age:[],gender:[],occupation:[],location:[],techSavviness:[],ethnicity:[],folderStatus:[]}),[De,de]=v.useState(!1),[be,Pe]=v.useState(!1),[ne,Je]=v.useState(!1),[ve,at]=v.useState(!1),[st,Mt]=v.useState("gemini-2.5-pro"),C=()=>{de(!1),Pe(!1),Je(!1)},R=G=>{const Ce={age:new Set,gender:new Set,occupation:new Set,location:new Set,techSavviness:new Set,ethnicity:new Set};return G.forEach(Oe=>{if(Oe.age&&Ce.age.add(Oe.age),Oe.gender&&Ce.gender.add(Oe.gender),Oe.occupation&&Ce.occupation.add(Oe.occupation),Oe.location&&Ce.location.add(Oe.location),Oe.techSavviness!==void 0){const Ue=Oe.techSavviness<30?"Low (0-30)":Oe.techSavviness<70?"Medium (31-70)":"High (71-100)";Ce.techSavviness.add(Ue)}Oe.ethnicity&&Ce.ethnicity.add(Oe.ethnicity)}),{age:Array.from(Ce.age).sort(),gender:Array.from(Ce.gender).sort(),occupation:Array.from(Ce.occupation).sort(),location:Array.from(Ce.location).sort(),techSavviness:Array.from(Ce.techSavviness).sort((Oe,Ue)=>{const Le=["Low (0-30)","Medium (31-70)","High (71-100)"];return Le.indexOf(Oe)-Le.indexOf(Ue)}),ethnicity:Array.from(Ce.ethnicity).sort()}},U=()=>{ge(!1),setTimeout(()=>{le({...se})},0)},X=()=>{ce({age:[],gender:[],occupation:[],location:[],techSavviness:[],ethnicity:[],folderStatus:[]})},Q=(G,Ce)=>{ce(Oe=>{const Ue={...Oe};return Ue[G].includes(Ce)?Ue[G]=Ue[G].filter(Le=>Le!==Ce):Ue[G]=[...Ue[G],Ce],Ue})},z=async()=>{S(!0);try{const Oe=(await Dn.getAll()).data;{const Le=[...Oe.map(ft=>({...ft,id:ft.id||ft._id}))];try{(async()=>{const J=await r();console.log("Loaded stored personas (for debugging only):",J?J.length:0)})()}catch(ft){console.warn("Error loading stored personas:",ft)}b(Le)}}catch(Ce){console.error("Error fetching personas:",Ce),Ke.error("Failed to load personas"),b([])}finally{S(!1)}},ee=(G,Ce)=>(G.forEach(Oe=>{if(Oe.folderId){const Ue=Ce.find(Le=>Le.id===Oe.folderId);Ue&&!Ue.personaIds.includes(Oe.id)&&Ue.personaIds.push(Oe.id)}}),Ce.forEach(Oe=>{Oe.personaIds=Oe.personaIds.filter(Ue=>{const Le=G.find(ft=>ft.id===Ue);return Le&&(!Le.folderId||Le.folderId===Oe.id)})}),Ce);v.useEffect(()=>{let G=!0;const Ce=localStorage.getItem("persona-folders");let Oe=[];if(Ce)try{Oe=JSON.parse(Ce),w(Oe)}catch(Le){console.error("Failed to parse stored folders:",Le)}return(async()=>{if(await z(),G&&y.length>0){const Le=ee(y,Oe);w(Le)}})(),()=>{G=!1}},[e]),v.useEffect(()=>{var G;if(s==="view")z();else if(s==="create"&&(console.log(`Switching to create mode with folder: ${d}, ${d!==xn?"NOT default":"IS default"}`),d!==xn)){const Ce=(G=x.find(Oe=>Oe.id===d))==null?void 0:G.name;console.log(`Selected folder for creation: ${d} (${Ce})`)}},[s]),v.useEffect(()=>{if(y.length>0){const G=x.map(Oe=>({...Oe,personaIds:[...Oe.personaIds]})),Ce=ee(y,G);w(Ce)}},[y]),v.useEffect(()=>{z();const G=()=>{window.location.pathname.includes("/synthetic-users")&&!window.location.pathname.includes("/synthetic-users/")&&(console.log("Navigation to synthetic users page detected, refreshing data"),z())},Ce=()=>{console.log("Synthetic users navigation event detected, refreshing data"),z()};console.log("Setting up MutationObserver for body style");const Oe=new MutationObserver(Ue=>{Ue.forEach(Le=>{Le.type==="attributes"&&Le.attributeName==="style"&&document.body.style.pointerEvents==="none"&&(console.log("MutationObserver detected pointer-events: none, fixing..."),e())})});return Oe.observe(document.body,{attributes:!0,attributeFilter:["style"]}),e(),window.addEventListener("popstate",G),window.addEventListener("syntheticUsersNavigation",Ce),()=>{window.removeEventListener("popstate",G),window.removeEventListener("syntheticUsersNavigation",Ce),console.log("Disconnecting MutationObserver"),Oe.disconnect()}},[]),v.useEffect(()=>{x.length>0&&localStorage.setItem("persona-folders",JSON.stringify(x))},[x]),v.useEffect(()=>{if(y.length>0&&x.length>0){const G=ee(y,[...x]);JSON.stringify(G)!==JSON.stringify(x)&&w(G)}},[y,x.length]);const me=()=>{if(!g.trim()){Ke.error("Please enter a folder name");return}const G={id:`folder-${Date.now()}`,name:g.trim(),personaIds:[]};w([...x,G]),m(""),p(!1),Ke.success(`Folder "${g}" created`)},Se=()=>{m(""),p(!1)},Ie=G=>{M(G),$(G.name)},we=()=>{if(!O||!A.trim()){M(null);return}const G=x.map(Ce=>Ce.id===O.id?{...Ce,name:A.trim()}:Ce);w(G),M(null),Ke.success(`Folder renamed to "${A}"`)},ze=()=>{M(null),$("")},gt=G=>{V(G),H(!0)},jt=()=>{D&&(w(x.filter(G=>G.id!==D.id)),d===D.id&&f(xn),H(!1),V(null),Ke.success(`Folder "${D.name}" deleted`))},Ge=async(G,Ce)=>{var ft;const Oe=G||N,Ue=Ce||q;if(!Ue||Oe.size===0)return;const Le=Array.from(Oe);try{const J=x.map(K=>{if(K.id===Ue){const W=[...K.personaIds];return Le.forEach(ie=>{W.includes(ie)||W.push(ie)}),{...K,personaIds:W}}else return{...K,personaIds:K.personaIds.filter(W=>!Le.includes(W))}});w(J),localStorage.setItem("persona-folders",JSON.stringify(J));const Y=Le.map(async K=>{try{const W=y.find(ie=>ie.id===K);if(W){const ie={...W,folderId:Ue===xn?null:Ue},he=W._id||W.id;return await Dn.update(he,ie),{success:!0,id:K}}return{success:!1,id:K,error:"Persona not found locally"}}catch(W){return console.error(`Failed to update folder for persona ${K}:`,W),{success:!1,id:K,error:W}}}),ye=await Promise.all(Y),xe=ye.filter(K=>K.success).map(K=>K.id),je=ye.filter(K=>!K.success),Qe=y.map(K=>xe.includes(K.id)?{...K,folderId:Ue===xn?null:Ue}:K);b(Qe);const I=Ue===xn?"All Personas":((ft=x.find(K=>K.id===Ue))==null?void 0:ft.name)||"folder";return xe.length>0&&Ke.success(`Moved ${xe.length} persona${xe.length!==1?"s":""} to ${I}`),je.length>0&&(Ke.error(`Failed to move ${je.length} persona${je.length!==1?"s":""}.`),console.error("Failed updates:",je)),G||_(new Set),{success:xe.length>0,successCount:xe.length,failureCount:je.length}}catch(J){return console.error("Error moving personas to folder:",J),Ke.error("An unexpected error occurred while moving personas."),{success:!1,error:J}}},Ze=async()=>{var ft;if(N.size===0||d===xn)return;const G=Array.from(N),Ce=x.map(J=>J.id===d?{...J,personaIds:J.personaIds.filter(Y=>!G.includes(Y))}:J);w(Ce);const Oe=[],Ue=[];for(const J of G)try{const Y=y.find(ye=>ye.id===J);if(Y){const ye={...Y,folderId:null},xe=Y._id||Y.id;await Dn.update(xe,ye),Oe.push(J)}}catch(Y){console.error(`Failed to update persona ${J}:`,Y),Ue.push(J)}b(J=>J.map(Y=>Oe.includes(Y.id)?{...Y,folderId:null}:Y)),_(new Set);const Le=((ft=x.find(J=>J.id===d))==null?void 0:ft.name)||"folder";Oe.length>0&&Ke.success(`Removed ${Oe.length} persona${Oe.length!==1?"s":""} from ${Le}`),Ue.length>0&&Ke.error(`Failed to remove ${Ue.length} persona${Ue.length!==1?"s":""} from ${Le}`)},kt=G=>{_(Ce=>{const Oe=new Set(Ce);return Oe.has(G)?Oe.delete(G):Oe.add(G),Oe})},Vt=()=>{N.size===an.length?_(new Set):_(new Set(an.map(G=>G.id)))},Xn=async()=>{if(N.size===0)return;const G=Array.from(N);_(new Set),k(!1),S(!0);const Ce=[],Oe=[];for(const Ue of G)try{const Le=y.find(J=>J.id===Ue);if(!Le){console.error(`Could not find persona with id: ${Ue}`),Oe.push(Ue);continue}let ft=Ue;Le._id&&(ft=Le._id.toString()),console.log(`Attempting to delete persona: ${ft}`),await Dn.delete(ft),Ce.push(Ue)}catch(Le){console.error(`Failed to delete persona ${Ue}:`,Le),Oe.push(Ue)}b(Ue=>Ue.filter(Le=>!Ce.includes(Le.id))),w(Ue=>{const Le=Ue.map(ft=>({...ft,personaIds:ft.personaIds.filter(J=>!Ce.includes(J))}));return localStorage.setItem("persona-folders",JSON.stringify(Le)),Le}),S(!1),setTimeout(()=>{Ce.length>0&&Ke.success(`Successfully deleted ${Ce.length} persona${Ce.length!==1?"s":""}`),Oe.length>0&&Ke.error(`Failed to delete ${Oe.length} persona${Oe.length!==1?"s":""}`),(Ce.length>0||Oe.length>0)&&z()},50)},an=y.filter(G=>{const Ce=G.name.toLowerCase().includes(c.toLowerCase())||G.occupation.toLowerCase().includes(c.toLowerCase())||G.location.toLowerCase().includes(c.toLowerCase()),Oe=(B.age.length===0||B.age.includes(G.age))&&(B.gender.length===0||B.gender.includes(G.gender))&&(B.occupation.length===0||B.occupation.includes(G.occupation))&&(B.location.length===0||B.location.includes(G.location))&&(B.ethnicity.length===0||G.ethnicity&&B.ethnicity.includes(G.ethnicity))&&(B.techSavviness.length===0||G.techSavviness!==void 0&&B.techSavviness.includes(G.techSavviness<30?"Low (0-30)":G.techSavviness<70?"Medium (31-70)":"High (71-100)"))&&(B.folderStatus.length===0||B.folderStatus.includes("hasFolder")&&B.folderStatus.includes("noFolder")||B.folderStatus.includes("hasFolder")&&!B.folderStatus.includes("noFolder")&&G.folderId&&G.folderId!==xn||B.folderStatus.includes("noFolder")&&!B.folderStatus.includes("hasFolder")&&(!G.folderId||G.folderId===xn));if(d===xn||G.folderId===d)return Ce&&Oe;const Ue=x.find(Le=>Le.id===d);return Ue&&Ue.personaIds.includes(G.id)&&Ce&&Oe}),pt=(G,Ce)=>{const Oe=new Date().toISOString().split("T")[0],Ue=G.length;let Le=`# Persona Summary Report +For more information, see https://radix-ui.com/primitives/docs/components/alert-dialog`;return v.useEffect(()=>{var r;document.getElementById((r=e.current)==null?void 0:r.getAttribute("aria-describedby"))||console.warn(t)},[t,e]),null},iQ=mL,oQ=gL,PL=vL,AL=yL,CL=SL,EL=_L,OL=bL,kL=jL;const Vw=iQ,lQ=oQ,TL=v.forwardRef(({className:e,...t},n)=>i.jsx(PL,{className:Oe("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,ref:n}));TL.displayName=PL.displayName;const Mg=v.forwardRef(({className:e,...t},n)=>i.jsxs(lQ,{children:[i.jsx(TL,{}),i.jsx(AL,{ref:n,className:Oe("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),...t})]}));Mg.displayName=AL.displayName;const Ig=({className:e,...t})=>i.jsx("div",{className:Oe("flex flex-col space-y-2 text-center sm:text-left",e),...t});Ig.displayName="AlertDialogHeader";const Rg=({className:e,...t})=>i.jsx("div",{className:Oe("flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2",e),...t});Rg.displayName="AlertDialogFooter";const Dg=v.forwardRef(({className:e,...t},n)=>i.jsx(OL,{ref:n,className:Oe("text-lg font-semibold",e),...t}));Dg.displayName=OL.displayName;const Lg=v.forwardRef(({className:e,...t},n)=>i.jsx(kL,{ref:n,className:Oe("text-sm text-muted-foreground",e),...t}));Lg.displayName=kL.displayName;const Fg=v.forwardRef(({className:e,...t},n)=>i.jsx(CL,{ref:n,className:Oe(XS(),e),...t}));Fg.displayName=CL.displayName;const Bg=v.forwardRef(({className:e,...t},n)=>i.jsx(EL,{ref:n,className:Oe(XS({variant:"outline"}),"mt-2 sm:mt-0",e),...t}));Bg.displayName=EL.displayName;const wl=fL,cQ=hL,$L=v.forwardRef(({className:e,...t},n)=>i.jsx(TN,{ref:n,className:Oe("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}));$L.displayName=TN.displayName;const ho=v.forwardRef(({className:e,children:t,...n},r)=>i.jsxs(cQ,{children:[i.jsx($L,{}),i.jsxs($N,{ref:r,className:Oe("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,i.jsxs(RN,{className:"absolute right-4 top-4 z-[100] 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:[i.jsx(Zs,{className:"h-4 w-4"}),i.jsx("span",{className:"sr-only",children:"Close"})]})]})]}));ho.displayName=$N.displayName;const po=({className:e,...t})=>i.jsx("div",{className:Oe("flex flex-col space-y-1.5 text-center sm:text-left",e),...t});po.displayName="DialogHeader";const mo=({className:e,...t})=>i.jsx("div",{className:Oe("flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2",e),...t});mo.displayName="DialogFooter";const go=v.forwardRef(({className:e,...t},n)=>i.jsx(MN,{ref:n,className:Oe("text-lg font-semibold leading-none tracking-tight",e),...t}));go.displayName=MN.displayName;const jl=v.forwardRef(({className:e,...t},n)=>i.jsx(IN,{ref:n,className:Oe("text-sm text-muted-foreground",e),...t}));jl.displayName=IN.displayName;var DN="Radio",[uQ,ML]=Hr(DN),[dQ,fQ]=uQ(DN),IL=v.forwardRef((e,t)=>{const{__scopeRadio:n,name:r,checked:s=!1,required:a,disabled:o,value:l="on",onCheck:c,form:u,...d}=e,[f,h]=v.useState(null),p=xt(t,y=>h(y)),g=v.useRef(!1),m=f?u||!!f.closest("form"):!0;return i.jsxs(dQ,{scope:n,checked:s,disabled:o,children:[i.jsx(Ye.button,{type:"button",role:"radio","aria-checked":s,"data-state":LL(s),"data-disabled":o?"":void 0,disabled:o,value:l,...d,ref:p,onClick:Ee(e.onClick,y=>{s||c==null||c(),m&&(g.current=y.isPropagationStopped(),g.current||y.stopPropagation())})}),m&&i.jsx(hQ,{control:f,bubbles:!g.current,name:r,value:l,checked:s,required:a,disabled:o,form:u,style:{transform:"translateX(-100%)"}})]})});IL.displayName=DN;var RL="RadioIndicator",DL=v.forwardRef((e,t)=>{const{__scopeRadio:n,forceMount:r,...s}=e,a=fQ(RL,n);return i.jsx(lr,{present:r||a.checked,children:i.jsx(Ye.span,{"data-state":LL(a.checked),"data-disabled":a.disabled?"":void 0,...s,ref:t})})});DL.displayName=RL;var hQ=e=>{const{control:t,checked:n,bubbles:r=!0,...s}=e,a=v.useRef(null),o=op(n),l=np(t);return v.useEffect(()=>{const c=a.current,u=window.HTMLInputElement.prototype,f=Object.getOwnPropertyDescriptor(u,"checked").set;if(o!==n&&f){const h=new Event("click",{bubbles:r});f.call(c,n),c.dispatchEvent(h)}},[o,n,r]),i.jsx("input",{type:"radio","aria-hidden":!0,defaultChecked:n,...s,tabIndex:-1,ref:a,style:{...e.style,...l,position:"absolute",pointerEvents:"none",opacity:0,margin:0}})};function LL(e){return e?"checked":"unchecked"}var pQ=["ArrowUp","ArrowDown","ArrowLeft","ArrowRight"],LN="RadioGroup",[mQ,BPe]=Hr(LN,[ed,ML]),FL=ed(),BL=ML(),[gQ,vQ]=mQ(LN),zL=v.forwardRef((e,t)=>{const{__scopeRadioGroup:n,name:r,defaultValue:s,value:a,required:o=!1,disabled:l=!1,orientation:c,dir:u,loop:d=!0,onValueChange:f,...h}=e,p=FL(n),g=Xl(u),[m,y]=aa({prop:a,defaultProp:s,onChange:f});return i.jsx(gQ,{scope:n,name:r,required:o,disabled:l,value:m,onValueChange:y,children:i.jsx(gN,{asChild:!0,...p,orientation:c,dir:g,loop:d,children:i.jsx(Ye.div,{role:"radiogroup","aria-required":o,"aria-orientation":c,"data-disabled":l?"":void 0,dir:g,...h,ref:t})})})});zL.displayName=LN;var UL="RadioGroupItem",VL=v.forwardRef((e,t)=>{const{__scopeRadioGroup:n,disabled:r,...s}=e,a=vQ(UL,n),o=a.disabled||r,l=FL(n),c=BL(n),u=v.useRef(null),d=xt(t,u),f=a.value===s.value,h=v.useRef(!1);return v.useEffect(()=>{const p=m=>{pQ.includes(m.key)&&(h.current=!0)},g=()=>h.current=!1;return document.addEventListener("keydown",p),document.addEventListener("keyup",g),()=>{document.removeEventListener("keydown",p),document.removeEventListener("keyup",g)}},[]),i.jsx(vN,{asChild:!0,...l,focusable:!o,active:f,children:i.jsx(IL,{disabled:o,required:a.required,checked:f,...c,...s,name:a.name,ref:d,onCheck:()=>a.onValueChange(s.value),onKeyDown:Ee(p=>{p.key==="Enter"&&p.preventDefault()}),onFocus:Ee(s.onFocus,()=>{var p;h.current&&((p=u.current)==null||p.click())})})})});VL.displayName=UL;var yQ="RadioGroupIndicator",WL=v.forwardRef((e,t)=>{const{__scopeRadioGroup:n,...r}=e,s=BL(n);return i.jsx(DL,{...s,...r,ref:t})});WL.displayName=yQ;var GL=zL,HL=VL,xQ=WL;const Ww=v.forwardRef(({className:e,...t},n)=>i.jsx(GL,{className:Oe("grid gap-2",e),...t,ref:n}));Ww.displayName=GL.displayName;const Zd=v.forwardRef(({className:e,...t},n)=>i.jsx(HL,{ref:n,className:Oe("aspect-square h-4 w-4 rounded-full border border-primary text-primary ring-offset-background focus:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50",e),...t,children:i.jsx(xQ,{className:"flex items-center justify-center",children:i.jsx(FS,{className:"h-2.5 w-2.5 fill-current text-current"})})}));Zd.displayName=HL.displayName;var FN="Checkbox",[bQ,zPe]=Hr(FN),[wQ,jQ]=bQ(FN),qL=v.forwardRef((e,t)=>{const{__scopeCheckbox:n,name:r,checked:s,defaultChecked:a,required:o,disabled:l,value:c="on",onCheckedChange:u,form:d,...f}=e,[h,p]=v.useState(null),g=xt(t,j=>p(j)),m=v.useRef(!1),y=h?d||!!h.closest("form"):!0,[b=!1,x]=aa({prop:s,defaultProp:a,onChange:u}),w=v.useRef(b);return v.useEffect(()=>{const j=h==null?void 0:h.form;if(j){const S=()=>x(w.current);return j.addEventListener("reset",S),()=>j.removeEventListener("reset",S)}},[h,x]),i.jsxs(wQ,{scope:n,state:b,disabled:l,children:[i.jsx(Ye.button,{type:"button",role:"checkbox","aria-checked":vo(b)?"mixed":b,"aria-required":o,"data-state":YL(b),"data-disabled":l?"":void 0,disabled:l,value:c,...f,ref:g,onKeyDown:Ee(e.onKeyDown,j=>{j.key==="Enter"&&j.preventDefault()}),onClick:Ee(e.onClick,j=>{x(S=>vo(S)?!0:!S),y&&(m.current=j.isPropagationStopped(),m.current||j.stopPropagation())})}),y&&i.jsx(SQ,{control:h,bubbles:!m.current,name:r,value:c,checked:b,required:o,disabled:l,form:d,style:{transform:"translateX(-100%)"},defaultChecked:vo(a)?!1:a})]})});qL.displayName=FN;var KL="CheckboxIndicator",XL=v.forwardRef((e,t)=>{const{__scopeCheckbox:n,forceMount:r,...s}=e,a=jQ(KL,n);return i.jsx(lr,{present:r||vo(a.state)||a.state===!0,children:i.jsx(Ye.span,{"data-state":YL(a.state),"data-disabled":a.disabled?"":void 0,...s,ref:t,style:{pointerEvents:"none",...e.style}})})});XL.displayName=KL;var SQ=e=>{const{control:t,checked:n,bubbles:r=!0,defaultChecked:s,...a}=e,o=v.useRef(null),l=op(n),c=np(t);v.useEffect(()=>{const d=o.current,f=window.HTMLInputElement.prototype,p=Object.getOwnPropertyDescriptor(f,"checked").set;if(l!==n&&p){const g=new Event("click",{bubbles:r});d.indeterminate=vo(n),p.call(d,vo(n)?!1:n),d.dispatchEvent(g)}},[l,n,r]);const u=v.useRef(vo(n)?!1:n);return i.jsx("input",{type:"checkbox","aria-hidden":!0,defaultChecked:s??u.current,...a,tabIndex:-1,ref:o,style:{...e.style,...c,position:"absolute",pointerEvents:"none",opacity:0,margin:0}})};function vo(e){return e==="indeterminate"}function YL(e){return vo(e)?"indeterminate":e?"checked":"unchecked"}var ZL=qL,NQ=XL;const ol=v.forwardRef(({className:e,...t},n)=>i.jsx(ZL,{ref:n,className:Oe("peer h-4 w-4 shrink-0 rounded-sm border border-primary ring-offset-background focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50 data-[state=checked]:bg-primary data-[state=checked]:text-primary-foreground",e),...t,children:i.jsx(NQ,{className:Oe("flex items-center justify-center text-current"),children:i.jsx($a,{className:"h-4 w-4"})})}));ol.displayName=ZL.displayName;const BN=({isActive:e,isComplete:t,hasError:n,label:r,onComplete:s,className:a})=>{const[o,l]=v.useState(0),[c,u]=v.useState("progressing"),[d,f]=v.useState(!1),h=v.useRef(null),p=v.useRef(null),g=()=>{h.current&&(clearInterval(h.current),h.current=null),p.current&&(clearTimeout(p.current),p.current=null)},m=()=>{g(),l(0),u("progressing"),f(!1)},y=j=>{g(),u("completing");const S=100-j,N=50,_=500/N,P=S/_;let k=0;h.current=setInterval(()=>{k++;const O=j+P*k;O>=100||k>=_?(l(100),u("completed"),g(),p.current=setTimeout(()=>{u("hiding"),setTimeout(()=>{m(),s==null||s()},300)},2e3)):l(O)},N)},b=()=>{c==="progressing"&&y(o)},x=()=>{c==="waiting"&&y(90)},w=()=>{g()};return v.useEffect(()=>{if(e&&!d){f(!0),l(0),u("progressing");const j=90/540;let S=0;h.current=setInterval(()=>{S+=j,S>=90?(l(90),u("waiting"),g()):l(S)},100)}return t&&c==="progressing"&&b(),t&&c==="waiting"&&x(),n&&(c==="progressing"||c==="waiting")&&w(),!e&&d&&m(),()=>{e||g()}},[e,t,n,c,d]),v.useEffect(()=>()=>{g()},[]),d?i.jsxs("div",{className:Oe("w-full space-y-2",a),children:[r&&i.jsxs("div",{className:"flex justify-between items-center text-sm text-muted-foreground",children:[i.jsx("span",{children:c==="waiting"?`${r} - finalizing...`:r}),i.jsxs("span",{children:[Math.round(o),"%"]})]}),i.jsx(al,{value:o,className:Oe("w-full transition-all duration-200",n&&"opacity-75",c==="completed"&&"bg-green-100")}),n&&i.jsx("div",{className:"text-sm text-red-600",children:"Generation failed. Please try again."}),c==="completed"&&!n&&i.jsx("div",{className:"text-sm text-green-600",children:"Generation completed successfully!"})]}):null},xn="all",_Q=()=>{var Lt,tn,Xr,Ua;const e=v.useCallback(()=>{document.body.style.pointerEvents==="none"&&(console.log("ensureBodyInteractive: Fixing body pointer-events..."),document.body.style.pointerEvents="auto")},[]),t=Tn(),[n]=fW(),{loadPersonas:r}=vD(),[s,a]=v.useState("view"),[o,l]=v.useState("ai"),[c,u]=v.useState("");v.useState(null);const[d,f]=v.useState(xn),[h,p]=v.useState(!1),[g,m]=v.useState("");v.useEffect(()=>{const H=n.get("mode");(H==="view"||H==="create")&&a(H)},[n]);const[y,b]=v.useState([]),[x,w]=v.useState([]),[j,S]=v.useState(!0);v.useState(null);const[N,_]=v.useState(new Set),[P,k]=v.useState(!1),[O,M]=v.useState(null),[A,$]=v.useState(""),[L,G]=v.useState(!1),[D,V]=v.useState(null),[T,F]=v.useState(!1),[q,Z]=v.useState(null),[re,ge]=v.useState(!1),[B,le]=v.useState({age:[],gender:[],occupation:[],location:[],techSavviness:[],ethnicity:[],folderStatus:[]}),[se,ce]=v.useState({age:[],gender:[],occupation:[],location:[],techSavviness:[],ethnicity:[],folderStatus:[]}),[De,de]=v.useState(!1),[be,Pe]=v.useState(!1),[ne,Je]=v.useState(!1),[ve,at]=v.useState(!1),[st,Mt]=v.useState("gemini-2.5-pro"),C=()=>{de(!1),Pe(!1),Je(!1)},R=H=>{const Ce={age:new Set,gender:new Set,occupation:new Set,location:new Set,techSavviness:new Set,ethnicity:new Set};return H.forEach(ke=>{if(ke.age&&Ce.age.add(ke.age),ke.gender&&Ce.gender.add(ke.gender),ke.occupation&&Ce.occupation.add(ke.occupation),ke.location&&Ce.location.add(ke.location),ke.techSavviness!==void 0){const Ue=ke.techSavviness<30?"Low (0-30)":ke.techSavviness<70?"Medium (31-70)":"High (71-100)";Ce.techSavviness.add(Ue)}ke.ethnicity&&Ce.ethnicity.add(ke.ethnicity)}),{age:Array.from(Ce.age).sort(),gender:Array.from(Ce.gender).sort(),occupation:Array.from(Ce.occupation).sort(),location:Array.from(Ce.location).sort(),techSavviness:Array.from(Ce.techSavviness).sort((ke,Ue)=>{const Le=["Low (0-30)","Medium (31-70)","High (71-100)"];return Le.indexOf(ke)-Le.indexOf(Ue)}),ethnicity:Array.from(Ce.ethnicity).sort()}},U=()=>{ge(!1),setTimeout(()=>{le({...se})},0)},X=()=>{ce({age:[],gender:[],occupation:[],location:[],techSavviness:[],ethnicity:[],folderStatus:[]})},Q=(H,Ce)=>{ce(ke=>{const Ue={...ke};return Ue[H].includes(Ce)?Ue[H]=Ue[H].filter(Le=>Le!==Ce):Ue[H]=[...Ue[H],Ce],Ue})},z=async()=>{S(!0);try{const ke=(await Dn.getAll()).data;{const Le=[...ke.map(ft=>({...ft,id:ft.id||ft._id}))];try{(async()=>{const J=await r();console.log("Loaded stored personas (for debugging only):",J?J.length:0)})()}catch(ft){console.warn("Error loading stored personas:",ft)}b(Le)}}catch(Ce){console.error("Error fetching personas:",Ce),Ke.error("Failed to load personas"),b([])}finally{S(!1)}},ee=(H,Ce)=>(H.forEach(ke=>{if(ke.folderId){const Ue=Ce.find(Le=>Le.id===ke.folderId);Ue&&!Ue.personaIds.includes(ke.id)&&Ue.personaIds.push(ke.id)}}),Ce.forEach(ke=>{ke.personaIds=ke.personaIds.filter(Ue=>{const Le=H.find(ft=>ft.id===Ue);return Le&&(!Le.folderId||Le.folderId===ke.id)})}),Ce);v.useEffect(()=>{let H=!0;const Ce=localStorage.getItem("persona-folders");let ke=[];if(Ce)try{ke=JSON.parse(Ce),w(ke)}catch(Le){console.error("Failed to parse stored folders:",Le)}return(async()=>{if(await z(),H&&y.length>0){const Le=ee(y,ke);w(Le)}})(),()=>{H=!1}},[e]),v.useEffect(()=>{var H;if(s==="view")z();else if(s==="create"&&(console.log(`Switching to create mode with folder: ${d}, ${d!==xn?"NOT default":"IS default"}`),d!==xn)){const Ce=(H=x.find(ke=>ke.id===d))==null?void 0:H.name;console.log(`Selected folder for creation: ${d} (${Ce})`)}},[s]),v.useEffect(()=>{if(y.length>0){const H=x.map(ke=>({...ke,personaIds:[...ke.personaIds]})),Ce=ee(y,H);w(Ce)}},[y]),v.useEffect(()=>{z();const H=()=>{window.location.pathname.includes("/synthetic-users")&&!window.location.pathname.includes("/synthetic-users/")&&(console.log("Navigation to synthetic users page detected, refreshing data"),z())},Ce=()=>{console.log("Synthetic users navigation event detected, refreshing data"),z()};console.log("Setting up MutationObserver for body style");const ke=new MutationObserver(Ue=>{Ue.forEach(Le=>{Le.type==="attributes"&&Le.attributeName==="style"&&document.body.style.pointerEvents==="none"&&(console.log("MutationObserver detected pointer-events: none, fixing..."),e())})});return ke.observe(document.body,{attributes:!0,attributeFilter:["style"]}),e(),window.addEventListener("popstate",H),window.addEventListener("syntheticUsersNavigation",Ce),()=>{window.removeEventListener("popstate",H),window.removeEventListener("syntheticUsersNavigation",Ce),console.log("Disconnecting MutationObserver"),ke.disconnect()}},[]),v.useEffect(()=>{x.length>0&&localStorage.setItem("persona-folders",JSON.stringify(x))},[x]),v.useEffect(()=>{if(y.length>0&&x.length>0){const H=ee(y,[...x]);JSON.stringify(H)!==JSON.stringify(x)&&w(H)}},[y,x.length]);const me=()=>{if(!g.trim()){Ke.error("Please enter a folder name");return}const H={id:`folder-${Date.now()}`,name:g.trim(),personaIds:[]};w([...x,H]),m(""),p(!1),Ke.success(`Folder "${g}" created`)},Se=()=>{m(""),p(!1)},Ie=H=>{M(H),$(H.name)},we=()=>{if(!O||!A.trim()){M(null);return}const H=x.map(Ce=>Ce.id===O.id?{...Ce,name:A.trim()}:Ce);w(H),M(null),Ke.success(`Folder renamed to "${A}"`)},ze=()=>{M(null),$("")},gt=H=>{V(H),G(!0)},St=()=>{D&&(w(x.filter(H=>H.id!==D.id)),d===D.id&&f(xn),G(!1),V(null),Ke.success(`Folder "${D.name}" deleted`))},He=async(H,Ce)=>{var ft;const ke=H||N,Ue=Ce||q;if(!Ue||ke.size===0)return;const Le=Array.from(ke);try{const J=x.map(K=>{if(K.id===Ue){const W=[...K.personaIds];return Le.forEach(ie=>{W.includes(ie)||W.push(ie)}),{...K,personaIds:W}}else return{...K,personaIds:K.personaIds.filter(W=>!Le.includes(W))}});w(J),localStorage.setItem("persona-folders",JSON.stringify(J));const Y=Le.map(async K=>{try{const W=y.find(ie=>ie.id===K);if(W){const ie={...W,folderId:Ue===xn?null:Ue},he=W._id||W.id;return await Dn.update(he,ie),{success:!0,id:K}}return{success:!1,id:K,error:"Persona not found locally"}}catch(W){return console.error(`Failed to update folder for persona ${K}:`,W),{success:!1,id:K,error:W}}}),ye=await Promise.all(Y),xe=ye.filter(K=>K.success).map(K=>K.id),je=ye.filter(K=>!K.success),Qe=y.map(K=>xe.includes(K.id)?{...K,folderId:Ue===xn?null:Ue}:K);b(Qe);const I=Ue===xn?"All Personas":((ft=x.find(K=>K.id===Ue))==null?void 0:ft.name)||"folder";return xe.length>0&&Ke.success(`Moved ${xe.length} persona${xe.length!==1?"s":""} to ${I}`),je.length>0&&(Ke.error(`Failed to move ${je.length} persona${je.length!==1?"s":""}.`),console.error("Failed updates:",je)),H||_(new Set),{success:xe.length>0,successCount:xe.length,failureCount:je.length}}catch(J){return console.error("Error moving personas to folder:",J),Ke.error("An unexpected error occurred while moving personas."),{success:!1,error:J}}},Ze=async()=>{var ft;if(N.size===0||d===xn)return;const H=Array.from(N),Ce=x.map(J=>J.id===d?{...J,personaIds:J.personaIds.filter(Y=>!H.includes(Y))}:J);w(Ce);const ke=[],Ue=[];for(const J of H)try{const Y=y.find(ye=>ye.id===J);if(Y){const ye={...Y,folderId:null},xe=Y._id||Y.id;await Dn.update(xe,ye),ke.push(J)}}catch(Y){console.error(`Failed to update persona ${J}:`,Y),Ue.push(J)}b(J=>J.map(Y=>ke.includes(Y.id)?{...Y,folderId:null}:Y)),_(new Set);const Le=((ft=x.find(J=>J.id===d))==null?void 0:ft.name)||"folder";ke.length>0&&Ke.success(`Removed ${ke.length} persona${ke.length!==1?"s":""} from ${Le}`),Ue.length>0&&Ke.error(`Failed to remove ${Ue.length} persona${Ue.length!==1?"s":""} from ${Le}`)},kt=H=>{_(Ce=>{const ke=new Set(Ce);return ke.has(H)?ke.delete(H):ke.add(H),ke})},Vt=()=>{N.size===an.length?_(new Set):_(new Set(an.map(H=>H.id)))},Xn=async()=>{if(N.size===0)return;const H=Array.from(N);_(new Set),k(!1),S(!0);const Ce=[],ke=[];for(const Ue of H)try{const Le=y.find(J=>J.id===Ue);if(!Le){console.error(`Could not find persona with id: ${Ue}`),ke.push(Ue);continue}let ft=Ue;Le._id&&(ft=Le._id.toString()),console.log(`Attempting to delete persona: ${ft}`),await Dn.delete(ft),Ce.push(Ue)}catch(Le){console.error(`Failed to delete persona ${Ue}:`,Le),ke.push(Ue)}b(Ue=>Ue.filter(Le=>!Ce.includes(Le.id))),w(Ue=>{const Le=Ue.map(ft=>({...ft,personaIds:ft.personaIds.filter(J=>!Ce.includes(J))}));return localStorage.setItem("persona-folders",JSON.stringify(Le)),Le}),S(!1),setTimeout(()=>{Ce.length>0&&Ke.success(`Successfully deleted ${Ce.length} persona${Ce.length!==1?"s":""}`),ke.length>0&&Ke.error(`Failed to delete ${ke.length} persona${ke.length!==1?"s":""}`),(Ce.length>0||ke.length>0)&&z()},50)},an=y.filter(H=>{const Ce=H.name.toLowerCase().includes(c.toLowerCase())||H.occupation.toLowerCase().includes(c.toLowerCase())||H.location.toLowerCase().includes(c.toLowerCase()),ke=(B.age.length===0||B.age.includes(H.age))&&(B.gender.length===0||B.gender.includes(H.gender))&&(B.occupation.length===0||B.occupation.includes(H.occupation))&&(B.location.length===0||B.location.includes(H.location))&&(B.ethnicity.length===0||H.ethnicity&&B.ethnicity.includes(H.ethnicity))&&(B.techSavviness.length===0||H.techSavviness!==void 0&&B.techSavviness.includes(H.techSavviness<30?"Low (0-30)":H.techSavviness<70?"Medium (31-70)":"High (71-100)"))&&(B.folderStatus.length===0||B.folderStatus.includes("hasFolder")&&B.folderStatus.includes("noFolder")||B.folderStatus.includes("hasFolder")&&!B.folderStatus.includes("noFolder")&&H.folderId&&H.folderId!==xn||B.folderStatus.includes("noFolder")&&!B.folderStatus.includes("hasFolder")&&(!H.folderId||H.folderId===xn));if(d===xn||H.folderId===d)return Ce&&ke;const Ue=x.find(Le=>Le.id===d);return Ue&&Ue.personaIds.includes(H.id)&&Ce&&ke}),pt=(H,Ce)=>{const ke=new Date().toISOString().split("T")[0],Ue=H.length;let Le=`# Persona Summary Report `;return Le+=`**Folder:** ${Ce} -`,Le+=`**Date:** ${Oe} +`,Le+=`**Date:** ${ke} `,Le+=`**Total Personas:** ${Ue} `,Ue===0?(Le+=`No personas found in this folder. -`,Le):(G.forEach((ft,J)=>{Le+=`## ${ft.name} +`,Le):(H.forEach((ft,J)=>{Le+=`## ${ft.name} `,Le+=`### Demographics `,Le+=`- **Age:** ${ft.age} @@ -564,11 +564,11 @@ For more information, see https://radix-ui.com/primitives/docs/components/alert- `),ft.topPersonalityTraits&&ft.topPersonalityTraits.length>0&&(Le+=`### Top Personality Traits `,ft.topPersonalityTraits.forEach(Y=>{Le+=`- 🧠 ${Y} `}),Le+=` -`),J{if(an.length===0){Ke.error("No personas to download");return}at(!0)},it=async()=>{var Oe,Ue,Le,ft,J;const G=d===xn?"All Personas":((Oe=x.find(Y=>Y.id===d))==null?void 0:Oe.name)||"Unknown Folder",Ce=an.map(Y=>Y._id||Y.id);console.log(`🤖 Frontend: User selected ${st} for persona summary download`),at(!1),de(!0),Pe(!1),Je(!1),S(!0);try{Ke.info("Generating persona summaries...",{description:`Processing ${an.length} persona${an.length!==1?"s":""} with AI`});const Y=await Ka.batchGenerateSummaries(Ce,.7,st),{summaries:ye,summary_stats:xe,errors:je}=Y.data,Qe=new Date().toISOString().split("T")[0],I=`persona-summary-${G.toLowerCase().replace(/\s+/g,"-")}-${Qe}.md`;let K=`# Persona Summary Report +`)}),Le)},tt=async()=>{if(an.length===0){Ke.error("No personas to download");return}at(!0)},it=async()=>{var ke,Ue,Le,ft,J;const H=d===xn?"All Personas":((ke=x.find(Y=>Y.id===d))==null?void 0:ke.name)||"Unknown Folder",Ce=an.map(Y=>Y._id||Y.id);console.log(`🤖 Frontend: User selected ${st} for persona summary download`),at(!1),de(!0),Pe(!1),Je(!1),S(!0);try{Ke.info("Generating persona summaries...",{description:`Processing ${an.length} persona${an.length!==1?"s":""} with AI`});const Y=await Xa.batchGenerateSummaries(Ce,.7,st),{summaries:ye,summary_stats:xe,errors:je}=Y.data,Qe=new Date().toISOString().split("T")[0],I=`persona-summary-${H.toLowerCase().replace(/\s+/g,"-")}-${Qe}.md`;let K=`# Persona Summary Report -`;K+=`**Folder:** ${G} +`;K+=`**Folder:** ${H} `,K+=`**Date:** ${Qe} `,K+=`**Total Personas:** ${xe.total_requested} `,K+=`**Successfully Processed:** ${xe.total_successful} @@ -577,9 +577,9 @@ For more information, see https://radix-ui.com/primitives/docs/components/alert- --- `,ye.length===0?K+=`No persona summaries could be generated. -`:ye.forEach((ke,qe)=>{K+=`# ${ke.persona_name} +`:ye.forEach((Te,qe)=>{K+=`# ${Te.persona_name} -`,K+=`${ke.summary} +`,K+=`${Te.summary} `,qe0&&(K+=`### Failed to Generate Summaries -`,je.failed_summaries.forEach(ke=>{K+=`- **${ke.persona_name}** (ID: ${ke.persona_id}): ${ke.error} +`,je.failed_summaries.forEach(Te=>{K+=`- **${Te.persona_name}** (ID: ${Te.persona_id}): ${Te.error} `}),K+=` `),((J=je.missing_personas)==null?void 0:J.length)>0&&(K+=`### Missing Personas -`,je.missing_personas.forEach(ke=>{K+=`- ID: ${ke} -`})));const W=document.createElement("a"),ie=new Blob([K],{type:"text/markdown"});W.href=URL.createObjectURL(ie),W.download=I,document.body.appendChild(W),W.click(),document.body.removeChild(W),Pe(!0);const he=st==="gpt-4.1"?"GPT-4.1":"Gemini 2.5 Pro";xe.total_successful===xe.total_requested?Ke.success("Persona summary downloaded",{description:`Successfully processed all ${xe.total_successful} persona${xe.total_successful!==1?"s":""} from "${G}" using ${he}`}):Ke.success("Persona summary downloaded with warnings",{description:`Processed ${xe.total_successful} of ${xe.total_requested} personas from "${G}" using ${he}`})}catch(Y){console.error("Error generating persona summaries:",Y),Y.response?(console.error("Error response data:",Y.response.data),console.error("Error response status:",Y.response.status),console.error("Error response headers:",Y.response.headers)):Y.request?console.error("Error request:",Y.request):console.error("Error message:",Y.message),Je(!0),Ke.error("AI summary generation failed, creating basic summary",{description:"Using simplified format due to processing error"});try{const ye=new Date().toISOString().split("T")[0],xe=`persona-summary-basic-${G.toLowerCase().replace(/\s+/g,"-")}-${ye}.md`,je=pt(an,G),Qe=document.createElement("a"),I=new Blob([je],{type:"text/markdown"});Qe.href=URL.createObjectURL(I),Qe.download=xe,document.body.appendChild(Qe),Qe.click(),document.body.removeChild(Qe)}catch{Ke.error("Failed to create persona summary",{description:"Unable to generate summary in any format"})}}finally{S(!1)}};return i.jsxs("div",{className:"min-h-screen bg-slate-50",children:[i.jsx(oi,{}),i.jsxs("main",{className:"pt-20 pb-16 px-4 sm:px-6 lg:px-8 max-w-7xl mx-auto",children:[i.jsxs("div",{className:"flex flex-col sm:flex-row justify-between items-start sm:items-center mb-8",children:[i.jsxs("div",{children:[i.jsx("h1",{className:"font-sf text-3xl font-bold text-slate-900",children:"Synthetic Personas"}),i.jsx("p",{className:"text-slate-600 mt-1",children:"Create and manage AI-generated research participants"})]}),i.jsx("div",{className:"mt-4 sm:mt-0 flex flex-col items-end gap-3",children:i.jsxs("div",{className:"flex items-center gap-3",children:[s==="view"&&an.length>0&&i.jsxs(te,{variant:"outline",onClick:tt,disabled:De,className:"flex items-center gap-2 hover-transition",children:[i.jsx($l,{className:"h-4 w-4"}),De?"Generating Summary...":"Download Persona Summary"]}),i.jsx(te,{onClick:()=>a(s==="view"?"create":"view"),className:"hover-transition",children:s==="view"?"Create New Personas":"View All Personas"})]})})]}),s==="view"&&an.length>0&&De&&i.jsx("div",{className:"mb-6",children:i.jsx(IN,{isActive:De,isComplete:be,hasError:ne,label:"Generating comprehensive persona summaries",onComplete:C,className:"max-w-4xl mx-auto"})}),s==="view"?i.jsx(i.Fragment,{children:i.jsxs("div",{className:"flex flex-col md:flex-row gap-6 mb-6",children:[i.jsxs("div",{className:"w-full md:w-64 space-y-4",children:[i.jsxs("div",{className:"flex items-center justify-between",children:[i.jsx("h3",{className:"text-sm font-medium",children:"Folders"}),i.jsx(te,{variant:"ghost",size:"sm",onClick:()=>p(!0),className:"h-7 w-7 p-0",children:i.jsx(iI,{className:"h-4 w-4"})})]}),i.jsxs("div",{className:"space-y-1",children:[i.jsxs("button",{onClick:()=>f(xn),className:`w-full flex items-center space-x-2 px-3 py-2 text-sm rounded-md text-left transition-colors ${d===xn?"bg-primary/10 text-primary font-medium":"hover:bg-slate-100"}`,children:[i.jsx(Us,{className:"h-4 w-4"}),i.jsx("span",{children:"All Personas"})]}),x.map(G=>i.jsx("div",{className:"flex items-center justify-between group",children:O&&O.id===G.id?i.jsxs("div",{className:"flex-1 flex items-center px-3 py-2 space-x-2",children:[i.jsx(Us,{className:"h-4 w-4"}),i.jsx(Ot,{value:A,onChange:Ce=>$(Ce.target.value),placeholder:"Folder name",className:"h-7 text-sm",autoFocus:!0,onKeyDown:Ce=>{Ce.key==="Enter"?we():Ce.key==="Escape"&&ze()}}),i.jsx(te,{size:"sm",variant:"ghost",onClick:we,className:"h-7 w-7 p-0",children:i.jsx(Ta,{className:"h-4 w-4"})}),i.jsx(te,{size:"sm",variant:"ghost",onClick:ze,className:"h-7 w-7 p-0",children:i.jsx(Zs,{className:"h-4 w-4"})})]}):i.jsxs(i.Fragment,{children:[i.jsxs("button",{onClick:()=>f(G.id),className:`flex-1 flex items-center space-x-2 px-3 py-2 text-sm rounded-md text-left transition-colors ${d===G.id?"bg-primary/10 text-primary font-medium":"hover:bg-slate-100"}`,children:[i.jsx(Us,{className:"h-4 w-4"}),i.jsx("span",{children:G.name}),i.jsx("span",{className:"text-muted-foreground text-xs ml-auto",children:G.personaIds.length})]}),i.jsxs(Fw,{children:[i.jsx(Bw,{asChild:!0,children:i.jsx(te,{variant:"ghost",size:"sm",className:"h-7 w-7 p-0 opacity-0 group-hover:opacity-100",children:i.jsx(uw,{className:"h-4 w-4"})})}),i.jsxs(Og,{align:"end",children:[i.jsx(Fi,{onClick:()=>Ie(G),children:"Rename"}),i.jsx(Fi,{className:"text-red-600",onClick:()=>gt(G),children:"Delete"})]})]})]})},G.id)),h&&i.jsxs("div",{className:"flex items-center px-3 py-2 space-x-2",children:[i.jsxs("div",{className:"flex-1 flex items-center space-x-2",children:[i.jsx(Us,{className:"h-4 w-4"}),i.jsx(Ot,{value:g,onChange:G=>m(G.target.value),placeholder:"Folder name",className:"h-7 text-sm",autoFocus:!0,onKeyDown:G=>{G.key==="Enter"?me():G.key==="Escape"&&Se()}})]}),i.jsx(te,{size:"sm",variant:"ghost",onClick:me,className:"h-7 w-7 p-0",children:i.jsx(Ta,{className:"h-4 w-4"})}),i.jsx(te,{size:"sm",variant:"ghost",onClick:Se,className:"h-7 w-7 p-0",children:i.jsx(Zs,{className:"h-4 w-4"})})]})]})]}),i.jsxs("div",{className:"flex-1",children:[i.jsxs("div",{className:"flex flex-col sm:flex-row gap-4 mb-6",children:[i.jsxs("div",{className:"relative flex-1",children:[i.jsx(DS,{className:"absolute left-3 top-1/2 transform -translate-y-1/2 text-muted-foreground h-4 w-4"}),i.jsx(Ot,{placeholder:"Search personas by name, occupation, or location...",className:"pl-10 bg-white",value:c,onChange:G=>u(G.target.value)})]}),i.jsxs("div",{className:"flex items-center gap-2",children:[N.size>0&&i.jsxs(Fw,{children:[i.jsx(Bw,{asChild:!0,children:i.jsxs(te,{variant:"outline",size:"sm",className:"flex items-center gap-2",onClick:G=>{G.stopPropagation()},children:[i.jsxs("span",{children:["Actions (",N.size,")"]}),i.jsx(uw,{className:"h-4 w-4"})]})}),i.jsxs(Og,{align:"end",onCloseAutoFocus:G=>{G.preventDefault()},children:[i.jsxs(Fi,{className:"flex items-center gap-2 cursor-pointer",onClick:G=>{G.preventDefault(),G.stopPropagation();const Ce=Array.from(N);t("/focus-groups",{state:{mode:"create",preSelectedParticipants:Ce}})},children:[i.jsx($a,{className:"h-4 w-4"}),"Create Focus Group with selected Personas"]}),i.jsxs(Fi,{className:"flex items-center gap-2 cursor-pointer",onClick:G=>{G.preventDefault(),G.stopPropagation(),k(!0)},children:[i.jsx(_n,{className:"h-4 w-4"}),"Delete"]}),i.jsxs(Fi,{className:"flex items-center gap-2 cursor-pointer",onClick:G=>{G.preventDefault(),G.stopPropagation(),F(!0)},children:[i.jsx(Us,{className:"h-4 w-4"}),"Move to folder"]}),d!==xn&&i.jsxs(Fi,{className:"flex items-center gap-2 cursor-pointer",onClick:G=>{G.preventDefault(),G.stopPropagation(),Ze()},children:[i.jsx(Zs,{className:"h-4 w-4"}),"Remove from ",((Lt=x.find(G=>G.id===d))==null?void 0:Lt.name)||"folder"]})]})]}),i.jsxs(te,{variant:"outline",className:"flex items-center gap-2",onClick:()=>ge(!0),children:[i.jsx(IS,{className:"h-4 w-4"}),i.jsxs("span",{children:["Filter",Object.values(B).some(G=>G.length>0)?` (${Object.values(B).reduce((G,Ce)=>G+Ce.length,0)})`:""]})]})]})]}),i.jsxs("div",{className:"glass-panel rounded-xl p-6 mb-6",children:[i.jsxs("div",{className:"flex items-center justify-between mb-4",children:[i.jsxs("div",{className:"flex items-center gap-2",children:[i.jsx(or,{className:"h-5 w-5 text-primary"}),i.jsx("h2",{className:"font-sf text-xl font-semibold",children:d===xn?"Your Synthetic Persona Library":((tn=x.find(G=>G.id===d))==null?void 0:tn.name)||"Personas"}),i.jsxs("span",{className:"text-sm text-muted-foreground",children:["(",an.length,")"]})]}),an.length>0&&i.jsxs("div",{className:"flex items-center",children:[i.jsx(ol,{id:"select-all",checked:an.length>0&&N.size===an.length,onCheckedChange:Vt,className:"mr-2"}),i.jsx("label",{htmlFor:"select-all",className:"text-sm cursor-pointer",children:"Select All"})]})]}),an.length>0?i.jsx("div",{className:"grid grid-cols-1 sm:grid-cols-1 lg:grid-cols-2 xl:grid-cols-2 gap-4",children:an.map(G=>i.jsx("div",{className:"relative group",children:i.jsx(sN,{user:G,selected:N.has(G.id),onClick:()=>t(`/synthetic-users/${G._id||G.id}`),onSelectionToggle:Ce=>{Ce.stopPropagation(),kt(G.id)},showAddToFolderButton:!1})},G.id))}):i.jsx("div",{className:"text-center py-12",children:i.jsx("p",{className:"text-muted-foreground",children:"No personas found matching your criteria."})})]}),i.jsx(zw,{open:P,onOpenChange:G=>{k(G||!1)},children:i.jsxs(Tg,{onInteractOutside:G=>{G.preventDefault()},children:[i.jsxs($g,{children:[i.jsx(Ig,{children:"Delete Personas"}),i.jsxs(Rg,{children:["Are you sure you want to delete ",N.size," selected persona",N.size!==1?"s":"","? This action cannot be undone."]})]}),i.jsxs(Mg,{children:[i.jsx(Lg,{onClick:()=>{setTimeout(()=>_(new Set),50)},children:"Cancel"}),i.jsx(Dg,{onClick:Xn,className:"bg-red-600 hover:bg-red-700",children:"Delete"})]})]})}),i.jsx(zw,{open:L,onOpenChange:G=>{H(G||!1)},children:i.jsxs(Tg,{children:[i.jsxs($g,{children:[i.jsx(Ig,{children:"Delete Folder"}),i.jsxs(Rg,{children:['Are you sure you want to delete the folder "',D==null?void 0:D.name,'"?',i.jsx("br",{}),i.jsx("br",{}),i.jsx("strong",{children:"Note:"})," Any personas in this folder will not be deleted - they will still be available under 'All Personas' after folder deletion."]})]}),i.jsxs(Mg,{children:[i.jsx(Lg,{children:"Cancel"}),i.jsx(Dg,{onClick:jt,className:"bg-red-600 hover:bg-red-700",children:"Delete"})]})]})}),i.jsx(wl,{open:T,onOpenChange:G=>{F(G||!1)},children:i.jsxs(ho,{className:"z-50",children:[i.jsxs(po,{children:[i.jsx(go,{children:"Move to Folder"}),i.jsxs(jl,{children:["Choose a folder to move ",N.size," selected persona",N.size!==1?"s":""," to."]})]}),i.jsx("div",{className:"py-4",children:i.jsxs(Uw,{value:q||"",onValueChange:Z,className:"space-y-2",children:[i.jsxs("div",{className:"flex items-center space-x-2",children:[i.jsx(Zd,{value:xn,id:"folder-all"}),i.jsxs(vs,{htmlFor:"folder-all",className:"flex items-center gap-2",children:[i.jsx(Us,{className:"h-4 w-4"}),i.jsx("span",{children:"All Personas (Remove from folders)"})]})]}),x.map(G=>i.jsxs("div",{className:"flex items-center space-x-2",children:[i.jsx(Zd,{value:G.id,id:`folder-${G.id}`}),i.jsxs(vs,{htmlFor:`folder-${G.id}`,className:"flex items-center gap-2",children:[i.jsx(Us,{className:"h-4 w-4"}),i.jsx("span",{children:G.name})]})]},G.id))]})}),i.jsxs(mo,{children:[i.jsx(te,{variant:"outline",onClick:G=>{G.preventDefault(),G.stopPropagation(),F(!1),Z(null)},children:"Cancel"}),i.jsx(te,{onClick:async G=>{if(G.preventDefault(),G.stopPropagation(),!q)return;const Ce=new Set(N),Oe=q;if(F(!1),Z(null),Oe&&Ce.size>0){S(!0);try{await Ge(Ce,Oe)}finally{S(!1),_(new Set)}}},disabled:!q,children:"Move"})]})]})}),i.jsx(wl,{open:re,onOpenChange:G=>{G?(ge(G),ce({...B})):(N.size>0&&_(new Set),ge(!1))},children:i.jsxs(ho,{className:"max-w-4xl max-h-[80vh] flex flex-col",onInteractOutside:G=>{G.preventDefault()},children:[i.jsx("div",{className:"sticky top-0 bg-background border-b shadow-sm pb-4 z-10",children:i.jsxs(po,{children:[i.jsx(go,{children:"Filter Personas"}),i.jsx(jl,{children:"Select attributes to filter personas by. Multiple selections within a category use OR logic, different categories use AND logic. Filter options dynamically update to show only relevant values."})]})}),i.jsxs("div",{className:"flex-1 overflow-y-auto px-1 py-4 space-y-6",children:[Object.values(se).some(G=>G.length>0)&&i.jsx("div",{className:"bg-muted/30 p-3 rounded-md",children:i.jsxs("p",{className:"text-sm text-muted-foreground",children:[Object.values(se).reduce((G,Ce)=>G+Ce.length,0)," active filters"]})}),i.jsx("div",{className:"space-y-4",children:(()=>{const G=Le=>{const ft={...se};ft[Le]=[];const J=y.filter(Y=>Object.entries(ft).every(([ye,xe])=>{if(xe.length===0)return!0;const je=ye;if(je==="techSavviness"&&Y.techSavviness!==void 0){const Qe=Y.techSavviness<30?"Low (0-30)":Y.techSavviness<70?"Medium (31-70)":"High (71-100)";return xe.includes(Qe)}else{if(je==="age"&&Y.age)return xe.includes(Y.age);if(je==="gender"&&Y.gender)return xe.includes(Y.gender);if(je==="occupation"&&Y.occupation)return xe.includes(Y.occupation);if(je==="location"&&Y.location)return xe.includes(Y.location);if(je==="ethnicity"&&Y.ethnicity)return xe.includes(Y.ethnicity)}return!0}));return R(J)},Ce=Object.values(se).every(Le=>Le.length===0),Oe=R(y),Ue=(Le,ft,J,Y=1)=>{const ye=se[ft],xe=[...new Set([...J,...ye])].sort();return xe.length===0?null:i.jsxs("div",{className:"mb-6",children:[i.jsx("h3",{className:"text-sm font-medium mb-3",children:Le}),i.jsx("div",{className:`grid grid-cols-1 ${Y===2?"sm:grid-cols-2":Y===3?"sm:grid-cols-2 md:grid-cols-3":""} gap-2`,children:xe.map(je=>{const Qe=se[ft].includes(je),I=J.includes(je);return i.jsxs("div",{className:`flex items-center space-x-2 ${!I&&!Qe?"opacity-50":""}`,children:[i.jsx(ol,{id:`${ft}-${je}`,checked:Qe,onCheckedChange:()=>Q(ft,je),disabled:!I&&!Qe}),i.jsxs(vs,{htmlFor:`${ft}-${je}`,className:"truncate overflow-hidden",children:[je,Qe&&!I&&i.jsx("span",{className:"ml-1 text-xs text-muted-foreground",children:"(no matches)"})]})]},je)})})]})};return i.jsxs(i.Fragment,{children:[Ue("Gender","gender",Ce?Oe.gender:G("gender").gender,3),Ue("Age","age",Ce?Oe.age:G("age").age,3),Ue("Ethnicity","ethnicity",Ce?Oe.ethnicity:G("ethnicity").ethnicity,2),Ue("Location","location",Ce?Oe.location:G("location").location,2),Ue("Occupation","occupation",Ce?Oe.occupation:G("occupation").occupation,2),Ue("Tech Savviness","techSavviness",Ce?Oe.techSavviness:G("techSavviness").techSavviness,3),i.jsxs("div",{className:"mb-6",children:[i.jsx("h3",{className:"text-sm font-medium mb-3",children:"Folder Assignment"}),i.jsxs("div",{className:"grid grid-cols-1 sm:grid-cols-2 gap-2",children:[i.jsxs("div",{className:"flex items-center space-x-2",children:[i.jsx(ol,{id:"folderStatus-hasFolder",checked:se.folderStatus.includes("hasFolder"),onCheckedChange:()=>Q("folderStatus","hasFolder")}),i.jsx(vs,{htmlFor:"folderStatus-hasFolder",className:"truncate overflow-hidden",children:"Has folder assignment"})]}),i.jsxs("div",{className:"flex items-center space-x-2",children:[i.jsx(ol,{id:"folderStatus-noFolder",checked:se.folderStatus.includes("noFolder"),onCheckedChange:()=>Q("folderStatus","noFolder")}),i.jsx(vs,{htmlFor:"folderStatus-noFolder",className:"truncate overflow-hidden",children:"No folder assignment"})]})]})]}),i.jsx("div",{className:"grid grid-cols-1 sm:grid-cols-2 gap-6"})]})})()})]}),i.jsx("div",{className:"sticky bottom-0 bg-background border-t shadow-[0_-2px_4px_rgba(0,0,0,0.05)] pt-4 z-10",children:i.jsxs(mo,{children:[i.jsx(te,{variant:"outline",onClick:X,children:"Reset"}),i.jsx(te,{onClick:U,children:"Apply Filters"})]})})]})}),i.jsx(wl,{open:ve,onOpenChange:at,children:i.jsxs(ho,{children:[i.jsxs(po,{children:[i.jsx(go,{children:"Select AI Model for Summary Generation"}),i.jsx(jl,{children:"Choose which AI model to use for generating persona summaries"})]}),i.jsx("div",{className:"py-4",children:i.jsxs(Uw,{value:st,onValueChange:Mt,className:"space-y-3",children:[i.jsxs("div",{className:"flex items-center space-x-2",children:[i.jsx(Zd,{value:"gemini-2.5-pro",id:"download-gemini"}),i.jsx(vs,{htmlFor:"download-gemini",className:"text-sm font-medium",children:"Gemini 2.5 Pro"})]}),i.jsxs("div",{className:"flex items-center space-x-2",children:[i.jsx(Zd,{value:"gpt-4.1",id:"download-gpt"}),i.jsx(vs,{htmlFor:"download-gpt",className:"text-sm font-medium",children:"GPT-4.1"})]})]})}),i.jsxs(mo,{children:[i.jsx(te,{variant:"outline",onClick:()=>at(!1),children:"Cancel"}),i.jsx(te,{onClick:it,children:"Generate Summary"})]})]})})]})]})}):i.jsxs(Fo,{defaultValue:"ai",onValueChange:G=>l(G),children:[i.jsxs(Pi,{className:"grid w-full grid-cols-2 mb-6",children:[i.jsx(Xt,{value:"ai",children:"AI Recruiter"}),i.jsx(Xt,{value:"manual",children:"Manual Creation"})]}),i.jsxs(Yt,{value:"ai",children:[console.log(`Rendering AIRecruiter with targetFolderId: ${d!==xn?d:"null"}`),console.log("Current folders:",x.map(G=>({id:G.id,name:G.name}))),i.jsx(OX,{targetFolderId:d!==xn?d:null,targetFolderName:d!==xn?(Xr=x.find(G=>G.id===d))==null?void 0:Xr.name:null})]}),i.jsx(Yt,{value:"manual",children:i.jsx(bY,{targetFolderId:d!==xn?d:null,targetFolderName:d!==xn?(za=x.find(G=>G.id===d))==null?void 0:za.name:null})})]})]})]})},bQ="modulepreload",wQ=function(e){return"/semblance/"+e},AC={},jQ=function(t,n,r){let s=Promise.resolve();if(n&&n.length>0){document.getElementsByTagName("link");const o=document.querySelector("meta[property=csp-nonce]"),l=(o==null?void 0:o.nonce)||(o==null?void 0:o.getAttribute("nonce"));s=Promise.allSettled(n.map(c=>{if(c=wQ(c),c in AC)return;AC[c]=!0;const u=c.endsWith(".css"),d=u?'[rel="stylesheet"]':"";if(document.querySelector(`link[href="${c}"]${d}`))return;const f=document.createElement("link");if(f.rel=u?"stylesheet":bQ,u||(f.as="script"),f.crossOrigin="",f.href=c,l&&f.setAttribute("nonce",l),document.head.appendChild(f),u)return new Promise((h,p)=>{f.addEventListener("load",h),f.addEventListener("error",()=>p(new Error(`Unable to preload CSS for ${c}`)))})}))}function a(o){const l=new Event("vite:preloadError",{cancelable:!0});if(l.payload=o,window.dispatchEvent(l),!l.defaultPrevented)throw o}return s.then(o=>{for(const l of o||[])l.status==="rejected"&&a(l.reason);return t().catch(a)})},KL=v.createContext(void 0),A0="synthetic-society-navigation-state",SQ=({children:e})=>{const[t,n]=v.useState(()=>{try{const a=localStorage.getItem(A0);return a?JSON.parse(a):{}}catch{return{}}});v.useEffect(()=>{localStorage.setItem(A0,JSON.stringify(t))},[t]);const r=(a,o)=>{n({...t,previousRoute:a,...o})},s=()=>{n({}),localStorage.removeItem(A0)};return i.jsx(KL.Provider,{value:{navigationState:t,setNavigationState:n,clearNavigationState:s,setPreviousRoute:r},children:e})},XL=()=>{const e=v.useContext(KL);if(!e)throw new Error("useNavigation must be used within a NavigationProvider");return e},NQ=VS("inline-flex items-center rounded-full 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 hover:bg-primary/80",secondary:"border-transparent bg-secondary text-secondary-foreground hover:bg-secondary/80",destructive:"border-transparent bg-destructive text-destructive-foreground hover:bg-destructive/80",outline:"text-foreground"}},defaultVariants:{variant:"default"}});function Wn({className:e,variant:t,...n}){return i.jsx("div",{className:Me(NQ({variant:t}),e),...n})}const RN=E.memo(e=>{const{discussionGuide:t,moderatorStatus:n,onSectionSelect:r,onSetPosition:s,onSave:a,showProgress:o=!0,collapsible:l=!0,defaultExpanded:c=!1,className:u,onDownload:d,isDownloading:f=!1,focusGroupId:h,onEditingChange:p}=e,g=typeof t=="string",m=v.useMemo(()=>g?null:t,[t,g]),[y,b]=v.useState(new Set),[x,w]=v.useState(null),[j,S]=v.useState(null),[N,_]=v.useState(!1),[P,k]=v.useState(null),[O,M]=v.useState("");v.useEffect(()=>{p&&p(!!x)},[x,p]),v.useEffect(()=>{if(x&&m){const C=m.sections.find(R=>R.id===x);C&&!j&&S({...C})}},[m,x,j]);const A=C=>{w(C.id),S({...C}),b(R=>new Set(R).add(C.id))},$=()=>{w(null),S(null)},L=v.useCallback(C=>{S(R=>R&&{...R,...C})},[]),H=v.useCallback((C,R,U)=>{S(X=>{if(!X)return X;const Q={...X};if(U==="question"&&Q.questions){if(Q.questions.findIndex(ee=>ee.id===C)!==-1)return Q.questions=Q.questions.map(ee=>ee.id===C?{...ee,...R}:ee),Q}else if(U==="activity"&&Q.activities&&Q.activities.findIndex(ee=>ee.id===C)!==-1)return Q.activities=Q.activities.map(ee=>ee.id===C?{...ee,...R}:ee),Q;return Q.subsections&&(Q.subsections=Q.subsections.map(z=>{const ee={...z};return U==="question"&&ee.questions?ee.questions.findIndex(Se=>Se.id===C)!==-1&&(ee.questions=ee.questions.map(Se=>Se.id===C?{...Se,...R}:Se)):U==="activity"&&ee.activities&&ee.activities.findIndex(Se=>Se.id===C)!==-1&&(ee.activities=ee.activities.map(Se=>Se.id===C?{...Se,...R}:Se)),ee})),Q})},[]),D=C=>{if(!j)return;const R={id:`${C}-${Date.now()}`,content:`New ${C}`,type:C==="question"?"open_ended":"discussion",time_limit:void 0},U={...j};C==="question"?U.questions=[...U.questions||[],R]:U.activities=[...U.activities||[],R],S(U)},V=(C,R)=>{if(!j||!j.subsections)return;const U={id:`${R}-${Date.now()}`,content:`New ${R}`,type:R==="question"?"open_ended":"discussion",time_limit:void 0},X=[...j.subsections],Q={...X[C]};R==="question"?Q.questions=[...Q.questions||[],U]:Q.activities=[...Q.activities||[],U],X[C]=Q,S(z=>z&&{...z,subsections:X})},T=()=>{if(!j)return;const C={id:`subsection-${Date.now()}`,title:"New Subsection",questions:[],activities:[]},R=[...j.subsections||[],C];S(U=>U&&{...U,subsections:R})},F=C=>{if(!j||!j.subsections)return;const R=j.subsections.filter((U,X)=>X!==C);S(U=>U&&{...U,subsections:R})},q=(C,R)=>{var X,Q;if(!j)return;const U={...j};R==="question"?U.questions=(X=U.questions)==null?void 0:X.filter(z=>z.id!==C):U.activities=(Q=U.activities)==null?void 0:Q.filter(z=>z.id!==C),S(U)},Z=async()=>{if(!(!j||!m||!a)){_(!0);try{const C={...m,sections:m.sections.map(R=>R.id===x?j:R)};await a(C),$(),oe.success("Section updated successfully")}catch(C){console.error("Error saving section:",C),oe.error("Failed to save section")}finally{_(!1)}}},re=C=>{b(R=>{const U=new Set(R);return U.has(C)?U.delete(C):U.add(C),U})};v.useEffect(()=>{m&&m.sections.length>0&&b(c?new Set(m.sections.map(C=>C.id)):new Set)},[c,m]);const ge=(C,R,U,X)=>{if(!n||n.legacy_format)return null;const Q=n.moderator_position;if(Q.section_index!==C)return Q.section_index>C?"completed":null;if(X!==void 0){if(Q.subsection_index===void 0)return null;if(Q.subsection_index!==X)return Q.subsection_index>X?"completed":null}else if(Q.subsection_index!==void 0)return"completed";return Q.item_type!==U?U==="activity"&&Q.item_type==="question"?"completed":null:Q.item_index===R?"current":Q.item_index>R?"completed":null},B=(C,R)=>C===`New ${R}`,le=v.useCallback((C,R,U)=>{if(R<0||R>=C.length||U<0||U>=C.length)return C;const X=[...C],[Q]=X.splice(R,1);return X.splice(U,0,Q),X},[]),se=v.useCallback((C,R)=>R>0,[]),ce=v.useCallback((C,R)=>R{if(!j||!j.subsections)return;const R=j.subsections;if(se(R,C)){const U=le(R,C,C-1);S(X=>X&&{...X,subsections:U})}},[j,se,le]),de=v.useCallback(C=>{if(!j||!j.subsections)return;const R=j.subsections;if(ce(R,C)){const U=le(R,C,C+1);S(X=>X&&{...X,subsections:U})}},[j,ce,le]),be=v.useCallback((C,R)=>{k(C),M(R)},[]),Pe=v.useCallback(()=>{k(null),M("")},[]),ne=v.useCallback(()=>{if(!P||!j||!j.subsections)return;const C=j.subsections.map(R=>R.id===P?{...R,title:O.trim()}:R);S(R=>R&&{...R,subsections:C}),Pe()},[P,j,O,Pe]),Je=v.useCallback((C,R,U,X)=>{if(!j)return;const Q=R==="question"?"questions":"activities";if(X!==void 0){const z=j.subsections||[];if(X>=0&&Xwe&&{...we,subsections:Ie})}}}else{const z=j[Q]||[];if(se(z,U)){const ee=le(z,U,U-1);S(me=>me&&{...me,[Q]:ee})}}},[j,se,le]),ve=v.useCallback((C,R,U,X)=>{if(!j)return;const Q=R==="question"?"questions":"activities";if(X!==void 0){const z=j.subsections||[];if(X>=0&&Xwe&&{...we,subsections:Ie})}}}else{const z=j[Q]||[];if(ce(z,U)){const ee=le(z,U,U+1);S(me=>me&&{...me,[Q]:ee})}}},[j,ce,le]),at=(C,R,U,X,Q)=>{var jt,Ge,Ze,kt,Vt,Xn,an,pt,tt;const z=m==null?void 0:m.sections[R],ee=x===(z==null?void 0:z.id),me=ge(R,U,X,Q),Se=me==="current",Ie=me==="completed",ze=(it=>{const Lt=it.match(/['"`]([^'"`]*fg-[^'"`]*\.(jpe?g|png|gif|webp))['"`]/i);return Lt?Lt[1]:null})(C.content),gt=B(C.content,X);return ee?i.jsxs("div",{className:"flex items-start gap-3 p-3 rounded-lg border bg-white border-blue-200",children:[i.jsxs("div",{className:"flex-shrink-0 flex flex-col gap-1",children:[i.jsx(te,{size:"sm",variant:"ghost",onClick:()=>Je(C.id,X,U,Q),disabled:(()=>{if(Q!==void 0){const Lt=((j==null?void 0:j.subsections)||[])[Q],tn=(Lt==null?void 0:Lt[X==="question"?"questions":"activities"])||[];return!se(tn,U)}else{const it=(j==null?void 0:j[X==="question"?"questions":"activities"])||[];return!se(it,U)}})(),className:"h-6 w-6 p-0",title:"Move item up",children:i.jsx(Tl,{className:"h-3 w-3"})}),i.jsx(te,{size:"sm",variant:"ghost",onClick:()=>ve(C.id,X,U,Q),disabled:(()=>{if(Q!==void 0){const Lt=((j==null?void 0:j.subsections)||[])[Q],tn=(Lt==null?void 0:Lt[X==="question"?"questions":"activities"])||[];return!ce(tn,U)}else{const it=(j==null?void 0:j[X==="question"?"questions":"activities"])||[];return!ce(it,U)}})(),className:"h-6 w-6 p-0",title:"Move item down",children:i.jsx(yi,{className:"h-3 w-3"})})]}),i.jsxs("div",{className:"flex-1 min-w-0 space-y-3",children:[i.jsxs("div",{className:"flex items-center gap-2 mb-2",children:[i.jsx(Wn,{variant:"outline",className:"text-xs",children:X==="activity"?i.jsxs(i.Fragment,{children:[i.jsx(Za,{className:"h-3 w-3 mr-1"}),typeof C.type=="string"?C.type.replace("_"," "):String(C.type||"unknown")]}):i.jsxs(i.Fragment,{children:[i.jsx(xa,{className:"h-3 w-3 mr-1"}),typeof C.type=="string"?C.type.replace("_"," "):String(C.type||"unknown")]})}),C.time_limit&&i.jsxs("div",{className:"flex items-center gap-1 text-xs text-slate-500",children:[i.jsx(Uf,{className:"h-3 w-3"}),i.jsx(Ot,{type:"number",value:C.time_limit,onChange:it=>H(C.id,{time_limit:parseInt(it.target.value)||void 0},X),className:"w-16 h-6 text-xs",placeholder:"min"}),"min"]})]}),i.jsx(nt,{value:gt?"":C.content,onChange:it=>H(C.id,{content:it.target.value},X),placeholder:gt?C.content:"Enter content...",className:"min-h-[60px]"}),X==="question"&&i.jsxs("div",{children:[i.jsx("label",{className:"text-sm font-medium text-slate-700 mb-1 block",children:"Probe Questions (one per line)"}),i.jsx(nt,{value:((jt=C.probes)==null?void 0:jt.join(` +`,je.missing_personas.forEach(Te=>{K+=`- ID: ${Te} +`})));const W=document.createElement("a"),ie=new Blob([K],{type:"text/markdown"});W.href=URL.createObjectURL(ie),W.download=I,document.body.appendChild(W),W.click(),document.body.removeChild(W),Pe(!0);const he=st==="gpt-4.1"?"GPT-4.1":"Gemini 2.5 Pro";xe.total_successful===xe.total_requested?Ke.success("Persona summary downloaded",{description:`Successfully processed all ${xe.total_successful} persona${xe.total_successful!==1?"s":""} from "${H}" using ${he}`}):Ke.success("Persona summary downloaded with warnings",{description:`Processed ${xe.total_successful} of ${xe.total_requested} personas from "${H}" using ${he}`})}catch(Y){console.error("Error generating persona summaries:",Y),Y.response?(console.error("Error response data:",Y.response.data),console.error("Error response status:",Y.response.status),console.error("Error response headers:",Y.response.headers)):Y.request?console.error("Error request:",Y.request):console.error("Error message:",Y.message),Je(!0),Ke.error("AI summary generation failed, creating basic summary",{description:"Using simplified format due to processing error"});try{const ye=new Date().toISOString().split("T")[0],xe=`persona-summary-basic-${H.toLowerCase().replace(/\s+/g,"-")}-${ye}.md`,je=pt(an,H),Qe=document.createElement("a"),I=new Blob([je],{type:"text/markdown"});Qe.href=URL.createObjectURL(I),Qe.download=xe,document.body.appendChild(Qe),Qe.click(),document.body.removeChild(Qe)}catch{Ke.error("Failed to create persona summary",{description:"Unable to generate summary in any format"})}}finally{S(!1)}};return i.jsxs("div",{className:"min-h-screen bg-slate-50",children:[i.jsx(ci,{}),i.jsxs("main",{className:"pt-20 pb-16 px-4 sm:px-6 lg:px-8 max-w-7xl mx-auto",children:[i.jsxs("div",{className:"flex flex-col sm:flex-row justify-between items-start sm:items-center mb-8",children:[i.jsxs("div",{children:[i.jsx("h1",{className:"font-sf text-3xl font-bold text-slate-900",children:"Synthetic Personas"}),i.jsx("p",{className:"text-slate-600 mt-1",children:"Create and manage AI-generated research participants"})]}),i.jsx("div",{className:"mt-4 sm:mt-0 flex flex-col items-end gap-3",children:i.jsxs("div",{className:"flex items-center gap-3",children:[s==="view"&&an.length>0&&i.jsxs(te,{variant:"outline",onClick:tt,disabled:De,className:"flex items-center gap-2 hover-transition",children:[i.jsx($l,{className:"h-4 w-4"}),De?"Generating Summary...":"Download Persona Summary"]}),i.jsx(te,{onClick:()=>a(s==="view"?"create":"view"),className:"hover-transition",children:s==="view"?"Create New Personas":"View All Personas"})]})})]}),s==="view"&&an.length>0&&De&&i.jsx("div",{className:"mb-6",children:i.jsx(BN,{isActive:De,isComplete:be,hasError:ne,label:"Generating comprehensive persona summaries",onComplete:C,className:"max-w-4xl mx-auto"})}),s==="view"?i.jsx(i.Fragment,{children:i.jsxs("div",{className:"flex flex-col md:flex-row gap-6 mb-6",children:[i.jsxs("div",{className:"w-full md:w-64 space-y-4",children:[i.jsxs("div",{className:"flex items-center justify-between",children:[i.jsx("h3",{className:"text-sm font-medium",children:"Folders"}),i.jsx(te,{variant:"ghost",size:"sm",onClick:()=>p(!0),className:"h-7 w-7 p-0",children:i.jsx(uI,{className:"h-4 w-4"})})]}),i.jsxs("div",{className:"space-y-1",children:[i.jsxs("button",{onClick:()=>f(xn),className:`w-full flex items-center space-x-2 px-3 py-2 text-sm rounded-md text-left transition-colors ${d===xn?"bg-primary/10 text-primary font-medium":"hover:bg-slate-100"}`,children:[i.jsx(Us,{className:"h-4 w-4"}),i.jsx("span",{children:"All Personas"})]}),x.map(H=>i.jsx("div",{className:"flex items-center justify-between group",children:O&&O.id===H.id?i.jsxs("div",{className:"flex-1 flex items-center px-3 py-2 space-x-2",children:[i.jsx(Us,{className:"h-4 w-4"}),i.jsx(Ot,{value:A,onChange:Ce=>$(Ce.target.value),placeholder:"Folder name",className:"h-7 text-sm",autoFocus:!0,onKeyDown:Ce=>{Ce.key==="Enter"?we():Ce.key==="Escape"&&ze()}}),i.jsx(te,{size:"sm",variant:"ghost",onClick:we,className:"h-7 w-7 p-0",children:i.jsx($a,{className:"h-4 w-4"})}),i.jsx(te,{size:"sm",variant:"ghost",onClick:ze,className:"h-7 w-7 p-0",children:i.jsx(Zs,{className:"h-4 w-4"})})]}):i.jsxs(i.Fragment,{children:[i.jsxs("button",{onClick:()=>f(H.id),className:`flex-1 flex items-center space-x-2 px-3 py-2 text-sm rounded-md text-left transition-colors ${d===H.id?"bg-primary/10 text-primary font-medium":"hover:bg-slate-100"}`,children:[i.jsx(Us,{className:"h-4 w-4"}),i.jsx("span",{children:H.name}),i.jsx("span",{className:"text-muted-foreground text-xs ml-auto",children:H.personaIds.length})]}),i.jsxs(zw,{children:[i.jsx(Uw,{asChild:!0,children:i.jsx(te,{variant:"ghost",size:"sm",className:"h-7 w-7 p-0 opacity-0 group-hover:opacity-100",children:i.jsx(hw,{className:"h-4 w-4"})})}),i.jsxs(Tg,{align:"end",children:[i.jsx(Bi,{onClick:()=>Ie(H),children:"Rename"}),i.jsx(Bi,{className:"text-red-600",onClick:()=>gt(H),children:"Delete"})]})]})]})},H.id)),h&&i.jsxs("div",{className:"flex items-center px-3 py-2 space-x-2",children:[i.jsxs("div",{className:"flex-1 flex items-center space-x-2",children:[i.jsx(Us,{className:"h-4 w-4"}),i.jsx(Ot,{value:g,onChange:H=>m(H.target.value),placeholder:"Folder name",className:"h-7 text-sm",autoFocus:!0,onKeyDown:H=>{H.key==="Enter"?me():H.key==="Escape"&&Se()}})]}),i.jsx(te,{size:"sm",variant:"ghost",onClick:me,className:"h-7 w-7 p-0",children:i.jsx($a,{className:"h-4 w-4"})}),i.jsx(te,{size:"sm",variant:"ghost",onClick:Se,className:"h-7 w-7 p-0",children:i.jsx(Zs,{className:"h-4 w-4"})})]})]})]}),i.jsxs("div",{className:"flex-1",children:[i.jsxs("div",{className:"flex flex-col sm:flex-row gap-4 mb-6",children:[i.jsxs("div",{className:"relative flex-1",children:[i.jsx(US,{className:"absolute left-3 top-1/2 transform -translate-y-1/2 text-muted-foreground h-4 w-4"}),i.jsx(Ot,{placeholder:"Search personas by name, occupation, or location...",className:"pl-10 bg-white",value:c,onChange:H=>u(H.target.value)})]}),i.jsxs("div",{className:"flex items-center gap-2",children:[N.size>0&&i.jsxs(zw,{children:[i.jsx(Uw,{asChild:!0,children:i.jsxs(te,{variant:"outline",size:"sm",className:"flex items-center gap-2",onClick:H=>{H.stopPropagation()},children:[i.jsxs("span",{children:["Actions (",N.size,")"]}),i.jsx(hw,{className:"h-4 w-4"})]})}),i.jsxs(Tg,{align:"end",onCloseAutoFocus:H=>{H.preventDefault()},children:[i.jsxs(Bi,{className:"flex items-center gap-2 cursor-pointer",onClick:H=>{H.preventDefault(),H.stopPropagation();const Ce=Array.from(N);t("/focus-groups",{state:{mode:"create",preSelectedParticipants:Ce}})},children:[i.jsx(Ma,{className:"h-4 w-4"}),"Create Focus Group with selected Personas"]}),i.jsxs(Bi,{className:"flex items-center gap-2 cursor-pointer",onClick:H=>{H.preventDefault(),H.stopPropagation(),k(!0)},children:[i.jsx(_n,{className:"h-4 w-4"}),"Delete"]}),i.jsxs(Bi,{className:"flex items-center gap-2 cursor-pointer",onClick:H=>{H.preventDefault(),H.stopPropagation(),F(!0)},children:[i.jsx(Us,{className:"h-4 w-4"}),"Move to folder"]}),d!==xn&&i.jsxs(Bi,{className:"flex items-center gap-2 cursor-pointer",onClick:H=>{H.preventDefault(),H.stopPropagation(),Ze()},children:[i.jsx(Zs,{className:"h-4 w-4"}),"Remove from ",((Lt=x.find(H=>H.id===d))==null?void 0:Lt.name)||"folder"]})]})]}),i.jsxs(te,{variant:"outline",className:"flex items-center gap-2",onClick:()=>ge(!0),children:[i.jsx(BS,{className:"h-4 w-4"}),i.jsxs("span",{children:["Filter",Object.values(B).some(H=>H.length>0)?` (${Object.values(B).reduce((H,Ce)=>H+Ce.length,0)})`:""]})]})]})]}),i.jsxs("div",{className:"glass-panel rounded-xl p-6 mb-6",children:[i.jsxs("div",{className:"flex items-center justify-between mb-4",children:[i.jsxs("div",{className:"flex items-center gap-2",children:[i.jsx(tr,{className:"h-5 w-5 text-primary"}),i.jsx("h2",{className:"font-sf text-xl font-semibold",children:d===xn?"Your Synthetic Persona Library":((tn=x.find(H=>H.id===d))==null?void 0:tn.name)||"Personas"}),i.jsxs("span",{className:"text-sm text-muted-foreground",children:["(",an.length,")"]})]}),an.length>0&&i.jsxs("div",{className:"flex items-center",children:[i.jsx(ol,{id:"select-all",checked:an.length>0&&N.size===an.length,onCheckedChange:Vt,className:"mr-2"}),i.jsx("label",{htmlFor:"select-all",className:"text-sm cursor-pointer",children:"Select All"})]})]}),an.length>0?i.jsx("div",{className:"grid grid-cols-1 sm:grid-cols-1 lg:grid-cols-2 xl:grid-cols-2 gap-4",children:an.map(H=>i.jsx("div",{className:"relative group",children:i.jsx(cN,{user:H,selected:N.has(H.id),onClick:()=>t(`/synthetic-users/${H._id||H.id}`),onSelectionToggle:Ce=>{Ce.stopPropagation(),kt(H.id)},showAddToFolderButton:!1})},H.id))}):i.jsx("div",{className:"text-center py-12",children:i.jsx("p",{className:"text-muted-foreground",children:"No personas found matching your criteria."})})]}),i.jsx(Vw,{open:P,onOpenChange:H=>{k(H||!1)},children:i.jsxs(Mg,{onInteractOutside:H=>{H.preventDefault()},children:[i.jsxs(Ig,{children:[i.jsx(Dg,{children:"Delete Personas"}),i.jsxs(Lg,{children:["Are you sure you want to delete ",N.size," selected persona",N.size!==1?"s":"","? This action cannot be undone."]})]}),i.jsxs(Rg,{children:[i.jsx(Bg,{onClick:()=>{setTimeout(()=>_(new Set),50)},children:"Cancel"}),i.jsx(Fg,{onClick:Xn,className:"bg-red-600 hover:bg-red-700",children:"Delete"})]})]})}),i.jsx(Vw,{open:L,onOpenChange:H=>{G(H||!1)},children:i.jsxs(Mg,{children:[i.jsxs(Ig,{children:[i.jsx(Dg,{children:"Delete Folder"}),i.jsxs(Lg,{children:['Are you sure you want to delete the folder "',D==null?void 0:D.name,'"?',i.jsx("br",{}),i.jsx("br",{}),i.jsx("strong",{children:"Note:"})," Any personas in this folder will not be deleted - they will still be available under 'All Personas' after folder deletion."]})]}),i.jsxs(Rg,{children:[i.jsx(Bg,{children:"Cancel"}),i.jsx(Fg,{onClick:St,className:"bg-red-600 hover:bg-red-700",children:"Delete"})]})]})}),i.jsx(wl,{open:T,onOpenChange:H=>{F(H||!1)},children:i.jsxs(ho,{className:"z-50",children:[i.jsxs(po,{children:[i.jsx(go,{children:"Move to Folder"}),i.jsxs(jl,{children:["Choose a folder to move ",N.size," selected persona",N.size!==1?"s":""," to."]})]}),i.jsx("div",{className:"py-4",children:i.jsxs(Ww,{value:q||"",onValueChange:Z,className:"space-y-2",children:[i.jsxs("div",{className:"flex items-center space-x-2",children:[i.jsx(Zd,{value:xn,id:"folder-all"}),i.jsxs(ys,{htmlFor:"folder-all",className:"flex items-center gap-2",children:[i.jsx(Us,{className:"h-4 w-4"}),i.jsx("span",{children:"All Personas (Remove from folders)"})]})]}),x.map(H=>i.jsxs("div",{className:"flex items-center space-x-2",children:[i.jsx(Zd,{value:H.id,id:`folder-${H.id}`}),i.jsxs(ys,{htmlFor:`folder-${H.id}`,className:"flex items-center gap-2",children:[i.jsx(Us,{className:"h-4 w-4"}),i.jsx("span",{children:H.name})]})]},H.id))]})}),i.jsxs(mo,{children:[i.jsx(te,{variant:"outline",onClick:H=>{H.preventDefault(),H.stopPropagation(),F(!1),Z(null)},children:"Cancel"}),i.jsx(te,{onClick:async H=>{if(H.preventDefault(),H.stopPropagation(),!q)return;const Ce=new Set(N),ke=q;if(F(!1),Z(null),ke&&Ce.size>0){S(!0);try{await He(Ce,ke)}finally{S(!1),_(new Set)}}},disabled:!q,children:"Move"})]})]})}),i.jsx(wl,{open:re,onOpenChange:H=>{H?(ge(H),ce({...B})):(N.size>0&&_(new Set),ge(!1))},children:i.jsxs(ho,{className:"max-w-4xl max-h-[80vh] flex flex-col",onInteractOutside:H=>{H.preventDefault()},children:[i.jsx("div",{className:"sticky top-0 bg-background border-b shadow-sm pb-4 z-10",children:i.jsxs(po,{children:[i.jsx(go,{children:"Filter Personas"}),i.jsx(jl,{children:"Select attributes to filter personas by. Multiple selections within a category use OR logic, different categories use AND logic. Filter options dynamically update to show only relevant values."})]})}),i.jsxs("div",{className:"flex-1 overflow-y-auto px-1 py-4 space-y-6",children:[Object.values(se).some(H=>H.length>0)&&i.jsx("div",{className:"bg-muted/30 p-3 rounded-md",children:i.jsxs("p",{className:"text-sm text-muted-foreground",children:[Object.values(se).reduce((H,Ce)=>H+Ce.length,0)," active filters"]})}),i.jsx("div",{className:"space-y-4",children:(()=>{const H=Le=>{const ft={...se};ft[Le]=[];const J=y.filter(Y=>Object.entries(ft).every(([ye,xe])=>{if(xe.length===0)return!0;const je=ye;if(je==="techSavviness"&&Y.techSavviness!==void 0){const Qe=Y.techSavviness<30?"Low (0-30)":Y.techSavviness<70?"Medium (31-70)":"High (71-100)";return xe.includes(Qe)}else{if(je==="age"&&Y.age)return xe.includes(Y.age);if(je==="gender"&&Y.gender)return xe.includes(Y.gender);if(je==="occupation"&&Y.occupation)return xe.includes(Y.occupation);if(je==="location"&&Y.location)return xe.includes(Y.location);if(je==="ethnicity"&&Y.ethnicity)return xe.includes(Y.ethnicity)}return!0}));return R(J)},Ce=Object.values(se).every(Le=>Le.length===0),ke=R(y),Ue=(Le,ft,J,Y=1)=>{const ye=se[ft],xe=[...new Set([...J,...ye])].sort();return xe.length===0?null:i.jsxs("div",{className:"mb-6",children:[i.jsx("h3",{className:"text-sm font-medium mb-3",children:Le}),i.jsx("div",{className:`grid grid-cols-1 ${Y===2?"sm:grid-cols-2":Y===3?"sm:grid-cols-2 md:grid-cols-3":""} gap-2`,children:xe.map(je=>{const Qe=se[ft].includes(je),I=J.includes(je);return i.jsxs("div",{className:`flex items-center space-x-2 ${!I&&!Qe?"opacity-50":""}`,children:[i.jsx(ol,{id:`${ft}-${je}`,checked:Qe,onCheckedChange:()=>Q(ft,je),disabled:!I&&!Qe}),i.jsxs(ys,{htmlFor:`${ft}-${je}`,className:"truncate overflow-hidden",children:[je,Qe&&!I&&i.jsx("span",{className:"ml-1 text-xs text-muted-foreground",children:"(no matches)"})]})]},je)})})]})};return i.jsxs(i.Fragment,{children:[Ue("Gender","gender",Ce?ke.gender:H("gender").gender,3),Ue("Age","age",Ce?ke.age:H("age").age,3),Ue("Ethnicity","ethnicity",Ce?ke.ethnicity:H("ethnicity").ethnicity,2),Ue("Location","location",Ce?ke.location:H("location").location,2),Ue("Occupation","occupation",Ce?ke.occupation:H("occupation").occupation,2),Ue("Tech Savviness","techSavviness",Ce?ke.techSavviness:H("techSavviness").techSavviness,3),i.jsxs("div",{className:"mb-6",children:[i.jsx("h3",{className:"text-sm font-medium mb-3",children:"Folder Assignment"}),i.jsxs("div",{className:"grid grid-cols-1 sm:grid-cols-2 gap-2",children:[i.jsxs("div",{className:"flex items-center space-x-2",children:[i.jsx(ol,{id:"folderStatus-hasFolder",checked:se.folderStatus.includes("hasFolder"),onCheckedChange:()=>Q("folderStatus","hasFolder")}),i.jsx(ys,{htmlFor:"folderStatus-hasFolder",className:"truncate overflow-hidden",children:"Has folder assignment"})]}),i.jsxs("div",{className:"flex items-center space-x-2",children:[i.jsx(ol,{id:"folderStatus-noFolder",checked:se.folderStatus.includes("noFolder"),onCheckedChange:()=>Q("folderStatus","noFolder")}),i.jsx(ys,{htmlFor:"folderStatus-noFolder",className:"truncate overflow-hidden",children:"No folder assignment"})]})]})]}),i.jsx("div",{className:"grid grid-cols-1 sm:grid-cols-2 gap-6"})]})})()})]}),i.jsx("div",{className:"sticky bottom-0 bg-background border-t shadow-[0_-2px_4px_rgba(0,0,0,0.05)] pt-4 z-10",children:i.jsxs(mo,{children:[i.jsx(te,{variant:"outline",onClick:X,children:"Reset"}),i.jsx(te,{onClick:U,children:"Apply Filters"})]})})]})}),i.jsx(wl,{open:ve,onOpenChange:at,children:i.jsxs(ho,{children:[i.jsxs(po,{children:[i.jsx(go,{children:"Select AI Model for Summary Generation"}),i.jsx(jl,{children:"Choose which AI model to use for generating persona summaries"})]}),i.jsx("div",{className:"py-4",children:i.jsxs(Ww,{value:st,onValueChange:Mt,className:"space-y-3",children:[i.jsxs("div",{className:"flex items-center space-x-2",children:[i.jsx(Zd,{value:"gemini-2.5-pro",id:"download-gemini"}),i.jsx(ys,{htmlFor:"download-gemini",className:"text-sm font-medium",children:"Gemini 2.5 Pro"})]}),i.jsxs("div",{className:"flex items-center space-x-2",children:[i.jsx(Zd,{value:"gpt-4.1",id:"download-gpt"}),i.jsx(ys,{htmlFor:"download-gpt",className:"text-sm font-medium",children:"GPT-4.1"})]})]})}),i.jsxs(mo,{children:[i.jsx(te,{variant:"outline",onClick:()=>at(!1),children:"Cancel"}),i.jsx(te,{onClick:it,children:"Generate Summary"})]})]})})]})]})}):i.jsxs(Fo,{defaultValue:"ai",onValueChange:H=>l(H),children:[i.jsxs(Ai,{className:"grid w-full grid-cols-2 mb-6",children:[i.jsx(Xt,{value:"ai",children:"AI Recruiter"}),i.jsx(Xt,{value:"manual",children:"Manual Creation"})]}),i.jsxs(Yt,{value:"ai",children:[console.log(`Rendering AIRecruiter with targetFolderId: ${d!==xn?d:"null"}`),console.log("Current folders:",x.map(H=>({id:H.id,name:H.name}))),i.jsx(RX,{targetFolderId:d!==xn?d:null,targetFolderName:d!==xn?(Xr=x.find(H=>H.id===d))==null?void 0:Xr.name:null})]}),i.jsx(Yt,{value:"manual",children:i.jsx(PY,{targetFolderId:d!==xn?d:null,targetFolderName:d!==xn?(Ua=x.find(H=>H.id===d))==null?void 0:Ua.name:null})})]})]})]})},PQ="modulepreload",AQ=function(e){return"/semblance/"+e},TC={},CQ=function(t,n,r){let s=Promise.resolve();if(n&&n.length>0){document.getElementsByTagName("link");const o=document.querySelector("meta[property=csp-nonce]"),l=(o==null?void 0:o.nonce)||(o==null?void 0:o.getAttribute("nonce"));s=Promise.allSettled(n.map(c=>{if(c=AQ(c),c in TC)return;TC[c]=!0;const u=c.endsWith(".css"),d=u?'[rel="stylesheet"]':"";if(document.querySelector(`link[href="${c}"]${d}`))return;const f=document.createElement("link");if(f.rel=u?"stylesheet":PQ,u||(f.as="script"),f.crossOrigin="",f.href=c,l&&f.setAttribute("nonce",l),document.head.appendChild(f),u)return new Promise((h,p)=>{f.addEventListener("load",h),f.addEventListener("error",()=>p(new Error(`Unable to preload CSS for ${c}`)))})}))}function a(o){const l=new Event("vite:preloadError",{cancelable:!0});if(l.payload=o,window.dispatchEvent(l),!l.defaultPrevented)throw o}return s.then(o=>{for(const l of o||[])l.status==="rejected"&&a(l.reason);return t().catch(a)})},QL=v.createContext(void 0),O0="synthetic-society-navigation-state",EQ=({children:e})=>{const[t,n]=v.useState(()=>{try{const a=localStorage.getItem(O0);return a?JSON.parse(a):{}}catch{return{}}});v.useEffect(()=>{localStorage.setItem(O0,JSON.stringify(t))},[t]);const r=(a,o)=>{n({...t,previousRoute:a,...o})},s=()=>{n({}),localStorage.removeItem(O0)};return i.jsx(QL.Provider,{value:{navigationState:t,setNavigationState:n,clearNavigationState:s,setPreviousRoute:r},children:e})},Uy=()=>{const e=v.useContext(QL);if(!e)throw new Error("useNavigation must be used within a NavigationProvider");return e},OQ=KS("inline-flex items-center rounded-full 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 hover:bg-primary/80",secondary:"border-transparent bg-secondary text-secondary-foreground hover:bg-secondary/80",destructive:"border-transparent bg-destructive text-destructive-foreground hover:bg-destructive/80",outline:"text-foreground"}},defaultVariants:{variant:"default"}});function Wn({className:e,variant:t,...n}){return i.jsx("div",{className:Oe(OQ({variant:t}),e),...n})}const zN=E.memo(e=>{const{discussionGuide:t,moderatorStatus:n,onSectionSelect:r,onSetPosition:s,onSave:a,showProgress:o=!0,collapsible:l=!0,defaultExpanded:c=!1,className:u,onDownload:d,isDownloading:f=!1,focusGroupId:h,onEditingChange:p}=e,g=typeof t=="string",m=v.useMemo(()=>g?null:t,[t,g]),[y,b]=v.useState(new Set),[x,w]=v.useState(null),[j,S]=v.useState(null),[N,_]=v.useState(!1),[P,k]=v.useState(null),[O,M]=v.useState("");v.useEffect(()=>{p&&p(!!x)},[x,p]),v.useEffect(()=>{if(x&&m){const C=m.sections.find(R=>R.id===x);C&&!j&&S({...C})}},[m,x,j]);const A=C=>{w(C.id),S({...C}),b(R=>new Set(R).add(C.id))},$=()=>{w(null),S(null)},L=v.useCallback(C=>{S(R=>R&&{...R,...C})},[]),G=v.useCallback((C,R,U)=>{S(X=>{if(!X)return X;const Q={...X};if(U==="question"&&Q.questions){if(Q.questions.findIndex(ee=>ee.id===C)!==-1)return Q.questions=Q.questions.map(ee=>ee.id===C?{...ee,...R}:ee),Q}else if(U==="activity"&&Q.activities&&Q.activities.findIndex(ee=>ee.id===C)!==-1)return Q.activities=Q.activities.map(ee=>ee.id===C?{...ee,...R}:ee),Q;return Q.subsections&&(Q.subsections=Q.subsections.map(z=>{const ee={...z};return U==="question"&&ee.questions?ee.questions.findIndex(Se=>Se.id===C)!==-1&&(ee.questions=ee.questions.map(Se=>Se.id===C?{...Se,...R}:Se)):U==="activity"&&ee.activities&&ee.activities.findIndex(Se=>Se.id===C)!==-1&&(ee.activities=ee.activities.map(Se=>Se.id===C?{...Se,...R}:Se)),ee})),Q})},[]),D=C=>{if(!j)return;const R={id:`${C}-${Date.now()}`,content:`New ${C}`,type:C==="question"?"open_ended":"discussion",time_limit:void 0},U={...j};C==="question"?U.questions=[...U.questions||[],R]:U.activities=[...U.activities||[],R],S(U)},V=(C,R)=>{if(!j||!j.subsections)return;const U={id:`${R}-${Date.now()}`,content:`New ${R}`,type:R==="question"?"open_ended":"discussion",time_limit:void 0},X=[...j.subsections],Q={...X[C]};R==="question"?Q.questions=[...Q.questions||[],U]:Q.activities=[...Q.activities||[],U],X[C]=Q,S(z=>z&&{...z,subsections:X})},T=()=>{if(!j)return;const C={id:`subsection-${Date.now()}`,title:"New Subsection",questions:[],activities:[]},R=[...j.subsections||[],C];S(U=>U&&{...U,subsections:R})},F=C=>{if(!j||!j.subsections)return;const R=j.subsections.filter((U,X)=>X!==C);S(U=>U&&{...U,subsections:R})},q=(C,R)=>{var X,Q;if(!j)return;const U={...j};R==="question"?U.questions=(X=U.questions)==null?void 0:X.filter(z=>z.id!==C):U.activities=(Q=U.activities)==null?void 0:Q.filter(z=>z.id!==C),S(U)},Z=async()=>{if(!(!j||!m||!a)){_(!0);try{const C={...m,sections:m.sections.map(R=>R.id===x?j:R)};await a(C),$(),oe.success("Section updated successfully")}catch(C){console.error("Error saving section:",C),oe.error("Failed to save section")}finally{_(!1)}}},re=C=>{b(R=>{const U=new Set(R);return U.has(C)?U.delete(C):U.add(C),U})};v.useEffect(()=>{m&&m.sections.length>0&&b(c?new Set(m.sections.map(C=>C.id)):new Set)},[c,m]);const ge=(C,R,U,X)=>{if(!n||n.legacy_format)return null;const Q=n.moderator_position;if(Q.section_index!==C)return Q.section_index>C?"completed":null;if(X!==void 0){if(Q.subsection_index===void 0)return null;if(Q.subsection_index!==X)return Q.subsection_index>X?"completed":null}else if(Q.subsection_index!==void 0)return"completed";return Q.item_type!==U?U==="activity"&&Q.item_type==="question"?"completed":null:Q.item_index===R?"current":Q.item_index>R?"completed":null},B=(C,R)=>C===`New ${R}`,le=v.useCallback((C,R,U)=>{if(R<0||R>=C.length||U<0||U>=C.length)return C;const X=[...C],[Q]=X.splice(R,1);return X.splice(U,0,Q),X},[]),se=v.useCallback((C,R)=>R>0,[]),ce=v.useCallback((C,R)=>R{if(!j||!j.subsections)return;const R=j.subsections;if(se(R,C)){const U=le(R,C,C-1);S(X=>X&&{...X,subsections:U})}},[j,se,le]),de=v.useCallback(C=>{if(!j||!j.subsections)return;const R=j.subsections;if(ce(R,C)){const U=le(R,C,C+1);S(X=>X&&{...X,subsections:U})}},[j,ce,le]),be=v.useCallback((C,R)=>{k(C),M(R)},[]),Pe=v.useCallback(()=>{k(null),M("")},[]),ne=v.useCallback(()=>{if(!P||!j||!j.subsections)return;const C=j.subsections.map(R=>R.id===P?{...R,title:O.trim()}:R);S(R=>R&&{...R,subsections:C}),Pe()},[P,j,O,Pe]),Je=v.useCallback((C,R,U,X)=>{if(!j)return;const Q=R==="question"?"questions":"activities";if(X!==void 0){const z=j.subsections||[];if(X>=0&&Xwe&&{...we,subsections:Ie})}}}else{const z=j[Q]||[];if(se(z,U)){const ee=le(z,U,U-1);S(me=>me&&{...me,[Q]:ee})}}},[j,se,le]),ve=v.useCallback((C,R,U,X)=>{if(!j)return;const Q=R==="question"?"questions":"activities";if(X!==void 0){const z=j.subsections||[];if(X>=0&&Xwe&&{...we,subsections:Ie})}}}else{const z=j[Q]||[];if(ce(z,U)){const ee=le(z,U,U+1);S(me=>me&&{...me,[Q]:ee})}}},[j,ce,le]),at=(C,R,U,X,Q)=>{var St,He,Ze,kt,Vt,Xn,an,pt,tt;const z=m==null?void 0:m.sections[R],ee=x===(z==null?void 0:z.id),me=ge(R,U,X,Q),Se=me==="current",Ie=me==="completed",ze=(it=>{const Lt=it.match(/['"`]([^'"`]*fg-[^'"`]*\.(jpe?g|png|gif|webp))['"`]/i);return Lt?Lt[1]:null})(C.content),gt=B(C.content,X);return ee?i.jsxs("div",{className:"flex items-start gap-3 p-3 rounded-lg border bg-white border-blue-200",children:[i.jsxs("div",{className:"flex-shrink-0 flex flex-col gap-1",children:[i.jsx(te,{size:"sm",variant:"ghost",onClick:()=>Je(C.id,X,U,Q),disabled:(()=>{if(Q!==void 0){const Lt=((j==null?void 0:j.subsections)||[])[Q],tn=(Lt==null?void 0:Lt[X==="question"?"questions":"activities"])||[];return!se(tn,U)}else{const it=(j==null?void 0:j[X==="question"?"questions":"activities"])||[];return!se(it,U)}})(),className:"h-6 w-6 p-0",title:"Move item up",children:i.jsx(Tl,{className:"h-3 w-3"})}),i.jsx(te,{size:"sm",variant:"ghost",onClick:()=>ve(C.id,X,U,Q),disabled:(()=>{if(Q!==void 0){const Lt=((j==null?void 0:j.subsections)||[])[Q],tn=(Lt==null?void 0:Lt[X==="question"?"questions":"activities"])||[];return!ce(tn,U)}else{const it=(j==null?void 0:j[X==="question"?"questions":"activities"])||[];return!ce(it,U)}})(),className:"h-6 w-6 p-0",title:"Move item down",children:i.jsx(xi,{className:"h-3 w-3"})})]}),i.jsxs("div",{className:"flex-1 min-w-0 space-y-3",children:[i.jsxs("div",{className:"flex items-center gap-2 mb-2",children:[i.jsx(Wn,{variant:"outline",className:"text-xs",children:X==="activity"?i.jsxs(i.Fragment,{children:[i.jsx(Qa,{className:"h-3 w-3 mr-1"}),typeof C.type=="string"?C.type.replace("_"," "):String(C.type||"unknown")]}):i.jsxs(i.Fragment,{children:[i.jsx(xa,{className:"h-3 w-3 mr-1"}),typeof C.type=="string"?C.type.replace("_"," "):String(C.type||"unknown")]})}),C.time_limit&&i.jsxs("div",{className:"flex items-center gap-1 text-xs text-slate-500",children:[i.jsx(Uf,{className:"h-3 w-3"}),i.jsx(Ot,{type:"number",value:C.time_limit,onChange:it=>G(C.id,{time_limit:parseInt(it.target.value)||void 0},X),className:"w-16 h-6 text-xs",placeholder:"min"}),"min"]})]}),i.jsx(nt,{value:gt?"":C.content,onChange:it=>G(C.id,{content:it.target.value},X),placeholder:gt?C.content:"Enter content...",className:"min-h-[60px]"}),X==="question"&&i.jsxs("div",{children:[i.jsx("label",{className:"text-sm font-medium text-slate-700 mb-1 block",children:"Probe Questions (one per line)"}),i.jsx(nt,{value:((St=C.probes)==null?void 0:St.join(` `))||"",onChange:it=>{const Lt=it.target.value.trim()?it.target.value.split(` -`).filter(tn=>tn.trim()):[];H(C.id,{probes:Lt},X)},placeholder:"Enter probe questions, one per line...",className:"min-h-[40px]"})]}),(((Ge=C.metadata)==null?void 0:Ge.image_url)||((Ze=C.metadata)==null?void 0:Ze.image_id)||ze)&&i.jsxs("div",{className:"mt-3",children:[i.jsxs("div",{className:"flex items-center gap-2 mb-2",children:[i.jsx(_m,{className:"h-4 w-4 text-slate-600"}),i.jsx("span",{className:"text-sm font-medium text-slate-700",children:"Visual Aid"})]}),(kt=C.metadata)!=null&&kt.image_url?i.jsx("img",{src:C.metadata.image_url,alt:"Visual aid for item",className:"max-w-[400px] max-h-[400px] object-contain rounded-lg border border-slate-200"}):(Vt=C.metadata)!=null&&Vt.image_id&&h?i.jsx("img",{src:St.getAssetUrl(h,C.metadata.image_id),alt:"Visual aid for item",className:"max-w-[400px] max-h-[400px] object-contain rounded-lg border border-slate-200"}):ze&&h?i.jsx("img",{src:St.getAssetUrl(h,ze),alt:"Visual aid for item",className:"max-w-[400px] max-h-[400px] object-contain rounded-lg border border-slate-200"}):null]})]}),i.jsx("div",{className:"flex-shrink-0",children:i.jsx(te,{size:"sm",variant:"ghost",onClick:()=>q(C.id,X),className:"h-8 w-8 p-0 text-red-600 hover:text-red-700",children:i.jsx(_n,{className:"h-3 w-3"})})})]},`edit-item-${C.id}`):i.jsxs("div",{className:Me("flex items-start gap-3 p-3 rounded-lg border transition-colors",Se&&"bg-blue-50 border-blue-200",Ie&&"bg-green-50 border-green-200",!Se&&!Ie&&"bg-slate-50 border-slate-200",r&&"cursor-pointer hover:bg-slate-100"),onClick:()=>r==null?void 0:r(m.sections[R].id,C.id),children:[i.jsx("div",{className:"flex-shrink-0 mt-1",children:Ie?i.jsx($S,{className:"h-4 w-4 text-green-600"}):Se?i.jsx(sI,{className:"h-4 w-4 text-blue-600"}):i.jsx(MS,{className:"h-4 w-4 text-slate-400"})}),i.jsxs("div",{className:"flex-1 min-w-0",children:[i.jsxs("div",{className:"flex items-center gap-2 mb-1 flex-wrap",children:[i.jsx(Wn,{variant:"outline",className:"text-xs whitespace-nowrap",children:X==="activity"?i.jsxs(i.Fragment,{children:[i.jsx(Za,{className:"h-3 w-3 mr-1"}),typeof C.type=="string"?C.type.replace("_"," "):String(C.type||"unknown")]}):i.jsxs(i.Fragment,{children:[i.jsx(xa,{className:"h-3 w-3 mr-1"}),typeof C.type=="string"?C.type.replace("_"," "):String(C.type||"unknown")]})}),C.time_limit&&i.jsxs("div",{className:"flex items-center gap-1 text-xs text-slate-500 whitespace-nowrap",children:[i.jsx(Uf,{className:"h-3 w-3"}),C.time_limit," min"]}),s&&i.jsxs(te,{size:"sm",variant:"ghost",onClick:it=>{it.stopPropagation();const Lt=m.sections[R],tn=X==="activity"?`Activity ${U+1}`:`Question ${U+1}`;s(Lt.id,C.id,C.content,Lt.title,tn,X)},className:"h-6 px-2 ml-auto",children:[i.jsx(Pm,{className:"h-3 w-3 mr-1"}),"Set Position"]})]}),i.jsx("p",{className:"text-sm text-slate-700 whitespace-pre-wrap",children:C.content}),C.probes&&C.probes.length>0&&i.jsxs("div",{className:"mt-2 pl-4 border-l-2 border-slate-200",children:[i.jsx("p",{className:"text-xs font-medium text-slate-600 mb-1",children:"Probe Questions:"}),i.jsx("ul",{className:"space-y-1",children:C.probes.map((it,Lt)=>i.jsxs("li",{className:"text-xs text-slate-600",children:["• ",it]},Lt))})]}),(((Xn=C.metadata)==null?void 0:Xn.image_url)||((an=C.metadata)==null?void 0:an.image_id)||ze)&&i.jsxs("div",{className:"mt-3",children:[i.jsxs("div",{className:"flex items-center gap-2 mb-2",children:[i.jsx(_m,{className:"h-4 w-4 text-slate-600"}),i.jsx("span",{className:"text-sm font-medium text-slate-700",children:"Visual Aid"})]}),(pt=C.metadata)!=null&&pt.image_url?i.jsx("img",{src:C.metadata.image_url,alt:"Visual aid for item",className:"max-w-[400px] max-h-[400px] object-contain rounded-lg border border-slate-200"}):(tt=C.metadata)!=null&&tt.image_id&&h?i.jsx("img",{src:St.getAssetUrl(h,C.metadata.image_id),alt:"Visual aid for item",className:"max-w-[400px] max-h-[400px] object-contain rounded-lg border border-slate-200"}):ze&&h?i.jsx("img",{src:St.getAssetUrl(h,ze),alt:"Visual aid for item",className:"max-w-[400px] max-h-[400px] object-contain rounded-lg border border-slate-200"}):null]})]})]},C.id)},st=(C,R)=>{var ee,me,Se,Ie;const U=y.has(C.id),X=x===C.id,Q=X?j:C,z=(n==null?void 0:n.moderator_position.section_index)===R;return i.jsxs("div",{className:Me("border rounded-lg overflow-hidden transition-colors",z&&"border-blue-500 shadow-md",!z&&"border-slate-200"),children:[i.jsxs("div",{className:Me("px-4 py-3 flex items-center justify-between cursor-pointer hover:bg-slate-50 transition-colors",z&&"bg-blue-50"),onClick:()=>!X&&re(C.id),children:[i.jsxs("div",{className:"flex items-center gap-3",children:[i.jsx("div",{className:"transition-transform",style:{transform:U?"rotate(90deg)":"rotate(0deg)"},children:i.jsx(zs,{className:"h-5 w-5 text-slate-500"})}),i.jsx("h3",{className:"font-semibold text-slate-800",children:X?i.jsx(Ot,{value:Q.title,onChange:we=>L({title:we.target.value}),onClick:we=>we.stopPropagation(),className:"font-semibold"}):Q.title}),z&&i.jsx(Wn,{variant:"default",className:"text-xs",children:"Current"})]}),i.jsxs("div",{className:"flex items-center gap-2",children:[a&&!X&&i.jsx(te,{size:"sm",variant:"ghost",onClick:we=>{we.stopPropagation(),A(C)},className:"h-8 px-2",children:i.jsx(BA,{className:"h-3 w-3"})}),X&&i.jsxs("div",{className:"flex items-center gap-2",onClick:we=>we.stopPropagation(),children:[i.jsxs(te,{size:"sm",variant:"default",onClick:Z,disabled:N,className:"h-8",children:[N?i.jsx(ii,{className:"h-3 w-3 animate-spin"}):i.jsx(RS,{className:"h-3 w-3"}),i.jsx("span",{className:"ml-1",children:"Save"})]}),i.jsxs(te,{size:"sm",variant:"ghost",onClick:$,disabled:N,className:"h-8",children:[i.jsx(Zs,{className:"h-3 w-3"}),i.jsx("span",{className:"ml-1",children:"Cancel"})]})]})]})]}),U&&i.jsxs("div",{className:"px-4 py-3 border-t border-slate-200 space-y-4",children:[Q.content&&i.jsx("div",{className:"prose prose-sm max-w-none",children:X?i.jsx(nt,{value:Q.content,onChange:we=>L({content:we.target.value}),placeholder:"Section introduction or context...",className:"min-h-[80px] w-full"}):i.jsx("p",{className:"text-slate-700",children:Q.content})}),Q.activities&&Q.activities.length>0||X?i.jsxs("div",{className:"space-y-2",children:[i.jsxs("div",{className:"flex items-center justify-between",children:[i.jsxs("h5",{className:"font-medium text-slate-700 flex items-center gap-2",children:[i.jsx(Za,{className:"h-4 w-4"}),"Activities"]}),X&&i.jsxs(te,{size:"sm",variant:"outline",onClick:()=>D("activity"),className:"h-7",children:[i.jsx(Za,{className:"h-3 w-3 mr-1"}),"Add Activity"]})]}),i.jsx("div",{className:"space-y-2",children:(ee=Q.activities)==null?void 0:ee.map((we,ze)=>at(we,R,ze,"activity"))})]}):null,Q.questions&&Q.questions.length>0||X?i.jsxs("div",{className:"space-y-2",children:[i.jsxs("div",{className:"flex items-center justify-between",children:[i.jsxs("h5",{className:"font-medium text-slate-700 flex items-center gap-2",children:[i.jsx(xa,{className:"h-4 w-4"}),"Questions"]}),X&&i.jsxs(te,{size:"sm",variant:"outline",onClick:()=>D("question"),className:"h-7",children:[i.jsx(xa,{className:"h-3 w-3 mr-1"}),"Add Question"]})]}),i.jsx("div",{className:"space-y-2",children:(me=Q.questions)==null?void 0:me.map((we,ze)=>at(we,R,ze,"question"))})]}):null,X&&i.jsx("div",{className:"space-y-2",children:i.jsxs("div",{className:"flex items-center justify-between",children:[i.jsxs("h5",{className:"font-medium text-slate-700 flex items-center gap-2",children:[i.jsx(Pm,{className:"h-4 w-4"}),"Subsections"]}),i.jsxs(te,{size:"sm",variant:"outline",onClick:T,className:"h-7",children:[i.jsx(Pm,{className:"h-3 w-3 mr-1"}),"Add Subsection"]})]})}),Q.subsections&&Q.subsections.length>0&&i.jsx("div",{className:"space-y-3 ml-4",children:Q.subsections.map((we,ze)=>{var gt,jt;return i.jsxs("div",{className:"border-l-2 border-slate-200 pl-4",children:[i.jsxs("div",{className:"flex items-center gap-2 mb-2",children:[X&&i.jsxs("div",{className:"flex flex-col gap-1",children:[i.jsx(te,{size:"sm",variant:"ghost",onClick:()=>De(ze),disabled:!se(Q.subsections||[],ze),className:"h-7 w-7 p-0",title:"Move subsection up",children:i.jsx(Tl,{className:"h-4 w-4"})}),i.jsx(te,{size:"sm",variant:"ghost",onClick:()=>de(ze),disabled:!ce(Q.subsections||[],ze),className:"h-7 w-7 p-0",title:"Move subsection down",children:i.jsx(yi,{className:"h-4 w-4"})})]}),X&&P===we.id?i.jsxs("div",{className:"flex items-center gap-2 flex-1",children:[i.jsx(Ot,{value:O,onChange:Ge=>M(Ge.target.value),className:"flex-1",onKeyDown:Ge=>{Ge.key==="Enter"?ne():Ge.key==="Escape"&&Pe()},autoFocus:!0}),i.jsx(te,{size:"sm",onClick:ne,children:i.jsx(Ta,{className:"h-3 w-3"})}),i.jsx(te,{size:"sm",variant:"outline",onClick:Pe,children:i.jsx(Zs,{className:"h-3 w-3"})})]}):i.jsxs("div",{className:"flex items-center gap-2 flex-1",children:[i.jsx("h5",{className:Me("font-medium text-slate-700",X&&"cursor-pointer hover:text-blue-600"),onClick:()=>X&&be(we.id,we.title),children:we.title}),X&&i.jsxs(i.Fragment,{children:[i.jsx(te,{size:"sm",variant:"ghost",onClick:()=>be(we.id,we.title),className:"h-6 w-6 p-0 opacity-60 hover:opacity-100",children:i.jsx(BA,{className:"h-3 w-3"})}),i.jsx(te,{size:"sm",variant:"ghost",onClick:()=>F(ze),className:"h-6 w-6 p-0 opacity-60 hover:opacity-100 text-red-600 hover:text-red-700",title:"Delete subsection",children:i.jsx(_n,{className:"h-3 w-3"})})]})]})]}),we.questions&&we.questions.length>0||X?i.jsxs("div",{className:"space-y-2 mb-3",children:[i.jsxs("div",{className:"flex items-center justify-between",children:[i.jsxs("h6",{className:"text-sm font-medium text-slate-600 flex items-center gap-1",children:[i.jsx(xa,{className:"h-3 w-3"}),"Questions"]}),X&&i.jsxs(te,{size:"sm",variant:"outline",onClick:()=>V(ze,"question"),className:"h-6",children:[i.jsx(xa,{className:"h-3 w-3 mr-1"}),"Add Question"]})]}),i.jsx("div",{className:"space-y-2",children:(gt=we.questions)==null?void 0:gt.map((Ge,Ze)=>at(Ge,R,Ze,"question",ze))})]}):null,we.activities&&we.activities.length>0||X?i.jsxs("div",{className:"space-y-2",children:[i.jsxs("div",{className:"flex items-center justify-between",children:[i.jsxs("h6",{className:"text-sm font-medium text-slate-600 flex items-center gap-1",children:[i.jsx(Za,{className:"h-3 w-3"}),"Activities"]}),X&&i.jsxs(te,{size:"sm",variant:"outline",onClick:()=>V(ze,"activity"),className:"h-6",children:[i.jsx(Za,{className:"h-3 w-3 mr-1"}),"Add Activity"]})]}),i.jsx("div",{className:"space-y-2",children:(jt=we.activities)==null?void 0:jt.map((Ge,Ze)=>at(Ge,R,Ze,"activity",ze))})]}):null]},we.id)})}),(((Se=C.metadata)==null?void 0:Se.image_url)||((Ie=C.metadata)==null?void 0:Ie.image_id))&&i.jsxs("div",{className:"mt-4",children:[i.jsxs("div",{className:"flex items-center gap-2 mb-2",children:[i.jsx(_m,{className:"h-4 w-4 text-slate-600"}),i.jsx("span",{className:"text-sm font-medium text-slate-700",children:"Visual Aid"})]}),C.metadata.image_url?i.jsx("img",{src:C.metadata.image_url,alt:"Visual aid for section",className:"max-w-[400px] max-h-[400px] object-contain rounded-lg border border-slate-200"}):C.metadata.image_id&&h?i.jsx("img",{src:St.getAssetUrl(h,C.metadata.image_id),alt:"Visual aid for section",className:"max-w-[400px] max-h-[400px] object-contain rounded-lg border border-slate-200"}):null]})]})]},C.id)};if(g)return i.jsxs("div",{className:Me("space-y-4",u),children:[o&&n&&i.jsxs("div",{className:"mb-4",children:[i.jsxs("div",{className:"flex items-center justify-between text-sm text-slate-600 mb-2",children:[i.jsx("span",{children:"Progress"}),i.jsxs("span",{children:[Math.round(n.progress),"%"]})]}),i.jsx("div",{className:"w-full bg-slate-200 rounded-full h-2",children:i.jsx("div",{className:"bg-blue-600 h-2 rounded-full transition-all",style:{width:`${n.progress}%`}})})]}),i.jsxs("div",{className:"bg-white rounded-lg border border-slate-200 p-6",children:[i.jsxs("div",{className:"flex items-center justify-between mb-4",children:[i.jsx("h2",{className:"text-xl font-semibold text-slate-800",children:"Discussion Guide"}),d&&i.jsxs(te,{size:"sm",variant:"outline",onClick:d,disabled:f,children:[f?i.jsx(ii,{className:"h-4 w-4 animate-spin mr-2"}):i.jsx($l,{className:"h-4 w-4 mr-2"}),"Download"]})]}),i.jsx("div",{className:"prose prose-sm max-w-none",children:i.jsx("pre",{className:"whitespace-pre-wrap text-sm text-slate-700 font-sans",children:t})}),n&&i.jsxs("div",{className:"mt-6 p-4 bg-blue-50 rounded-lg border border-blue-200",children:[i.jsx("h3",{className:"font-medium text-blue-900 mb-2",children:"Current Position"}),i.jsx("p",{className:"text-sm text-blue-800",children:n.current_section}),n.current_item&&i.jsx("p",{className:"text-sm text-blue-700 mt-1",children:n.current_item})]})]})]});if(!m)return i.jsx("div",{className:Me("bg-slate-50 rounded-lg p-8 text-center",u),children:i.jsx("p",{className:"text-slate-600",children:"No discussion guide available"})});const Mt=i.jsxs("div",{className:"space-y-4",children:[o&&n&&i.jsxs("div",{className:"mb-4",children:[i.jsxs("div",{className:"flex items-center justify-between text-sm text-slate-600 mb-2",children:[i.jsx("span",{children:"Overall Progress"}),i.jsxs("span",{children:[Math.round(n.progress),"%"]})]}),i.jsx("div",{className:"w-full bg-slate-200 rounded-full h-2",children:i.jsx("div",{className:"bg-blue-600 h-2 rounded-full transition-all",style:{width:`${n.progress}%`}})}),i.jsxs("div",{className:"flex items-center justify-between text-xs text-slate-500 mt-2",children:[i.jsxs("span",{children:["Section ",n.moderator_position.section_index+1," of ",n.total_sections]}),i.jsxs("span",{children:[Math.round(n.section_progress),"% of current section"]})]})]}),i.jsx("div",{className:"space-y-3",children:m.sections.map((C,R)=>st(C,R))})]});return l?i.jsxs(cp,{defaultOpen:c,className:u,children:[i.jsx(up,{asChild:!0,children:i.jsxs("div",{className:"flex items-center justify-between p-4 bg-white rounded-lg border border-slate-200 cursor-pointer hover:bg-slate-50 transition-colors",children:[i.jsxs("div",{className:"flex items-center gap-3",children:[i.jsx(zs,{className:"h-5 w-5 text-slate-500 transition-transform data-[state=open]:rotate-90"}),i.jsx("h2",{className:"text-lg font-semibold text-slate-800",children:m.title||"Discussion Guide"}),i.jsxs(Wn,{variant:"outline",className:"text-xs",children:[m.total_duration," min"]})]}),i.jsxs("div",{className:"flex items-center gap-2",children:[n&&i.jsxs(Wn,{variant:n.progress===100?"success":"default",className:"text-xs",children:[Math.round(n.progress),"% Complete"]}),d&&i.jsx(te,{size:"sm",variant:"outline",onClick:C=>{C.stopPropagation(),d()},disabled:f,children:f?i.jsx(ii,{className:"h-4 w-4 animate-spin"}):i.jsx($l,{className:"h-4 w-4"})})]})]})}),i.jsx(dp,{className:"mt-4",children:Mt})]}):i.jsx("div",{className:u,children:Mt})});RN.displayName="DiscussionGuideViewer";const Ho="all",_Q=Te.object({researchBrief:Te.string().min(10,{message:"Research brief must be at least 10 characters."}),focusGroupName:Te.string().min(3,{message:"Focus group name must be at least 3 characters."}),discussionTopics:Te.string().min(10,{message:"Discussion topics are required."}),creativeAssets:Te.instanceof(FileList).optional(),duration:Te.string().min(1,{message:"Duration is required."}),llm_model:Te.string().optional()}),kd={introduction:"Welcome to our focus group discussion. Today we'll be exploring your experiences and opinions on [product/service]. There are no right or wrong answers, we're just interested in your honest thoughts.",warmup:"Let's start by introducing ourselves and sharing a bit about your background and daily routines relevant to this topic.",exploration:"Now, let's dive deeper into your experiences with similar products. What features do you find most valuable? What frustrations have you encountered?",creative:"We'll now show you some concepts and get your feedback. Please be honest and specific in your reactions.",conclusion:"To wrap up, I'd like to hear your final thoughts on what we've discussed today and any additional insights you'd like to share."};function PQ({draftToEdit:e,onDraftSaved:t,preSelectedParticipants:n=[]}={}){console.log("FocusGroupModerator component rendering, draftToEdit:",e);const r=Tn();qr();const{setPreviousRoute:s,navigationState:a,clearNavigationState:o}=XL(),[l,c]=v.useState("setup"),[u,d]=v.useState(!1),[f,h]=v.useState(!1),[p,g]=v.useState(!1),[m,y]=v.useState(null),[b,x]=v.useState(null),[w,j]=v.useState(!1),S=v.useRef(m);S.current=m;const N=v.useRef(!1),_=I=>I&&typeof I=="object"&&I.title&&I.sections,[P,k]=v.useState([]),[O,M]=v.useState([]),[A,$]=v.useState([]),[L,H]=v.useState(!1),[D,V]=v.useState(!1),[T,F]=v.useState([]),[q,Z]=v.useState(Ho),[re,ge]=v.useState(!1),[B,le]=v.useState(""),[se,ce]=v.useState(null),[De,de]=v.useState(""),[be,Pe]=v.useState(""),[ne,Je]=v.useState(!1),[ve,at]=v.useState({age:[],gender:[],occupation:[],location:[],techSavviness:[],ethnicity:[]}),[st,Mt]=v.useState({age:[],gender:[],occupation:[],location:[],techSavviness:[],ethnicity:[]}),[C,R]=v.useState("idle"),[U,X]=v.useState(null),[Q,z]=v.useState(0),ee=v.useRef(null),me=v.useRef(!1),Se=v.useRef(!1),Ie=I=>{s("/focus-groups",{focusGroupId:b,focusGroupTab:"participants",isNewFocusGroup:!e,focusGroupData:{name:tt.getValues("name"),description:tt.getValues("description"),selectedParticipants:P,discussionGuide:m}}),r(`/synthetic-users/${I.id}`)},we=I=>{const K={age:new Set,gender:new Set,occupation:new Set,location:new Set,techSavviness:new Set,ethnicity:new Set};return I.forEach(W=>{if(W.age&&K.age.add(W.age),W.gender&&K.gender.add(W.gender),W.occupation&&K.occupation.add(W.occupation),W.location&&K.location.add(W.location),W.techSavviness!==void 0){const ie=W.techSavviness<30?"Low (0-30)":W.techSavviness<70?"Medium (31-70)":"High (71-100)";K.techSavviness.add(ie)}W.ethnicity&&K.ethnicity.add(W.ethnicity)}),{age:Array.from(K.age).sort(),gender:Array.from(K.gender).sort(),occupation:Array.from(K.occupation).sort(),location:Array.from(K.location).sort(),techSavviness:Array.from(K.techSavviness).sort((W,ie)=>{const he=["Low (0-30)","Medium (31-70)","High (71-100)"];return he.indexOf(W)-he.indexOf(ie)}),ethnicity:Array.from(K.ethnicity).sort()}},ze=I=>{const K={...st};K[I]=[];const W=A.filter(ie=>{let he=!0;if(q!==Ho)if(he=!1,ie.folderId===q)he=!0;else{const ke=T.find(qe=>qe.id===q);ke&&ke.personaIds.includes(ie.id)&&(he=!0)}return he?Object.entries(K).every(([ke,qe])=>{if(qe.length===0)return!0;const Ft=ke;if(Ft==="techSavviness"&&ie.techSavviness!==void 0){const Wt=ie.techSavviness<30?"Low (0-30)":ie.techSavviness<70?"Medium (31-70)":"High (71-100)";return qe.includes(Wt)}else{if(Ft==="age"&&ie.age)return qe.includes(ie.age);if(Ft==="gender"&&ie.gender)return qe.includes(ie.gender);if(Ft==="occupation"&&ie.occupation)return qe.includes(ie.occupation);if(Ft==="location"&&ie.location)return qe.includes(ie.location);if(Ft==="ethnicity"&&ie.ethnicity)return qe.includes(ie.ethnicity)}return!0}):!1});return we(W)},gt=()=>{Je(!1),setTimeout(()=>{at({...st})},0)},jt=()=>{Mt({age:[],gender:[],occupation:[],location:[],techSavviness:[],ethnicity:[]})},Ge=(I,K)=>{Mt(W=>{const ie={...W};return ie[I].includes(K)?ie[I]=ie[I].filter(he=>he!==K):ie[I]=[...ie[I],K],ie})},Ze=()=>{if(!B.trim()){oe.error("Please enter a folder name");return}const I={id:`folder-${Date.now()}`,name:B.trim(),personaIds:[]};F([...T,I]),le(""),ge(!1),oe.success(`Folder "${B}" created`)},kt=()=>{le(""),ge(!1)},Vt=I=>{ce(I),de(I.name)},Xn=()=>{if(!se||!De.trim()){ce(null);return}const I=T.map(K=>K.id===se.id?{...K,name:De.trim()}:K);F(I),ce(null),oe.success(`Folder renamed to "${De}"`)},an=()=>{ce(null),de("")},pt=(I,K)=>(I.forEach(W=>{if(W.folderId){const ie=K.find(he=>he.id===W.folderId);ie&&!ie.personaIds.includes(W.id)&&ie.personaIds.push(W.id)}}),K.forEach(W=>{W.personaIds=W.personaIds.filter(ie=>{if(!ie)return console.log(`Removing invalid personaId (${ie}) from folder ${W.name}`),!1;const he=I.find(ke=>ke.id===ie||ke._id===ie);return he||console.log(`Removing non-existent personaId ${ie} from folder ${W.name}`),!!he})}),K);v.useEffect(()=>{const I=async()=>{H(!0);try{const ie=await Dn.getAll();console.log("Fetched personas for FocusGroupModerator:",ie.data),Array.isArray(ie.data)&&ie.data.length>0?$(ie.data):(console.warn("No personas returned from API or invalid format",ie.data),oe.warning("No participants available"))}catch(ie){console.error("Error fetching personas:",ie),oe.error("Failed to load participants")}finally{H(!1)}},K=localStorage.getItem("persona-folders");let W=[];if(K)try{W=JSON.parse(K),F(W)}catch(ie){console.error("Failed to parse stored folders:",ie)}I()},[]),v.useEffect(()=>{T.length>0&&(console.log("Saving folders to localStorage:",T),localStorage.setItem("persona-folders",JSON.stringify(T)))},[T]),v.useEffect(()=>{if(A.length>0&&T.length>0){console.log("Running folder sync with personas:",A.length,"and folders:",T.length);const I=pt(A,[...T]);JSON.stringify(I)!==JSON.stringify(T)?(console.log("Updating folders after sync"),F(I)):console.log("No folder changes after sync")}},[A,T.length]),console.log("About to initialize form with useForm hook");const tt=Ny({resolver:_y(_Q),defaultValues:{researchBrief:"",focusGroupName:"",discussionTopics:"",duration:"60",llm_model:"gemini-2.5-pro"}});console.log("Form initialized successfully");const it=()=>{l!=="setup"||Se.current||(ee.current&&clearTimeout(ee.current),ee.current=setTimeout(async()=>{if(me.current)return;const I=tt.getValues(),K={name:I.focusGroupName||"",description:I.researchBrief||"",objective:I.researchBrief||"",topic:I.discussionTopics||"",duration:I.duration?parseInt(I.duration):60,llm_model:I.llm_model||"gemini-2.5-pro",participants:P,participants_count:P.length,status:"draft",date:new Date().toISOString(),uploadedAssets:O.map(W=>W.name)};if(!(U&&JSON.stringify(K)===JSON.stringify(U))&&!(!K.name&&!K.description&&!K.topic)){me.current=!0,R("saving");try{let W=b||(e==null?void 0:e.id)||(e==null?void 0:e._id);if(console.log("Auto-save: draftFocusGroupId =",b),console.log("Auto-save: draftToEdit ID =",(e==null?void 0:e.id)||(e==null?void 0:e._id)),console.log("Auto-save: using focusGroupId =",W),console.log("Auto-save: llm_model in currentData =",K.llm_model),console.log("Auto-save: duration in currentData =",K.duration),W)console.log("Auto-save: Updating existing focus group:",W),await St.update(W,K),console.log("Auto-save: Updated existing draft:",W);else{console.log("Auto-save: Creating NEW focus group (no existing ID)");const ie=await St.create(K);W=ie.data.focus_group_id||ie.data.id||ie.data._id,x(W),console.log("Auto-save: Created new draft with ID:",W)}X(K),R("saved"),z(0),setTimeout(()=>{R("idle")},2e3)}catch(W){if(console.error("Auto-save failed:",W),R("error"),z(ie=>ie+1),Q<3){const ie=Math.pow(2,Q)*2e3;setTimeout(()=>{it()},ie)}else oe.error("Auto-save failed",{description:"Your changes may not be saved. Please check your connection."})}finally{me.current=!1}}},2e3))},Lt=tt.watch(),tn=v.useRef(""),Xr=v.useRef(""),za=v.useRef("");v.useEffect(()=>{const I=JSON.stringify(Lt);l==="setup"&&I!==tn.current&&(tn.current=I,it())},[Lt,l]),v.useEffect(()=>{const I=JSON.stringify(P);l==="setup"&&I!==Xr.current&&(Xr.current=I,it())},[P,l]),v.useEffect(()=>{const I=JSON.stringify(O.map(K=>K.name));l==="setup"&&I!==za.current&&(za.current=I,it())},[O,l]),v.useEffect(()=>(l!=="setup"&&ee.current&&clearTimeout(ee.current),()=>{ee.current&&clearTimeout(ee.current)}),[l]),v.useEffect(()=>{if(console.log("Draft loading effect - draftToEdit:",e,"draftLoadedRef.current:",N.current),!e){N.current=!1;return}if(e&&!N.current){console.log("Loading draft focus group:",e),Se.current=!0,N.current=!0;const I=e.id||e._id;x(I),console.log("Setting draft ID from draftToEdit:",I),e.name&&tt.setValue("focusGroupName",e.name),(e.description||e.objective)&&tt.setValue("researchBrief",e.description||e.objective||""),e.topic&&tt.setValue("discussionTopics",e.topic),e.duration&&tt.setValue("duration",e.duration.toString()),e.llm_model&&tt.setValue("llm_model",e.llm_model),e.discussionGuide&&(y(e.discussionGuide),(!a.focusGroupTab||a.previousRoute!=="/focus-groups")&&c("review")),e.participants&&Array.isArray(e.participants)&&k(e.participants);const K={name:e.name||"",description:e.description||e.objective||"",objective:e.description||e.objective||"",topic:e.topic||"",duration:e.duration||60,llm_model:e.llm_model||"gemini-2.5-pro",participants:e.participants||[],participants_count:(e.participants||[]).length,status:"draft",date:e.date||new Date().toISOString(),uploadedAssets:[]};X(K),console.log("Set lastSavedData to current draft:",K),oe.success("Draft focus group loaded",{description:"Continue editing your focus group setup"}),setTimeout(()=>{Se.current=!1},1e3)}},[e,tt]),v.useEffect(()=>{n.length>0&&(console.log("Pre-selected participants received:",n),k(n),c("participants"))},[n]),v.useEffect(()=>{a.focusGroupTab&&a.previousRoute==="/focus-groups"&&setTimeout(()=>{c(a.focusGroupTab),o()},0)},[a.focusGroupTab,e,o]),v.useEffect(()=>{e||setTimeout(()=>{Se.current=!1},500)},[e]);const G=()=>{if(C==="idle")return null;const K={saving:{text:"Saving...",className:"text-blue-600 bg-blue-50"},saved:{text:"All changes saved",className:"text-green-600 bg-green-50"},error:{text:"Save failed - retrying...",className:"text-red-600 bg-red-50"}}[C];return i.jsx("div",{className:`fixed top-16 left-1/2 transform -translate-x-1/2 z-50 px-3 py-1 rounded-md text-sm font-medium border shadow-sm ${K.className}`,children:K.text})},Ce=async(I,K)=>{var W,ie;d(!0),h(!1),g(!1);try{const he={name:I.focusGroupName,description:I.researchBrief,objective:I.researchBrief,topic:I.discussionTopics,duration:parseInt(I.duration),llm_model:I.llm_model},ke=K?await St.generateDiscussionGuideForGroup(K,he):await St.generateDiscussionGuide(he);if(ke.data&&ke.data.discussionGuide)return h(!0),ke.data.discussionGuide;throw new Error("Failed to generate discussion guide")}catch(he){console.error("Error generating discussion guide:",he),g(!0);let ke="Unknown error occurred";return(ie=(W=he==null?void 0:he.response)==null?void 0:W.data)!=null&&ie.error?ke=he.response.data.error:he!=null&&he.message&&(ke=he.message),ke.includes("500")||ke.includes("internal error")||ke.includes("Internal Server Error")?oe.error("AI service temporarily unavailable",{description:"The discussion guide generator is experiencing issues. Please try again in a few minutes.",action:{label:"Retry",onClick:()=>Ce(I)}}):oe.error("Failed to generate discussion guide",{description:ke,action:{label:"Retry",onClick:()=>Ce(I)}}),` +`).filter(tn=>tn.trim()):[];G(C.id,{probes:Lt},X)},placeholder:"Enter probe questions, one per line...",className:"min-h-[40px]"})]}),(((He=C.metadata)==null?void 0:He.image_url)||((Ze=C.metadata)==null?void 0:Ze.image_id)||ze)&&i.jsxs("div",{className:"mt-3",children:[i.jsxs("div",{className:"flex items-center gap-2 mb-2",children:[i.jsx(Pm,{className:"h-4 w-4 text-slate-600"}),i.jsx("span",{className:"text-sm font-medium text-slate-700",children:"Visual Aid"})]}),(kt=C.metadata)!=null&&kt.image_url?i.jsx("img",{src:C.metadata.image_url,alt:"Visual aid for item",className:"max-w-[400px] max-h-[400px] object-contain rounded-lg border border-slate-200"}):(Vt=C.metadata)!=null&&Vt.image_id&&h?i.jsx("img",{src:bt.getAssetUrl(h,C.metadata.image_id),alt:"Visual aid for item",className:"max-w-[400px] max-h-[400px] object-contain rounded-lg border border-slate-200"}):ze&&h?i.jsx("img",{src:bt.getAssetUrl(h,ze),alt:"Visual aid for item",className:"max-w-[400px] max-h-[400px] object-contain rounded-lg border border-slate-200"}):null]})]}),i.jsx("div",{className:"flex-shrink-0",children:i.jsx(te,{size:"sm",variant:"ghost",onClick:()=>q(C.id,X),className:"h-8 w-8 p-0 text-red-600 hover:text-red-700",children:i.jsx(_n,{className:"h-3 w-3"})})})]},`edit-item-${C.id}`):i.jsxs("div",{className:Oe("flex items-start gap-3 p-3 rounded-lg border transition-colors",Se&&"bg-blue-50 border-blue-200",Ie&&"bg-green-50 border-green-200",!Se&&!Ie&&"bg-slate-50 border-slate-200",r&&"cursor-pointer hover:bg-slate-100"),onClick:()=>r==null?void 0:r(m.sections[R].id,C.id),children:[i.jsx("div",{className:"flex-shrink-0 mt-1",children:Ie?i.jsx(LS,{className:"h-4 w-4 text-green-600"}):Se?i.jsx(lI,{className:"h-4 w-4 text-blue-600"}):i.jsx(FS,{className:"h-4 w-4 text-slate-400"})}),i.jsxs("div",{className:"flex-1 min-w-0",children:[i.jsxs("div",{className:"flex items-center gap-2 mb-1 flex-wrap",children:[i.jsx(Wn,{variant:"outline",className:"text-xs whitespace-nowrap",children:X==="activity"?i.jsxs(i.Fragment,{children:[i.jsx(Qa,{className:"h-3 w-3 mr-1"}),typeof C.type=="string"?C.type.replace("_"," "):String(C.type||"unknown")]}):i.jsxs(i.Fragment,{children:[i.jsx(xa,{className:"h-3 w-3 mr-1"}),typeof C.type=="string"?C.type.replace("_"," "):String(C.type||"unknown")]})}),C.time_limit&&i.jsxs("div",{className:"flex items-center gap-1 text-xs text-slate-500 whitespace-nowrap",children:[i.jsx(Uf,{className:"h-3 w-3"}),C.time_limit," min"]}),s&&i.jsxs(te,{size:"sm",variant:"ghost",onClick:it=>{it.stopPropagation();const Lt=m.sections[R],tn=X==="activity"?`Activity ${U+1}`:`Question ${U+1}`;s(Lt.id,C.id,C.content,Lt.title,tn,X)},className:"h-6 px-2 ml-auto",children:[i.jsx(Am,{className:"h-3 w-3 mr-1"}),"Set Position"]})]}),i.jsx("p",{className:"text-sm text-slate-700 whitespace-pre-wrap",children:C.content}),C.probes&&C.probes.length>0&&i.jsxs("div",{className:"mt-2 pl-4 border-l-2 border-slate-200",children:[i.jsx("p",{className:"text-xs font-medium text-slate-600 mb-1",children:"Probe Questions:"}),i.jsx("ul",{className:"space-y-1",children:C.probes.map((it,Lt)=>i.jsxs("li",{className:"text-xs text-slate-600",children:["• ",it]},Lt))})]}),(((Xn=C.metadata)==null?void 0:Xn.image_url)||((an=C.metadata)==null?void 0:an.image_id)||ze)&&i.jsxs("div",{className:"mt-3",children:[i.jsxs("div",{className:"flex items-center gap-2 mb-2",children:[i.jsx(Pm,{className:"h-4 w-4 text-slate-600"}),i.jsx("span",{className:"text-sm font-medium text-slate-700",children:"Visual Aid"})]}),(pt=C.metadata)!=null&&pt.image_url?i.jsx("img",{src:C.metadata.image_url,alt:"Visual aid for item",className:"max-w-[400px] max-h-[400px] object-contain rounded-lg border border-slate-200"}):(tt=C.metadata)!=null&&tt.image_id&&h?i.jsx("img",{src:bt.getAssetUrl(h,C.metadata.image_id),alt:"Visual aid for item",className:"max-w-[400px] max-h-[400px] object-contain rounded-lg border border-slate-200"}):ze&&h?i.jsx("img",{src:bt.getAssetUrl(h,ze),alt:"Visual aid for item",className:"max-w-[400px] max-h-[400px] object-contain rounded-lg border border-slate-200"}):null]})]})]},C.id)},st=(C,R)=>{var ee,me,Se,Ie;const U=y.has(C.id),X=x===C.id,Q=X?j:C,z=(n==null?void 0:n.moderator_position.section_index)===R;return i.jsxs("div",{className:Oe("border rounded-lg overflow-hidden transition-colors",z&&"border-blue-500 shadow-md",!z&&"border-slate-200"),children:[i.jsxs("div",{className:Oe("px-4 py-3 flex items-center justify-between cursor-pointer hover:bg-slate-50 transition-colors",z&&"bg-blue-50"),onClick:()=>!X&&re(C.id),children:[i.jsxs("div",{className:"flex items-center gap-3",children:[i.jsx("div",{className:"transition-transform",style:{transform:U?"rotate(90deg)":"rotate(0deg)"},children:i.jsx(gs,{className:"h-5 w-5 text-slate-500"})}),i.jsx("h3",{className:"font-semibold text-slate-800",children:X?i.jsx(Ot,{value:Q.title,onChange:we=>L({title:we.target.value}),onClick:we=>we.stopPropagation(),className:"font-semibold"}):Q.title}),z&&i.jsx(Wn,{variant:"default",className:"text-xs",children:"Current"})]}),i.jsxs("div",{className:"flex items-center gap-2",children:[a&&!X&&i.jsx(te,{size:"sm",variant:"ghost",onClick:we=>{we.stopPropagation(),A(C)},className:"h-8 px-2",children:i.jsx(GA,{className:"h-3 w-3"})}),X&&i.jsxs("div",{className:"flex items-center gap-2",onClick:we=>we.stopPropagation(),children:[i.jsxs(te,{size:"sm",variant:"default",onClick:Z,disabled:N,className:"h-8",children:[N?i.jsx(li,{className:"h-3 w-3 animate-spin"}):i.jsx(zS,{className:"h-3 w-3"}),i.jsx("span",{className:"ml-1",children:"Save"})]}),i.jsxs(te,{size:"sm",variant:"ghost",onClick:$,disabled:N,className:"h-8",children:[i.jsx(Zs,{className:"h-3 w-3"}),i.jsx("span",{className:"ml-1",children:"Cancel"})]})]})]})]}),U&&i.jsxs("div",{className:"px-4 py-3 border-t border-slate-200 space-y-4",children:[Q.content&&i.jsx("div",{className:"prose prose-sm max-w-none",children:X?i.jsx(nt,{value:Q.content,onChange:we=>L({content:we.target.value}),placeholder:"Section introduction or context...",className:"min-h-[80px] w-full"}):i.jsx("p",{className:"text-slate-700",children:Q.content})}),Q.activities&&Q.activities.length>0||X?i.jsxs("div",{className:"space-y-2",children:[i.jsxs("div",{className:"flex items-center justify-between",children:[i.jsxs("h5",{className:"font-medium text-slate-700 flex items-center gap-2",children:[i.jsx(Qa,{className:"h-4 w-4"}),"Activities"]}),X&&i.jsxs(te,{size:"sm",variant:"outline",onClick:()=>D("activity"),className:"h-7",children:[i.jsx(Qa,{className:"h-3 w-3 mr-1"}),"Add Activity"]})]}),i.jsx("div",{className:"space-y-2",children:(ee=Q.activities)==null?void 0:ee.map((we,ze)=>at(we,R,ze,"activity"))})]}):null,Q.questions&&Q.questions.length>0||X?i.jsxs("div",{className:"space-y-2",children:[i.jsxs("div",{className:"flex items-center justify-between",children:[i.jsxs("h5",{className:"font-medium text-slate-700 flex items-center gap-2",children:[i.jsx(xa,{className:"h-4 w-4"}),"Questions"]}),X&&i.jsxs(te,{size:"sm",variant:"outline",onClick:()=>D("question"),className:"h-7",children:[i.jsx(xa,{className:"h-3 w-3 mr-1"}),"Add Question"]})]}),i.jsx("div",{className:"space-y-2",children:(me=Q.questions)==null?void 0:me.map((we,ze)=>at(we,R,ze,"question"))})]}):null,X&&i.jsx("div",{className:"space-y-2",children:i.jsxs("div",{className:"flex items-center justify-between",children:[i.jsxs("h5",{className:"font-medium text-slate-700 flex items-center gap-2",children:[i.jsx(Am,{className:"h-4 w-4"}),"Subsections"]}),i.jsxs(te,{size:"sm",variant:"outline",onClick:T,className:"h-7",children:[i.jsx(Am,{className:"h-3 w-3 mr-1"}),"Add Subsection"]})]})}),Q.subsections&&Q.subsections.length>0&&i.jsx("div",{className:"space-y-3 ml-4",children:Q.subsections.map((we,ze)=>{var gt,St;return i.jsxs("div",{className:"border-l-2 border-slate-200 pl-4",children:[i.jsxs("div",{className:"flex items-center gap-2 mb-2",children:[X&&i.jsxs("div",{className:"flex flex-col gap-1",children:[i.jsx(te,{size:"sm",variant:"ghost",onClick:()=>De(ze),disabled:!se(Q.subsections||[],ze),className:"h-7 w-7 p-0",title:"Move subsection up",children:i.jsx(Tl,{className:"h-4 w-4"})}),i.jsx(te,{size:"sm",variant:"ghost",onClick:()=>de(ze),disabled:!ce(Q.subsections||[],ze),className:"h-7 w-7 p-0",title:"Move subsection down",children:i.jsx(xi,{className:"h-4 w-4"})})]}),X&&P===we.id?i.jsxs("div",{className:"flex items-center gap-2 flex-1",children:[i.jsx(Ot,{value:O,onChange:He=>M(He.target.value),className:"flex-1",onKeyDown:He=>{He.key==="Enter"?ne():He.key==="Escape"&&Pe()},autoFocus:!0}),i.jsx(te,{size:"sm",onClick:ne,children:i.jsx($a,{className:"h-3 w-3"})}),i.jsx(te,{size:"sm",variant:"outline",onClick:Pe,children:i.jsx(Zs,{className:"h-3 w-3"})})]}):i.jsxs("div",{className:"flex items-center gap-2 flex-1",children:[i.jsx("h5",{className:Oe("font-medium text-slate-700",X&&"cursor-pointer hover:text-blue-600"),onClick:()=>X&&be(we.id,we.title),children:we.title}),X&&i.jsxs(i.Fragment,{children:[i.jsx(te,{size:"sm",variant:"ghost",onClick:()=>be(we.id,we.title),className:"h-6 w-6 p-0 opacity-60 hover:opacity-100",children:i.jsx(GA,{className:"h-3 w-3"})}),i.jsx(te,{size:"sm",variant:"ghost",onClick:()=>F(ze),className:"h-6 w-6 p-0 opacity-60 hover:opacity-100 text-red-600 hover:text-red-700",title:"Delete subsection",children:i.jsx(_n,{className:"h-3 w-3"})})]})]})]}),we.questions&&we.questions.length>0||X?i.jsxs("div",{className:"space-y-2 mb-3",children:[i.jsxs("div",{className:"flex items-center justify-between",children:[i.jsxs("h6",{className:"text-sm font-medium text-slate-600 flex items-center gap-1",children:[i.jsx(xa,{className:"h-3 w-3"}),"Questions"]}),X&&i.jsxs(te,{size:"sm",variant:"outline",onClick:()=>V(ze,"question"),className:"h-6",children:[i.jsx(xa,{className:"h-3 w-3 mr-1"}),"Add Question"]})]}),i.jsx("div",{className:"space-y-2",children:(gt=we.questions)==null?void 0:gt.map((He,Ze)=>at(He,R,Ze,"question",ze))})]}):null,we.activities&&we.activities.length>0||X?i.jsxs("div",{className:"space-y-2",children:[i.jsxs("div",{className:"flex items-center justify-between",children:[i.jsxs("h6",{className:"text-sm font-medium text-slate-600 flex items-center gap-1",children:[i.jsx(Qa,{className:"h-3 w-3"}),"Activities"]}),X&&i.jsxs(te,{size:"sm",variant:"outline",onClick:()=>V(ze,"activity"),className:"h-6",children:[i.jsx(Qa,{className:"h-3 w-3 mr-1"}),"Add Activity"]})]}),i.jsx("div",{className:"space-y-2",children:(St=we.activities)==null?void 0:St.map((He,Ze)=>at(He,R,Ze,"activity",ze))})]}):null]},we.id)})}),(((Se=C.metadata)==null?void 0:Se.image_url)||((Ie=C.metadata)==null?void 0:Ie.image_id))&&i.jsxs("div",{className:"mt-4",children:[i.jsxs("div",{className:"flex items-center gap-2 mb-2",children:[i.jsx(Pm,{className:"h-4 w-4 text-slate-600"}),i.jsx("span",{className:"text-sm font-medium text-slate-700",children:"Visual Aid"})]}),C.metadata.image_url?i.jsx("img",{src:C.metadata.image_url,alt:"Visual aid for section",className:"max-w-[400px] max-h-[400px] object-contain rounded-lg border border-slate-200"}):C.metadata.image_id&&h?i.jsx("img",{src:bt.getAssetUrl(h,C.metadata.image_id),alt:"Visual aid for section",className:"max-w-[400px] max-h-[400px] object-contain rounded-lg border border-slate-200"}):null]})]})]},C.id)};if(g)return i.jsxs("div",{className:Oe("space-y-4",u),children:[o&&n&&i.jsxs("div",{className:"mb-4",children:[i.jsxs("div",{className:"flex items-center justify-between text-sm text-slate-600 mb-2",children:[i.jsx("span",{children:"Progress"}),i.jsxs("span",{children:[Math.round(n.progress),"%"]})]}),i.jsx("div",{className:"w-full bg-slate-200 rounded-full h-2",children:i.jsx("div",{className:"bg-blue-600 h-2 rounded-full transition-all",style:{width:`${n.progress}%`}})})]}),i.jsxs("div",{className:"bg-white rounded-lg border border-slate-200 p-6",children:[i.jsxs("div",{className:"flex items-center justify-between mb-4",children:[i.jsx("h2",{className:"text-xl font-semibold text-slate-800",children:"Discussion Guide"}),d&&i.jsxs(te,{size:"sm",variant:"outline",onClick:d,disabled:f,children:[f?i.jsx(li,{className:"h-4 w-4 animate-spin mr-2"}):i.jsx($l,{className:"h-4 w-4 mr-2"}),"Download"]})]}),i.jsx("div",{className:"prose prose-sm max-w-none",children:i.jsx("pre",{className:"whitespace-pre-wrap text-sm text-slate-700 font-sans",children:t})}),n&&i.jsxs("div",{className:"mt-6 p-4 bg-blue-50 rounded-lg border border-blue-200",children:[i.jsx("h3",{className:"font-medium text-blue-900 mb-2",children:"Current Position"}),i.jsx("p",{className:"text-sm text-blue-800",children:n.current_section}),n.current_item&&i.jsx("p",{className:"text-sm text-blue-700 mt-1",children:n.current_item})]})]})]});if(!m)return i.jsx("div",{className:Oe("bg-slate-50 rounded-lg p-8 text-center",u),children:i.jsx("p",{className:"text-slate-600",children:"No discussion guide available"})});const Mt=i.jsxs("div",{className:"space-y-4",children:[o&&n&&i.jsxs("div",{className:"mb-4",children:[i.jsxs("div",{className:"flex items-center justify-between text-sm text-slate-600 mb-2",children:[i.jsx("span",{children:"Overall Progress"}),i.jsxs("span",{children:[Math.round(n.progress),"%"]})]}),i.jsx("div",{className:"w-full bg-slate-200 rounded-full h-2",children:i.jsx("div",{className:"bg-blue-600 h-2 rounded-full transition-all",style:{width:`${n.progress}%`}})}),i.jsxs("div",{className:"flex items-center justify-between text-xs text-slate-500 mt-2",children:[i.jsxs("span",{children:["Section ",n.moderator_position.section_index+1," of ",n.total_sections]}),i.jsxs("span",{children:[Math.round(n.section_progress),"% of current section"]})]})]}),i.jsx("div",{className:"space-y-3",children:m.sections.map((C,R)=>st(C,R))})]});return l?i.jsxs(up,{defaultOpen:c,className:u,children:[i.jsx(dp,{asChild:!0,children:i.jsxs("div",{className:"flex items-center justify-between p-4 bg-white rounded-lg border border-slate-200 cursor-pointer hover:bg-slate-50 transition-colors",children:[i.jsxs("div",{className:"flex items-center gap-3",children:[i.jsx(gs,{className:"h-5 w-5 text-slate-500 transition-transform data-[state=open]:rotate-90"}),i.jsx("h2",{className:"text-lg font-semibold text-slate-800",children:m.title||"Discussion Guide"}),i.jsxs(Wn,{variant:"outline",className:"text-xs",children:[m.total_duration," min"]})]}),i.jsxs("div",{className:"flex items-center gap-2",children:[n&&i.jsxs(Wn,{variant:n.progress===100?"success":"default",className:"text-xs",children:[Math.round(n.progress),"% Complete"]}),d&&i.jsx(te,{size:"sm",variant:"outline",onClick:C=>{C.stopPropagation(),d()},disabled:f,children:f?i.jsx(li,{className:"h-4 w-4 animate-spin"}):i.jsx($l,{className:"h-4 w-4"})})]})]})}),i.jsx(fp,{className:"mt-4",children:Mt})]}):i.jsx("div",{className:u,children:Mt})});zN.displayName="DiscussionGuideViewer";const Go="all",kQ=$e.object({researchBrief:$e.string().min(10,{message:"Research brief must be at least 10 characters."}),focusGroupName:$e.string().min(3,{message:"Focus group name must be at least 3 characters."}),discussionTopics:$e.string().min(10,{message:"Discussion topics are required."}),creativeAssets:$e.instanceof(FileList).optional(),duration:$e.string().min(1,{message:"Duration is required."}),llm_model:$e.string().optional()}),kd={introduction:"Welcome to our focus group discussion. Today we'll be exploring your experiences and opinions on [product/service]. There are no right or wrong answers, we're just interested in your honest thoughts.",warmup:"Let's start by introducing ourselves and sharing a bit about your background and daily routines relevant to this topic.",exploration:"Now, let's dive deeper into your experiences with similar products. What features do you find most valuable? What frustrations have you encountered?",creative:"We'll now show you some concepts and get your feedback. Please be honest and specific in your reactions.",conclusion:"To wrap up, I'd like to hear your final thoughts on what we've discussed today and any additional insights you'd like to share."};function TQ({draftToEdit:e,onDraftSaved:t,preSelectedParticipants:n=[]}={}){console.log("FocusGroupModerator component rendering, draftToEdit:",e);const r=Tn();qr();const{setPreviousRoute:s,navigationState:a,clearNavigationState:o}=Uy(),[l,c]=v.useState("setup"),[u,d]=v.useState(!1),[f,h]=v.useState(!1),[p,g]=v.useState(!1),[m,y]=v.useState(null),[b,x]=v.useState(null),[w,j]=v.useState(!1),S=v.useRef(m);S.current=m;const N=v.useRef(!1),_=I=>I&&typeof I=="object"&&I.title&&I.sections,[P,k]=v.useState([]),[O,M]=v.useState([]),[A,$]=v.useState([]),[L,G]=v.useState(!1),[D,V]=v.useState(!1),[T,F]=v.useState([]),[q,Z]=v.useState(Go),[re,ge]=v.useState(!1),[B,le]=v.useState(""),[se,ce]=v.useState(null),[De,de]=v.useState(""),[be,Pe]=v.useState(""),[ne,Je]=v.useState(!1),[ve,at]=v.useState({age:[],gender:[],occupation:[],location:[],techSavviness:[],ethnicity:[]}),[st,Mt]=v.useState({age:[],gender:[],occupation:[],location:[],techSavviness:[],ethnicity:[]}),[C,R]=v.useState("idle"),[U,X]=v.useState(null),[Q,z]=v.useState(0),ee=v.useRef(null),me=v.useRef(!1),Se=v.useRef(!1),Ie=I=>{s("/focus-groups",{focusGroupId:b,focusGroupTab:"participants",isNewFocusGroup:!e,focusGroupData:{name:tt.getValues("name"),description:tt.getValues("description"),selectedParticipants:P,discussionGuide:m}}),r(`/synthetic-users/${I.id}`)},we=I=>{const K={age:new Set,gender:new Set,occupation:new Set,location:new Set,techSavviness:new Set,ethnicity:new Set};return I.forEach(W=>{if(W.age&&K.age.add(W.age),W.gender&&K.gender.add(W.gender),W.occupation&&K.occupation.add(W.occupation),W.location&&K.location.add(W.location),W.techSavviness!==void 0){const ie=W.techSavviness<30?"Low (0-30)":W.techSavviness<70?"Medium (31-70)":"High (71-100)";K.techSavviness.add(ie)}W.ethnicity&&K.ethnicity.add(W.ethnicity)}),{age:Array.from(K.age).sort(),gender:Array.from(K.gender).sort(),occupation:Array.from(K.occupation).sort(),location:Array.from(K.location).sort(),techSavviness:Array.from(K.techSavviness).sort((W,ie)=>{const he=["Low (0-30)","Medium (31-70)","High (71-100)"];return he.indexOf(W)-he.indexOf(ie)}),ethnicity:Array.from(K.ethnicity).sort()}},ze=I=>{const K={...st};K[I]=[];const W=A.filter(ie=>{let he=!0;if(q!==Go)if(he=!1,ie.folderId===q)he=!0;else{const Te=T.find(qe=>qe.id===q);Te&&Te.personaIds.includes(ie.id)&&(he=!0)}return he?Object.entries(K).every(([Te,qe])=>{if(qe.length===0)return!0;const Ft=Te;if(Ft==="techSavviness"&&ie.techSavviness!==void 0){const Wt=ie.techSavviness<30?"Low (0-30)":ie.techSavviness<70?"Medium (31-70)":"High (71-100)";return qe.includes(Wt)}else{if(Ft==="age"&&ie.age)return qe.includes(ie.age);if(Ft==="gender"&&ie.gender)return qe.includes(ie.gender);if(Ft==="occupation"&&ie.occupation)return qe.includes(ie.occupation);if(Ft==="location"&&ie.location)return qe.includes(ie.location);if(Ft==="ethnicity"&&ie.ethnicity)return qe.includes(ie.ethnicity)}return!0}):!1});return we(W)},gt=()=>{Je(!1),setTimeout(()=>{at({...st})},0)},St=()=>{Mt({age:[],gender:[],occupation:[],location:[],techSavviness:[],ethnicity:[]})},He=(I,K)=>{Mt(W=>{const ie={...W};return ie[I].includes(K)?ie[I]=ie[I].filter(he=>he!==K):ie[I]=[...ie[I],K],ie})},Ze=()=>{if(!B.trim()){oe.error("Please enter a folder name");return}const I={id:`folder-${Date.now()}`,name:B.trim(),personaIds:[]};F([...T,I]),le(""),ge(!1),oe.success(`Folder "${B}" created`)},kt=()=>{le(""),ge(!1)},Vt=I=>{ce(I),de(I.name)},Xn=()=>{if(!se||!De.trim()){ce(null);return}const I=T.map(K=>K.id===se.id?{...K,name:De.trim()}:K);F(I),ce(null),oe.success(`Folder renamed to "${De}"`)},an=()=>{ce(null),de("")},pt=(I,K)=>(I.forEach(W=>{if(W.folderId){const ie=K.find(he=>he.id===W.folderId);ie&&!ie.personaIds.includes(W.id)&&ie.personaIds.push(W.id)}}),K.forEach(W=>{W.personaIds=W.personaIds.filter(ie=>{if(!ie)return console.log(`Removing invalid personaId (${ie}) from folder ${W.name}`),!1;const he=I.find(Te=>Te.id===ie||Te._id===ie);return he||console.log(`Removing non-existent personaId ${ie} from folder ${W.name}`),!!he})}),K);v.useEffect(()=>{const I=async()=>{G(!0);try{const ie=await Dn.getAll();console.log("Fetched personas for FocusGroupModerator:",ie.data),Array.isArray(ie.data)&&ie.data.length>0?$(ie.data):(console.warn("No personas returned from API or invalid format",ie.data),oe.warning("No participants available"))}catch(ie){console.error("Error fetching personas:",ie),oe.error("Failed to load participants")}finally{G(!1)}},K=localStorage.getItem("persona-folders");let W=[];if(K)try{W=JSON.parse(K),F(W)}catch(ie){console.error("Failed to parse stored folders:",ie)}I()},[]),v.useEffect(()=>{T.length>0&&(console.log("Saving folders to localStorage:",T),localStorage.setItem("persona-folders",JSON.stringify(T)))},[T]),v.useEffect(()=>{if(A.length>0&&T.length>0){console.log("Running folder sync with personas:",A.length,"and folders:",T.length);const I=pt(A,[...T]);JSON.stringify(I)!==JSON.stringify(T)?(console.log("Updating folders after sync"),F(I)):console.log("No folder changes after sync")}},[A,T.length]),console.log("About to initialize form with useForm hook");const tt=Py({resolver:Ay(kQ),defaultValues:{researchBrief:"",focusGroupName:"",discussionTopics:"",duration:"60",llm_model:"gemini-2.5-pro"}});console.log("Form initialized successfully");const it=()=>{l!=="setup"||Se.current||(ee.current&&clearTimeout(ee.current),ee.current=setTimeout(async()=>{if(me.current)return;const I=tt.getValues(),K={name:I.focusGroupName||"",description:I.researchBrief||"",objective:I.researchBrief||"",topic:I.discussionTopics||"",duration:I.duration?parseInt(I.duration):60,llm_model:I.llm_model||"gemini-2.5-pro",participants:P,participants_count:P.length,status:"draft",date:new Date().toISOString(),uploadedAssets:O.map(W=>W.name)};if(!(U&&JSON.stringify(K)===JSON.stringify(U))&&!(!K.name&&!K.description&&!K.topic)){me.current=!0,R("saving");try{let W=b||(e==null?void 0:e.id)||(e==null?void 0:e._id);if(console.log("Auto-save: draftFocusGroupId =",b),console.log("Auto-save: draftToEdit ID =",(e==null?void 0:e.id)||(e==null?void 0:e._id)),console.log("Auto-save: using focusGroupId =",W),console.log("Auto-save: llm_model in currentData =",K.llm_model),console.log("Auto-save: duration in currentData =",K.duration),W)console.log("Auto-save: Updating existing focus group:",W),await bt.update(W,K),console.log("Auto-save: Updated existing draft:",W);else{console.log("Auto-save: Creating NEW focus group (no existing ID)");const ie=await bt.create(K);W=ie.data.focus_group_id||ie.data.id||ie.data._id,x(W),console.log("Auto-save: Created new draft with ID:",W)}X(K),R("saved"),z(0),setTimeout(()=>{R("idle")},2e3)}catch(W){if(console.error("Auto-save failed:",W),R("error"),z(ie=>ie+1),Q<3){const ie=Math.pow(2,Q)*2e3;setTimeout(()=>{it()},ie)}else oe.error("Auto-save failed",{description:"Your changes may not be saved. Please check your connection."})}finally{me.current=!1}}},2e3))},Lt=tt.watch(),tn=v.useRef(""),Xr=v.useRef(""),Ua=v.useRef("");v.useEffect(()=>{const I=JSON.stringify(Lt);l==="setup"&&I!==tn.current&&(tn.current=I,it())},[Lt,l]),v.useEffect(()=>{const I=JSON.stringify(P);l==="setup"&&I!==Xr.current&&(Xr.current=I,it())},[P,l]),v.useEffect(()=>{const I=JSON.stringify(O.map(K=>K.name));l==="setup"&&I!==Ua.current&&(Ua.current=I,it())},[O,l]),v.useEffect(()=>(l!=="setup"&&ee.current&&clearTimeout(ee.current),()=>{ee.current&&clearTimeout(ee.current)}),[l]),v.useEffect(()=>{if(console.log("Draft loading effect - draftToEdit:",e,"draftLoadedRef.current:",N.current),!e){N.current=!1;return}if(e&&!N.current){console.log("Loading draft focus group:",e),Se.current=!0,N.current=!0;const I=e.id||e._id;x(I),console.log("Setting draft ID from draftToEdit:",I),e.name&&tt.setValue("focusGroupName",e.name),(e.description||e.objective)&&tt.setValue("researchBrief",e.description||e.objective||""),e.topic&&tt.setValue("discussionTopics",e.topic),e.duration&&tt.setValue("duration",e.duration.toString()),e.llm_model&&tt.setValue("llm_model",e.llm_model),e.discussionGuide&&(y(e.discussionGuide),(!a.focusGroupTab||a.previousRoute!=="/focus-groups")&&c("review")),e.participants&&Array.isArray(e.participants)&&k(e.participants);const K={name:e.name||"",description:e.description||e.objective||"",objective:e.description||e.objective||"",topic:e.topic||"",duration:e.duration||60,llm_model:e.llm_model||"gemini-2.5-pro",participants:e.participants||[],participants_count:(e.participants||[]).length,status:"draft",date:e.date||new Date().toISOString(),uploadedAssets:[]};X(K),console.log("Set lastSavedData to current draft:",K),oe.success("Draft focus group loaded",{description:"Continue editing your focus group setup"}),setTimeout(()=>{Se.current=!1},1e3)}},[e,tt]),v.useEffect(()=>{n.length>0&&(console.log("Pre-selected participants received:",n),k(n),c("participants"))},[n]),v.useEffect(()=>{a.focusGroupTab&&a.previousRoute==="/focus-groups"&&setTimeout(()=>{c(a.focusGroupTab),o()},0)},[a.focusGroupTab,e,o]),v.useEffect(()=>{e||setTimeout(()=>{Se.current=!1},500)},[e]);const H=()=>{if(C==="idle")return null;const K={saving:{text:"Saving...",className:"text-blue-600 bg-blue-50"},saved:{text:"All changes saved",className:"text-green-600 bg-green-50"},error:{text:"Save failed - retrying...",className:"text-red-600 bg-red-50"}}[C];return i.jsx("div",{className:`fixed top-16 left-1/2 transform -translate-x-1/2 z-50 px-3 py-1 rounded-md text-sm font-medium border shadow-sm ${K.className}`,children:K.text})},Ce=async(I,K)=>{var W,ie;d(!0),h(!1),g(!1);try{const he={name:I.focusGroupName,description:I.researchBrief,objective:I.researchBrief,topic:I.discussionTopics,duration:parseInt(I.duration),llm_model:I.llm_model},Te=K?await bt.generateDiscussionGuideForGroup(K,he):await bt.generateDiscussionGuide(he);if(Te.data&&Te.data.discussionGuide)return h(!0),Te.data.discussionGuide;throw new Error("Failed to generate discussion guide")}catch(he){console.error("Error generating discussion guide:",he),g(!0);let Te="Unknown error occurred";return(ie=(W=he==null?void 0:he.response)==null?void 0:W.data)!=null&&ie.error?Te=he.response.data.error:he!=null&&he.message&&(Te=he.message),Te.includes("500")||Te.includes("internal error")||Te.includes("Internal Server Error")?oe.error("AI service temporarily unavailable",{description:"The discussion guide generator is experiencing issues. Please try again in a few minutes.",action:{label:"Retry",onClick:()=>Ce(I)}}):oe.error("Failed to generate discussion guide",{description:Te,action:{label:"Retry",onClick:()=>Ce(I)}}),` # Discussion Guide: ${I.focusGroupName} ## Introduction (5 minutes) @@ -616,7 +616,7 @@ ${kd.conclusion} ## Research Brief Context ${I.researchBrief} - `}},Oe=()=>{d(!1),h(!1),g(!1)};async function Ue(I){var K;try{let W=b;if(!W){const he={name:I.focusGroupName,status:"draft",participants:P,participants_count:P.length,date:new Date().toISOString(),duration:parseInt(I.duration),topic:I.discussionTopics.split(",")[0].trim().toLowerCase().replace(/\s+/g,"-"),description:I.researchBrief,objective:I.researchBrief,llm_model:I.llm_model},ke=await St.create(he);W=ke.data.focus_group_id||ke.data.id||ke.data._id,x(W),console.log("Draft focus group created for asset upload:",ke,"with ID:",W)}if(I.creativeAssets&&I.creativeAssets.length>0&&W)try{const he=new FormData;Array.from(I.creativeAssets).forEach(Wt=>{he.append("assets",Wt)});const qe=(await St.uploadAssets(W,he)).data;console.log("Assets uploaded successfully:",qe),oe.success(`${qe.uploaded_assets} asset(s) uploaded successfully`,{description:"Assets will be included in the discussion guide"});const Ft=Array.from(I.creativeAssets);M(Ft)}catch(he){console.error("Asset upload failed:",he);const ke=(K=he.response)==null?void 0:K.data;let qe="Asset upload failed",Ft="Some assets could not be uploaded";(ke==null?void 0:ke.code)==="TEMP_DIR_ERROR"?(qe="Upload temporarily unavailable",Ft="Server storage issue. Please try again in a moment."):(ke==null?void 0:ke.code)==="UPLOAD_SYSTEM_FAILURE"?(qe="Upload system unavailable",Ft="Critical server issue. Please contact support."):ke!=null&&ke.can_retry&&(qe="Upload failed - can retry",Ft=(ke==null?void 0:ke.details)||"Please try uploading again."),oe.error(qe,{description:Ft}),console.log("Continuing without assets due to upload failure")}if(W)try{const he={name:I.focusGroupName,participants:P,participants_count:P.length,duration:parseInt(I.duration),topic:I.discussionTopics.split(",")[0].trim().toLowerCase().replace(/\s+/g,"-"),description:I.researchBrief,objective:I.researchBrief,llm_model:I.llm_model};await St.update(W,he),console.log("Focus group updated with latest form values before guide generation"),console.log(`🔄 Updated focus group ${W} with model: ${I.llm_model}`)}catch(he){console.error("Failed to update focus group before guide generation:",he)}const ie=await Ce(I,W);y(ie);try{const he={name:I.focusGroupName,status:"draft",participants:P,participants_count:P.length,date:new Date().toISOString(),duration:parseInt(I.duration),topic:I.discussionTopics.split(",")[0].trim().toLowerCase().replace(/\s+/g,"-"),description:I.researchBrief,objective:I.researchBrief,llm_model:I.llm_model,discussionGuide:ie};await St.update(W,he),console.log("Focus group updated with discussion guide"),oe.success("Progress saved as draft",{description:"Your focus group setup has been automatically saved"})}catch(he){console.error("Failed to update focus group with discussion guide:",he),oe.error("Failed to save draft",{description:"Discussion guide generated, but draft save failed"})}c("review"),oe.success("Discussion guide generated",{description:"Review and edit before proceeding"})}catch(W){console.error("Error in focus group creation flow:",W),oe.error("Focus group creation failed",{description:W.message||"An unexpected error occurred"})}}const Le=(()=>{var K;const I=A.filter(W=>{const ie=W.name.toLowerCase().includes(be.toLowerCase())||W.occupation&&W.occupation.toLowerCase().includes(be.toLowerCase())||W.location&&W.location.toLowerCase().includes(be.toLowerCase()),he=(ve.age.length===0||ve.age.includes(W.age))&&(ve.gender.length===0||ve.gender.includes(W.gender))&&(ve.occupation.length===0||ve.occupation.includes(W.occupation))&&(ve.location.length===0||ve.location.includes(W.location))&&(ve.ethnicity.length===0||W.ethnicity&&ve.ethnicity.includes(W.ethnicity))&&(ve.techSavviness.length===0||W.techSavviness!==void 0&&ve.techSavviness.includes(W.techSavviness<30?"Low (0-30)":W.techSavviness<70?"Medium (31-70)":"High (71-100)"))&&!0;let ke=!0;if(q!==Ho)if(ke=!1,W.folderId===q)ke=!0;else{const qe=T.find(Ft=>Ft.id===q);if(qe){const Ft=qe.personaIds.filter(It=>!!It),Wt=W.id||W._id;Ft.includes(Wt)&&(ke=!0)}}return ie&&he&&ke});if(console.log(`Filtered personas: ${I.length}/${A.length}`),console.log(`Selected folder: ${q===Ho?"All Personas":((K=T.find(W=>W.id===q))==null?void 0:K.name)||q}`),q!==Ho){const W=T.find(ie=>ie.id===q);if(W){const ie=W.personaIds.filter(qe=>!!qe);console.log(`Folder details: ${W.name}, ID: ${W.id}, Contains: ${ie.length} valid personas`),console.log("Folder personaIds (valid only):",ie);const he=A.filter(qe=>qe.folderId===q);console.log(`Personas with folderId matching this folder: ${he.length}`);const ke=A.filter(qe=>{const Ft=qe.id||qe._id;return W.personaIds.includes(Ft)});console.log(`Personas in folder's personaIds array: ${ke.length}`)}}return I})(),ft=I=>{console.log("Toggling selection for participant ID:",I),k(K=>{const W=K.includes(I);console.log("Current selection:",{id:I,isCurrentlySelected:W,currentSelections:[...K]});const ie=W?K.filter(he=>he!==I):[...K,I];return console.log("New selection:",ie),ie})},J=async()=>{try{const I=tt.getValues(),K={name:I.focusGroupName,status:"in-progress",participants:P,participants_count:P.length,date:new Date().toISOString(),duration:parseInt(I.duration),topic:I.discussionTopics.split(",")[0].trim().toLowerCase().replace(/\s+/g,"-"),discussionGuide:m},ie=(await St.create(K)).data;return console.log("Focus group created successfully:",ie),ie.focus_group_id}catch(I){throw console.error("Error saving focus group:",I),I}},Y=v.useCallback(async()=>{if(!S.current){oe.error("No discussion guide available",{description:"Please generate a discussion guide first"});return}V(!0);try{const{downloadDiscussionGuideAsMarkdown:I}=await jQ(async()=>{const{downloadDiscussionGuideAsMarkdown:W}=await import("./discussionGuideMarkdown-eMXneipz.js");return{downloadDiscussionGuideAsMarkdown:W}},[]),K=tt.getValues();I(S.current,K.focusGroupName),oe.success("Discussion guide downloaded",{description:"The guide has been saved to your downloads folder"})}catch(I){console.error("Error downloading discussion guide:",I),oe.error("Download failed",{description:"Unable to download the discussion guide. Please try again."})}finally{V(!1)}},[tt]),ye=v.useCallback(async I=>{console.log("📝 handleSaveDiscussionGuide called with:",I),w?(S.current=I,console.log("📝 Skipping discussionGuide state update during editing to preserve focus")):(y(I),oe.success("Discussion guide updated",{description:"Your changes have been saved."}))},[w]),xe=v.useCallback(I=>{console.log("📝 Discussion guide editing state changed:",I),j(I),!I&&S.current&&(console.log("📝 Updating discussionGuide state after editing ended"),y(S.current))},[]),je=v.useCallback(()=>{},[]),Qe=async()=>{if(!tt.getValues().focusGroupName){oe.error("Missing focus group name",{description:"Please provide a name for the focus group"});return}if(!m){oe.error("Missing discussion guide",{description:"Please generate a discussion guide first"});return}if(P.length<1){oe.error("Not enough participants",{description:"Please select at least one participant for the focus group"});return}console.log("Starting focus group with participants:",P);try{oe.loading("Creating focus group...");let I;if(b){const K=tt.getValues(),W={name:K.focusGroupName,status:"in-progress",participants:P,participants_count:P.length,date:new Date().toISOString(),duration:parseInt(K.duration),topic:K.discussionTopics.split(",")[0].trim().toLowerCase().replace(/\s+/g,"-"),description:K.researchBrief,objective:K.researchBrief,discussionGuide:m},ie=await St.update(b,W);I=b,console.log("Draft focus group updated to in-progress:",ie),t&&t()}else I=await J();oe.dismiss(),oe.success("Focus group created successfully",{description:"The AI moderator is now running the session"}),r(`/focus-groups/${I}`)}catch(I){oe.dismiss(),I!=null&&I.message,console.error("Failed to start focus group:",I),oe.error("Failed to create focus group",{description:"Please try again or check your connection"})}};return i.jsxs(i.Fragment,{children:[i.jsx(G,{}),i.jsxs("div",{className:"glass-panel rounded-xl p-6",children:[i.jsxs("div",{className:"flex items-center gap-2 mb-6",children:[i.jsx($a,{className:"h-5 w-5 text-primary"}),i.jsx("h2",{className:"font-sf text-xl font-semibold",children:"AI Focus Group Moderator"})]}),u&&i.jsx("div",{className:"mb-6",children:i.jsx(IN,{isActive:u,isComplete:f,hasError:p,label:"Generating discussion guide",onComplete:Oe})}),i.jsxs(Fo,{value:l,onValueChange:c,children:[i.jsxs(Pi,{className:"grid w-full grid-cols-3 mb-6",children:[i.jsx(Xt,{value:"setup",children:"Setup"}),i.jsx(Xt,{value:"review",children:"Review & Edit"}),i.jsx(Xt,{value:"participants",children:"Participants"})]}),i.jsx(Yt,{value:"setup",children:i.jsx(Ay,{...tt,children:i.jsxs("form",{onSubmit:tt.handleSubmit(Ue),className:"space-y-6",children:[i.jsx(dt,{control:tt.control,name:"focusGroupName",render:({field:I})=>i.jsxs(ot,{children:[i.jsx(lt,{children:"Focus Group Name"}),i.jsx(ct,{children:i.jsx(Ot,{placeholder:"e.g., Mobile App UX Evaluation",...I})}),i.jsx(fn,{children:"Give your focus group a descriptive name"}),i.jsx(ut,{})]})}),i.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-6",children:[i.jsx(dt,{control:tt.control,name:"researchBrief",render:({field:I})=>i.jsxs(ot,{children:[i.jsx(lt,{children:"Research Brief"}),i.jsx(ct,{children:i.jsx(nt,{placeholder:"Describe your research objectives...",className:"h-36",...I})}),i.jsx(fn,{children:"Provide context about what you want to learn"}),i.jsx(ut,{})]})}),i.jsxs("div",{className:"space-y-6",children:[i.jsx(dt,{control:tt.control,name:"discussionTopics",render:({field:I})=>i.jsxs(ot,{children:[i.jsx(lt,{children:"Discussion Topics"}),i.jsx(ct,{children:i.jsx(nt,{placeholder:"List main topics to cover, separated by commas",className:"h-24",...I})}),i.jsx(fn,{children:"E.g., User experience, feature preferences, pain points"}),i.jsx(ut,{})]})}),i.jsx(dt,{control:tt.control,name:"duration",render:({field:I})=>i.jsxs(ot,{children:[i.jsx(lt,{children:"Duration (minutes)"}),i.jsxs(Mn,{onValueChange:I.onChange,value:I.value,children:[i.jsx(ct,{children:i.jsx(Pn,{children:i.jsx(In,{placeholder:"Select duration"})})}),i.jsxs(An,{children:[i.jsx(fe,{value:"30",children:"30 minutes"}),i.jsx(fe,{value:"45",children:"45 minutes"}),i.jsx(fe,{value:"60",children:"60 minutes"}),i.jsx(fe,{value:"90",children:"90 minutes"}),i.jsx(fe,{value:"120",children:"120 minutes"})]})]}),i.jsx(fn,{children:"How long should the focus group session last?"}),i.jsx(ut,{})]})}),i.jsx(dt,{control:tt.control,name:"llm_model",render:({field:I})=>i.jsxs(ot,{children:[i.jsx(lt,{children:"AI Model"}),i.jsxs(Mn,{onValueChange:I.onChange,value:I.value,children:[i.jsx(ct,{children:i.jsx(Pn,{children:i.jsx(In,{placeholder:"Select AI model"})})}),i.jsxs(An,{children:[i.jsx(fe,{value:"gemini-2.5-pro",children:"Gemini 2.5 Pro"}),i.jsx(fe,{value:"gpt-4.1",children:"GPT-4.1"})]})]}),i.jsx(fn,{children:"Choose which AI model to use for generating responses and discussion guides"}),i.jsx(ut,{})]})})]})]}),i.jsx(dt,{control:tt.control,name:"creativeAssets",render:({field:{value:I,onChange:K,...W}})=>i.jsxs(ot,{children:[i.jsx(lt,{children:"Creative Assets (Optional)"}),i.jsx(ct,{children:i.jsxs("div",{className:"border-2 border-dashed border-slate-200 rounded-lg p-6 flex flex-col items-center justify-center bg-slate-50 hover:bg-slate-100 transition cursor-pointer",children:[i.jsx(aI,{className:"h-10 w-10 text-slate-400 mb-2"}),i.jsx("p",{className:"text-sm text-slate-600 mb-1",children:"Upload creative assets for testing"}),i.jsx("p",{className:"text-xs text-slate-500 mb-3",children:"Images, mockups, or product designs"}),i.jsx(Ot,{...W,type:"file",accept:"image/*,.pdf",multiple:!0,onChange:ie=>{K(ie.target.files)},className:"hidden",id:"assets-file-input"}),i.jsxs(te,{type:"button",variant:"outline",size:"sm",onClick:()=>{var ie;return(ie=document.getElementById("assets-file-input"))==null?void 0:ie.click()},children:[i.jsx(oI,{className:"mr-2 h-4 w-4"}),"Select Files"]}),I&&I.length>0&&i.jsxs("p",{className:"text-xs text-primary mt-2",children:[I.length," file(s) selected"]})]})}),i.jsx(fn,{children:"Upload visuals that you want feedback on during the session"}),i.jsx(ut,{})]})}),i.jsx("div",{className:"space-y-3",children:i.jsx("div",{className:"flex justify-end",children:i.jsxs(te,{type:"submit",disabled:u,className:"min-w-32",children:[i.jsx($a,{className:"mr-2 h-4 w-4"}),u?"Generating...":"Generate Discussion Guide"]})})})]})})}),i.jsx(Yt,{value:"review",children:i.jsxs("div",{className:"space-y-6",children:[i.jsx(rt,{children:i.jsxs(bt,{className:"p-6",children:[i.jsx("div",{className:"flex items-center justify-between mb-4",children:i.jsxs("div",{className:"flex items-center gap-3",children:[i.jsx("h3",{className:"font-sf text-lg font-medium",children:"AI-Generated Discussion Guide"}),m&&i.jsx(Wn,{variant:"outline",className:"text-xs",children:_(m)?"Structured JSON":"Legacy Text"})]})}),i.jsx("div",{className:"prose max-w-none",children:m?i.jsx(RN,{discussionGuide:m,showProgress:!1,collapsible:!0,defaultExpanded:!0,className:"border-0",onSave:ye,onDownload:Y,onSectionSelect:je,isDownloading:D,focusGroupId:b,onEditingChange:xe}):i.jsx("div",{className:"bg-slate-50 p-4 rounded border text-center text-slate-600",children:'No discussion guide generated yet. Complete the setup and click "Generate Discussion Guide" to create one.'})})]})}),O.length>0&&i.jsx(rt,{children:i.jsxs(bt,{className:"p-6",children:[i.jsx("h3",{className:"font-sf text-lg font-medium mb-4",children:"Uploaded Creative Assets"}),i.jsx("div",{className:"grid grid-cols-2 sm:grid-cols-3 md:grid-cols-4 gap-4",children:O.map((I,K)=>i.jsxs("div",{className:"border rounded-md p-2",children:[i.jsx("div",{className:"aspect-square bg-slate-100 rounded flex items-center justify-center mb-2",children:I.type.startsWith("image/")?i.jsx("img",{src:URL.createObjectURL(I),alt:`Asset ${K+1}`,className:"max-h-full max-w-full object-contain"}):i.jsx(dw,{className:"h-10 w-10 text-slate-400"})}),i.jsx("p",{className:"text-xs truncate",children:I.name})]},K))})]})}),i.jsxs("div",{className:"flex justify-between",children:[i.jsx(te,{variant:"outline",onClick:()=>c("setup"),children:"Back to Setup"}),i.jsxs(te,{onClick:()=>c("participants"),children:["Select Participants",i.jsx(or,{className:"ml-2 h-4 w-4"})]})]})]})}),i.jsxs(Yt,{value:"participants",children:[i.jsxs("div",{className:"flex flex-col md:flex-row gap-6",children:[i.jsxs("div",{className:"w-full md:w-64 space-y-4",children:[i.jsxs("div",{className:"flex items-center justify-between",children:[i.jsx("h3",{className:"text-sm font-medium",children:"Folders"}),i.jsx(te,{variant:"ghost",size:"sm",onClick:()=>{console.log("Clicked 'Create new folder' button"),ge(!0)},className:"h-7 w-7 p-0",children:i.jsx(iI,{className:"h-4 w-4"})})]}),i.jsxs("div",{className:"space-y-1",children:[i.jsxs("button",{onClick:()=>{console.log("Clicked 'All Personas' folder"),console.log("All personas count:",A.length),Z(Ho),setTimeout(()=>{console.log(`Will show all ${A.length} personas`)},0)},className:`w-full flex items-center space-x-2 px-3 py-2 text-sm rounded-md text-left transition-colors ${q===Ho?"bg-primary/10 text-primary font-medium":"hover:bg-slate-100"}`,children:[i.jsx(Us,{className:"h-4 w-4"}),i.jsx("span",{children:"All Personas"})]}),T.map(I=>i.jsx("div",{className:"flex items-center justify-between group",children:se&&se.id===I.id?i.jsxs("div",{className:"flex-1 flex items-center px-3 py-2 space-x-2",children:[i.jsx(Us,{className:"h-4 w-4"}),i.jsx(Ot,{value:De,onChange:K=>de(K.target.value),placeholder:"Folder name",className:"h-7 text-sm",autoFocus:!0,onKeyDown:K=>{K.key==="Enter"?Xn():K.key==="Escape"&&an()}}),i.jsx(te,{size:"sm",variant:"ghost",onClick:()=>{console.log(`Confirming folder rename: "${se==null?void 0:se.name}" to "${De}"`),Xn()},className:"h-7 w-7 p-0",children:i.jsx(Ta,{className:"h-4 w-4"})}),i.jsx(te,{size:"sm",variant:"ghost",onClick:()=>{console.log(`Cancelling rename of folder: "${se==null?void 0:se.name}"`),an()},className:"h-7 w-7 p-0",children:i.jsx(Zs,{className:"h-4 w-4"})})]}):i.jsxs(i.Fragment,{children:[i.jsxs("button",{onClick:()=>{console.log(`Clicked folder: ${I.name} (ID: ${I.id})`);const K=I.personaIds.filter(W=>!!W);console.log(`Current persona count in folder: ${K.length}`),console.log("Folder personaIds:",K),console.log("All personas count:",A.length),Z(I.id),setTimeout(()=>{const W=A.filter(ie=>{if(ie.folderId===I.id)return!0;const he=ie.id||ie._id;return K.includes(he)});console.log(`Will show ${W.length} personas after filtering`),console.log("Filtered personas:",W.map(ie=>ie.name))},0)},className:`flex-1 flex items-center space-x-2 px-3 py-2 text-sm rounded-md text-left transition-colors ${q===I.id?"bg-primary/10 text-primary font-medium":"hover:bg-slate-100"}`,children:[i.jsx(Us,{className:"h-4 w-4"}),i.jsx("span",{children:I.name}),i.jsx("span",{className:"text-muted-foreground text-xs ml-auto",children:I.personaIds.filter(K=>!!K).length})]}),i.jsxs(Fw,{children:[i.jsx(Bw,{asChild:!0,children:i.jsx(te,{variant:"ghost",size:"sm",className:"h-7 w-7 p-0 opacity-0 group-hover:opacity-100",children:i.jsx(uw,{className:"h-4 w-4"})})}),i.jsx(Og,{align:"end",children:i.jsx(Fi,{onClick:()=>{console.log(`Initiating rename for folder: ${I.name} (ID: ${I.id})`),Vt(I)},children:"Rename"})})]})]})},I.id)),re&&i.jsxs("div",{className:"flex items-center px-3 py-2 space-x-2",children:[i.jsxs("div",{className:"flex-1 flex items-center space-x-2",children:[i.jsx(Us,{className:"h-4 w-4"}),i.jsx(Ot,{value:B,onChange:I=>le(I.target.value),placeholder:"Folder name",className:"h-7 text-sm",autoFocus:!0,onKeyDown:I=>{I.key==="Enter"?Ze():I.key==="Escape"&&kt()}})]}),i.jsx(te,{size:"sm",variant:"ghost",onClick:()=>{console.log(`Confirming creation of new folder: "${B}"`),Ze()},className:"h-7 w-7 p-0",children:i.jsx(Ta,{className:"h-4 w-4"})}),i.jsx(te,{size:"sm",variant:"ghost",onClick:()=>{console.log("Cancelling folder creation"),kt()},className:"h-7 w-7 p-0",children:i.jsx(Zs,{className:"h-4 w-4"})})]})]})]}),i.jsxs("div",{className:"flex-1",children:[i.jsx(rt,{className:"mb-4",children:i.jsx(bt,{className:"p-6",children:i.jsxs("div",{className:"flex flex-col space-y-6",children:[i.jsxs("div",{className:"flex items-center justify-between",children:[i.jsx("h3",{className:"font-sf text-lg font-medium",children:"Select Participants"}),i.jsxs("div",{className:"flex items-center",children:[i.jsx(or,{className:"h-5 w-5 mr-2 text-muted-foreground"}),i.jsxs("span",{className:"text-sm font-medium",children:[P.length," of ",Le.length," selected"]})]})]}),i.jsxs("div",{className:"flex flex-col sm:flex-row gap-4",children:[i.jsxs("div",{className:"relative flex-1",children:[i.jsx(DS,{className:"absolute left-3 top-1/2 transform -translate-y-1/2 text-muted-foreground h-4 w-4"}),i.jsx(Ot,{placeholder:"Search personas by name, occupation, or location...",className:"pl-10 bg-white",value:be,onChange:I=>Pe(I.target.value)})]}),i.jsxs(te,{variant:"outline",className:"flex items-center gap-2",onClick:()=>Je(!0),children:[i.jsx(IS,{className:"h-4 w-4"}),i.jsxs("span",{children:["Filter",Object.values(ve).some(I=>I.length>0)?` (${Object.values(ve).reduce((I,K)=>I+K.length,0)})`:""]})]})]}),L?i.jsx("div",{className:"flex justify-center items-center py-12",children:i.jsx(ii,{className:"h-8 w-8 animate-spin text-primary"})}):Le.length>0?i.jsx("div",{className:"grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-3 gap-4",children:Le.map(I=>{const K=I._id||I.id;return i.jsx(sN,{user:{id:K,_id:I._id,name:I.name,age:I.age,gender:I.gender,occupation:I.occupation,location:I.location||"Unknown",techSavviness:I.techSavviness||50,personality:I.personality||"No description available",oceanTraits:I.oceanTraits,qualitativeAttributes:I.qualitativeAttributes,topPersonalityTraits:I.topPersonalityTraits,aiSynthesizedBio:I.aiSynthesizedBio},selected:P.includes(K),onSelectionToggle:()=>ft(K),onViewDetails:Ie},K)})}):i.jsx("div",{className:"text-center py-12",children:i.jsx("p",{className:"text-muted-foreground",children:"No personas available matching your criteria."})})]})})}),i.jsxs("div",{className:"flex justify-between",children:[i.jsx(te,{variant:"outline",onClick:()=>c("review"),children:"Back to Review"}),i.jsxs(te,{onClick:Qe,disabled:P.length<1||!m,children:[i.jsx(AW,{className:"mr-2 h-4 w-4"}),"Start Focus Group Session"]})]})]})]}),i.jsx(wl,{open:ne,onOpenChange:I=>{I?(Je(I),Mt({...ve})):Je(!1)},children:i.jsxs(ho,{className:"max-w-4xl max-h-[80vh] overflow-y-auto",children:[i.jsxs(po,{children:[i.jsx(go,{children:"Filter Personas"}),i.jsx(jl,{children:"Select attributes to filter personas by. Multiple selections within a category use OR logic, different categories use AND logic."})]}),i.jsxs("div",{className:"py-4 space-y-6",children:[Object.values(st).some(I=>I.length>0)&&i.jsx("div",{className:"bg-muted/30 p-3 rounded-md",children:i.jsxs("p",{className:"text-sm text-muted-foreground",children:[Object.values(st).reduce((I,K)=>I+K.length,0)," active filters"]})}),(()=>{const I=we(A),K=Object.values(st).every(ie=>ie.length===0),W=(ie,he,ke=1)=>{const qe=K?I[he]:ze(he)[he],Ft=st[he],Wt=[...new Set([...qe,...Ft])].sort();return Wt.length===0?null:i.jsxs("div",{className:"mb-6",children:[i.jsx("h3",{className:"text-sm font-medium mb-3",children:ie}),i.jsx("div",{className:`grid grid-cols-1 ${ke===2?"sm:grid-cols-2":ke===3?"sm:grid-cols-2 md:grid-cols-3":""} gap-2`,children:Wt.map(It=>{const fa=st[he].includes(It),tc=qe.includes(It);return i.jsxs("div",{className:`flex items-center space-x-2 ${!tc&&!fa?"opacity-50":""}`,children:[i.jsx(ol,{id:`${he}-${It}`,checked:fa,onCheckedChange:()=>Ge(he,It),disabled:!tc&&!fa}),i.jsxs(vs,{htmlFor:`${he}-${It}`,className:"truncate overflow-hidden",children:[It,fa&&!tc&&i.jsx("span",{className:"ml-1 text-xs text-muted-foreground",children:"(no matches)"})]})]},It)})})]})};return i.jsxs(i.Fragment,{children:[W("Gender","gender",3),W("Age","age",3),W("Ethnicity","ethnicity",2),W("Location","location",2),W("Occupation","occupation",2),W("Tech Savviness","techSavviness",3),i.jsx("div",{className:"grid grid-cols-1 sm:grid-cols-2 gap-6"})]})})()]}),i.jsxs(mo,{children:[i.jsx(te,{variant:"outline",onClick:jt,children:"Reset"}),i.jsx(te,{onClick:gt,children:"Apply Filters"})]})]})})]})]})]})]})}const AQ=[{id:"1",name:"Mobile App UX Evaluation",status:"completed",participants:6,date:"2023-06-10T14:00:00Z",duration:60,topic:"user-experience"},{id:"2",name:"Product Feature Feedback",status:"scheduled",participants:8,date:"2023-06-15T10:00:00Z",duration:90,topic:"product-feedback"},{id:"3",name:"Marketing Campaign Testing",status:"in-progress",participants:5,date:"2023-06-12T15:30:00Z",duration:45,topic:"creative-testing"},{id:"4",name:"Website Navigation Study",status:"scheduled",participants:7,date:"2023-06-18T13:00:00Z",duration:60,topic:"user-experience"}],CQ={completed:"bg-green-100 text-green-800 border-green-200",scheduled:"bg-blue-100 text-blue-800 border-blue-200","in-progress":"bg-amber-100 text-amber-800 border-amber-200",active:"bg-amber-100 text-amber-800 border-amber-200",paused:"bg-purple-100 text-purple-800 border-purple-200",new:"bg-slate-100 text-slate-800 border-slate-200",ai_mode:"bg-amber-100 text-amber-800 border-amber-200",draft:"bg-gray-100 text-gray-800 border-gray-200"},EQ=()=>{console.log("FocusGroups component rendering");const[e,t]=v.useState("view"),[n,r]=v.useState(""),[s,a]=v.useState([]),[o,l]=v.useState(!0),[c,u]=v.useState([]),[d,f]=v.useState(!1),[h,p]=v.useState(!1),[g,m]=v.useState(null),y=Tn(),b=qr(),[x,w]=v.useState([]),j=v.useRef(!0),S=async(A=!0)=>{if(console.log("fetchFocusGroups called with isMountedCheck:",A),console.log("isMounted.current:",j.current),A&&!j.current){console.log("Exiting early: component not mounted");return}console.log("Setting loading to true and making API call"),l(!0);try{console.log("Calling focusGroupsApi.getAll()");const $=await St.getAll();if(console.log("API response received:",$),!A||j.current){const L=$.data.map(H=>({...H,id:H.id||H._id,participants_count:Array.isArray(H.participants)?H.participants.length:typeof H.participants=="number"?H.participants:0}));a(L)}}catch($){console.error("Error fetching focus groups:",$),(!A||j.current)&&(Ke.error("Failed to load focus groups"),a(AQ))}finally{(!A||j.current)&&l(!1)}},N=async A=>{try{const $=await St.getById(A);$&&$.data&&(m($.data),t("create"))}catch($){console.error("Error fetching focus group for edit:",$),Ke.error("Failed to load focus group for editing")}};v.useEffect(()=>(console.log("useEffect running - about to fetch focus groups"),S(),()=>{console.log("useEffect cleanup - setting isMounted to false"),j.current=!1}),[]),v.useEffect(()=>{console.log("Mode change useEffect running, mode:",e),e==="view"&&(console.log("Mode is view, calling fetchFocusGroups"),S())},[e]),v.useEffect(()=>{const A=b.state;(A==null?void 0:A.mode)==="create"&&(A!=null&&A.preSelectedParticipants)&&(w(A.preSelectedParticipants),t("create"),y(b.pathname,{replace:!0,state:null}))},[b.state,b.pathname,y]),v.useEffect(()=>{const A=new URLSearchParams(b.search),$=A.get("mode"),L=A.get("id"),H=A.get("tab");if($==="create")t("create"),m(null);else if($==="edit"&&L){const D=s.find(V=>(V._id||V.id)===L);D?(m(D),t("create")):N(L)}if($||L||H){const D=b.pathname;y(D,{replace:!0})}},[b.search,s,y,b.pathname]);const _=s.filter(A=>A.name.toLowerCase().includes(n.toLowerCase())||A.topic.toLowerCase().includes(n.toLowerCase())),P=A=>new Date(A).toLocaleDateString("en-US",{month:"short",day:"numeric",year:"numeric"}),k=A=>new Date(A).toLocaleTimeString("en-US",{hour:"numeric",minute:"2-digit",hour12:!0}),O=A=>{u($=>$.includes(A)?$.filter(L=>L!==A):[...$,A])},M=async()=>{if(c.length!==0){p(!0);try{const A=c.map($=>St.delete($));await Promise.all(A),a($=>$.filter(L=>!c.includes(L.id||L._id||""))),u([]),Ke.success(`${c.length} focus group${c.length>1?"s":""} deleted successfully`)}catch(A){console.error("Error deleting focus groups:",A),Ke.error("Failed to delete focus groups")}finally{p(!1),f(!1)}}};return i.jsxs("div",{className:"min-h-screen bg-slate-50",children:[i.jsx(oi,{}),i.jsxs("main",{className:"pt-20 pb-16 px-4 sm:px-6 lg:px-8 max-w-7xl mx-auto",children:[i.jsxs("div",{className:"flex flex-col sm:flex-row justify-between items-start sm:items-center mb-8",children:[i.jsxs("div",{children:[i.jsx("h1",{className:"font-sf text-3xl font-bold text-slate-900",children:"Focus Groups"}),i.jsx("p",{className:"text-slate-600 mt-1",children:"Set up and manage AI-moderated research sessions"})]}),i.jsx("div",{className:"mt-4 sm:mt-0",children:i.jsx(te,{onClick:()=>{console.log("Create New Focus Group button clicked, current mode:",e);try{e==="view"?(console.log("Setting draft to null and switching to create mode"),m(null),t("create")):(console.log("Switching back to view mode"),t("view"))}catch(A){console.error("Error in Create New Focus Group onClick:",A)}},className:"hover-transition",children:e==="view"?"Create New Focus Group":"View All Focus Groups"})})]}),e==="view"?i.jsxs(i.Fragment,{children:[i.jsxs("div",{className:"flex flex-col sm:flex-row gap-4 mb-6",children:[i.jsxs("div",{className:"relative flex-1",children:[i.jsx(DS,{className:"absolute left-3 top-1/2 transform -translate-y-1/2 text-muted-foreground h-4 w-4"}),i.jsx(Ot,{placeholder:"Search focus groups by name or topic...",className:"pl-10 bg-white",value:n,onChange:A=>r(A.target.value)})]}),i.jsxs(te,{variant:"outline",className:"flex items-center gap-2",children:[i.jsx(IS,{className:"h-4 w-4"}),i.jsx("span",{children:"Filter"})]})]}),i.jsxs("div",{className:"glass-panel rounded-xl p-6",children:[i.jsxs("div",{className:"flex items-center justify-between mb-6",children:[i.jsxs("div",{className:"flex items-center gap-2",children:[i.jsx($a,{className:"h-5 w-5 text-primary"}),i.jsx("h2",{className:"font-sf text-xl font-semibold",children:"Your Focus Groups"})]}),c.length>0&&i.jsxs(te,{variant:"destructive",size:"sm",onClick:()=>f(!0),disabled:h,className:"flex items-center gap-2",children:[i.jsx(_n,{className:"h-4 w-4"}),"Delete Selected (",c.length,")"]})]}),o?i.jsx("div",{className:"flex justify-center items-center py-12",children:i.jsx(ii,{className:"h-8 w-8 animate-spin text-primary"})}):_.length>0?i.jsx("div",{className:"space-y-4",children:_.map(A=>i.jsx("div",{className:"glass-card rounded-xl overflow-hidden hover:shadow-md button-transition",children:i.jsxs("div",{className:"flex flex-col md:flex-row",children:[i.jsxs("div",{className:"flex-1 p-6",children:[i.jsxs("div",{className:"flex items-start justify-between",children:[i.jsxs("div",{className:"flex items-start gap-3",children:[i.jsx(ol,{id:`select-${A.id||A._id}`,checked:c.includes(A.id||A._id||""),onCheckedChange:()=>O(A.id||A._id||""),className:"mt-1"}),i.jsxs("div",{children:[i.jsx("h3",{className:"font-sf text-lg font-semibold mb-2",children:A.name}),i.jsxs("div",{className:"flex flex-wrap items-center gap-3 text-sm text-muted-foreground",children:[i.jsxs("div",{className:"flex items-center",children:[i.jsx(uW,{className:"h-4 w-4 mr-1"}),P(A.date)]}),i.jsxs("div",{className:"flex items-center",children:[i.jsx(Uf,{className:"h-4 w-4 mr-1"}),k(A.date)]}),i.jsxs("div",{className:"flex items-center",children:[i.jsx(or,{className:"h-4 w-4 mr-1"}),A.participants_count||(Array.isArray(A.participants)?A.participants.length:0)," participant",A.participants_count>1||Array.isArray(A.participants)&&A.participants.length>1?"s":""]}),i.jsxs("div",{className:"flex items-center",children:[i.jsx(Uf,{className:"h-4 w-4 mr-1"}),A.duration," min"]})]})]})]}),i.jsxs("div",{className:Me("px-3 py-1 rounded-full text-xs font-medium border",CQ[A.status]||"bg-gray-100 text-gray-800 border-gray-200"),children:[A.status==="completed"&&"Completed",A.status==="scheduled"&&"Scheduled",A.status==="in-progress"&&"In Progress",A.status==="active"&&"In Progress",A.status==="ai_mode"&&"In Progress",A.status==="paused"&&"Paused",A.status==="new"&&"Not Started",A.status==="draft"&&"Draft",!["completed","scheduled","in-progress","active","ai_mode","paused","new","draft"].includes(A.status)&&A.status]})]}),i.jsxs("div",{className:"mt-4 flex flex-wrap gap-2",children:[i.jsxs("div",{className:"px-3 py-1 bg-slate-100 rounded-full text-xs font-medium text-slate-800",children:[A.topic==="user-experience"&&"User Experience",A.topic==="product-feedback"&&"Product Feedback",A.topic==="creative-testing"&&"Creative Testing",A.topic==="messaging-evaluation"&&"Messaging Evaluation",A.topic&&!["user-experience","product-feedback","creative-testing","messaging-evaluation"].includes(A.topic)&&A.topic.charAt(0).toUpperCase()+A.topic.slice(1).replace(/-/g," ")]}),i.jsx("div",{className:"px-3 py-1 bg-slate-100 rounded-full text-xs font-medium text-slate-800",children:"AI Moderated"})]})]}),i.jsx("div",{className:"bg-slate-50 p-6 flex flex-col justify-center items-center md:border-l border-slate-100",children:i.jsx(te,{variant:A.status==="in-progress"||A.status==="active"||A.status==="ai_mode"?"default":A.status==="new"||A.status==="draft"?"outline":"default",className:Me("w-full hover-transition",A.status==="new"?"bg-slate-200 text-slate-700 hover:bg-slate-300 border-slate-300":"",A.status==="draft"?"bg-gray-200 text-gray-700 hover:bg-gray-300 border-gray-300":""),onClick:()=>{if(A.status==="draft")m(A),t("create");else{const $=A.id||A._id;console.log("Navigating to focus group:",$),y(`/focus-groups/${$}`)}},children:A.status==="completed"?i.jsxs(i.Fragment,{children:["View Session",i.jsx(zs,{className:"ml-2 h-4 w-4"})]}):A.status==="in-progress"||A.status==="active"||A.status==="ai_mode"?i.jsxs(i.Fragment,{children:["Join Session",i.jsx(zs,{className:"ml-2 h-4 w-4"})]}):A.status==="paused"?i.jsxs(i.Fragment,{children:["Session Details",i.jsx(zs,{className:"ml-2 h-4 w-4"})]}):A.status==="scheduled"?i.jsxs(i.Fragment,{children:["View Details",i.jsx(zs,{className:"ml-2 h-4 w-4"})]}):A.status==="new"?i.jsxs(i.Fragment,{children:["View Session",i.jsx(zs,{className:"ml-2 h-4 w-4"})]}):A.status==="draft"?i.jsxs(i.Fragment,{children:["Edit",i.jsx(zs,{className:"ml-2 h-4 w-4"})]}):i.jsxs(i.Fragment,{children:["View Session",i.jsx(zs,{className:"ml-2 h-4 w-4"})]})})})]})},A.id))}):i.jsx("div",{className:"text-center py-12",children:i.jsx("p",{className:"text-muted-foreground",children:"No focus groups found matching your search criteria."})})]})]}):i.jsx(PQ,{draftToEdit:g,preSelectedParticipants:x,onDraftSaved:()=>{m(null),t("view"),w([]),S()}})]}),i.jsx(zw,{open:d,onOpenChange:f,children:i.jsxs(Tg,{children:[i.jsxs($g,{children:[i.jsxs(Ig,{children:["Delete ",c.length," Focus Group",c.length!==1?"s":"","?"]}),i.jsxs(Rg,{children:["This action cannot be undone. This will permanently delete the selected focus group",c.length!==1?"s":""," and remove all data associated with ",c.length!==1?"them":"it","."]})]}),i.jsxs(Mg,{children:[i.jsx(Lg,{disabled:h,children:"Cancel"}),i.jsx(Dg,{onClick:A=>{A.preventDefault(),M()},disabled:h,className:"bg-destructive text-destructive-foreground hover:bg-destructive/90",children:h?i.jsxs(i.Fragment,{children:[i.jsx(ii,{className:"mr-2 h-4 w-4 animate-spin"}),"Deleting..."]}):i.jsx(i.Fragment,{children:"Delete"})})]})]})})]})},OQ=({participants:e,selectedParticipantIds:t,onToggleParticipantFilter:n})=>{const r=Tn(),s=o=>{const l=o.id||o._id;l&&r(`/personas/${l}`)},a=o=>{const l=o.id||o._id;l&&n(l)};return i.jsx("div",{className:"w-full lg:w-64 shrink-0",children:i.jsxs("div",{className:"glass-panel rounded-xl p-4",children:[i.jsxs("h2",{className:"font-sf text-lg font-semibold flex items-center mb-3",children:[i.jsx(or,{className:"h-5 w-5 text-primary mr-2"})," Participants"]}),i.jsxs("div",{className:"space-y-3",children:[i.jsxs("div",{className:"flex items-center p-2 bg-primary/5 rounded-lg",children:[i.jsx(fo,{className:"h-8 w-8 text-primary mr-3"}),i.jsxs("div",{children:[i.jsx("p",{className:"font-medium text-primary",children:"AI Moderator"}),i.jsx("p",{className:"text-xs text-slate-500",children:"Session facilitator"})]})]}),e.map(o=>{const l=o.id||o._id,c=t.includes(l);return i.jsxs("div",{className:`flex items-center p-2 rounded-lg transition-colors ${c?"bg-blue-50 border border-blue-200":"hover:bg-slate-100"}`,children:[i.jsx("div",{className:"cursor-pointer mr-3",onClick:()=>s(o),title:`View ${o.name}'s profile`,children:i.jsx("img",{src:lp(o),alt:o.name,className:"h-8 w-8 rounded-full object-cover"})}),i.jsxs("div",{className:"flex-1",children:[i.jsxs("div",{className:"flex items-center",children:[i.jsx("p",{className:"font-medium cursor-pointer hover:text-blue-600 transition-colors",onClick:()=>a(o),title:`Filter to show only ${o.name}'s messages`,children:o.name}),c&&i.jsx(Ta,{className:"h-4 w-4 text-blue-600 ml-2"})]}),i.jsx("p",{className:"text-xs text-slate-500",children:o.occupation})]})]},o.id)})]})]})})};function kQ(e,t){return v.useReducer((n,r)=>t[n][r]??n,e)}var DN="ScrollArea",[YL,RPe]=Gr(DN),[TQ,Os]=YL(DN),ZL=v.forwardRef((e,t)=>{const{__scopeScrollArea:n,type:r="hover",dir:s,scrollHideDelay:a=600,...o}=e,[l,c]=v.useState(null),[u,d]=v.useState(null),[f,h]=v.useState(null),[p,g]=v.useState(null),[m,y]=v.useState(null),[b,x]=v.useState(0),[w,j]=v.useState(0),[S,N]=v.useState(!1),[_,P]=v.useState(!1),k=xt(t,M=>c(M)),O=Xl(s);return i.jsx(TQ,{scope:n,type:r,dir:O,scrollHideDelay:a,scrollArea:l,viewport:u,onViewportChange:d,content:f,onContentChange:h,scrollbarX:p,onScrollbarXChange:g,scrollbarXEnabled:S,onScrollbarXEnabledChange:N,scrollbarY:m,onScrollbarYChange:y,scrollbarYEnabled:_,onScrollbarYEnabledChange:P,onCornerWidthChange:x,onCornerHeightChange:j,children:i.jsx(Ye.div,{dir:O,...o,ref:k,style:{position:"relative","--radix-scroll-area-corner-width":b+"px","--radix-scroll-area-corner-height":w+"px",...e.style}})})});ZL.displayName=DN;var QL="ScrollAreaViewport",JL=v.forwardRef((e,t)=>{const{__scopeScrollArea:n,children:r,asChild:s,nonce:a,...o}=e,l=Os(QL,n),c=v.useRef(null),u=xt(t,c,l.onViewportChange);return i.jsxs(i.Fragment,{children:[i.jsx("style",{dangerouslySetInnerHTML:{__html:` + `}},ke=()=>{d(!1),h(!1),g(!1)};async function Ue(I){var K;try{let W=b;if(!W){const he={name:I.focusGroupName,status:"draft",participants:P,participants_count:P.length,date:new Date().toISOString(),duration:parseInt(I.duration),topic:I.discussionTopics.split(",")[0].trim().toLowerCase().replace(/\s+/g,"-"),description:I.researchBrief,objective:I.researchBrief,llm_model:I.llm_model},Te=await bt.create(he);W=Te.data.focus_group_id||Te.data.id||Te.data._id,x(W),console.log("Draft focus group created for asset upload:",Te,"with ID:",W)}if(I.creativeAssets&&I.creativeAssets.length>0&&W)try{const he=new FormData;Array.from(I.creativeAssets).forEach(Wt=>{he.append("assets",Wt)});const qe=(await bt.uploadAssets(W,he)).data;console.log("Assets uploaded successfully:",qe),oe.success(`${qe.uploaded_assets} asset(s) uploaded successfully`,{description:"Assets will be included in the discussion guide"});const Ft=Array.from(I.creativeAssets);M(Ft)}catch(he){console.error("Asset upload failed:",he);const Te=(K=he.response)==null?void 0:K.data;let qe="Asset upload failed",Ft="Some assets could not be uploaded";(Te==null?void 0:Te.code)==="TEMP_DIR_ERROR"?(qe="Upload temporarily unavailable",Ft="Server storage issue. Please try again in a moment."):(Te==null?void 0:Te.code)==="UPLOAD_SYSTEM_FAILURE"?(qe="Upload system unavailable",Ft="Critical server issue. Please contact support."):Te!=null&&Te.can_retry&&(qe="Upload failed - can retry",Ft=(Te==null?void 0:Te.details)||"Please try uploading again."),oe.error(qe,{description:Ft}),console.log("Continuing without assets due to upload failure")}if(W)try{const he={name:I.focusGroupName,participants:P,participants_count:P.length,duration:parseInt(I.duration),topic:I.discussionTopics.split(",")[0].trim().toLowerCase().replace(/\s+/g,"-"),description:I.researchBrief,objective:I.researchBrief,llm_model:I.llm_model};await bt.update(W,he),console.log("Focus group updated with latest form values before guide generation"),console.log(`🔄 Updated focus group ${W} with model: ${I.llm_model}`)}catch(he){console.error("Failed to update focus group before guide generation:",he)}const ie=await Ce(I,W);y(ie);try{const he={name:I.focusGroupName,status:"draft",participants:P,participants_count:P.length,date:new Date().toISOString(),duration:parseInt(I.duration),topic:I.discussionTopics.split(",")[0].trim().toLowerCase().replace(/\s+/g,"-"),description:I.researchBrief,objective:I.researchBrief,llm_model:I.llm_model,discussionGuide:ie};await bt.update(W,he),console.log("Focus group updated with discussion guide"),oe.success("Progress saved as draft",{description:"Your focus group setup has been automatically saved"})}catch(he){console.error("Failed to update focus group with discussion guide:",he),oe.error("Failed to save draft",{description:"Discussion guide generated, but draft save failed"})}c("review"),oe.success("Discussion guide generated",{description:"Review and edit before proceeding"})}catch(W){console.error("Error in focus group creation flow:",W),oe.error("Focus group creation failed",{description:W.message||"An unexpected error occurred"})}}const Le=(()=>{var K;const I=A.filter(W=>{const ie=W.name.toLowerCase().includes(be.toLowerCase())||W.occupation&&W.occupation.toLowerCase().includes(be.toLowerCase())||W.location&&W.location.toLowerCase().includes(be.toLowerCase()),he=(ve.age.length===0||ve.age.includes(W.age))&&(ve.gender.length===0||ve.gender.includes(W.gender))&&(ve.occupation.length===0||ve.occupation.includes(W.occupation))&&(ve.location.length===0||ve.location.includes(W.location))&&(ve.ethnicity.length===0||W.ethnicity&&ve.ethnicity.includes(W.ethnicity))&&(ve.techSavviness.length===0||W.techSavviness!==void 0&&ve.techSavviness.includes(W.techSavviness<30?"Low (0-30)":W.techSavviness<70?"Medium (31-70)":"High (71-100)"))&&!0;let Te=!0;if(q!==Go)if(Te=!1,W.folderId===q)Te=!0;else{const qe=T.find(Ft=>Ft.id===q);if(qe){const Ft=qe.personaIds.filter(It=>!!It),Wt=W.id||W._id;Ft.includes(Wt)&&(Te=!0)}}return ie&&he&&Te});if(console.log(`Filtered personas: ${I.length}/${A.length}`),console.log(`Selected folder: ${q===Go?"All Personas":((K=T.find(W=>W.id===q))==null?void 0:K.name)||q}`),q!==Go){const W=T.find(ie=>ie.id===q);if(W){const ie=W.personaIds.filter(qe=>!!qe);console.log(`Folder details: ${W.name}, ID: ${W.id}, Contains: ${ie.length} valid personas`),console.log("Folder personaIds (valid only):",ie);const he=A.filter(qe=>qe.folderId===q);console.log(`Personas with folderId matching this folder: ${he.length}`);const Te=A.filter(qe=>{const Ft=qe.id||qe._id;return W.personaIds.includes(Ft)});console.log(`Personas in folder's personaIds array: ${Te.length}`)}}return I})(),ft=I=>{console.log("Toggling selection for participant ID:",I),k(K=>{const W=K.includes(I);console.log("Current selection:",{id:I,isCurrentlySelected:W,currentSelections:[...K]});const ie=W?K.filter(he=>he!==I):[...K,I];return console.log("New selection:",ie),ie})},J=async()=>{try{const I=tt.getValues(),K={name:I.focusGroupName,status:"in-progress",participants:P,participants_count:P.length,date:new Date().toISOString(),duration:parseInt(I.duration),topic:I.discussionTopics.split(",")[0].trim().toLowerCase().replace(/\s+/g,"-"),discussionGuide:m},ie=(await bt.create(K)).data;return console.log("Focus group created successfully:",ie),ie.focus_group_id}catch(I){throw console.error("Error saving focus group:",I),I}},Y=v.useCallback(async()=>{if(!S.current){oe.error("No discussion guide available",{description:"Please generate a discussion guide first"});return}V(!0);try{const{downloadDiscussionGuideAsMarkdown:I}=await CQ(async()=>{const{downloadDiscussionGuideAsMarkdown:W}=await import("./discussionGuideMarkdown-eMXneipz.js");return{downloadDiscussionGuideAsMarkdown:W}},[]),K=tt.getValues();I(S.current,K.focusGroupName),oe.success("Discussion guide downloaded",{description:"The guide has been saved to your downloads folder"})}catch(I){console.error("Error downloading discussion guide:",I),oe.error("Download failed",{description:"Unable to download the discussion guide. Please try again."})}finally{V(!1)}},[tt]),ye=v.useCallback(async I=>{console.log("📝 handleSaveDiscussionGuide called with:",I),w?(S.current=I,console.log("📝 Skipping discussionGuide state update during editing to preserve focus")):(y(I),oe.success("Discussion guide updated",{description:"Your changes have been saved."}))},[w]),xe=v.useCallback(I=>{console.log("📝 Discussion guide editing state changed:",I),j(I),!I&&S.current&&(console.log("📝 Updating discussionGuide state after editing ended"),y(S.current))},[]),je=v.useCallback(()=>{},[]),Qe=async()=>{if(!tt.getValues().focusGroupName){oe.error("Missing focus group name",{description:"Please provide a name for the focus group"});return}if(!m){oe.error("Missing discussion guide",{description:"Please generate a discussion guide first"});return}if(P.length<1){oe.error("Not enough participants",{description:"Please select at least one participant for the focus group"});return}console.log("Starting focus group with participants:",P);try{oe.loading("Creating focus group...");let I;if(b){const K=tt.getValues(),W={name:K.focusGroupName,status:"in-progress",participants:P,participants_count:P.length,date:new Date().toISOString(),duration:parseInt(K.duration),topic:K.discussionTopics.split(",")[0].trim().toLowerCase().replace(/\s+/g,"-"),description:K.researchBrief,objective:K.researchBrief,discussionGuide:m},ie=await bt.update(b,W);I=b,console.log("Draft focus group updated to in-progress:",ie),t&&t()}else I=await J();oe.dismiss(),oe.success("Focus group created successfully",{description:"The AI moderator is now running the session"}),r(`/focus-groups/${I}`)}catch(I){oe.dismiss(),I!=null&&I.message,console.error("Failed to start focus group:",I),oe.error("Failed to create focus group",{description:"Please try again or check your connection"})}};return i.jsxs(i.Fragment,{children:[i.jsx(H,{}),i.jsxs("div",{className:"glass-panel rounded-xl p-6",children:[i.jsxs("div",{className:"flex items-center gap-2 mb-6",children:[i.jsx(Ma,{className:"h-5 w-5 text-primary"}),i.jsx("h2",{className:"font-sf text-xl font-semibold",children:"AI Focus Group Moderator"})]}),u&&i.jsx("div",{className:"mb-6",children:i.jsx(BN,{isActive:u,isComplete:f,hasError:p,label:"Generating discussion guide",onComplete:ke})}),i.jsxs(Fo,{value:l,onValueChange:c,children:[i.jsxs(Ai,{className:"grid w-full grid-cols-3 mb-6",children:[i.jsx(Xt,{value:"setup",children:"Setup"}),i.jsx(Xt,{value:"review",children:"Review & Edit"}),i.jsx(Xt,{value:"participants",children:"Participants"})]}),i.jsx(Yt,{value:"setup",children:i.jsx(Ey,{...tt,children:i.jsxs("form",{onSubmit:tt.handleSubmit(Ue),className:"space-y-6",children:[i.jsx(dt,{control:tt.control,name:"focusGroupName",render:({field:I})=>i.jsxs(ot,{children:[i.jsx(lt,{children:"Focus Group Name"}),i.jsx(ct,{children:i.jsx(Ot,{placeholder:"e.g., Mobile App UX Evaluation",...I})}),i.jsx(fn,{children:"Give your focus group a descriptive name"}),i.jsx(ut,{})]})}),i.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-6",children:[i.jsx(dt,{control:tt.control,name:"researchBrief",render:({field:I})=>i.jsxs(ot,{children:[i.jsx(lt,{children:"Research Brief"}),i.jsx(ct,{children:i.jsx(nt,{placeholder:"Describe your research objectives...",className:"h-36",...I})}),i.jsx(fn,{children:"Provide context about what you want to learn"}),i.jsx(ut,{})]})}),i.jsxs("div",{className:"space-y-6",children:[i.jsx(dt,{control:tt.control,name:"discussionTopics",render:({field:I})=>i.jsxs(ot,{children:[i.jsx(lt,{children:"Discussion Topics"}),i.jsx(ct,{children:i.jsx(nt,{placeholder:"List main topics to cover, separated by commas",className:"h-24",...I})}),i.jsx(fn,{children:"E.g., User experience, feature preferences, pain points"}),i.jsx(ut,{})]})}),i.jsx(dt,{control:tt.control,name:"duration",render:({field:I})=>i.jsxs(ot,{children:[i.jsx(lt,{children:"Duration (minutes)"}),i.jsxs(Mn,{onValueChange:I.onChange,value:I.value,children:[i.jsx(ct,{children:i.jsx(Pn,{children:i.jsx(In,{placeholder:"Select duration"})})}),i.jsxs(An,{children:[i.jsx(fe,{value:"30",children:"30 minutes"}),i.jsx(fe,{value:"45",children:"45 minutes"}),i.jsx(fe,{value:"60",children:"60 minutes"}),i.jsx(fe,{value:"90",children:"90 minutes"}),i.jsx(fe,{value:"120",children:"120 minutes"})]})]}),i.jsx(fn,{children:"How long should the focus group session last?"}),i.jsx(ut,{})]})}),i.jsx(dt,{control:tt.control,name:"llm_model",render:({field:I})=>i.jsxs(ot,{children:[i.jsx(lt,{children:"AI Model"}),i.jsxs(Mn,{onValueChange:I.onChange,value:I.value,children:[i.jsx(ct,{children:i.jsx(Pn,{children:i.jsx(In,{placeholder:"Select AI model"})})}),i.jsxs(An,{children:[i.jsx(fe,{value:"gemini-2.5-pro",children:"Gemini 2.5 Pro"}),i.jsx(fe,{value:"gpt-4.1",children:"GPT-4.1"})]})]}),i.jsx(fn,{children:"Choose which AI model to use for generating responses and discussion guides"}),i.jsx(ut,{})]})})]})]}),i.jsx(dt,{control:tt.control,name:"creativeAssets",render:({field:{value:I,onChange:K,...W}})=>i.jsxs(ot,{children:[i.jsx(lt,{children:"Creative Assets (Optional)"}),i.jsx(ct,{children:i.jsxs("div",{className:"border-2 border-dashed border-slate-200 rounded-lg p-6 flex flex-col items-center justify-center bg-slate-50 hover:bg-slate-100 transition cursor-pointer",children:[i.jsx(cI,{className:"h-10 w-10 text-slate-400 mb-2"}),i.jsx("p",{className:"text-sm text-slate-600 mb-1",children:"Upload creative assets for testing"}),i.jsx("p",{className:"text-xs text-slate-500 mb-3",children:"Images, mockups, or product designs"}),i.jsx(Ot,{...W,type:"file",accept:"image/*,.pdf",multiple:!0,onChange:ie=>{K(ie.target.files)},className:"hidden",id:"assets-file-input"}),i.jsxs(te,{type:"button",variant:"outline",size:"sm",onClick:()=>{var ie;return(ie=document.getElementById("assets-file-input"))==null?void 0:ie.click()},children:[i.jsx(dI,{className:"mr-2 h-4 w-4"}),"Select Files"]}),I&&I.length>0&&i.jsxs("p",{className:"text-xs text-primary mt-2",children:[I.length," file(s) selected"]})]})}),i.jsx(fn,{children:"Upload visuals that you want feedback on during the session"}),i.jsx(ut,{})]})}),i.jsx("div",{className:"space-y-3",children:i.jsx("div",{className:"flex justify-end",children:i.jsxs(te,{type:"submit",disabled:u,className:"min-w-32",children:[i.jsx(Ma,{className:"mr-2 h-4 w-4"}),u?"Generating...":"Generate Discussion Guide"]})})})]})})}),i.jsx(Yt,{value:"review",children:i.jsxs("div",{className:"space-y-6",children:[i.jsx(rt,{children:i.jsxs(wt,{className:"p-6",children:[i.jsx("div",{className:"flex items-center justify-between mb-4",children:i.jsxs("div",{className:"flex items-center gap-3",children:[i.jsx("h3",{className:"font-sf text-lg font-medium",children:"AI-Generated Discussion Guide"}),m&&i.jsx(Wn,{variant:"outline",className:"text-xs",children:_(m)?"Structured JSON":"Legacy Text"})]})}),i.jsx("div",{className:"prose max-w-none",children:m?i.jsx(zN,{discussionGuide:m,showProgress:!1,collapsible:!0,defaultExpanded:!0,className:"border-0",onSave:ye,onDownload:Y,onSectionSelect:je,isDownloading:D,focusGroupId:b,onEditingChange:xe}):i.jsx("div",{className:"bg-slate-50 p-4 rounded border text-center text-slate-600",children:'No discussion guide generated yet. Complete the setup and click "Generate Discussion Guide" to create one.'})})]})}),O.length>0&&i.jsx(rt,{children:i.jsxs(wt,{className:"p-6",children:[i.jsx("h3",{className:"font-sf text-lg font-medium mb-4",children:"Uploaded Creative Assets"}),i.jsx("div",{className:"grid grid-cols-2 sm:grid-cols-3 md:grid-cols-4 gap-4",children:O.map((I,K)=>i.jsxs("div",{className:"border rounded-md p-2",children:[i.jsx("div",{className:"aspect-square bg-slate-100 rounded flex items-center justify-center mb-2",children:I.type.startsWith("image/")?i.jsx("img",{src:URL.createObjectURL(I),alt:`Asset ${K+1}`,className:"max-h-full max-w-full object-contain"}):i.jsx(pw,{className:"h-10 w-10 text-slate-400"})}),i.jsx("p",{className:"text-xs truncate",children:I.name})]},K))})]})}),i.jsxs("div",{className:"flex justify-between",children:[i.jsx(te,{variant:"outline",onClick:()=>c("setup"),children:"Back to Setup"}),i.jsxs(te,{onClick:()=>c("participants"),children:["Select Participants",i.jsx(tr,{className:"ml-2 h-4 w-4"})]})]})]})}),i.jsxs(Yt,{value:"participants",children:[i.jsxs("div",{className:"flex flex-col md:flex-row gap-6",children:[i.jsxs("div",{className:"w-full md:w-64 space-y-4",children:[i.jsxs("div",{className:"flex items-center justify-between",children:[i.jsx("h3",{className:"text-sm font-medium",children:"Folders"}),i.jsx(te,{variant:"ghost",size:"sm",onClick:()=>{console.log("Clicked 'Create new folder' button"),ge(!0)},className:"h-7 w-7 p-0",children:i.jsx(uI,{className:"h-4 w-4"})})]}),i.jsxs("div",{className:"space-y-1",children:[i.jsxs("button",{onClick:()=>{console.log("Clicked 'All Personas' folder"),console.log("All personas count:",A.length),Z(Go),setTimeout(()=>{console.log(`Will show all ${A.length} personas`)},0)},className:`w-full flex items-center space-x-2 px-3 py-2 text-sm rounded-md text-left transition-colors ${q===Go?"bg-primary/10 text-primary font-medium":"hover:bg-slate-100"}`,children:[i.jsx(Us,{className:"h-4 w-4"}),i.jsx("span",{children:"All Personas"})]}),T.map(I=>i.jsx("div",{className:"flex items-center justify-between group",children:se&&se.id===I.id?i.jsxs("div",{className:"flex-1 flex items-center px-3 py-2 space-x-2",children:[i.jsx(Us,{className:"h-4 w-4"}),i.jsx(Ot,{value:De,onChange:K=>de(K.target.value),placeholder:"Folder name",className:"h-7 text-sm",autoFocus:!0,onKeyDown:K=>{K.key==="Enter"?Xn():K.key==="Escape"&&an()}}),i.jsx(te,{size:"sm",variant:"ghost",onClick:()=>{console.log(`Confirming folder rename: "${se==null?void 0:se.name}" to "${De}"`),Xn()},className:"h-7 w-7 p-0",children:i.jsx($a,{className:"h-4 w-4"})}),i.jsx(te,{size:"sm",variant:"ghost",onClick:()=>{console.log(`Cancelling rename of folder: "${se==null?void 0:se.name}"`),an()},className:"h-7 w-7 p-0",children:i.jsx(Zs,{className:"h-4 w-4"})})]}):i.jsxs(i.Fragment,{children:[i.jsxs("button",{onClick:()=>{console.log(`Clicked folder: ${I.name} (ID: ${I.id})`);const K=I.personaIds.filter(W=>!!W);console.log(`Current persona count in folder: ${K.length}`),console.log("Folder personaIds:",K),console.log("All personas count:",A.length),Z(I.id),setTimeout(()=>{const W=A.filter(ie=>{if(ie.folderId===I.id)return!0;const he=ie.id||ie._id;return K.includes(he)});console.log(`Will show ${W.length} personas after filtering`),console.log("Filtered personas:",W.map(ie=>ie.name))},0)},className:`flex-1 flex items-center space-x-2 px-3 py-2 text-sm rounded-md text-left transition-colors ${q===I.id?"bg-primary/10 text-primary font-medium":"hover:bg-slate-100"}`,children:[i.jsx(Us,{className:"h-4 w-4"}),i.jsx("span",{children:I.name}),i.jsx("span",{className:"text-muted-foreground text-xs ml-auto",children:I.personaIds.filter(K=>!!K).length})]}),i.jsxs(zw,{children:[i.jsx(Uw,{asChild:!0,children:i.jsx(te,{variant:"ghost",size:"sm",className:"h-7 w-7 p-0 opacity-0 group-hover:opacity-100",children:i.jsx(hw,{className:"h-4 w-4"})})}),i.jsx(Tg,{align:"end",children:i.jsx(Bi,{onClick:()=>{console.log(`Initiating rename for folder: ${I.name} (ID: ${I.id})`),Vt(I)},children:"Rename"})})]})]})},I.id)),re&&i.jsxs("div",{className:"flex items-center px-3 py-2 space-x-2",children:[i.jsxs("div",{className:"flex-1 flex items-center space-x-2",children:[i.jsx(Us,{className:"h-4 w-4"}),i.jsx(Ot,{value:B,onChange:I=>le(I.target.value),placeholder:"Folder name",className:"h-7 text-sm",autoFocus:!0,onKeyDown:I=>{I.key==="Enter"?Ze():I.key==="Escape"&&kt()}})]}),i.jsx(te,{size:"sm",variant:"ghost",onClick:()=>{console.log(`Confirming creation of new folder: "${B}"`),Ze()},className:"h-7 w-7 p-0",children:i.jsx($a,{className:"h-4 w-4"})}),i.jsx(te,{size:"sm",variant:"ghost",onClick:()=>{console.log("Cancelling folder creation"),kt()},className:"h-7 w-7 p-0",children:i.jsx(Zs,{className:"h-4 w-4"})})]})]})]}),i.jsxs("div",{className:"flex-1",children:[i.jsx(rt,{className:"mb-4",children:i.jsx(wt,{className:"p-6",children:i.jsxs("div",{className:"flex flex-col space-y-6",children:[i.jsxs("div",{className:"flex items-center justify-between",children:[i.jsx("h3",{className:"font-sf text-lg font-medium",children:"Select Participants"}),i.jsxs("div",{className:"flex items-center",children:[i.jsx(tr,{className:"h-5 w-5 mr-2 text-muted-foreground"}),i.jsxs("span",{className:"text-sm font-medium",children:[P.length," of ",Le.length," selected"]})]})]}),i.jsxs("div",{className:"flex flex-col sm:flex-row gap-4",children:[i.jsxs("div",{className:"relative flex-1",children:[i.jsx(US,{className:"absolute left-3 top-1/2 transform -translate-y-1/2 text-muted-foreground h-4 w-4"}),i.jsx(Ot,{placeholder:"Search personas by name, occupation, or location...",className:"pl-10 bg-white",value:be,onChange:I=>Pe(I.target.value)})]}),i.jsxs(te,{variant:"outline",className:"flex items-center gap-2",onClick:()=>Je(!0),children:[i.jsx(BS,{className:"h-4 w-4"}),i.jsxs("span",{children:["Filter",Object.values(ve).some(I=>I.length>0)?` (${Object.values(ve).reduce((I,K)=>I+K.length,0)})`:""]})]})]}),L?i.jsx("div",{className:"flex justify-center items-center py-12",children:i.jsx(li,{className:"h-8 w-8 animate-spin text-primary"})}):Le.length>0?i.jsx("div",{className:"grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-3 gap-4",children:Le.map(I=>{const K=I._id||I.id;return i.jsx(cN,{user:{id:K,_id:I._id,name:I.name,age:I.age,gender:I.gender,occupation:I.occupation,location:I.location||"Unknown",techSavviness:I.techSavviness||50,personality:I.personality||"No description available",oceanTraits:I.oceanTraits,qualitativeAttributes:I.qualitativeAttributes,topPersonalityTraits:I.topPersonalityTraits,aiSynthesizedBio:I.aiSynthesizedBio},selected:P.includes(K),onSelectionToggle:()=>ft(K),onViewDetails:Ie},K)})}):i.jsx("div",{className:"text-center py-12",children:i.jsx("p",{className:"text-muted-foreground",children:"No personas available matching your criteria."})})]})})}),i.jsxs("div",{className:"flex justify-between",children:[i.jsx(te,{variant:"outline",onClick:()=>c("review"),children:"Back to Review"}),i.jsxs(te,{onClick:Qe,disabled:P.length<1||!m,children:[i.jsx($W,{className:"mr-2 h-4 w-4"}),"Start Focus Group Session"]})]})]})]}),i.jsx(wl,{open:ne,onOpenChange:I=>{I?(Je(I),Mt({...ve})):Je(!1)},children:i.jsxs(ho,{className:"max-w-4xl max-h-[80vh] overflow-y-auto",children:[i.jsxs(po,{children:[i.jsx(go,{children:"Filter Personas"}),i.jsx(jl,{children:"Select attributes to filter personas by. Multiple selections within a category use OR logic, different categories use AND logic."})]}),i.jsxs("div",{className:"py-4 space-y-6",children:[Object.values(st).some(I=>I.length>0)&&i.jsx("div",{className:"bg-muted/30 p-3 rounded-md",children:i.jsxs("p",{className:"text-sm text-muted-foreground",children:[Object.values(st).reduce((I,K)=>I+K.length,0)," active filters"]})}),(()=>{const I=we(A),K=Object.values(st).every(ie=>ie.length===0),W=(ie,he,Te=1)=>{const qe=K?I[he]:ze(he)[he],Ft=st[he],Wt=[...new Set([...qe,...Ft])].sort();return Wt.length===0?null:i.jsxs("div",{className:"mb-6",children:[i.jsx("h3",{className:"text-sm font-medium mb-3",children:ie}),i.jsx("div",{className:`grid grid-cols-1 ${Te===2?"sm:grid-cols-2":Te===3?"sm:grid-cols-2 md:grid-cols-3":""} gap-2`,children:Wt.map(It=>{const fa=st[he].includes(It),tc=qe.includes(It);return i.jsxs("div",{className:`flex items-center space-x-2 ${!tc&&!fa?"opacity-50":""}`,children:[i.jsx(ol,{id:`${he}-${It}`,checked:fa,onCheckedChange:()=>He(he,It),disabled:!tc&&!fa}),i.jsxs(ys,{htmlFor:`${he}-${It}`,className:"truncate overflow-hidden",children:[It,fa&&!tc&&i.jsx("span",{className:"ml-1 text-xs text-muted-foreground",children:"(no matches)"})]})]},It)})})]})};return i.jsxs(i.Fragment,{children:[W("Gender","gender",3),W("Age","age",3),W("Ethnicity","ethnicity",2),W("Location","location",2),W("Occupation","occupation",2),W("Tech Savviness","techSavviness",3),i.jsx("div",{className:"grid grid-cols-1 sm:grid-cols-2 gap-6"})]})})()]}),i.jsxs(mo,{children:[i.jsx(te,{variant:"outline",onClick:St,children:"Reset"}),i.jsx(te,{onClick:gt,children:"Apply Filters"})]})]})})]})]})]})]})}const $Q=[{id:"1",name:"Mobile App UX Evaluation",status:"completed",participants:6,date:"2023-06-10T14:00:00Z",duration:60,topic:"user-experience"},{id:"2",name:"Product Feature Feedback",status:"scheduled",participants:8,date:"2023-06-15T10:00:00Z",duration:90,topic:"product-feedback"},{id:"3",name:"Marketing Campaign Testing",status:"in-progress",participants:5,date:"2023-06-12T15:30:00Z",duration:45,topic:"creative-testing"},{id:"4",name:"Website Navigation Study",status:"scheduled",participants:7,date:"2023-06-18T13:00:00Z",duration:60,topic:"user-experience"}],MQ={completed:"bg-green-100 text-green-800 border-green-200",scheduled:"bg-blue-100 text-blue-800 border-blue-200","in-progress":"bg-amber-100 text-amber-800 border-amber-200",active:"bg-amber-100 text-amber-800 border-amber-200",paused:"bg-purple-100 text-purple-800 border-purple-200",new:"bg-slate-100 text-slate-800 border-slate-200",ai_mode:"bg-amber-100 text-amber-800 border-amber-200",draft:"bg-gray-100 text-gray-800 border-gray-200"},IQ=()=>{console.log("FocusGroups component rendering");const[e,t]=v.useState("view"),[n,r]=v.useState(""),[s,a]=v.useState([]),[o,l]=v.useState(!0),[c,u]=v.useState([]),[d,f]=v.useState(!1),[h,p]=v.useState(!1),[g,m]=v.useState(null),y=Tn(),b=qr(),[x,w]=v.useState([]),j=v.useRef(!0),S=async(A=!0)=>{if(console.log("fetchFocusGroups called with isMountedCheck:",A),console.log("isMounted.current:",j.current),A&&!j.current){console.log("Exiting early: component not mounted");return}console.log("Setting loading to true and making API call"),l(!0);try{console.log("Calling focusGroupsApi.getAll()");const $=await bt.getAll();if(console.log("API response received:",$),!A||j.current){const L=$.data.map(G=>({...G,id:G.id||G._id,participants_count:Array.isArray(G.participants)?G.participants.length:typeof G.participants=="number"?G.participants:0}));a(L)}}catch($){console.error("Error fetching focus groups:",$),(!A||j.current)&&(Ke.error("Failed to load focus groups"),a($Q))}finally{(!A||j.current)&&l(!1)}},N=async A=>{try{const $=await bt.getById(A);$&&$.data&&(m($.data),t("create"))}catch($){console.error("Error fetching focus group for edit:",$),Ke.error("Failed to load focus group for editing")}};v.useEffect(()=>(console.log("useEffect running - about to fetch focus groups"),S(),()=>{console.log("useEffect cleanup - setting isMounted to false"),j.current=!1}),[]),v.useEffect(()=>{console.log("Mode change useEffect running, mode:",e),e==="view"&&(console.log("Mode is view, calling fetchFocusGroups"),S())},[e]),v.useEffect(()=>{const A=b.state;(A==null?void 0:A.mode)==="create"&&(A!=null&&A.preSelectedParticipants)&&(w(A.preSelectedParticipants),t("create"),y(b.pathname,{replace:!0,state:null}))},[b.state,b.pathname,y]),v.useEffect(()=>{const A=new URLSearchParams(b.search),$=A.get("mode"),L=A.get("id"),G=A.get("tab");if($==="create")t("create"),m(null);else if($==="edit"&&L){const D=s.find(V=>(V._id||V.id)===L);D?(m(D),t("create")):N(L)}if($||L||G){const D=b.pathname;y(D,{replace:!0})}},[b.search,s,y,b.pathname]);const _=s.filter(A=>A.name.toLowerCase().includes(n.toLowerCase())||A.topic.toLowerCase().includes(n.toLowerCase())),P=A=>new Date(A).toLocaleDateString("en-US",{month:"short",day:"numeric",year:"numeric"}),k=A=>new Date(A).toLocaleTimeString("en-US",{hour:"numeric",minute:"2-digit",hour12:!0}),O=A=>{u($=>$.includes(A)?$.filter(L=>L!==A):[...$,A])},M=async()=>{if(c.length!==0){p(!0);try{const A=c.map($=>bt.delete($));await Promise.all(A),a($=>$.filter(L=>!c.includes(L.id||L._id||""))),u([]),Ke.success(`${c.length} focus group${c.length>1?"s":""} deleted successfully`)}catch(A){console.error("Error deleting focus groups:",A),Ke.error("Failed to delete focus groups")}finally{p(!1),f(!1)}}};return i.jsxs("div",{className:"min-h-screen bg-slate-50",children:[i.jsx(ci,{}),i.jsxs("main",{className:"pt-20 pb-16 px-4 sm:px-6 lg:px-8 max-w-7xl mx-auto",children:[i.jsxs("div",{className:"flex flex-col sm:flex-row justify-between items-start sm:items-center mb-8",children:[i.jsxs("div",{children:[i.jsx("h1",{className:"font-sf text-3xl font-bold text-slate-900",children:"Focus Groups"}),i.jsx("p",{className:"text-slate-600 mt-1",children:"Set up and manage AI-moderated research sessions"})]}),i.jsx("div",{className:"mt-4 sm:mt-0",children:i.jsx(te,{onClick:()=>{console.log("Create New Focus Group button clicked, current mode:",e);try{e==="view"?(console.log("Setting draft to null and switching to create mode"),m(null),t("create")):(console.log("Switching back to view mode"),t("view"))}catch(A){console.error("Error in Create New Focus Group onClick:",A)}},className:"hover-transition",children:e==="view"?"Create New Focus Group":"View All Focus Groups"})})]}),e==="view"?i.jsxs(i.Fragment,{children:[i.jsxs("div",{className:"flex flex-col sm:flex-row gap-4 mb-6",children:[i.jsxs("div",{className:"relative flex-1",children:[i.jsx(US,{className:"absolute left-3 top-1/2 transform -translate-y-1/2 text-muted-foreground h-4 w-4"}),i.jsx(Ot,{placeholder:"Search focus groups by name or topic...",className:"pl-10 bg-white",value:n,onChange:A=>r(A.target.value)})]}),i.jsxs(te,{variant:"outline",className:"flex items-center gap-2",children:[i.jsx(BS,{className:"h-4 w-4"}),i.jsx("span",{children:"Filter"})]})]}),i.jsxs("div",{className:"glass-panel rounded-xl p-6",children:[i.jsxs("div",{className:"flex items-center justify-between mb-6",children:[i.jsxs("div",{className:"flex items-center gap-2",children:[i.jsx(Ma,{className:"h-5 w-5 text-primary"}),i.jsx("h2",{className:"font-sf text-xl font-semibold",children:"Your Focus Groups"})]}),c.length>0&&i.jsxs(te,{variant:"destructive",size:"sm",onClick:()=>f(!0),disabled:h,className:"flex items-center gap-2",children:[i.jsx(_n,{className:"h-4 w-4"}),"Delete Selected (",c.length,")"]})]}),o?i.jsx("div",{className:"flex justify-center items-center py-12",children:i.jsx(li,{className:"h-8 w-8 animate-spin text-primary"})}):_.length>0?i.jsx("div",{className:"space-y-4",children:_.map(A=>i.jsx("div",{className:"glass-card rounded-xl overflow-hidden hover:shadow-md button-transition",children:i.jsxs("div",{className:"flex flex-col md:flex-row",children:[i.jsxs("div",{className:"flex-1 p-6",children:[i.jsxs("div",{className:"flex items-start justify-between",children:[i.jsxs("div",{className:"flex items-start gap-3",children:[i.jsx(ol,{id:`select-${A.id||A._id}`,checked:c.includes(A.id||A._id||""),onCheckedChange:()=>O(A.id||A._id||""),className:"mt-1"}),i.jsxs("div",{children:[i.jsx("h3",{className:"font-sf text-lg font-semibold mb-2",children:A.name}),i.jsxs("div",{className:"flex flex-wrap items-center gap-3 text-sm text-muted-foreground",children:[i.jsxs("div",{className:"flex items-center",children:[i.jsx(gW,{className:"h-4 w-4 mr-1"}),P(A.date)]}),i.jsxs("div",{className:"flex items-center",children:[i.jsx(Uf,{className:"h-4 w-4 mr-1"}),k(A.date)]}),i.jsxs("div",{className:"flex items-center",children:[i.jsx(tr,{className:"h-4 w-4 mr-1"}),A.participants_count||(Array.isArray(A.participants)?A.participants.length:0)," participant",A.participants_count>1||Array.isArray(A.participants)&&A.participants.length>1?"s":""]}),i.jsxs("div",{className:"flex items-center",children:[i.jsx(Uf,{className:"h-4 w-4 mr-1"}),A.duration," min"]})]})]})]}),i.jsxs("div",{className:Oe("px-3 py-1 rounded-full text-xs font-medium border",MQ[A.status]||"bg-gray-100 text-gray-800 border-gray-200"),children:[A.status==="completed"&&"Completed",A.status==="scheduled"&&"Scheduled",A.status==="in-progress"&&"In Progress",A.status==="active"&&"In Progress",A.status==="ai_mode"&&"In Progress",A.status==="paused"&&"Paused",A.status==="new"&&"Not Started",A.status==="draft"&&"Draft",!["completed","scheduled","in-progress","active","ai_mode","paused","new","draft"].includes(A.status)&&A.status]})]}),i.jsxs("div",{className:"mt-4 flex flex-wrap gap-2",children:[i.jsxs("div",{className:"px-3 py-1 bg-slate-100 rounded-full text-xs font-medium text-slate-800",children:[A.topic==="user-experience"&&"User Experience",A.topic==="product-feedback"&&"Product Feedback",A.topic==="creative-testing"&&"Creative Testing",A.topic==="messaging-evaluation"&&"Messaging Evaluation",A.topic&&!["user-experience","product-feedback","creative-testing","messaging-evaluation"].includes(A.topic)&&A.topic.charAt(0).toUpperCase()+A.topic.slice(1).replace(/-/g," ")]}),i.jsx("div",{className:"px-3 py-1 bg-slate-100 rounded-full text-xs font-medium text-slate-800",children:"AI Moderated"})]})]}),i.jsx("div",{className:"bg-slate-50 p-6 flex flex-col justify-center items-center md:border-l border-slate-100",children:i.jsx(te,{variant:A.status==="in-progress"||A.status==="active"||A.status==="ai_mode"?"default":A.status==="new"||A.status==="draft"?"outline":"default",className:Oe("w-full hover-transition",A.status==="new"?"bg-slate-200 text-slate-700 hover:bg-slate-300 border-slate-300":"",A.status==="draft"?"bg-gray-200 text-gray-700 hover:bg-gray-300 border-gray-300":""),onClick:()=>{if(A.status==="draft")m(A),t("create");else{const $=A.id||A._id;console.log("Navigating to focus group:",$),y(`/focus-groups/${$}`)}},children:A.status==="completed"?i.jsxs(i.Fragment,{children:["View Session",i.jsx(gs,{className:"ml-2 h-4 w-4"})]}):A.status==="in-progress"||A.status==="active"||A.status==="ai_mode"?i.jsxs(i.Fragment,{children:["Join Session",i.jsx(gs,{className:"ml-2 h-4 w-4"})]}):A.status==="paused"?i.jsxs(i.Fragment,{children:["Session Details",i.jsx(gs,{className:"ml-2 h-4 w-4"})]}):A.status==="scheduled"?i.jsxs(i.Fragment,{children:["View Details",i.jsx(gs,{className:"ml-2 h-4 w-4"})]}):A.status==="new"?i.jsxs(i.Fragment,{children:["View Session",i.jsx(gs,{className:"ml-2 h-4 w-4"})]}):A.status==="draft"?i.jsxs(i.Fragment,{children:["Edit",i.jsx(gs,{className:"ml-2 h-4 w-4"})]}):i.jsxs(i.Fragment,{children:["View Session",i.jsx(gs,{className:"ml-2 h-4 w-4"})]})})})]})},A.id))}):i.jsx("div",{className:"text-center py-12",children:i.jsx("p",{className:"text-muted-foreground",children:"No focus groups found matching your search criteria."})})]})]}):i.jsx(TQ,{draftToEdit:g,preSelectedParticipants:x,onDraftSaved:()=>{m(null),t("view"),w([]),S()}})]}),i.jsx(Vw,{open:d,onOpenChange:f,children:i.jsxs(Mg,{children:[i.jsxs(Ig,{children:[i.jsxs(Dg,{children:["Delete ",c.length," Focus Group",c.length!==1?"s":"","?"]}),i.jsxs(Lg,{children:["This action cannot be undone. This will permanently delete the selected focus group",c.length!==1?"s":""," and remove all data associated with ",c.length!==1?"them":"it","."]})]}),i.jsxs(Rg,{children:[i.jsx(Bg,{disabled:h,children:"Cancel"}),i.jsx(Fg,{onClick:A=>{A.preventDefault(),M()},disabled:h,className:"bg-destructive text-destructive-foreground hover:bg-destructive/90",children:h?i.jsxs(i.Fragment,{children:[i.jsx(li,{className:"mr-2 h-4 w-4 animate-spin"}),"Deleting..."]}):i.jsx(i.Fragment,{children:"Delete"})})]})]})})]})},RQ=({participants:e,selectedParticipantIds:t,onToggleParticipantFilter:n})=>{const r=Tn(),{id:s}=DS(),{setPreviousRoute:a}=Uy(),o=c=>{const u=c.id||c._id;u&&s&&(a(`/focus-groups/${s}`,{focusGroupId:s}),r(`/personas/${u}`))},l=c=>{const u=c.id||c._id;u&&n(u)};return i.jsx("div",{className:"w-full lg:w-64 shrink-0",children:i.jsxs("div",{className:"glass-panel rounded-xl p-4",children:[i.jsxs("h2",{className:"font-sf text-lg font-semibold flex items-center mb-3",children:[i.jsx(tr,{className:"h-5 w-5 text-primary mr-2"})," Participants"]}),i.jsxs("div",{className:"space-y-3",children:[i.jsxs("div",{className:"flex items-center p-2 bg-primary/5 rounded-lg",children:[i.jsx(ni,{className:"h-8 w-8 text-primary mr-3"}),i.jsxs("div",{children:[i.jsx("p",{className:"font-medium text-primary",children:"AI Moderator"}),i.jsx("p",{className:"text-xs text-slate-500",children:"Session facilitator"})]})]}),e.map(c=>{const u=c.id||c._id,d=t.includes(u);return i.jsxs("div",{className:`flex items-center p-2 rounded-lg transition-colors ${d?"bg-blue-50 border border-blue-200":"hover:bg-slate-100"}`,children:[i.jsx("div",{className:"cursor-pointer mr-3",onClick:()=>o(c),title:`View ${c.name}'s profile`,children:i.jsx("img",{src:cp(c),alt:c.name,className:"h-8 w-8 rounded-full object-cover"})}),i.jsxs("div",{className:"flex-1",children:[i.jsxs("div",{className:"flex items-center",children:[i.jsx("p",{className:"font-medium cursor-pointer hover:text-blue-600 transition-colors",onClick:()=>l(c),title:`Filter to show only ${c.name}'s messages`,children:c.name}),d&&i.jsx($a,{className:"h-4 w-4 text-blue-600 ml-2"})]}),i.jsx("p",{className:"text-xs text-slate-500",children:c.occupation})]})]},c.id)})]})]})})};function DQ(e,t){return v.useReducer((n,r)=>t[n][r]??n,e)}var UN="ScrollArea",[JL,UPe]=Hr(UN),[LQ,ks]=JL(UN),e3=v.forwardRef((e,t)=>{const{__scopeScrollArea:n,type:r="hover",dir:s,scrollHideDelay:a=600,...o}=e,[l,c]=v.useState(null),[u,d]=v.useState(null),[f,h]=v.useState(null),[p,g]=v.useState(null),[m,y]=v.useState(null),[b,x]=v.useState(0),[w,j]=v.useState(0),[S,N]=v.useState(!1),[_,P]=v.useState(!1),k=xt(t,M=>c(M)),O=Xl(s);return i.jsx(LQ,{scope:n,type:r,dir:O,scrollHideDelay:a,scrollArea:l,viewport:u,onViewportChange:d,content:f,onContentChange:h,scrollbarX:p,onScrollbarXChange:g,scrollbarXEnabled:S,onScrollbarXEnabledChange:N,scrollbarY:m,onScrollbarYChange:y,scrollbarYEnabled:_,onScrollbarYEnabledChange:P,onCornerWidthChange:x,onCornerHeightChange:j,children:i.jsx(Ye.div,{dir:O,...o,ref:k,style:{position:"relative","--radix-scroll-area-corner-width":b+"px","--radix-scroll-area-corner-height":w+"px",...e.style}})})});e3.displayName=UN;var t3="ScrollAreaViewport",n3=v.forwardRef((e,t)=>{const{__scopeScrollArea:n,children:r,asChild:s,nonce:a,...o}=e,l=ks(t3,n),c=v.useRef(null),u=xt(t,c,l.onViewportChange);return i.jsxs(i.Fragment,{children:[i.jsx("style",{dangerouslySetInnerHTML:{__html:` [data-radix-scroll-area-viewport] { scrollbar-width: none; -ms-overflow-style: none; @@ -633,7 +633,7 @@ ${I.researchBrief} :where([data-radix-scroll-area-content]) { flex-grow: 1; } -`},nonce:a}),i.jsx(Ye.div,{"data-radix-scroll-area-viewport":"",...o,asChild:s,ref:u,style:{overflowX:l.scrollbarXEnabled?"scroll":"hidden",overflowY:l.scrollbarYEnabled?"scroll":"hidden",...e.style},children:UQ({asChild:s,children:r},d=>i.jsx("div",{"data-radix-scroll-area-content":"",ref:l.onContentChange,style:{minWidth:l.scrollbarXEnabled?"fit-content":void 0},children:d}))})]})});JL.displayName=QL;var La="ScrollAreaScrollbar",LN=v.forwardRef((e,t)=>{const{forceMount:n,...r}=e,s=Os(La,e.__scopeScrollArea),{onScrollbarXEnabledChange:a,onScrollbarYEnabledChange:o}=s,l=e.orientation==="horizontal";return v.useEffect(()=>(l?a(!0):o(!0),()=>{l?a(!1):o(!1)}),[l,a,o]),s.type==="hover"?i.jsx($Q,{...r,ref:t,forceMount:n}):s.type==="scroll"?i.jsx(MQ,{...r,ref:t,forceMount:n}):s.type==="auto"?i.jsx(e3,{...r,ref:t,forceMount:n}):s.type==="always"?i.jsx(FN,{...r,ref:t}):null});LN.displayName=La;var $Q=v.forwardRef((e,t)=>{const{forceMount:n,...r}=e,s=Os(La,e.__scopeScrollArea),[a,o]=v.useState(!1);return v.useEffect(()=>{const l=s.scrollArea;let c=0;if(l){const u=()=>{window.clearTimeout(c),o(!0)},d=()=>{c=window.setTimeout(()=>o(!1),s.scrollHideDelay)};return l.addEventListener("pointerenter",u),l.addEventListener("pointerleave",d),()=>{window.clearTimeout(c),l.removeEventListener("pointerenter",u),l.removeEventListener("pointerleave",d)}}},[s.scrollArea,s.scrollHideDelay]),i.jsx(lr,{present:n||a,children:i.jsx(e3,{"data-state":a?"visible":"hidden",...r,ref:t})})}),MQ=v.forwardRef((e,t)=>{const{forceMount:n,...r}=e,s=Os(La,e.__scopeScrollArea),a=e.orientation==="horizontal",o=zy(()=>c("SCROLL_END"),100),[l,c]=kQ("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 v.useEffect(()=>{if(l==="idle"){const u=window.setTimeout(()=>c("HIDE"),s.scrollHideDelay);return()=>window.clearTimeout(u)}},[l,s.scrollHideDelay,c]),v.useEffect(()=>{const u=s.viewport,d=a?"scrollLeft":"scrollTop";if(u){let f=u[d];const h=()=>{const p=u[d];f!==p&&(c("SCROLL"),o()),f=p};return u.addEventListener("scroll",h),()=>u.removeEventListener("scroll",h)}},[s.viewport,a,c,o]),i.jsx(lr,{present:n||l!=="hidden",children:i.jsx(FN,{"data-state":l==="hidden"?"hidden":"visible",...r,ref:t,onPointerEnter:Ee(e.onPointerEnter,()=>c("POINTER_ENTER")),onPointerLeave:Ee(e.onPointerLeave,()=>c("POINTER_LEAVE"))})})}),e3=v.forwardRef((e,t)=>{const n=Os(La,e.__scopeScrollArea),{forceMount:r,...s}=e,[a,o]=v.useState(!1),l=e.orientation==="horizontal",c=zy(()=>{if(n.viewport){const u=n.viewport.offsetWidth{const{orientation:n="vertical",...r}=e,s=Os(La,e.__scopeScrollArea),a=v.useRef(null),o=v.useRef(0),[l,c]=v.useState({content:0,viewport:0,scrollbar:{size:0,paddingStart:0,paddingEnd:0}}),u=a3(l.viewport,l.content),d={...r,sizes:l,onSizesChange:c,hasThumb:u>0&&u<1,onThumbChange:h=>a.current=h,onThumbPointerUp:()=>o.current=0,onThumbPointerDown:h=>o.current=h};function f(h,p){return BQ(h,o.current,l,p)}return n==="horizontal"?i.jsx(IQ,{...d,ref:t,onThumbPositionChange:()=>{if(s.viewport&&a.current){const h=s.viewport.scrollLeft,p=CC(h,l,s.dir);a.current.style.transform=`translate3d(${p}px, 0, 0)`}},onWheelScroll:h=>{s.viewport&&(s.viewport.scrollLeft=h)},onDragScroll:h=>{s.viewport&&(s.viewport.scrollLeft=f(h,s.dir))}}):n==="vertical"?i.jsx(RQ,{...d,ref:t,onThumbPositionChange:()=>{if(s.viewport&&a.current){const h=s.viewport.scrollTop,p=CC(h,l);a.current.style.transform=`translate3d(0, ${p}px, 0)`}},onWheelScroll:h=>{s.viewport&&(s.viewport.scrollTop=h)},onDragScroll:h=>{s.viewport&&(s.viewport.scrollTop=f(h))}}):null}),IQ=v.forwardRef((e,t)=>{const{sizes:n,onSizesChange:r,...s}=e,a=Os(La,e.__scopeScrollArea),[o,l]=v.useState(),c=v.useRef(null),u=xt(t,c,a.onScrollbarXChange);return v.useEffect(()=>{c.current&&l(getComputedStyle(c.current))},[c]),i.jsx(n3,{"data-orientation":"horizontal",...s,ref:u,sizes:n,style:{bottom:0,left:a.dir==="rtl"?"var(--radix-scroll-area-corner-width)":0,right:a.dir==="ltr"?"var(--radix-scroll-area-corner-width)":0,"--radix-scroll-area-thumb-width":By(n)+"px",...e.style},onThumbPointerDown:d=>e.onThumbPointerDown(d.x),onDragScroll:d=>e.onDragScroll(d.x),onWheelScroll:(d,f)=>{if(a.viewport){const h=a.viewport.scrollLeft+d.deltaX;e.onWheelScroll(h),o3(h,f)&&d.preventDefault()}},onResize:()=>{c.current&&a.viewport&&o&&r({content:a.viewport.scrollWidth,viewport:a.viewport.offsetWidth,scrollbar:{size:c.current.clientWidth,paddingStart:Bg(o.paddingLeft),paddingEnd:Bg(o.paddingRight)}})}})}),RQ=v.forwardRef((e,t)=>{const{sizes:n,onSizesChange:r,...s}=e,a=Os(La,e.__scopeScrollArea),[o,l]=v.useState(),c=v.useRef(null),u=xt(t,c,a.onScrollbarYChange);return v.useEffect(()=>{c.current&&l(getComputedStyle(c.current))},[c]),i.jsx(n3,{"data-orientation":"vertical",...s,ref:u,sizes:n,style:{top:0,right:a.dir==="ltr"?0:void 0,left:a.dir==="rtl"?0:void 0,bottom:"var(--radix-scroll-area-corner-height)","--radix-scroll-area-thumb-height":By(n)+"px",...e.style},onThumbPointerDown:d=>e.onThumbPointerDown(d.y),onDragScroll:d=>e.onDragScroll(d.y),onWheelScroll:(d,f)=>{if(a.viewport){const h=a.viewport.scrollTop+d.deltaY;e.onWheelScroll(h),o3(h,f)&&d.preventDefault()}},onResize:()=>{c.current&&a.viewport&&o&&r({content:a.viewport.scrollHeight,viewport:a.viewport.offsetHeight,scrollbar:{size:c.current.clientHeight,paddingStart:Bg(o.paddingTop),paddingEnd:Bg(o.paddingBottom)}})}})}),[DQ,t3]=YL(La),n3=v.forwardRef((e,t)=>{const{__scopeScrollArea:n,sizes:r,hasThumb:s,onThumbChange:a,onThumbPointerUp:o,onThumbPointerDown:l,onThumbPositionChange:c,onDragScroll:u,onWheelScroll:d,onResize:f,...h}=e,p=Os(La,n),[g,m]=v.useState(null),y=xt(t,k=>m(k)),b=v.useRef(null),x=v.useRef(""),w=p.viewport,j=r.content-r.viewport,S=Hn(d),N=Hn(c),_=zy(f,10);function P(k){if(b.current){const O=k.clientX-b.current.left,M=k.clientY-b.current.top;u({x:O,y:M})}}return v.useEffect(()=>{const k=O=>{const M=O.target;(g==null?void 0:g.contains(M))&&S(O,j)};return document.addEventListener("wheel",k,{passive:!1}),()=>document.removeEventListener("wheel",k,{passive:!1})},[w,g,j,S]),v.useEffect(N,[r,N]),hu(g,_),hu(p.content,_),i.jsx(DQ,{scope:n,scrollbar:g,hasThumb:s,onThumbChange:Hn(a),onThumbPointerUp:Hn(o),onThumbPositionChange:N,onThumbPointerDown:Hn(l),children:i.jsx(Ye.div,{...h,ref:y,style:{position:"absolute",...h.style},onPointerDown:Ee(e.onPointerDown,k=>{k.button===0&&(k.target.setPointerCapture(k.pointerId),b.current=g.getBoundingClientRect(),x.current=document.body.style.webkitUserSelect,document.body.style.webkitUserSelect="none",p.viewport&&(p.viewport.style.scrollBehavior="auto"),P(k))}),onPointerMove:Ee(e.onPointerMove,P),onPointerUp:Ee(e.onPointerUp,k=>{const O=k.target;O.hasPointerCapture(k.pointerId)&&O.releasePointerCapture(k.pointerId),document.body.style.webkitUserSelect=x.current,p.viewport&&(p.viewport.style.scrollBehavior=""),b.current=null})})})}),Fg="ScrollAreaThumb",r3=v.forwardRef((e,t)=>{const{forceMount:n,...r}=e,s=t3(Fg,e.__scopeScrollArea);return i.jsx(lr,{present:n||s.hasThumb,children:i.jsx(LQ,{ref:t,...r})})}),LQ=v.forwardRef((e,t)=>{const{__scopeScrollArea:n,style:r,...s}=e,a=Os(Fg,n),o=t3(Fg,n),{onThumbPositionChange:l}=o,c=xt(t,f=>o.onThumbChange(f)),u=v.useRef(),d=zy(()=>{u.current&&(u.current(),u.current=void 0)},100);return v.useEffect(()=>{const f=a.viewport;if(f){const h=()=>{if(d(),!u.current){const p=zQ(f,l);u.current=p,l()}};return l(),f.addEventListener("scroll",h),()=>f.removeEventListener("scroll",h)}},[a.viewport,d,l]),i.jsx(Ye.div,{"data-state":o.hasThumb?"visible":"hidden",...s,ref:c,style:{width:"var(--radix-scroll-area-thumb-width)",height:"var(--radix-scroll-area-thumb-height)",...r},onPointerDownCapture:Ee(e.onPointerDownCapture,f=>{const p=f.target.getBoundingClientRect(),g=f.clientX-p.left,m=f.clientY-p.top;o.onThumbPointerDown({x:g,y:m})}),onPointerUp:Ee(e.onPointerUp,o.onThumbPointerUp)})});r3.displayName=Fg;var BN="ScrollAreaCorner",s3=v.forwardRef((e,t)=>{const n=Os(BN,e.__scopeScrollArea),r=!!(n.scrollbarX&&n.scrollbarY);return n.type!=="scroll"&&r?i.jsx(FQ,{...e,ref:t}):null});s3.displayName=BN;var FQ=v.forwardRef((e,t)=>{const{__scopeScrollArea:n,...r}=e,s=Os(BN,n),[a,o]=v.useState(0),[l,c]=v.useState(0),u=!!(a&&l);return hu(s.scrollbarX,()=>{var f;const d=((f=s.scrollbarX)==null?void 0:f.offsetHeight)||0;s.onCornerHeightChange(d),c(d)}),hu(s.scrollbarY,()=>{var f;const d=((f=s.scrollbarY)==null?void 0:f.offsetWidth)||0;s.onCornerWidthChange(d),o(d)}),u?i.jsx(Ye.div,{...r,ref:t,style:{width:a,height:l,position:"absolute",right:s.dir==="ltr"?0:void 0,left:s.dir==="rtl"?0:void 0,bottom:0,...e.style}}):null});function Bg(e){return e?parseInt(e,10):0}function a3(e,t){const n=e/t;return isNaN(n)?0:n}function By(e){const t=a3(e.viewport,e.content),n=e.scrollbar.paddingStart+e.scrollbar.paddingEnd,r=(e.scrollbar.size-n)*t;return Math.max(r,18)}function BQ(e,t,n,r="ltr"){const s=By(n),a=s/2,o=t||a,l=s-o,c=n.scrollbar.paddingStart+o,u=n.scrollbar.size-n.scrollbar.paddingEnd-l,d=n.content-n.viewport,f=r==="ltr"?[0,d]:[d*-1,0];return i3([c,u],f)(e)}function CC(e,t,n="ltr"){const r=By(t),s=t.scrollbar.paddingStart+t.scrollbar.paddingEnd,a=t.scrollbar.size-s,o=t.content-t.viewport,l=a-r,c=n==="ltr"?[0,o]:[o*-1,0],u=sh(e,c);return i3([0,o],[0,l])(u)}function i3(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 o3(e,t){return e>0&&e{})=>{let n={left:e.scrollLeft,top:e.scrollTop},r=0;return function s(){const a={left:e.scrollLeft,top:e.scrollTop},o=n.left!==a.left,l=n.top!==a.top;(o||l)&&t(),n=a,r=window.requestAnimationFrame(s)}(),()=>window.cancelAnimationFrame(r)};function zy(e,t){const n=Hn(e),r=v.useRef(0);return v.useEffect(()=>()=>window.clearTimeout(r.current),[]),v.useCallback(()=>{window.clearTimeout(r.current),r.current=window.setTimeout(n,t)},[n,t])}function hu(e,t){const n=Hn(t);ir(()=>{let r=0;if(e){const s=new ResizeObserver(()=>{cancelAnimationFrame(r),r=window.requestAnimationFrame(n)});return s.observe(e),()=>{window.cancelAnimationFrame(r),s.unobserve(e)}}},[e,n])}function UQ(e,t){const{asChild:n,children:r}=e;if(!n)return typeof t=="function"?t(r):t;const s=v.Children.only(r);return v.cloneElement(s,{children:typeof t=="function"?t(s.props.children):t})}var l3=ZL,VQ=JL,WQ=s3;const Uy=v.forwardRef(({className:e,children:t,...n},r)=>i.jsxs(l3,{ref:r,className:Me("relative overflow-hidden",e),...n,children:[i.jsx(VQ,{className:"h-full w-full rounded-[inherit]",children:t}),i.jsx(c3,{}),i.jsx(WQ,{})]}));Uy.displayName=l3.displayName;const c3=v.forwardRef(({className:e,orientation:t="vertical",...n},r)=>i.jsx(LN,{ref:r,orientation:t,className:Me("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:i.jsx(r3,{className:"relative flex-1 rounded-full bg-border"})}));c3.displayName=LN.displayName;const HQ=({participants:e,isVisible:t,selectedIndex:n,onSelect:r,onClose:s,position:a})=>{const o=v.useRef(null);return v.useEffect(()=>{const l=c=>{o.current&&!o.current.contains(c.target)&&s()};if(t)return document.addEventListener("mousedown",l),()=>document.removeEventListener("mousedown",l)},[t,s]),v.useEffect(()=>{if(t&&n>=0&&o.current){const l=o.current.children[n];l&&l.scrollIntoView({block:"nearest",behavior:"smooth"})}},[n,t]),!t||e.length===0?null:i.jsxs("div",{ref:o,className:"absolute z-50 w-64 max-h-48 overflow-y-auto bg-white border border-slate-200 rounded-lg shadow-lg",style:{top:a.top,left:a.left},children:[e.map((l,c)=>{const u=l.id||l._id,d=c===n;return i.jsxs("div",{className:`flex items-center p-3 cursor-pointer transition-colors ${d?"bg-blue-50 border-l-4 border-blue-500":"hover:bg-slate-50"}`,onClick:()=>r(l),children:[i.jsx("img",{src:lp(l),alt:l.name,className:"h-8 w-8 rounded-full object-cover mr-3 flex-shrink-0"}),i.jsxs("div",{className:"flex-1 min-w-0",children:[i.jsx("p",{className:`font-medium truncate ${d?"text-blue-900":"text-slate-900"}`,children:l.name}),i.jsx("p",{className:`text-sm truncate ${d?"text-blue-600":"text-slate-500"}`,children:l.occupation})]})]},u)}),e.length===0&&i.jsx("div",{className:"p-3 text-center text-slate-500 text-sm",children:"No participants found"})]})};function Vw(e,t){const n=[],r=[],s=/@(\w+(?:\s+\w+)*)/g;let a;for(;(a=s.exec(e))!==null;){const o=a[1],l=a.index,c=a.index+a[0].length,u=t.find(d=>d.name.toLowerCase()===o.toLowerCase());if(u){const d=u.id||u._id;d&&(n.push({id:d,name:u.name,startIndex:l,endIndex:c}),r.includes(d)||r.push(d))}}return{text:e,mentions:n,mentionedParticipantIds:r}}function GQ(e,t){if(t.length===0)return[e];const n=[];let r=0;return[...t].sort((a,o)=>a.startIndex-o.startIndex).forEach((a,o)=>{a.startIndex>r&&n.push(e.slice(r,a.startIndex)),n.push(E.createElement("span",{key:`mention-${o}`,className:"text-blue-600 bg-blue-50 px-1 rounded font-medium"},`@${a.name}`)),r=a.endIndex}),r=0;n--){const r=e[n];if(r==="@"){if(n===0||/\s/.test(e[n-1]))return n}else if(/\s/.test(r))break}return null}function XQ(e,t,n){return e.slice(t+1,n).toLowerCase()}function YQ(e,t){return t?e.filter(n=>n.name.toLowerCase().includes(t)):e}const u3=v.forwardRef(({value:e,onChange:t,participants:n,placeholder:r="Ask a question or provide guidance...",className:s="",disabled:a=!1},o)=>{const[l,c]=v.useState(!1),[u,d]=v.useState(0),[f,h]=v.useState({top:0,left:0}),[p,g]=v.useState(null),[m,y]=v.useState([]),b=v.useRef(null),x=v.useRef(null);v.useEffect(()=>{o&&b.current&&(typeof o=="function"?o(b.current):o.current=b.current)},[o]);const w=()=>{if(b.current&&x.current&&p!==null){const P=b.current,k=x.current,O=document.createElement("div");O.style.position="absolute",O.style.visibility="hidden",O.style.whiteSpace="pre",O.style.font=window.getComputedStyle(P).font,O.textContent=e.slice(0,p),document.body.appendChild(O);const M=O.offsetWidth;document.body.removeChild(O);const A=k.getBoundingClientRect(),$=P.getBoundingClientRect();h({top:$.height+4,left:Math.min(M,A.width-280)})}},j=P=>{const k=P.target.value,O=P.target.selectionStart||0,M=KQ(k,O);if(M!==null&&n.length>0){const $=XQ(k,M,O),L=YQ(n,$);g(M),y(L),d(0),c(!0)}else c(!1),g(null);const A=Vw(k,n);t(k,A)},S=P=>{if(l&&m.length>0)switch(P.key){case"ArrowDown":P.preventDefault(),d(k=>kk>0?k-1:m.length-1);break;case"Enter":case"Tab":P.preventDefault(),m[u]&&N(m[u]);break;case"Escape":P.preventDefault(),c(!1);break}},N=P=>{if(p!==null&&b.current){const k=b.current.selectionStart||0,{newText:O,newCursorPosition:M}=qQ(e,k,P,p),A=Vw(O,n);t(O,A),setTimeout(()=>{b.current&&(b.current.focus(),b.current.setSelectionRange(M,M))},0),c(!1),g(null)}},_=()=>{c(!1),g(null)};return v.useEffect(()=>{l&&p!==null&&w()},[l,p,e]),i.jsxs("div",{ref:x,className:`relative ${s}`,children:[i.jsx("input",{ref:b,type:"text",value:e,onChange:j,onKeyDown:S,placeholder:r,disabled:a,className:"flex h-10 w-full rounded-md border border-slate-200 bg-white px-3 py-2 text-sm ring-offset-white file:border-0 file:bg-transparent file:text-sm file:font-medium placeholder:text-slate-500 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-slate-950 focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50"}),i.jsx(HQ,{participants:m,isVisible:l,selectedIndex:u,onSelect:N,onClose:_,position:f})]})});u3.displayName="MentionInput";const ZQ=({message:e,persona:t,toggleHighlight:n,participants:r=[],focusGroupId:s})=>{const[a,o]=v.useState(!1),l=e.senderId==="moderator",c=e.senderId==="facilitator",u=Vw(e.text,r),d=GQ(e.text,u.mentions),h=(m=>{const y=[/titled\s+['"]([^'"]+\.(jpg|jpeg|png))['\"]/i,/asset\s+['"]([^'"]+\.(jpg|jpeg|png))['\"]/i,/image\s+['"]([^'"]+\.(jpg|jpeg|png))['\"]/i,/['"]([a-zA-Z0-9_\-]+\.(jpg|jpeg|png))['\"]/i,/(fg-[a-f0-9]+-[a-f0-9]{32}\.(jpg|jpeg|png))/i];for(const b of y){const x=m.match(b);if(x)return x[1]}return null})(e.text),p=(l||c)&&h&&s,g=()=>{n()};return i.jsxs("div",{id:`message-${e.id}`,className:Me("flex items-start p-3 rounded-lg transition-colors",e.highlighted?"bg-amber-50 border border-amber-200":"hover:bg-slate-50",l?"border-l-4 border-l-primary pl-4":"",c?"border-l-4 border-l-green-500 pl-4":""),onMouseEnter:()=>o(!0),onMouseLeave:()=>o(!1),"data-highlighted":e.highlighted?"true":"false",children:[i.jsx("div",{className:"flex-shrink-0 mr-3",children:l?i.jsx("div",{className:"bg-primary/10 p-2 rounded-full",children:i.jsx(fo,{className:"h-6 w-6 text-primary"})}):c?i.jsx("div",{className:"bg-green-100 p-2 rounded-full",children:i.jsx(fg,{className:"h-6 w-6 text-green-600"})}):t?i.jsx("div",{className:"bg-slate-100 p-2 rounded-full",children:i.jsx("img",{src:lp(t),alt:`${t.name} avatar`,className:"h-6 w-6 rounded-full object-cover"})}):i.jsx("div",{className:"bg-slate-100 p-2 rounded-full",children:i.jsx(pW,{className:"h-6 w-6 text-slate-600"})})}),i.jsxs("div",{className:"flex-1",children:[i.jsxs("div",{className:"flex items-center mb-1",children:[i.jsx("span",{className:"font-medium mr-2",children:l?"AI Moderator":c?"Human Facilitator":(t==null?void 0:t.name)||"Unknown"}),!l&&!c&&t&&i.jsx(Wn,{variant:"outline",className:"text-xs font-normal",children:t.occupation}),i.jsx("span",{className:"text-xs text-slate-500 ml-auto",children:e.timestamp.toLocaleTimeString([],{hour:"2-digit",minute:"2-digit"})})]}),i.jsx("p",{className:"text-slate-700",children:d}),p&&i.jsxs("div",{className:"mt-3 p-3 border rounded-lg bg-slate-50",children:[i.jsxs("div",{className:"flex items-center gap-2 mb-2",children:[i.jsx(_m,{className:"h-4 w-4 text-slate-600"}),i.jsx("span",{className:"text-sm font-medium text-slate-700",children:"Creative Asset"})]}),i.jsx("img",{src:St.getAssetUrl(s,h),alt:"Creative asset for review",className:"max-w-full h-auto rounded border shadow-sm",style:{maxHeight:"300px"},onError:m=>{var b;console.error("Failed to load creative asset:",St.getAssetUrl(s,h)),m.currentTarget.style.display="none";const y=document.createElement("div");y.className="text-xs text-slate-500 italic p-2 border rounded bg-slate-100",y.textContent=`Creative asset not found: ${h}`,(b=m.currentTarget.parentNode)==null||b.appendChild(y)}})]}),i.jsx("div",{className:Me("flex mt-2 space-x-2",!a&&!e.highlighted&&"hidden"),children:i.jsxs(te,{variant:"ghost",size:"sm",onClick:g,className:"h-8 px-2 text-xs",children:[i.jsx($W,{className:Me("h-3 w-3 mr-1",e.highlighted?"fill-amber-400 text-amber-400":"text-slate-400")}),e.highlighted?"Highlighted":"Highlight"]})})]})]})},QQ=({action:e})=>{switch(e){case"moderator_speak":return i.jsx($a,{className:"h-4 w-4 text-blue-500"});case"participant_respond":return i.jsx(or,{className:"h-4 w-4 text-green-500"});case"participant_interaction":return i.jsx(or,{className:"h-4 w-4 text-purple-500"});case"probe_trigger":return i.jsx(lI,{className:"h-4 w-4 text-orange-500"});case"end_session":return i.jsx(RW,{className:"h-4 w-4 text-red-500"});default:return i.jsx(kl,{className:"h-4 w-4 text-gray-500"})}},JQ=({status:e})=>{switch(e){case"success":return i.jsx($S,{className:"h-3 w-3 text-green-500"});case"error":return i.jsx(mW,{className:"h-3 w-3 text-red-500"});case"pending":return i.jsx(Uf,{className:"h-3 w-3 text-yellow-500 animate-pulse"});default:return null}},eJ=({action:e})=>({moderator_speak:"Moderator",participant_respond:"Participant Response",participant_interaction:"Participant Interaction",probe_trigger:"Probe Question",end_session:"End Session"})[e]||e,tJ=e=>{try{return new Date(e).toLocaleTimeString([],{hour:"2-digit",minute:"2-digit",second:"2-digit"})}catch{return e}},nJ=({entry:e,isLatest:t})=>{const[n,r]=v.useState(t);return i.jsx(rt,{className:`mb-2 ${t?"ring-2 ring-blue-200 bg-blue-50/50":""}`,children:i.jsxs(cp,{open:n,onOpenChange:r,children:[i.jsx(up,{asChild:!0,children:i.jsx(Dr,{className:"pb-2 cursor-pointer hover:bg-gray-50/50 transition-colors",children:i.jsxs("div",{className:"flex items-center justify-between",children:[i.jsxs("div",{className:"flex items-center gap-2",children:[i.jsx(QQ,{action:e.action}),i.jsxs("div",{className:"flex flex-col",children:[i.jsxs("div",{className:"flex items-center gap-2",children:[i.jsx("span",{className:"font-medium text-sm",children:i.jsx(eJ,{action:e.action})}),i.jsx(JQ,{status:e.execution_status})]}),i.jsx("span",{className:"text-xs text-gray-500",children:tJ(e.timestamp)})]})]}),i.jsxs("div",{className:"flex items-center gap-2",children:[t&&i.jsx(Wn,{variant:"secondary",className:"text-xs",children:"Latest"}),n?i.jsx(Tl,{className:"h-4 w-4 text-gray-400"}):i.jsx(yi,{className:"h-4 w-4 text-gray-400"})]})]})})}),i.jsx(dp,{children:i.jsx(bt,{className:"pt-0",children:i.jsxs("div",{className:"space-y-2",children:[i.jsxs("div",{children:[i.jsx("h4",{className:"text-sm font-medium text-gray-700 mb-1",children:"AI Reasoning:"}),i.jsxs("p",{className:"text-sm text-gray-600 bg-gray-50 p-2 rounded italic",children:['"',e.reasoning,'"']})]}),e.details&&Object.keys(e.details).length>0&&i.jsxs("div",{children:[i.jsx("h4",{className:"text-sm font-medium text-gray-700 mb-1",children:"Details:"}),i.jsx("div",{className:"text-xs text-gray-600 bg-gray-50 p-2 rounded font-mono",children:JSON.stringify(e.details,null,2)})]}),e.execution_result&&i.jsxs("div",{children:[i.jsx("h4",{className:"text-sm font-medium text-gray-700 mb-1",children:"Execution Result:"}),i.jsx("div",{className:"text-xs text-gray-600 bg-gray-50 p-2 rounded",children:e.execution_result.error?i.jsxs("span",{className:"text-red-600",children:["Error: ",e.execution_result.error]}):i.jsx("span",{className:"text-green-600",children:e.execution_result.message||"Success"})})]})]})})})]})})},rJ=({reasoningHistory:e,isVisible:t,onToggle:n,isAiMode:r=!1})=>{const[s,a]=v.useState(!0);return v.useEffect(()=>{if(s&&e.length>0){const o=document.getElementById("reasoning-panel-content");o&&(o.scrollTop=0)}},[e.length,s]),i.jsx("div",{className:"border-t border-gray-200 bg-white",children:i.jsxs(cp,{open:t,onOpenChange:n,children:[i.jsx(up,{asChild:!0,children:i.jsxs("div",{className:"flex items-center justify-between p-3 cursor-pointer hover:bg-gray-50 transition-colors",children:[i.jsxs("div",{className:"flex items-center gap-2",children:[i.jsx(kl,{className:"h-4 w-4 text-purple-600"}),i.jsx("span",{className:"font-medium text-sm",children:r?"AI Decision Reasoning":"AI Moderator Logic"}),r&&e.length>0&&i.jsx(Wn,{variant:"outline",className:"text-xs",children:e.length}),!r&&i.jsx(Wn,{variant:"secondary",className:"text-xs",children:"Manual Mode"})]}),t?i.jsx(Tl,{className:"h-4 w-4 text-gray-400"}):i.jsx(yi,{className:"h-4 w-4 text-gray-400"})]})}),i.jsx(dp,{children:i.jsx("div",{className:"border-t border-gray-100",children:r?e.length===0?i.jsxs("div",{className:"p-4 text-center text-gray-500",children:[i.jsx(kl,{className:"h-8 w-8 mx-auto mb-2 text-gray-300"}),i.jsx("p",{className:"text-sm",children:"No AI decisions yet"}),i.jsx("p",{className:"text-xs text-gray-400",children:"Reasoning will appear here when the AI makes decisions"})]}):i.jsx(Uy,{id:"reasoning-panel-content",className:"h-[25vh] p-3",children:i.jsx("div",{className:"space-y-2",children:e.map((o,l)=>i.jsx(nJ,{entry:o,isLatest:l===0},`${o.timestamp}-${l}`))})}):i.jsxs("div",{className:"p-4 text-center text-gray-500",children:[i.jsx(LS,{className:"h-8 w-8 mx-auto mb-2 text-gray-400"}),i.jsx("p",{className:"text-sm font-medium text-gray-700",children:"Manual Moderation Mode"}),i.jsx("p",{className:"text-xs text-gray-500 mt-1",children:"You are currently moderating the discussion manually."}),i.jsx("p",{className:"text-xs text-gray-500 mt-2",children:"Switch to AI Mode to see automated reasoning and decisions."})]})})})]})})},sJ=({modeEvent:e})=>{const t=s=>s.toLocaleTimeString([],{hour:"2-digit",minute:"2-digit"}),n=s=>{switch(s){case"ai_mode_started":return"AI Mode Started";case"manual_mode_started":return"Manual Moderation Enabled";case"ai_session_concluded":return"AI Discussion Concluded";default:return"Mode Changed"}},r=s=>{switch(s){case"ai_mode_started":return"text-blue-600";case"manual_mode_started":return"text-slate-600";case"ai_session_concluded":return"text-green-600";default:return"text-gray-600"}};return i.jsxs("div",{className:"flex items-center my-6 px-4",children:[i.jsx("div",{className:"flex-1 border-t border-gray-200"}),i.jsx("div",{className:`mx-4 px-3 py-1 bg-white border border-gray-200 rounded-full ${r(e.event_type)}`,children:i.jsxs("div",{className:"flex items-center space-x-2 text-xs font-medium",children:[i.jsx("span",{children:n(e.event_type)}),i.jsx("span",{className:"text-gray-400",children:"at"}),i.jsx("span",{children:t(e.timestamp)})]})}),i.jsx("div",{className:"flex-1 border-t border-gray-200"})]})},aJ=({messages:e,modeEvents:t,personas:n,isSpeaking:r,focusGroupId:s,isAiModeActive:a=!1,selectedParticipantIds:o,onToggleHighlight:l,onAdvanceDiscussion:c,onNewMessage:u,onStatusChange:d,isEditingDiscussionGuide:f=!1})=>{const[h,p]=v.useState(""),[g,m]=v.useState(null),[y,b]=v.useState(!1),[x,w]=v.useState(null),j=v.useRef(null),[S,N]=v.useState(-1),[_,P]=v.useState(!1),k=v.useRef(0),O=v.useRef(null),M=v.useRef(1e4),A=v.useRef(null),[$,L]=v.useState(!1),[H,D]=v.useState(!1),[V,T]=v.useState(!1),[F,q]=v.useState(null),Z=F!==null?F:a,[re,ge]=v.useState([]),[B,le]=v.useState(!1),se=B;v.useEffect(()=>{a&&s&&ce()},[a,s]);const ce=async()=>{if(s)try{a&&De()}catch(z){console.error("Error checking autonomous status:",z)}},De=async()=>{if(s)try{const z=await jn.getReasoningHistory(s);ge(z.data.reasoning_history||[])}catch(z){console.error("Error fetching reasoning history:",z)}};v.useEffect(()=>{$&&ne()},[e,$]),v.useEffect(()=>{let z;return a&&s&&(z=setInterval(()=>{De(),ce()},5e3)),()=>{z&&clearInterval(z)}},[a,s]),v.useEffect(()=>{k.current=e.length},[]),v.useEffect(()=>{const z=e.length,ee=k.current;if(_&&z>ee){const me=Date.now(),Se=O.current;if(Se&&me-Se>=M.current)b(!1),P(!1),O.current=null;else if(Se){const Ie=M.current-(me-Se);setTimeout(()=>{b(!1),P(!1),O.current=null},Math.max(0,Ie))}else b(!1),P(!1)}k.current=z},[e.length,_]);const de=z=>n.find(ee=>ee.id===z||ee._id===z),be=o.length===0?e:e.filter(z=>z.senderId==="moderator"||z.senderId==="facilitator"||o.includes(z.senderId)),Pe=()=>{const z=[];return be.forEach(ee=>{z.push({type:"message",data:ee,timestamp:ee.timestamp})}),t.forEach(ee=>{z.push({type:"mode_event",data:ee,timestamp:ee.timestamp})}),z.sort((ee,me)=>ee.timestamp.getTime()-me.timestamp.getTime())},ne=()=>{if(!f&&A.current){const z=A.current.closest("[data-radix-scroll-area-viewport]");if(z){const ee=A.current.offsetTop-z.clientHeight+50,me=z.scrollTop,Se=ee-me,Ie=300;let we=null;const ze=gt=>{we||(we=gt);const jt=gt-we,Ge=Math.min(jt/Ie,1),Ze=1-Math.pow(1-Ge,3);z.scrollTop=me+Se*Ze,Ge<1&&window.requestAnimationFrame(ze)};window.requestAnimationFrame(ze)}else A.current.scrollIntoView({behavior:"smooth",block:"end"})}},Je=async z=>{var Ie,we;if(z.preventDefault(),!h.trim())return;let ee=h,me=null;const Se=g;p(""),m(null),b(!0),P(!0),O.current=Date.now();try{if(x){try{oe.info("Uploading creative asset...",{description:"Please wait while we upload your image."});const jt=new FormData;jt.append("assets",x);const Ge=await St.uploadAssets(s,jt);console.log("Upload response:",Ge==null?void 0:Ge.data);const Ze=Ge==null?void 0:Ge.data;Ze&&Ze.assets&&Ze.assets.length>0?(me=Ze.assets[0].filename,console.log("Successfully got filename from upload response:",me)):console.error("Invalid upload response structure:",Ze),me&&(ee=`Please review this creative asset titled '${me}'. ${h}`,oe.success("Creative asset uploaded successfully",{description:"The image has been attached to your message."}))}catch(jt){console.error("Error uploading file:",jt),console.error("Upload error details:",(Ie=jt.response)==null?void 0:Ie.data),oe.error("Failed to upload creative asset",{description:"Your message will be sent without the attachment."})}U()}const ze={id:`msg-${Date.now()}`,senderId:"facilitator",text:ee,timestamp:new Date,type:"question"},gt=await St.sendMessage(s,{text:ee,type:"question",senderId:"facilitator"});console.log("Message sent to API:",gt),(we=gt==null?void 0:gt.data)!=null&&we.message_id&&(ze.id=gt.data.message_id),u(ze),setTimeout(()=>{ne()},100),Se&&Se.mentionedParticipantIds.length>0&&setTimeout(()=>{X(Se.mentionedParticipantIds,ze.text)},500)}catch(ze){console.error("Error sending message:",ze),b(!1),P(!1),O.current=null;const gt={id:`msg-${Date.now()}`,senderId:"facilitator",text:h,timestamp:new Date,type:"question"};u(gt),setTimeout(()=>{ne()},100),oe.error("Failed to send message to server",{description:"Message will be shown locally but not saved."})}},ve=()=>{for(let z=e.length-1;z>=0;z--)if(e[z].senderId==="moderator"&&e[z].type==="question")return e[z].text;for(let z=e.length-1;z>=0;z--)if(e[z].senderId==="moderator")return e[z].text;return"What are your thoughts on this topic?"},at=(z,ee)=>{if(!z||!z.sections||!ee)return null;const{section_index:me,subsection_index:Se,item_index:Ie,item_type:we}=ee,ze=z.sections,gt=Ge=>{const Ze=[];return Ge.questions&&Ge.questions.forEach((kt,Vt)=>{Ze.push({...kt,type:"question",index:Vt})}),Ge.activities&&Ge.activities.forEach((kt,Vt)=>{Ze.push({...kt,type:"activity",index:Vt})}),Ze.sort((kt,Vt)=>kt.type!==Vt.type?kt.type==="question"?-1:1:kt.index-Vt.index)};if(me>=ze.length)return{completed:!0};const jt=ze[me];if(Se!==void 0&&jt.subsections){if(Se>=jt.subsections.length)return at(z,{section_index:me+1,subsection_index:void 0,item_index:0,item_type:"question"});const Ge=jt.subsections[Se],Ze=gt(Ge),kt=Ze.findIndex(Vt=>Vt.type===we&&Vt.index===Ie);if(kt0){const Ze=Ge.findIndex(kt=>kt.type===we&&kt.index===Ie);if(Ze0?at(z,{section_index:me,subsection_index:0,item_index:0,item_type:"question"}):at(z,{section_index:me+1,subsection_index:void 0,item_index:0,item_type:"question"})}},st=async()=>{var z,ee,me;if(s)try{b(!0),P(!0),O.current=Date.now(),oe.info("Advancing discussion...",{description:"Moving to the next question in the discussion guide."});const[Se,Ie]=await Promise.all([jn.getModeratorStatus(s),St.getById(s)]);if(!((z=Se==null?void 0:Se.data)!=null&&z.status)||!((ee=Ie==null?void 0:Ie.data)!=null&&ee.discussionGuide))throw new Error("Could not fetch moderator status or discussion guide");const we=Se.data.status,ze=Ie.data.discussionGuide;if(!ze.sections)throw new Error("Discussion guide does not have a structured format");const gt=at(ze,we.moderator_position);if(!gt)throw new Error("Could not determine next discussion item");if(gt.completed){oe.success("Discussion guide completed",{description:"All sections of the discussion guide have been covered."});const Ge={id:`msg-${Date.now()}`,senderId:"moderator",text:"We have covered all the questions in our discussion guide. Thank you all for your valuable insights and participation in this focus group session.",timestamp:new Date,type:"system"};u(Ge);return}await jn.setModeratorPosition(s,gt.sectionId,gt.itemId);const jt={id:`msg-${Date.now()}`,senderId:"moderator",text:gt.content,timestamp:new Date,type:"question"};try{const Ge=await St.sendMessage(s,{senderId:"moderator",text:jt.text,type:"question"});(me=Ge==null?void 0:Ge.data)!=null&&me.message_id&&(jt.id=Ge.data.message_id)}catch(Ge){console.warn("Failed to save message to API, showing locally:",Ge)}u(jt),setTimeout(()=>{ne()},100),oe.success("Discussion advanced",{description:`Moved to: ${gt.section.title}${gt.subsection?` > ${gt.subsection.title}`:""}`}),d&&setTimeout(()=>d(),500)}catch(Se){console.error("Error advancing discussion:",Se),oe.error("Failed to advance discussion",{description:Se.message||"There was a problem advancing to the next question."}),b(!1),P(!1),O.current=null}},Mt=async()=>{var z,ee,me,Se;if(s){console.log("Starting AI Mode: setting autonomousLoading to true"),T(!0);try{console.log("Starting AI Mode: calling API...");const we=await Promise.race([jn.startAutonomousConversation(s),new Promise((ze,gt)=>setTimeout(()=>gt(new Error("API call timeout after 30 seconds")),3e4))]);if(console.log("Starting AI Mode: API response received:",we),we.data.error){oe.error("Failed to start autonomous conversation",{description:we.data.error}),T(!1);return}oe.success("Autonomous conversation started",{description:"The AI is now managing the focus group conversation"}),q(!0);try{console.log("Starting AI Mode: calling onStatusChange..."),d&&(await d(),console.log("Starting AI Mode: onStatusChange completed successfully"))}catch(ze){console.error("Starting AI Mode: onStatusChange failed:",ze)}console.log("Starting AI Mode: resetting autonomousLoading to false"),T(!1),setTimeout(()=>{console.log("Starting AI Mode: clearing local AI mode state"),q(null)},1e3),De()}catch(Ie){console.error("Error starting autonomous conversation:",Ie),Ie.response&&Ie.response.data&&console.error("Backend error details:",Ie.response.data);const we=((ee=(z=Ie.response)==null?void 0:z.data)==null?void 0:ee.message)||((Se=(me=Ie.response)==null?void 0:me.data)==null?void 0:Se.error)||"Please check your connection and try again";oe.error("Failed to start autonomous conversation",{description:we}),T(!1)}}},C=async()=>{if(s){console.log("Stopping AI Mode: setting autonomousLoading to true"),T(!0);try{const z=await jn.stopAutonomousConversation(s,"manual_stop");if(z.data.error){oe.error("Failed to stop autonomous conversation",{description:z.data.error}),T(!1);return}ge([]),oe.success("Autonomous conversation stopped",{description:"You can now moderate the discussion manually"}),q(!1);try{console.log("Stopping AI Mode: calling onStatusChange..."),d&&(await d(),console.log("Stopping AI Mode: onStatusChange completed successfully"))}catch(ee){console.error("Stopping AI Mode: onStatusChange failed:",ee)}console.log("Stopping AI Mode: resetting autonomousLoading to false"),T(!1),setTimeout(()=>{console.log("Stopping AI Mode: clearing local AI mode state"),q(null)},1e3)}catch(z){console.error("Error stopping autonomous conversation:",z),oe.error("Failed to stop autonomous conversation"),T(!1)}}},R=z=>{var me;const ee=(me=z.target.files)==null?void 0:me[0];if(ee){if(!ee.type.startsWith("image/")){oe.error("Please select an image file",{description:"Only image files (JPG, PNG, etc.) are supported for creative review."});return}if(ee.size>10*1024*1024){oe.error("File too large",{description:"Please select an image smaller than 10MB."});return}w(ee),oe.success(`Image selected: ${ee.name}`,{description:"The image will be attached to your next message."})}},U=()=>{w(null),j.current&&(j.current.value="")},X=async(z,ee)=>{var me;if(!(!s||z.length===0))try{b(!0),P(!0),O.current=Date.now(),oe.info("Generating responses from mentioned participants...",{description:`Generating responses from ${z.length} mentioned participant(s).`});for(const Se of z){const Ie=n.find(we=>(we._id||we.id)===Se);if(!Ie){console.warn(`Mentioned participant ${Se} not found in focus group`);continue}try{const we=await jn.generateResponse(s,Se,ee||"Continue the conversation based on the latest moderator message.");if((me=we==null?void 0:we.data)!=null&&me.response){console.log("Generated response from mentioned participant:",we.data);const ze={id:we.data.message_id||`msg-${Date.now()}-${Se}`,senderId:Se,text:we.data.response,timestamp:new Date,type:"response"};u(ze),oe.success(`Response generated from ${Ie.name}`,{description:we.data.response.substring(0,100)+"..."})}}catch(we){console.error(`Error generating response from ${Ie.name}:`,we),oe.error(`Failed to generate response from ${Ie.name}`)}}}catch(Se){console.error("Error generating mentioned responses:",Se),oe.error("Failed to generate responses from mentioned participants"),b(!1),P(!1),O.current=null}},Q=async()=>{var z,ee,me,Se;if(s){if(n.length===0){oe.error("No participants available",{description:"Add participants to the focus group before generating responses."});return}try{b(!0),P(!0),O.current=Date.now(),oe.info("AI is selecting participant...",{description:"Analyzing the conversation to choose the best respondent."});const Ie=await jn.makeConversationDecision(s,.7,"manual");if(!Ie||!Ie.data||!Ie.data.decision)throw new Error("Empty decision response from AI");const we=Ie.data.decision;if(we.action==="participant_respond"){const ze=we.details.participant_id,gt=we.details.topic_context,jt=we.reasoning,Ge=n.find(kt=>(kt._id||kt.id)===ze);if(!Ge)throw new Error(`Selected participant ${ze} not found in focus group`);oe.info("Generating response...",{description:`AI selected ${Ge.name}: ${jt.substring(0,100)}${jt.length>100?"...":""}`});const Ze=await jn.generateResponse(s,ze,gt);if(!Ze||!Ze.data)throw new Error("Empty response from API");if((z=Ze==null?void 0:Ze.data)!=null&&z.message_id&&((ee=Ze==null?void 0:Ze.data)!=null&&ee.response)){const kt={id:Ze.data.message_id,senderId:ze,text:Ze.data.response,timestamp:new Date,type:"response",highlighted:!1};u(kt),setTimeout(()=>{ne()},100)}else throw new Error("Failed to generate or save AI response")}else{if(console.log("AI suggested different action:",we.action),we.action==="moderator_speak"){oe.info("AI suggests moderator intervention",{description:`AI reasoning: ${we.reasoning.substring(0,100)}${we.reasoning.length>100?"...":""}`});return}oe.warning("Using fallback participant selection",{description:`AI suggested "${we.action}" but generating participant response anyway.`});const ze=(S+1)%n.length,gt=n[ze],jt=ve(),Ge=gt._id||gt.id,Ze=await jn.generateResponse(s,Ge,jt);if((me=Ze==null?void 0:Ze.data)!=null&&me.message_id&&((Se=Ze==null?void 0:Ze.data)!=null&&Se.response)){const kt={id:Ze.data.message_id,senderId:Ge,text:Ze.data.response,timestamp:new Date,type:"response",highlighted:!1};u(kt),setTimeout(()=>{ne()},100),N(ze)}}}catch(Ie){console.error("Error generating AI response:",Ie),oe.error("Failed to generate AI response",{description:"There was a problem connecting to the server."}),b(!1),P(!1),O.current=null}}};return i.jsxs("div",{className:"glass-panel rounded-xl p-4 flex flex-col h-full",children:[i.jsx("div",{className:"flex-1 min-h-0 mb-4",children:i.jsxs(Uy,{className:"h-full pr-4",children:[i.jsxs("div",{className:"space-y-4",children:[Pe().map(z=>z.type==="message"?i.jsx(ZQ,{message:z.data,persona:z.data.senderId!=="moderator"&&z.data.senderId!=="facilitator"?de(z.data.senderId):null,toggleHighlight:()=>l(z.data.id),participants:n,focusGroupId:s},z.data.id):i.jsx(sJ,{modeEvent:z.data},z.data.id)),y&&i.jsxs("div",{className:"flex items-center space-x-2 text-sm text-slate-500 animate-pulse",children:[i.jsx("div",{className:"bg-primary/10 p-2 rounded-full",children:i.jsx(xa,{className:"h-4 w-4 text-primary"})}),i.jsx("span",{children:"Generating AI response..."})]}),i.jsx("div",{className:"h-8"}),i.jsx("div",{ref:A,className:"h-1"})]}),!$&&be.length>6&&i.jsx("div",{className:"sticky bottom-5 ml-auto mr-5 z-10 w-fit",children:i.jsx(te,{size:"sm",className:"rounded-full shadow-md h-10 w-10 p-0",onClick:ne,title:"Scroll to bottom",children:i.jsx(MA,{className:"h-4 w-4"})})})]})}),i.jsx(rJ,{reasoningHistory:re,isVisible:se,onToggle:()=>le(!B),isAiMode:a}),i.jsxs("div",{className:"pt-4 border-t border-slate-200 w-full",children:[x&&i.jsxs("div",{className:"mb-2 p-2 bg-blue-50 border border-blue-200 rounded-md flex items-center justify-between",children:[i.jsxs("div",{className:"flex items-center gap-2",children:[i.jsx(FA,{className:"h-4 w-4 text-blue-600"}),i.jsx("span",{className:"text-sm text-blue-700",children:x.name}),i.jsxs("span",{className:"text-xs text-blue-500",children:["(",(x.size/1024/1024).toFixed(1)," MB)"]})]}),i.jsx(te,{type:"button",variant:"ghost",size:"sm",onClick:U,className:"h-6 w-6 p-0 text-blue-600 hover:text-blue-800",children:"×"})]}),i.jsxs("form",{onSubmit:Je,className:"flex items-center gap-2 w-full",children:[i.jsx("input",{ref:j,type:"file",accept:"image/*",onChange:R,className:"hidden"}),i.jsx(u3,{value:h,onChange:(z,ee)=>{p(z),m(ee||null)},participants:n,placeholder:"Ask a question or provide guidance...",className:"flex-1 min-w-0",disabled:!1}),i.jsx(te,{type:"button",variant:"outline",size:"sm",onClick:()=>{var z;return(z=j.current)==null?void 0:z.click()},className:"hover-transition shrink-0 px-3",disabled:!1,title:"Attach image for creative review",children:i.jsx(FA,{className:"h-4 w-4"})}),i.jsxs(te,{type:"submit",variant:"default",className:"hover-transition shrink-0",disabled:!1,children:[i.jsx($a,{className:"mr-2 h-4 w-4"}),"Send"]})]}),i.jsxs("div",{className:"flex justify-between items-center mt-3",children:[i.jsxs("div",{className:"flex items-center space-x-2",children:[i.jsx("p",{className:"text-sm text-slate-500",children:r?"Speaking...":a?"AI mode active":"Manual moderation mode"}),i.jsx(te,{variant:"outline",size:"sm",onClick:Z?C:Mt,disabled:V,className:`hover-transition ${Z?"bg-red-50 text-red-600 hover:bg-red-100":"bg-blue-50 text-blue-600 hover:bg-blue-100"}`,title:Z?"Stop AI mode and return to manual":"Start autonomous AI conversation",children:V?i.jsxs(i.Fragment,{children:[i.jsx(fo,{className:"mr-1 h-3 w-3 animate-spin"}),a?"Stopping...":"Starting..."]}):Z?i.jsxs(i.Fragment,{children:[i.jsx(fo,{className:"mr-1 h-3 w-3"}),"Stop AI Mode"]}):i.jsxs(i.Fragment,{children:[i.jsx(fo,{className:"mr-1 h-3 w-3"}),"Start AI Mode"]})}),i.jsxs(te,{variant:"outline",size:"sm",onClick:()=>{L(!$),$||ne()},className:`hover-transition ${$?"bg-blue-50 text-blue-600 hover:bg-blue-100":""}`,title:$?"Disable auto-scroll":"Enable auto-scroll",children:[i.jsx(MA,{className:`h-3 w-3 ${$?"mr-1":""}`}),$&&"Auto-scroll"]})]}),i.jsxs("div",{className:"flex items-center gap-2",children:[!a&&i.jsxs(i.Fragment,{children:[i.jsxs(te,{variant:"outline",onClick:st,className:`hover-transition ${n.length===0?"bg-red-50":""}`,disabled:y,title:n.length===0?"Add participants to the focus group first":"Advance to the next part of the discussion guide",children:[i.jsx($a,{className:"mr-2 h-4 w-4"}),n.length===0?"No Participants":"Advance Discussion"]}),i.jsxs(te,{variant:"ghost",size:"sm",onClick:Q,className:`hover-transition ${n.length===0?"bg-red-50":""}`,disabled:y||n.length===0,title:"Generate a participant response to the current topic",children:[i.jsx(xa,{className:"mr-1 h-3 w-3"}),"Get Response"]})]}),a&&i.jsxs("div",{className:"flex items-center gap-2",children:[i.jsxs("div",{className:"flex items-center gap-1 text-sm text-slate-600",children:[i.jsx("div",{className:"w-2 h-2 bg-green-500 rounded-full animate-pulse"}),i.jsx("span",{children:"AI Active"})]}),i.jsx(te,{variant:"outline",size:"sm",onClick:()=>D(!H),className:"hover-transition",title:"Show autonomous conversation controls",children:i.jsx(LS,{className:"h-3 w-3"})})]})]})]})]})]})},iJ=({themes:e,messages:t,personas:n=[],onThemeDelete:r,onQuoteClick:s})=>{const a=(d,f)=>{d.stopPropagation(),r&&(r(f),oe.success("Theme deleted successfully"))},o=d=>n.find(f=>f.id===d||f._id===d),l=d=>{let f=d;const h=d.match(/^\[MSG_ID:[^\]]+\]\s*(.*)$/);h&&(f=h[1]);const p=f.match(/^\[([^\]]+)\]:\s*(.*)$/);if(p)return{persona:p[1],text:p[2]};const g=f.match(/^([^:]+):\s*(.*)$/);return g&&g[1].trim()!==f.trim()?{persona:g[1].trim(),text:g[2]}:{persona:null,text:f}},c=e.filter(d=>"source"in d?d.source==="highlight":!0),u=e.filter(d=>"source"in d&&d.source==="generated");return i.jsxs("div",{className:"glass-panel rounded-xl p-6 h-[70vh] flex flex-col overflow-hidden",children:[i.jsxs("div",{className:"flex items-center mb-4",children:[i.jsx(Ml,{className:"h-5 w-5 text-primary mr-2"}),i.jsx("h2",{className:"font-sf text-xl font-semibold",children:"Key Themes"})]}),i.jsxs("div",{className:"overflow-auto",children:[u.length>0&&i.jsxs("div",{className:"mb-8",children:[i.jsxs("div",{className:"flex items-center mb-3",children:[i.jsx(kl,{className:"h-4 w-4 text-primary mr-2"}),i.jsx("h3",{className:"font-medium",children:"AI-Generated Themes"})]}),i.jsx("div",{className:"grid grid-cols-1 gap-4 mb-4",children:u.map(d=>i.jsxs(rt,{className:"hover:shadow-md transition-shadow relative group",children:[r&&i.jsx("button",{className:"absolute top-2 right-2 p-1 rounded-full bg-slate-200 opacity-0 group-hover:opacity-100 transition-opacity",onClick:f=>a(f,d.id),children:i.jsx(Zs,{className:"h-3 w-3 text-slate-700"})}),i.jsx(Dr,{className:"pb-2",children:i.jsx(ts,{className:"text-base",children:d.title})}),i.jsxs(bt,{children:[i.jsx("p",{className:"text-sm text-slate-600 mb-2",children:d.description}),d.quotes&&d.quotes.length>0&&i.jsxs("div",{className:"mt-3",children:[i.jsx("h4",{className:"text-xs font-medium text-slate-700 mb-2",children:"Supporting Quotes:"}),i.jsx("div",{className:"space-y-2",children:d.quotes.map((f,h)=>{const p=typeof f=="object"&&f!==null,g=p?f.text:f,m=p?f.speaker:l(f).persona,y=p?f.message_id:void 0,b=p?f.original:f;return i.jsxs("div",{className:"bg-slate-50 p-2 rounded text-xs text-slate-600 border-l-2 border-slate-200 cursor-pointer hover:bg-slate-100 transition-colors",onClick:x=>{x.stopPropagation(),s&&s(p?f:b,y)},title:y?`Message ID: ${y}`:"Click to find original message",children:[m&&i.jsxs("span",{className:"font-semibold text-slate-700 mr-1",children:[m,":"]}),'"',g,'"',y&&i.jsx("span",{className:"ml-2 text-xs text-green-600 opacity-70",children:"✓"})]},h)})})]})]})]},d.id))})]}),c.length>0&&i.jsxs("div",{children:[i.jsxs("div",{className:"flex items-center mb-3",children:[i.jsx(PW,{className:"h-4 w-4 text-primary mr-2"}),i.jsx("h3",{className:"font-medium",children:"Highlighted Comments"})]}),i.jsx("div",{className:"grid grid-cols-1 gap-4 mb-4",children:c.map(d=>{const f=d.messages.length>0?t.find(y=>y.id===d.messages[0]):null,h=(f==null?void 0:f.text)||d.text,p=h.length>200?h.substring(0,200)+"...":h,g=f==null?void 0:f.senderId;let m="";if(g==="moderator")m="AI Moderator";else if(g==="facilitator")m="Human Facilitator";else if(g){const y=o(g);m=(y==null?void 0:y.name)||"Unknown Participant"}return i.jsxs(rt,{className:"hover:shadow-md hover:bg-slate-50 transition-all cursor-pointer relative group",onClick:y=>{y.stopPropagation(),s&&f&&s(f.text,f.id)},title:"Click to view in discussion",children:[r&&i.jsx("button",{className:"absolute top-2 right-2 p-1 rounded-full bg-slate-200 opacity-0 group-hover:opacity-100 transition-opacity z-10",onClick:y=>a(y,d.id),children:i.jsx(Zs,{className:"h-3 w-3 text-slate-700"})}),i.jsx(Dr,{className:"pb-2",children:i.jsx(ts,{className:"text-sm font-medium text-slate-800 line-clamp-2",children:m&&i.jsx("span",{className:"text-primary font-semibold",children:m})})}),i.jsxs(bt,{className:"pt-0",children:[i.jsxs("p",{className:"text-sm text-slate-600 leading-relaxed",children:['"',p,'"']}),i.jsxs("div",{className:"mt-2 flex items-center text-xs text-slate-400",children:[i.jsx(xa,{className:"h-3 w-3 mr-1"}),"Click to view in discussion"]})]})]},d.id)})})]}),e.length===0&&i.jsxs("div",{className:"flex flex-col items-center justify-center p-8 text-center bg-slate-50 rounded-lg",children:[i.jsx(Ml,{className:"h-8 w-8 text-slate-400 mb-3"}),i.jsx("p",{className:"text-slate-600",children:"No themes have been identified yet."}),i.jsx("p",{className:"text-sm text-slate-500 mt-2",children:"Highlight important messages in the discussion or generate themes automatically."})]})]})]})},oJ=({themes:e,messages:t,personas:n,focusGroupId:r,onThemesGenerated:s,onThemeDelete:a,onQuoteClick:o,onGenerateKeyThemes:l})=>{const c=()=>{if(!e||e.length===0){oe.warning("No themes to export",{description:"Generate some themes first before exporting."});return}let u=`# Key Themes Analysis +`},nonce:a}),i.jsx(Ye.div,{"data-radix-scroll-area-viewport":"",...o,asChild:s,ref:u,style:{overflowX:l.scrollbarXEnabled?"scroll":"hidden",overflowY:l.scrollbarYEnabled?"scroll":"hidden",...e.style},children:KQ({asChild:s,children:r},d=>i.jsx("div",{"data-radix-scroll-area-content":"",ref:l.onContentChange,style:{minWidth:l.scrollbarXEnabled?"fit-content":void 0},children:d}))})]})});n3.displayName=t3;var Fa="ScrollAreaScrollbar",VN=v.forwardRef((e,t)=>{const{forceMount:n,...r}=e,s=ks(Fa,e.__scopeScrollArea),{onScrollbarXEnabledChange:a,onScrollbarYEnabledChange:o}=s,l=e.orientation==="horizontal";return v.useEffect(()=>(l?a(!0):o(!0),()=>{l?a(!1):o(!1)}),[l,a,o]),s.type==="hover"?i.jsx(FQ,{...r,ref:t,forceMount:n}):s.type==="scroll"?i.jsx(BQ,{...r,ref:t,forceMount:n}):s.type==="auto"?i.jsx(r3,{...r,ref:t,forceMount:n}):s.type==="always"?i.jsx(WN,{...r,ref:t}):null});VN.displayName=Fa;var FQ=v.forwardRef((e,t)=>{const{forceMount:n,...r}=e,s=ks(Fa,e.__scopeScrollArea),[a,o]=v.useState(!1);return v.useEffect(()=>{const l=s.scrollArea;let c=0;if(l){const u=()=>{window.clearTimeout(c),o(!0)},d=()=>{c=window.setTimeout(()=>o(!1),s.scrollHideDelay)};return l.addEventListener("pointerenter",u),l.addEventListener("pointerleave",d),()=>{window.clearTimeout(c),l.removeEventListener("pointerenter",u),l.removeEventListener("pointerleave",d)}}},[s.scrollArea,s.scrollHideDelay]),i.jsx(lr,{present:n||a,children:i.jsx(r3,{"data-state":a?"visible":"hidden",...r,ref:t})})}),BQ=v.forwardRef((e,t)=>{const{forceMount:n,...r}=e,s=ks(Fa,e.__scopeScrollArea),a=e.orientation==="horizontal",o=Wy(()=>c("SCROLL_END"),100),[l,c]=DQ("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 v.useEffect(()=>{if(l==="idle"){const u=window.setTimeout(()=>c("HIDE"),s.scrollHideDelay);return()=>window.clearTimeout(u)}},[l,s.scrollHideDelay,c]),v.useEffect(()=>{const u=s.viewport,d=a?"scrollLeft":"scrollTop";if(u){let f=u[d];const h=()=>{const p=u[d];f!==p&&(c("SCROLL"),o()),f=p};return u.addEventListener("scroll",h),()=>u.removeEventListener("scroll",h)}},[s.viewport,a,c,o]),i.jsx(lr,{present:n||l!=="hidden",children:i.jsx(WN,{"data-state":l==="hidden"?"hidden":"visible",...r,ref:t,onPointerEnter:Ee(e.onPointerEnter,()=>c("POINTER_ENTER")),onPointerLeave:Ee(e.onPointerLeave,()=>c("POINTER_LEAVE"))})})}),r3=v.forwardRef((e,t)=>{const n=ks(Fa,e.__scopeScrollArea),{forceMount:r,...s}=e,[a,o]=v.useState(!1),l=e.orientation==="horizontal",c=Wy(()=>{if(n.viewport){const u=n.viewport.offsetWidth{const{orientation:n="vertical",...r}=e,s=ks(Fa,e.__scopeScrollArea),a=v.useRef(null),o=v.useRef(0),[l,c]=v.useState({content:0,viewport:0,scrollbar:{size:0,paddingStart:0,paddingEnd:0}}),u=l3(l.viewport,l.content),d={...r,sizes:l,onSizesChange:c,hasThumb:u>0&&u<1,onThumbChange:h=>a.current=h,onThumbPointerUp:()=>o.current=0,onThumbPointerDown:h=>o.current=h};function f(h,p){return HQ(h,o.current,l,p)}return n==="horizontal"?i.jsx(zQ,{...d,ref:t,onThumbPositionChange:()=>{if(s.viewport&&a.current){const h=s.viewport.scrollLeft,p=$C(h,l,s.dir);a.current.style.transform=`translate3d(${p}px, 0, 0)`}},onWheelScroll:h=>{s.viewport&&(s.viewport.scrollLeft=h)},onDragScroll:h=>{s.viewport&&(s.viewport.scrollLeft=f(h,s.dir))}}):n==="vertical"?i.jsx(UQ,{...d,ref:t,onThumbPositionChange:()=>{if(s.viewport&&a.current){const h=s.viewport.scrollTop,p=$C(h,l);a.current.style.transform=`translate3d(0, ${p}px, 0)`}},onWheelScroll:h=>{s.viewport&&(s.viewport.scrollTop=h)},onDragScroll:h=>{s.viewport&&(s.viewport.scrollTop=f(h))}}):null}),zQ=v.forwardRef((e,t)=>{const{sizes:n,onSizesChange:r,...s}=e,a=ks(Fa,e.__scopeScrollArea),[o,l]=v.useState(),c=v.useRef(null),u=xt(t,c,a.onScrollbarXChange);return v.useEffect(()=>{c.current&&l(getComputedStyle(c.current))},[c]),i.jsx(a3,{"data-orientation":"horizontal",...s,ref:u,sizes:n,style:{bottom:0,left:a.dir==="rtl"?"var(--radix-scroll-area-corner-width)":0,right:a.dir==="ltr"?"var(--radix-scroll-area-corner-width)":0,"--radix-scroll-area-thumb-width":Vy(n)+"px",...e.style},onThumbPointerDown:d=>e.onThumbPointerDown(d.x),onDragScroll:d=>e.onDragScroll(d.x),onWheelScroll:(d,f)=>{if(a.viewport){const h=a.viewport.scrollLeft+d.deltaX;e.onWheelScroll(h),u3(h,f)&&d.preventDefault()}},onResize:()=>{c.current&&a.viewport&&o&&r({content:a.viewport.scrollWidth,viewport:a.viewport.offsetWidth,scrollbar:{size:c.current.clientWidth,paddingStart:Ug(o.paddingLeft),paddingEnd:Ug(o.paddingRight)}})}})}),UQ=v.forwardRef((e,t)=>{const{sizes:n,onSizesChange:r,...s}=e,a=ks(Fa,e.__scopeScrollArea),[o,l]=v.useState(),c=v.useRef(null),u=xt(t,c,a.onScrollbarYChange);return v.useEffect(()=>{c.current&&l(getComputedStyle(c.current))},[c]),i.jsx(a3,{"data-orientation":"vertical",...s,ref:u,sizes:n,style:{top:0,right:a.dir==="ltr"?0:void 0,left:a.dir==="rtl"?0:void 0,bottom:"var(--radix-scroll-area-corner-height)","--radix-scroll-area-thumb-height":Vy(n)+"px",...e.style},onThumbPointerDown:d=>e.onThumbPointerDown(d.y),onDragScroll:d=>e.onDragScroll(d.y),onWheelScroll:(d,f)=>{if(a.viewport){const h=a.viewport.scrollTop+d.deltaY;e.onWheelScroll(h),u3(h,f)&&d.preventDefault()}},onResize:()=>{c.current&&a.viewport&&o&&r({content:a.viewport.scrollHeight,viewport:a.viewport.offsetHeight,scrollbar:{size:c.current.clientHeight,paddingStart:Ug(o.paddingTop),paddingEnd:Ug(o.paddingBottom)}})}})}),[VQ,s3]=JL(Fa),a3=v.forwardRef((e,t)=>{const{__scopeScrollArea:n,sizes:r,hasThumb:s,onThumbChange:a,onThumbPointerUp:o,onThumbPointerDown:l,onThumbPositionChange:c,onDragScroll:u,onWheelScroll:d,onResize:f,...h}=e,p=ks(Fa,n),[g,m]=v.useState(null),y=xt(t,k=>m(k)),b=v.useRef(null),x=v.useRef(""),w=p.viewport,j=r.content-r.viewport,S=Gn(d),N=Gn(c),_=Wy(f,10);function P(k){if(b.current){const O=k.clientX-b.current.left,M=k.clientY-b.current.top;u({x:O,y:M})}}return v.useEffect(()=>{const k=O=>{const M=O.target;(g==null?void 0:g.contains(M))&&S(O,j)};return document.addEventListener("wheel",k,{passive:!1}),()=>document.removeEventListener("wheel",k,{passive:!1})},[w,g,j,S]),v.useEffect(N,[r,N]),hu(g,_),hu(p.content,_),i.jsx(VQ,{scope:n,scrollbar:g,hasThumb:s,onThumbChange:Gn(a),onThumbPointerUp:Gn(o),onThumbPositionChange:N,onThumbPointerDown:Gn(l),children:i.jsx(Ye.div,{...h,ref:y,style:{position:"absolute",...h.style},onPointerDown:Ee(e.onPointerDown,k=>{k.button===0&&(k.target.setPointerCapture(k.pointerId),b.current=g.getBoundingClientRect(),x.current=document.body.style.webkitUserSelect,document.body.style.webkitUserSelect="none",p.viewport&&(p.viewport.style.scrollBehavior="auto"),P(k))}),onPointerMove:Ee(e.onPointerMove,P),onPointerUp:Ee(e.onPointerUp,k=>{const O=k.target;O.hasPointerCapture(k.pointerId)&&O.releasePointerCapture(k.pointerId),document.body.style.webkitUserSelect=x.current,p.viewport&&(p.viewport.style.scrollBehavior=""),b.current=null})})})}),zg="ScrollAreaThumb",i3=v.forwardRef((e,t)=>{const{forceMount:n,...r}=e,s=s3(zg,e.__scopeScrollArea);return i.jsx(lr,{present:n||s.hasThumb,children:i.jsx(WQ,{ref:t,...r})})}),WQ=v.forwardRef((e,t)=>{const{__scopeScrollArea:n,style:r,...s}=e,a=ks(zg,n),o=s3(zg,n),{onThumbPositionChange:l}=o,c=xt(t,f=>o.onThumbChange(f)),u=v.useRef(),d=Wy(()=>{u.current&&(u.current(),u.current=void 0)},100);return v.useEffect(()=>{const f=a.viewport;if(f){const h=()=>{if(d(),!u.current){const p=qQ(f,l);u.current=p,l()}};return l(),f.addEventListener("scroll",h),()=>f.removeEventListener("scroll",h)}},[a.viewport,d,l]),i.jsx(Ye.div,{"data-state":o.hasThumb?"visible":"hidden",...s,ref:c,style:{width:"var(--radix-scroll-area-thumb-width)",height:"var(--radix-scroll-area-thumb-height)",...r},onPointerDownCapture:Ee(e.onPointerDownCapture,f=>{const p=f.target.getBoundingClientRect(),g=f.clientX-p.left,m=f.clientY-p.top;o.onThumbPointerDown({x:g,y:m})}),onPointerUp:Ee(e.onPointerUp,o.onThumbPointerUp)})});i3.displayName=zg;var GN="ScrollAreaCorner",o3=v.forwardRef((e,t)=>{const n=ks(GN,e.__scopeScrollArea),r=!!(n.scrollbarX&&n.scrollbarY);return n.type!=="scroll"&&r?i.jsx(GQ,{...e,ref:t}):null});o3.displayName=GN;var GQ=v.forwardRef((e,t)=>{const{__scopeScrollArea:n,...r}=e,s=ks(GN,n),[a,o]=v.useState(0),[l,c]=v.useState(0),u=!!(a&&l);return hu(s.scrollbarX,()=>{var f;const d=((f=s.scrollbarX)==null?void 0:f.offsetHeight)||0;s.onCornerHeightChange(d),c(d)}),hu(s.scrollbarY,()=>{var f;const d=((f=s.scrollbarY)==null?void 0:f.offsetWidth)||0;s.onCornerWidthChange(d),o(d)}),u?i.jsx(Ye.div,{...r,ref:t,style:{width:a,height:l,position:"absolute",right:s.dir==="ltr"?0:void 0,left:s.dir==="rtl"?0:void 0,bottom:0,...e.style}}):null});function Ug(e){return e?parseInt(e,10):0}function l3(e,t){const n=e/t;return isNaN(n)?0:n}function Vy(e){const t=l3(e.viewport,e.content),n=e.scrollbar.paddingStart+e.scrollbar.paddingEnd,r=(e.scrollbar.size-n)*t;return Math.max(r,18)}function HQ(e,t,n,r="ltr"){const s=Vy(n),a=s/2,o=t||a,l=s-o,c=n.scrollbar.paddingStart+o,u=n.scrollbar.size-n.scrollbar.paddingEnd-l,d=n.content-n.viewport,f=r==="ltr"?[0,d]:[d*-1,0];return c3([c,u],f)(e)}function $C(e,t,n="ltr"){const r=Vy(t),s=t.scrollbar.paddingStart+t.scrollbar.paddingEnd,a=t.scrollbar.size-s,o=t.content-t.viewport,l=a-r,c=n==="ltr"?[0,o]:[o*-1,0],u=ah(e,c);return c3([0,o],[0,l])(u)}function c3(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 u3(e,t){return e>0&&e{})=>{let n={left:e.scrollLeft,top:e.scrollTop},r=0;return function s(){const a={left:e.scrollLeft,top:e.scrollTop},o=n.left!==a.left,l=n.top!==a.top;(o||l)&&t(),n=a,r=window.requestAnimationFrame(s)}(),()=>window.cancelAnimationFrame(r)};function Wy(e,t){const n=Gn(e),r=v.useRef(0);return v.useEffect(()=>()=>window.clearTimeout(r.current),[]),v.useCallback(()=>{window.clearTimeout(r.current),r.current=window.setTimeout(n,t)},[n,t])}function hu(e,t){const n=Gn(t);or(()=>{let r=0;if(e){const s=new ResizeObserver(()=>{cancelAnimationFrame(r),r=window.requestAnimationFrame(n)});return s.observe(e),()=>{window.cancelAnimationFrame(r),s.unobserve(e)}}},[e,n])}function KQ(e,t){const{asChild:n,children:r}=e;if(!n)return typeof t=="function"?t(r):t;const s=v.Children.only(r);return v.cloneElement(s,{children:typeof t=="function"?t(s.props.children):t})}var d3=e3,XQ=n3,YQ=o3;const Gy=v.forwardRef(({className:e,children:t,...n},r)=>i.jsxs(d3,{ref:r,className:Oe("relative overflow-hidden",e),...n,children:[i.jsx(XQ,{className:"h-full w-full rounded-[inherit]",children:t}),i.jsx(f3,{}),i.jsx(YQ,{})]}));Gy.displayName=d3.displayName;const f3=v.forwardRef(({className:e,orientation:t="vertical",...n},r)=>i.jsx(VN,{ref:r,orientation:t,className:Oe("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:i.jsx(i3,{className:"relative flex-1 rounded-full bg-border"})}));f3.displayName=VN.displayName;const ZQ=({participants:e,isVisible:t,selectedIndex:n,onSelect:r,onClose:s,position:a})=>{const o=v.useRef(null);return v.useEffect(()=>{const l=c=>{o.current&&!o.current.contains(c.target)&&s()};if(t)return document.addEventListener("mousedown",l),()=>document.removeEventListener("mousedown",l)},[t,s]),v.useEffect(()=>{if(t&&n>=0&&o.current){const l=o.current.children[n];l&&l.scrollIntoView({block:"nearest",behavior:"smooth"})}},[n,t]),!t||e.length===0?null:i.jsxs("div",{ref:o,className:"absolute z-50 w-64 max-h-48 overflow-y-auto bg-white border border-slate-200 rounded-lg shadow-lg",style:{top:a.top,left:a.left},children:[e.map((l,c)=>{const u=l.id||l._id,d=c===n;return i.jsxs("div",{className:`flex items-center p-3 cursor-pointer transition-colors ${d?"bg-blue-50 border-l-4 border-blue-500":"hover:bg-slate-50"}`,onClick:()=>r(l),children:[i.jsx("img",{src:cp(l),alt:l.name,className:"h-8 w-8 rounded-full object-cover mr-3 flex-shrink-0"}),i.jsxs("div",{className:"flex-1 min-w-0",children:[i.jsx("p",{className:`font-medium truncate ${d?"text-blue-900":"text-slate-900"}`,children:l.name}),i.jsx("p",{className:`text-sm truncate ${d?"text-blue-600":"text-slate-500"}`,children:l.occupation})]})]},u)}),e.length===0&&i.jsx("div",{className:"p-3 text-center text-slate-500 text-sm",children:"No participants found"})]})};function Gw(e,t){const n=[],r=[],s=/@(\w+(?:\s+\w+)*)/g;let a;for(;(a=s.exec(e))!==null;){const o=a[1],l=a.index,c=a.index+a[0].length,u=t.find(d=>d.name.toLowerCase()===o.toLowerCase());if(u){const d=u.id||u._id;d&&(n.push({id:d,name:u.name,startIndex:l,endIndex:c}),r.includes(d)||r.push(d))}}return{text:e,mentions:n,mentionedParticipantIds:r}}function QQ(e,t){if(t.length===0)return[e];const n=[];let r=0;return[...t].sort((a,o)=>a.startIndex-o.startIndex).forEach((a,o)=>{a.startIndex>r&&n.push(e.slice(r,a.startIndex)),n.push(E.createElement("span",{key:`mention-${o}`,className:"text-blue-600 bg-blue-50 px-1 rounded font-medium"},`@${a.name}`)),r=a.endIndex}),r=0;n--){const r=e[n];if(r==="@"){if(n===0||/\s/.test(e[n-1]))return n}else if(/\s/.test(r))break}return null}function tJ(e,t,n){return e.slice(t+1,n).toLowerCase()}function nJ(e,t){return t?e.filter(n=>n.name.toLowerCase().includes(t)):e}const h3=v.forwardRef(({value:e,onChange:t,participants:n,placeholder:r="Ask a question or provide guidance...",className:s="",disabled:a=!1},o)=>{const[l,c]=v.useState(!1),[u,d]=v.useState(0),[f,h]=v.useState({top:0,left:0}),[p,g]=v.useState(null),[m,y]=v.useState([]),b=v.useRef(null),x=v.useRef(null);v.useEffect(()=>{o&&b.current&&(typeof o=="function"?o(b.current):o.current=b.current)},[o]);const w=()=>{if(b.current&&x.current&&p!==null){const P=b.current,k=x.current,O=document.createElement("div");O.style.position="absolute",O.style.visibility="hidden",O.style.whiteSpace="pre",O.style.font=window.getComputedStyle(P).font,O.textContent=e.slice(0,p),document.body.appendChild(O);const M=O.offsetWidth;document.body.removeChild(O);const A=k.getBoundingClientRect(),$=P.getBoundingClientRect();h({top:$.height+4,left:Math.min(M,A.width-280)})}},j=P=>{const k=P.target.value,O=P.target.selectionStart||0,M=eJ(k,O);if(M!==null&&n.length>0){const $=tJ(k,M,O),L=nJ(n,$);g(M),y(L),d(0),c(!0)}else c(!1),g(null);const A=Gw(k,n);t(k,A)},S=P=>{if(l&&m.length>0)switch(P.key){case"ArrowDown":P.preventDefault(),d(k=>kk>0?k-1:m.length-1);break;case"Enter":case"Tab":P.preventDefault(),m[u]&&N(m[u]);break;case"Escape":P.preventDefault(),c(!1);break}},N=P=>{if(p!==null&&b.current){const k=b.current.selectionStart||0,{newText:O,newCursorPosition:M}=JQ(e,k,P,p),A=Gw(O,n);t(O,A),setTimeout(()=>{b.current&&(b.current.focus(),b.current.setSelectionRange(M,M))},0),c(!1),g(null)}},_=()=>{c(!1),g(null)};return v.useEffect(()=>{l&&p!==null&&w()},[l,p,e]),i.jsxs("div",{ref:x,className:`relative ${s}`,children:[i.jsx("input",{ref:b,type:"text",value:e,onChange:j,onKeyDown:S,placeholder:r,disabled:a,className:"flex h-10 w-full rounded-md border border-slate-200 bg-white px-3 py-2 text-sm ring-offset-white file:border-0 file:bg-transparent file:text-sm file:font-medium placeholder:text-slate-500 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-slate-950 focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50"}),i.jsx(ZQ,{participants:m,isVisible:l,selectedIndex:u,onSelect:N,onClose:_,position:f})]})});h3.displayName="MentionInput";const rJ=({message:e,persona:t,toggleHighlight:n,participants:r=[],focusGroupId:s})=>{const[a,o]=v.useState(!1),l=e.senderId==="moderator",c=e.senderId==="facilitator",u=Gw(e.text,r),d=QQ(e.text,u.mentions),h=(m=>{const y=[/titled\s+['"]([^'"]+\.(jpg|jpeg|png))['\"]/i,/asset\s+['"]([^'"]+\.(jpg|jpeg|png))['\"]/i,/image\s+['"]([^'"]+\.(jpg|jpeg|png))['\"]/i,/['"]([a-zA-Z0-9_\-]+\.(jpg|jpeg|png))['\"]/i,/(fg-[a-f0-9]+-[a-f0-9]{32}\.(jpg|jpeg|png))/i];for(const b of y){const x=m.match(b);if(x)return x[1]}return null})(e.text),p=(l||c)&&h&&s,g=()=>{n()};return i.jsxs("div",{id:`message-${e.id}`,className:Oe("flex items-start p-3 rounded-lg transition-colors",e.highlighted?"bg-amber-50 border border-amber-200":"hover:bg-slate-50",l?"border-l-4 border-l-primary pl-4":"",c?"border-l-4 border-l-green-500 pl-4":""),onMouseEnter:()=>o(!0),onMouseLeave:()=>o(!1),"data-highlighted":e.highlighted?"true":"false",children:[i.jsx("div",{className:"flex-shrink-0 mr-3",children:l?i.jsx("div",{className:"bg-primary/10 p-2 rounded-full",children:i.jsx(ni,{className:"h-6 w-6 text-primary"})}):c?i.jsx("div",{className:"bg-green-100 p-2 rounded-full",children:i.jsx(Vf,{className:"h-6 w-6 text-green-600"})}):t?i.jsx("div",{className:"bg-slate-100 p-2 rounded-full",children:i.jsx("img",{src:cp(t),alt:`${t.name} avatar`,className:"h-6 w-6 rounded-full object-cover"})}):i.jsx("div",{className:"bg-slate-100 p-2 rounded-full",children:i.jsx(bW,{className:"h-6 w-6 text-slate-600"})})}),i.jsxs("div",{className:"flex-1",children:[i.jsxs("div",{className:"flex items-center mb-1",children:[i.jsx("span",{className:"font-medium mr-2",children:l?"AI Moderator":c?"Human Facilitator":(t==null?void 0:t.name)||"Unknown"}),!l&&!c&&t&&i.jsx(Wn,{variant:"outline",className:"text-xs font-normal",children:t.occupation}),i.jsx("span",{className:"text-xs text-slate-500 ml-auto",children:e.timestamp.toLocaleTimeString([],{hour:"2-digit",minute:"2-digit"})})]}),i.jsx("p",{className:"text-slate-700",children:d}),p&&i.jsxs("div",{className:"mt-3 p-3 border rounded-lg bg-slate-50",children:[i.jsxs("div",{className:"flex items-center gap-2 mb-2",children:[i.jsx(Pm,{className:"h-4 w-4 text-slate-600"}),i.jsx("span",{className:"text-sm font-medium text-slate-700",children:"Creative Asset"})]}),i.jsx("img",{src:bt.getAssetUrl(s,h),alt:"Creative asset for review",className:"max-w-full h-auto rounded border shadow-sm",style:{maxHeight:"300px"},onError:m=>{var b;console.error("Failed to load creative asset:",bt.getAssetUrl(s,h)),m.currentTarget.style.display="none";const y=document.createElement("div");y.className="text-xs text-slate-500 italic p-2 border rounded bg-slate-100",y.textContent=`Creative asset not found: ${h}`,(b=m.currentTarget.parentNode)==null||b.appendChild(y)}})]}),i.jsx("div",{className:Oe("flex mt-2 space-x-2",!a&&!e.highlighted&&"hidden"),children:i.jsxs(te,{variant:"ghost",size:"sm",onClick:g,className:"h-8 px-2 text-xs",children:[i.jsx(FW,{className:Oe("h-3 w-3 mr-1",e.highlighted?"fill-amber-400 text-amber-400":"text-slate-400")}),e.highlighted?"Highlighted":"Highlight"]})})]})]})},sJ=({action:e})=>{switch(e){case"moderator_speak":return i.jsx(Ma,{className:"h-4 w-4 text-blue-500"});case"participant_respond":return i.jsx(tr,{className:"h-4 w-4 text-green-500"});case"participant_interaction":return i.jsx(tr,{className:"h-4 w-4 text-purple-500"});case"probe_trigger":return i.jsx(fI,{className:"h-4 w-4 text-orange-500"});case"end_session":return i.jsx(UW,{className:"h-4 w-4 text-red-500"});default:return i.jsx(kl,{className:"h-4 w-4 text-gray-500"})}},aJ=({status:e})=>{switch(e){case"success":return i.jsx(LS,{className:"h-3 w-3 text-green-500"});case"error":return i.jsx(wW,{className:"h-3 w-3 text-red-500"});case"pending":return i.jsx(Uf,{className:"h-3 w-3 text-yellow-500 animate-pulse"});default:return null}},iJ=({action:e})=>({moderator_speak:"Moderator",participant_respond:"Participant Response",participant_interaction:"Participant Interaction",probe_trigger:"Probe Question",end_session:"End Session"})[e]||e,oJ=e=>{try{return new Date(e).toLocaleTimeString([],{hour:"2-digit",minute:"2-digit",second:"2-digit"})}catch{return e}},lJ=({entry:e,isLatest:t})=>{const[n,r]=v.useState(t);return i.jsx(rt,{className:`mb-2 ${t?"ring-2 ring-blue-200 bg-blue-50/50":""}`,children:i.jsxs(up,{open:n,onOpenChange:r,children:[i.jsx(dp,{asChild:!0,children:i.jsx(Dr,{className:"pb-2 cursor-pointer hover:bg-gray-50/50 transition-colors",children:i.jsxs("div",{className:"flex items-center justify-between",children:[i.jsxs("div",{className:"flex items-center gap-2",children:[i.jsx(sJ,{action:e.action}),i.jsxs("div",{className:"flex flex-col",children:[i.jsxs("div",{className:"flex items-center gap-2",children:[i.jsx("span",{className:"font-medium text-sm",children:i.jsx(iJ,{action:e.action})}),i.jsx(aJ,{status:e.execution_status})]}),i.jsx("span",{className:"text-xs text-gray-500",children:oJ(e.timestamp)})]})]}),i.jsxs("div",{className:"flex items-center gap-2",children:[t&&i.jsx(Wn,{variant:"secondary",className:"text-xs",children:"Latest"}),n?i.jsx(Tl,{className:"h-4 w-4 text-gray-400"}):i.jsx(xi,{className:"h-4 w-4 text-gray-400"})]})]})})}),i.jsx(fp,{children:i.jsx(wt,{className:"pt-0",children:i.jsxs("div",{className:"space-y-2",children:[i.jsxs("div",{children:[i.jsx("h4",{className:"text-sm font-medium text-gray-700 mb-1",children:"AI Reasoning:"}),i.jsxs("p",{className:"text-sm text-gray-600 bg-gray-50 p-2 rounded italic",children:['"',e.reasoning,'"']})]}),e.details&&Object.keys(e.details).length>0&&i.jsxs("div",{children:[i.jsx("h4",{className:"text-sm font-medium text-gray-700 mb-1",children:"Details:"}),i.jsx("div",{className:"text-xs text-gray-600 bg-gray-50 p-2 rounded font-mono",children:JSON.stringify(e.details,null,2)})]}),e.execution_result&&i.jsxs("div",{children:[i.jsx("h4",{className:"text-sm font-medium text-gray-700 mb-1",children:"Execution Result:"}),i.jsx("div",{className:"text-xs text-gray-600 bg-gray-50 p-2 rounded",children:e.execution_result.error?i.jsxs("span",{className:"text-red-600",children:["Error: ",e.execution_result.error]}):i.jsx("span",{className:"text-green-600",children:e.execution_result.message||"Success"})})]})]})})})]})})},cJ=({reasoningHistory:e,isVisible:t,onToggle:n,isAiMode:r=!1})=>{const[s,a]=v.useState(!0);return v.useEffect(()=>{if(s&&e.length>0){const o=document.getElementById("reasoning-panel-content");o&&(o.scrollTop=0)}},[e.length,s]),i.jsx("div",{className:"border-t border-gray-200 bg-white",children:i.jsxs(up,{open:t,onOpenChange:n,children:[i.jsx(dp,{asChild:!0,children:i.jsxs("div",{className:"flex items-center justify-between p-3 cursor-pointer hover:bg-gray-50 transition-colors",children:[i.jsxs("div",{className:"flex items-center gap-2",children:[i.jsx(kl,{className:"h-4 w-4 text-purple-600"}),i.jsx("span",{className:"font-medium text-sm",children:r?"AI Decision Reasoning":"AI Moderator Logic"}),r&&e.length>0&&i.jsx(Wn,{variant:"outline",className:"text-xs",children:e.length}),!r&&i.jsx(Wn,{variant:"secondary",className:"text-xs",children:"Manual Mode"})]}),t?i.jsx(Tl,{className:"h-4 w-4 text-gray-400"}):i.jsx(xi,{className:"h-4 w-4 text-gray-400"})]})}),i.jsx(fp,{children:i.jsx("div",{className:"border-t border-gray-100",children:r?e.length===0?i.jsxs("div",{className:"p-4 text-center text-gray-500",children:[i.jsx(kl,{className:"h-8 w-8 mx-auto mb-2 text-gray-300"}),i.jsx("p",{className:"text-sm",children:"No AI decisions yet"}),i.jsx("p",{className:"text-xs text-gray-400",children:"Reasoning will appear here when the AI makes decisions"})]}):i.jsx(Gy,{id:"reasoning-panel-content",className:"h-[25vh] p-3",children:i.jsx("div",{className:"space-y-2",children:e.map((o,l)=>i.jsx(lJ,{entry:o,isLatest:l===0},`${o.timestamp}-${l}`))})}):i.jsxs("div",{className:"p-4 text-center text-gray-500",children:[i.jsx(VS,{className:"h-8 w-8 mx-auto mb-2 text-gray-400"}),i.jsx("p",{className:"text-sm font-medium text-gray-700",children:"Manual Moderation Mode"}),i.jsx("p",{className:"text-xs text-gray-500 mt-1",children:"You are currently moderating the discussion manually."}),i.jsx("p",{className:"text-xs text-gray-500 mt-2",children:"Switch to AI Mode to see automated reasoning and decisions."})]})})})]})})},uJ=({modeEvent:e})=>{const t=s=>s.toLocaleTimeString([],{hour:"2-digit",minute:"2-digit"}),n=s=>{switch(s){case"ai_mode_started":return"AI Mode Started";case"manual_mode_started":return"Manual Moderation Enabled";case"ai_session_concluded":return"AI Discussion Concluded";default:return"Mode Changed"}},r=s=>{switch(s){case"ai_mode_started":return"text-blue-600";case"manual_mode_started":return"text-slate-600";case"ai_session_concluded":return"text-green-600";default:return"text-gray-600"}};return i.jsxs("div",{className:"flex items-center my-6 px-4",children:[i.jsx("div",{className:"flex-1 border-t border-gray-200"}),i.jsx("div",{className:`mx-4 px-3 py-1 bg-white border border-gray-200 rounded-full ${r(e.event_type)}`,children:i.jsxs("div",{className:"flex items-center space-x-2 text-xs font-medium",children:[i.jsx("span",{children:n(e.event_type)}),i.jsx("span",{className:"text-gray-400",children:"at"}),i.jsx("span",{children:t(e.timestamp)})]})}),i.jsx("div",{className:"flex-1 border-t border-gray-200"})]})},dJ=({messages:e,modeEvents:t,personas:n,isSpeaking:r,focusGroupId:s,isAiModeActive:a=!1,selectedParticipantIds:o,onToggleHighlight:l,onAdvanceDiscussion:c,onNewMessage:u,onStatusChange:d,isEditingDiscussionGuide:f=!1})=>{const[h,p]=v.useState(""),[g,m]=v.useState(null),[y,b]=v.useState(!1),[x,w]=v.useState(null),j=v.useRef(null),[S,N]=v.useState(-1),[_,P]=v.useState(!1),k=v.useRef(0),O=v.useRef(null),M=v.useRef(1e4),A=v.useRef(null),[$,L]=v.useState(!1),[G,D]=v.useState(!1),[V,T]=v.useState(!1),[F,q]=v.useState(null),Z=F!==null?F:a,[re,ge]=v.useState([]),[B,le]=v.useState(!1),se=B;v.useEffect(()=>{a&&s&&ce()},[a,s]);const ce=async()=>{if(s)try{a&&De()}catch(z){console.error("Error checking autonomous status:",z)}},De=async()=>{if(s)try{const z=await jn.getReasoningHistory(s);ge(z.data.reasoning_history||[])}catch(z){console.error("Error fetching reasoning history:",z)}};v.useEffect(()=>{$&&ne()},[e,$]),v.useEffect(()=>{let z;return a&&s&&(z=setInterval(()=>{De(),ce()},5e3)),()=>{z&&clearInterval(z)}},[a,s]),v.useEffect(()=>{k.current=e.length},[]),v.useEffect(()=>{const z=e.length,ee=k.current;if(_&&z>ee){const me=Date.now(),Se=O.current;if(Se&&me-Se>=M.current)b(!1),P(!1),O.current=null;else if(Se){const Ie=M.current-(me-Se);setTimeout(()=>{b(!1),P(!1),O.current=null},Math.max(0,Ie))}else b(!1),P(!1)}k.current=z},[e.length,_]);const de=z=>n.find(ee=>ee.id===z||ee._id===z),be=o.length===0?e:e.filter(z=>z.senderId==="moderator"||z.senderId==="facilitator"||o.includes(z.senderId)),Pe=()=>{const z=[];return be.forEach(ee=>{z.push({type:"message",data:ee,timestamp:ee.timestamp})}),t.forEach(ee=>{z.push({type:"mode_event",data:ee,timestamp:ee.timestamp})}),z.sort((ee,me)=>ee.timestamp.getTime()-me.timestamp.getTime())},ne=()=>{if(!f&&A.current){const z=A.current.closest("[data-radix-scroll-area-viewport]");if(z){const ee=A.current.offsetTop-z.clientHeight+50,me=z.scrollTop,Se=ee-me,Ie=300;let we=null;const ze=gt=>{we||(we=gt);const St=gt-we,He=Math.min(St/Ie,1),Ze=1-Math.pow(1-He,3);z.scrollTop=me+Se*Ze,He<1&&window.requestAnimationFrame(ze)};window.requestAnimationFrame(ze)}else A.current.scrollIntoView({behavior:"smooth",block:"end"})}},Je=async z=>{var Ie,we;if(z.preventDefault(),!h.trim())return;let ee=h,me=null;const Se=g;p(""),m(null),b(!0),P(!0),O.current=Date.now();try{if(x){try{oe.info("Uploading creative asset...",{description:"Please wait while we upload your image."});const St=new FormData;St.append("assets",x);const He=await bt.uploadAssets(s,St);console.log("Upload response:",He==null?void 0:He.data);const Ze=He==null?void 0:He.data;Ze&&Ze.assets&&Ze.assets.length>0?(me=Ze.assets[0].filename,console.log("Successfully got filename from upload response:",me)):console.error("Invalid upload response structure:",Ze),me&&(ee=`Please review this creative asset titled '${me}'. ${h}`,oe.success("Creative asset uploaded successfully",{description:"The image has been attached to your message."}))}catch(St){console.error("Error uploading file:",St),console.error("Upload error details:",(Ie=St.response)==null?void 0:Ie.data),oe.error("Failed to upload creative asset",{description:"Your message will be sent without the attachment."})}U()}const ze={id:`msg-${Date.now()}`,senderId:"facilitator",text:ee,timestamp:new Date,type:"question"},gt=await bt.sendMessage(s,{text:ee,type:"question",senderId:"facilitator"});console.log("Message sent to API:",gt),(we=gt==null?void 0:gt.data)!=null&&we.message_id&&(ze.id=gt.data.message_id),u(ze),setTimeout(()=>{ne()},100),Se&&Se.mentionedParticipantIds.length>0&&setTimeout(()=>{X(Se.mentionedParticipantIds,ze.text)},500)}catch(ze){console.error("Error sending message:",ze),b(!1),P(!1),O.current=null;const gt={id:`msg-${Date.now()}`,senderId:"facilitator",text:h,timestamp:new Date,type:"question"};u(gt),setTimeout(()=>{ne()},100),oe.error("Failed to send message to server",{description:"Message will be shown locally but not saved."})}},ve=()=>{for(let z=e.length-1;z>=0;z--)if(e[z].senderId==="moderator"&&e[z].type==="question")return e[z].text;for(let z=e.length-1;z>=0;z--)if(e[z].senderId==="moderator")return e[z].text;return"What are your thoughts on this topic?"},at=(z,ee)=>{if(!z||!z.sections||!ee)return null;const{section_index:me,subsection_index:Se,item_index:Ie,item_type:we}=ee,ze=z.sections,gt=He=>{const Ze=[];return He.questions&&He.questions.forEach((kt,Vt)=>{Ze.push({...kt,type:"question",index:Vt})}),He.activities&&He.activities.forEach((kt,Vt)=>{Ze.push({...kt,type:"activity",index:Vt})}),Ze.sort((kt,Vt)=>kt.type!==Vt.type?kt.type==="question"?-1:1:kt.index-Vt.index)};if(me>=ze.length)return{completed:!0};const St=ze[me];if(Se!==void 0&&St.subsections){if(Se>=St.subsections.length)return at(z,{section_index:me+1,subsection_index:void 0,item_index:0,item_type:"question"});const He=St.subsections[Se],Ze=gt(He),kt=Ze.findIndex(Vt=>Vt.type===we&&Vt.index===Ie);if(kt0){const Ze=He.findIndex(kt=>kt.type===we&&kt.index===Ie);if(Ze0?at(z,{section_index:me,subsection_index:0,item_index:0,item_type:"question"}):at(z,{section_index:me+1,subsection_index:void 0,item_index:0,item_type:"question"})}},st=async()=>{var z,ee,me;if(s)try{b(!0),P(!0),O.current=Date.now(),oe.info("Advancing discussion...",{description:"Moving to the next question in the discussion guide."});const[Se,Ie]=await Promise.all([jn.getModeratorStatus(s),bt.getById(s)]);if(!((z=Se==null?void 0:Se.data)!=null&&z.status)||!((ee=Ie==null?void 0:Ie.data)!=null&&ee.discussionGuide))throw new Error("Could not fetch moderator status or discussion guide");const we=Se.data.status,ze=Ie.data.discussionGuide;if(!ze.sections)throw new Error("Discussion guide does not have a structured format");const gt=at(ze,we.moderator_position);if(!gt)throw new Error("Could not determine next discussion item");if(gt.completed){oe.success("Discussion guide completed",{description:"All sections of the discussion guide have been covered."});const He={id:`msg-${Date.now()}`,senderId:"moderator",text:"We have covered all the questions in our discussion guide. Thank you all for your valuable insights and participation in this focus group session.",timestamp:new Date,type:"system"};u(He);return}await jn.setModeratorPosition(s,gt.sectionId,gt.itemId);const St={id:`msg-${Date.now()}`,senderId:"moderator",text:gt.content,timestamp:new Date,type:"question"};try{const He=await bt.sendMessage(s,{senderId:"moderator",text:St.text,type:"question"});(me=He==null?void 0:He.data)!=null&&me.message_id&&(St.id=He.data.message_id)}catch(He){console.warn("Failed to save message to API, showing locally:",He)}u(St),setTimeout(()=>{ne()},100),oe.success("Discussion advanced",{description:`Moved to: ${gt.section.title}${gt.subsection?` > ${gt.subsection.title}`:""}`}),d&&setTimeout(()=>d(),500)}catch(Se){console.error("Error advancing discussion:",Se),oe.error("Failed to advance discussion",{description:Se.message||"There was a problem advancing to the next question."}),b(!1),P(!1),O.current=null}},Mt=async()=>{var z,ee,me,Se;if(s){console.log("Starting AI Mode: setting autonomousLoading to true"),T(!0);try{console.log("Starting AI Mode: calling API...");const we=await Promise.race([jn.startAutonomousConversation(s),new Promise((ze,gt)=>setTimeout(()=>gt(new Error("API call timeout after 30 seconds")),3e4))]);if(console.log("Starting AI Mode: API response received:",we),we.data.error){oe.error("Failed to start autonomous conversation",{description:we.data.error}),T(!1);return}oe.success("Autonomous conversation started",{description:"The AI is now managing the focus group conversation"}),q(!0);try{console.log("Starting AI Mode: calling onStatusChange..."),d&&(await d(),console.log("Starting AI Mode: onStatusChange completed successfully"))}catch(ze){console.error("Starting AI Mode: onStatusChange failed:",ze)}console.log("Starting AI Mode: resetting autonomousLoading to false"),T(!1),setTimeout(()=>{console.log("Starting AI Mode: clearing local AI mode state"),q(null)},1e3),De()}catch(Ie){console.error("Error starting autonomous conversation:",Ie),Ie.response&&Ie.response.data&&console.error("Backend error details:",Ie.response.data);const we=((ee=(z=Ie.response)==null?void 0:z.data)==null?void 0:ee.message)||((Se=(me=Ie.response)==null?void 0:me.data)==null?void 0:Se.error)||"Please check your connection and try again";oe.error("Failed to start autonomous conversation",{description:we}),T(!1)}}},C=async()=>{if(s){console.log("Stopping AI Mode: setting autonomousLoading to true"),T(!0);try{const z=await jn.stopAutonomousConversation(s,"manual_stop");if(z.data.error){oe.error("Failed to stop autonomous conversation",{description:z.data.error}),T(!1);return}ge([]),oe.success("Autonomous conversation stopped",{description:"You can now moderate the discussion manually"}),q(!1);try{console.log("Stopping AI Mode: calling onStatusChange..."),d&&(await d(),console.log("Stopping AI Mode: onStatusChange completed successfully"))}catch(ee){console.error("Stopping AI Mode: onStatusChange failed:",ee)}console.log("Stopping AI Mode: resetting autonomousLoading to false"),T(!1),setTimeout(()=>{console.log("Stopping AI Mode: clearing local AI mode state"),q(null)},1e3)}catch(z){console.error("Error stopping autonomous conversation:",z),oe.error("Failed to stop autonomous conversation"),T(!1)}}},R=z=>{var me;const ee=(me=z.target.files)==null?void 0:me[0];if(ee){if(!ee.type.startsWith("image/")){oe.error("Please select an image file",{description:"Only image files (JPG, PNG, etc.) are supported for creative review."});return}if(ee.size>10*1024*1024){oe.error("File too large",{description:"Please select an image smaller than 10MB."});return}w(ee),oe.success(`Image selected: ${ee.name}`,{description:"The image will be attached to your next message."})}},U=()=>{w(null),j.current&&(j.current.value="")},X=async(z,ee)=>{var me;if(!(!s||z.length===0))try{b(!0),P(!0),O.current=Date.now(),oe.info("Generating responses from mentioned participants...",{description:`Generating responses from ${z.length} mentioned participant(s).`});for(const Se of z){const Ie=n.find(we=>(we._id||we.id)===Se);if(!Ie){console.warn(`Mentioned participant ${Se} not found in focus group`);continue}try{const we=await jn.generateResponse(s,Se,ee||"Continue the conversation based on the latest moderator message.");if((me=we==null?void 0:we.data)!=null&&me.response){console.log("Generated response from mentioned participant:",we.data);const ze={id:we.data.message_id||`msg-${Date.now()}-${Se}`,senderId:Se,text:we.data.response,timestamp:new Date,type:"response"};u(ze),oe.success(`Response generated from ${Ie.name}`,{description:we.data.response.substring(0,100)+"..."})}}catch(we){console.error(`Error generating response from ${Ie.name}:`,we),oe.error(`Failed to generate response from ${Ie.name}`)}}}catch(Se){console.error("Error generating mentioned responses:",Se),oe.error("Failed to generate responses from mentioned participants"),b(!1),P(!1),O.current=null}},Q=async()=>{var z,ee,me,Se;if(s){if(n.length===0){oe.error("No participants available",{description:"Add participants to the focus group before generating responses."});return}try{b(!0),P(!0),O.current=Date.now(),oe.info("AI is selecting participant...",{description:"Analyzing the conversation to choose the best respondent."});const Ie=await jn.makeConversationDecision(s,.7,"manual");if(!Ie||!Ie.data||!Ie.data.decision)throw new Error("Empty decision response from AI");const we=Ie.data.decision;if(we.action==="participant_respond"){const ze=we.details.participant_id,gt=we.details.topic_context,St=we.reasoning,He=n.find(kt=>(kt._id||kt.id)===ze);if(!He)throw new Error(`Selected participant ${ze} not found in focus group`);oe.info("Generating response...",{description:`AI selected ${He.name}: ${St.substring(0,100)}${St.length>100?"...":""}`});const Ze=await jn.generateResponse(s,ze,gt);if(!Ze||!Ze.data)throw new Error("Empty response from API");if((z=Ze==null?void 0:Ze.data)!=null&&z.message_id&&((ee=Ze==null?void 0:Ze.data)!=null&&ee.response)){const kt={id:Ze.data.message_id,senderId:ze,text:Ze.data.response,timestamp:new Date,type:"response",highlighted:!1};u(kt),setTimeout(()=>{ne()},100)}else throw new Error("Failed to generate or save AI response")}else{if(console.log("AI suggested different action:",we.action),we.action==="moderator_speak"){oe.info("AI suggests moderator intervention",{description:`AI reasoning: ${we.reasoning.substring(0,100)}${we.reasoning.length>100?"...":""}`});return}oe.warning("Using fallback participant selection",{description:`AI suggested "${we.action}" but generating participant response anyway.`});const ze=(S+1)%n.length,gt=n[ze],St=ve(),He=gt._id||gt.id,Ze=await jn.generateResponse(s,He,St);if((me=Ze==null?void 0:Ze.data)!=null&&me.message_id&&((Se=Ze==null?void 0:Ze.data)!=null&&Se.response)){const kt={id:Ze.data.message_id,senderId:He,text:Ze.data.response,timestamp:new Date,type:"response",highlighted:!1};u(kt),setTimeout(()=>{ne()},100),N(ze)}}}catch(Ie){console.error("Error generating AI response:",Ie),oe.error("Failed to generate AI response",{description:"There was a problem connecting to the server."}),b(!1),P(!1),O.current=null}}};return i.jsxs("div",{className:"glass-panel rounded-xl p-4 flex flex-col h-full",children:[i.jsx("div",{className:"flex-1 min-h-0 mb-4",children:i.jsxs(Gy,{className:"h-full pr-4",children:[i.jsxs("div",{className:"space-y-4",children:[Pe().map(z=>z.type==="message"?i.jsx(rJ,{message:z.data,persona:z.data.senderId!=="moderator"&&z.data.senderId!=="facilitator"?de(z.data.senderId):null,toggleHighlight:()=>l(z.data.id),participants:n,focusGroupId:s},z.data.id):i.jsx(uJ,{modeEvent:z.data},z.data.id)),(y||a)&&i.jsxs("div",{className:"flex items-center space-x-2 text-sm text-slate-500 animate-pulse",children:[i.jsx("div",{className:"bg-primary/10 p-2 rounded-full",children:a?i.jsx(ni,{className:"h-4 w-4 text-primary animate-spin"}):i.jsx(xa,{className:"h-4 w-4 text-primary"})}),i.jsx("span",{children:a?"AI is generating next response...":"Generating AI response..."})]}),i.jsx("div",{className:"h-8"}),i.jsx("div",{ref:A,className:"h-1"})]}),!$&&be.length>6&&i.jsx("div",{className:"sticky bottom-5 ml-auto mr-5 z-10 w-fit",children:i.jsx(te,{size:"sm",className:"rounded-full shadow-md h-10 w-10 p-0",onClick:ne,title:"Scroll to bottom",children:i.jsx(FA,{className:"h-4 w-4"})})})]})}),i.jsx(cJ,{reasoningHistory:re,isVisible:se,onToggle:()=>le(!B),isAiMode:a}),i.jsxs("div",{className:"pt-4 border-t border-slate-200 w-full",children:[x&&i.jsxs("div",{className:"mb-2 p-2 bg-blue-50 border border-blue-200 rounded-md flex items-center justify-between",children:[i.jsxs("div",{className:"flex items-center gap-2",children:[i.jsx(WA,{className:"h-4 w-4 text-blue-600"}),i.jsx("span",{className:"text-sm text-blue-700",children:x.name}),i.jsxs("span",{className:"text-xs text-blue-500",children:["(",(x.size/1024/1024).toFixed(1)," MB)"]})]}),i.jsx(te,{type:"button",variant:"ghost",size:"sm",onClick:U,className:"h-6 w-6 p-0 text-blue-600 hover:text-blue-800",children:"×"})]}),i.jsxs("form",{onSubmit:Je,className:"flex items-center gap-2 w-full",children:[i.jsx("input",{ref:j,type:"file",accept:"image/*",onChange:R,className:"hidden"}),i.jsx(h3,{value:h,onChange:(z,ee)=>{p(z),m(ee||null)},participants:n,placeholder:"Ask a question or provide guidance...",className:"flex-1 min-w-0",disabled:!1}),i.jsx(te,{type:"button",variant:"outline",size:"sm",onClick:()=>{var z;return(z=j.current)==null?void 0:z.click()},className:"hover-transition shrink-0 px-3",disabled:!1,title:"Attach image for creative review",children:i.jsx(WA,{className:"h-4 w-4"})}),i.jsxs(te,{type:"submit",variant:"default",className:"hover-transition shrink-0",disabled:!1,children:[i.jsx(Ma,{className:"mr-2 h-4 w-4"}),"Send"]})]}),i.jsxs("div",{className:"flex justify-between items-center mt-3",children:[i.jsxs("div",{className:"flex items-center space-x-2",children:[i.jsx("p",{className:"text-sm text-slate-500",children:r?"Speaking...":a?"AI mode active":"Manual moderation mode"}),i.jsx(te,{variant:"outline",size:"sm",onClick:Z?C:Mt,disabled:V,className:`hover-transition ${Z?"bg-red-50 text-red-600 hover:bg-red-100":"bg-blue-50 text-blue-600 hover:bg-blue-100"}`,title:Z?"Stop AI mode and return to manual":"Start autonomous AI conversation",children:V?i.jsxs(i.Fragment,{children:[i.jsx(ni,{className:"mr-1 h-3 w-3 animate-spin"}),a?"Stopping...":"Starting..."]}):Z?i.jsxs(i.Fragment,{children:[i.jsx(ni,{className:"mr-1 h-3 w-3"}),"Stop AI Mode"]}):i.jsxs(i.Fragment,{children:[i.jsx(ni,{className:"mr-1 h-3 w-3"}),"Start AI Mode"]})}),i.jsxs(te,{variant:"outline",size:"sm",onClick:()=>{L(!$),$||ne()},className:`hover-transition ${$?"bg-blue-50 text-blue-600 hover:bg-blue-100":""}`,title:$?"Disable auto-scroll":"Enable auto-scroll",children:[i.jsx(FA,{className:`h-3 w-3 ${$?"mr-1":""}`}),$&&"Auto-scroll"]})]}),i.jsxs("div",{className:"flex items-center gap-2",children:[!a&&i.jsxs(i.Fragment,{children:[i.jsxs(te,{variant:"outline",onClick:st,className:`hover-transition ${n.length===0?"bg-red-50":""}`,disabled:y,title:n.length===0?"Add participants to the focus group first":"Advance to the next part of the discussion guide",children:[i.jsx(Ma,{className:"mr-2 h-4 w-4"}),n.length===0?"No Participants":"Advance Discussion"]}),i.jsxs(te,{variant:"ghost",size:"sm",onClick:Q,className:`hover-transition ${n.length===0?"bg-red-50":""}`,disabled:y||n.length===0,title:"Generate a participant response to the current topic",children:[i.jsx(xa,{className:"mr-1 h-3 w-3"}),"Get Response"]})]}),a&&i.jsxs("div",{className:"flex items-center gap-2",children:[i.jsxs("div",{className:"flex items-center gap-1 text-sm text-slate-600",children:[i.jsx("div",{className:"w-2 h-2 bg-green-500 rounded-full animate-pulse"}),i.jsx("span",{children:"AI Active"})]}),i.jsx(te,{variant:"outline",size:"sm",onClick:()=>D(!G),className:"hover-transition",title:"Show autonomous conversation controls",children:i.jsx(VS,{className:"h-3 w-3"})})]})]})]})]})]})},fJ=({themes:e,messages:t,personas:n=[],onThemeDelete:r,onQuoteClick:s})=>{const a=(d,f)=>{d.stopPropagation(),r&&(r(f),oe.success("Theme deleted successfully"))},o=d=>n.find(f=>f.id===d||f._id===d),l=d=>{let f=d;const h=d.match(/^\[MSG_ID:[^\]]+\]\s*(.*)$/);h&&(f=h[1]);const p=f.match(/^\[([^\]]+)\]:\s*(.*)$/);if(p)return{persona:p[1],text:p[2]};const g=f.match(/^([^:]+):\s*(.*)$/);return g&&g[1].trim()!==f.trim()?{persona:g[1].trim(),text:g[2]}:{persona:null,text:f}},c=e.filter(d=>"source"in d?d.source==="highlight":!0),u=e.filter(d=>"source"in d&&d.source==="generated");return i.jsxs("div",{className:"glass-panel rounded-xl p-6 h-[70vh] flex flex-col overflow-hidden",children:[i.jsxs("div",{className:"flex items-center mb-4",children:[i.jsx(Ml,{className:"h-5 w-5 text-primary mr-2"}),i.jsx("h2",{className:"font-sf text-xl font-semibold",children:"Key Themes"})]}),i.jsxs("div",{className:"overflow-auto",children:[u.length>0&&i.jsxs("div",{className:"mb-8",children:[i.jsxs("div",{className:"flex items-center mb-3",children:[i.jsx(kl,{className:"h-4 w-4 text-primary mr-2"}),i.jsx("h3",{className:"font-medium",children:"AI-Generated Themes"})]}),i.jsx("div",{className:"grid grid-cols-1 gap-4 mb-4",children:u.map(d=>i.jsxs(rt,{className:"hover:shadow-md transition-shadow relative group",children:[r&&i.jsx("button",{className:"absolute top-2 right-2 p-1 rounded-full bg-slate-200 opacity-0 group-hover:opacity-100 transition-opacity",onClick:f=>a(f,d.id),children:i.jsx(Zs,{className:"h-3 w-3 text-slate-700"})}),i.jsx(Dr,{className:"pb-2",children:i.jsx(ts,{className:"text-base",children:d.title})}),i.jsxs(wt,{children:[i.jsx("p",{className:"text-sm text-slate-600 mb-2",children:d.description}),d.quotes&&d.quotes.length>0&&i.jsxs("div",{className:"mt-3",children:[i.jsx("h4",{className:"text-xs font-medium text-slate-700 mb-2",children:"Supporting Quotes:"}),i.jsx("div",{className:"space-y-2",children:d.quotes.map((f,h)=>{const p=typeof f=="object"&&f!==null,g=p?f.text:f,m=p?f.speaker:l(f).persona,y=p?f.message_id:void 0,b=p?f.original:f;return i.jsxs("div",{className:"bg-slate-50 p-2 rounded text-xs text-slate-600 border-l-2 border-slate-200 cursor-pointer hover:bg-slate-100 transition-colors",onClick:x=>{x.stopPropagation(),s&&s(p?f:b,y)},title:y?`Message ID: ${y}`:"Click to find original message",children:[m&&i.jsxs("span",{className:"font-semibold text-slate-700 mr-1",children:[m,":"]}),'"',g,'"',y&&i.jsx("span",{className:"ml-2 text-xs text-green-600 opacity-70",children:"✓"})]},h)})})]})]})]},d.id))})]}),c.length>0&&i.jsxs("div",{children:[i.jsxs("div",{className:"flex items-center mb-3",children:[i.jsx(TW,{className:"h-4 w-4 text-primary mr-2"}),i.jsx("h3",{className:"font-medium",children:"Highlighted Comments"})]}),i.jsx("div",{className:"grid grid-cols-1 gap-4 mb-4",children:c.map(d=>{const f=d.messages.length>0?t.find(y=>y.id===d.messages[0]):null,h=(f==null?void 0:f.text)||d.text,p=h.length>200?h.substring(0,200)+"...":h,g=f==null?void 0:f.senderId;let m="";if(g==="moderator")m="AI Moderator";else if(g==="facilitator")m="Human Facilitator";else if(g){const y=o(g);m=(y==null?void 0:y.name)||"Unknown Participant"}return i.jsxs(rt,{className:"hover:shadow-md hover:bg-slate-50 transition-all cursor-pointer relative group",onClick:y=>{y.stopPropagation(),s&&f&&s(f.text,f.id)},title:"Click to view in discussion",children:[r&&i.jsx("button",{className:"absolute top-2 right-2 p-1 rounded-full bg-slate-200 opacity-0 group-hover:opacity-100 transition-opacity z-10",onClick:y=>a(y,d.id),children:i.jsx(Zs,{className:"h-3 w-3 text-slate-700"})}),i.jsx(Dr,{className:"pb-2",children:i.jsx(ts,{className:"text-sm font-medium text-slate-800 line-clamp-2",children:m&&i.jsx("span",{className:"text-primary font-semibold",children:m})})}),i.jsxs(wt,{className:"pt-0",children:[i.jsxs("p",{className:"text-sm text-slate-600 leading-relaxed",children:['"',p,'"']}),i.jsxs("div",{className:"mt-2 flex items-center text-xs text-slate-400",children:[i.jsx(xa,{className:"h-3 w-3 mr-1"}),"Click to view in discussion"]})]})]},d.id)})})]}),e.length===0&&i.jsxs("div",{className:"flex flex-col items-center justify-center p-8 text-center bg-slate-50 rounded-lg",children:[i.jsx(Ml,{className:"h-8 w-8 text-slate-400 mb-3"}),i.jsx("p",{className:"text-slate-600",children:"No themes have been identified yet."}),i.jsx("p",{className:"text-sm text-slate-500 mt-2",children:"Highlight important messages in the discussion or generate themes automatically."})]})]})]})},hJ=({themes:e,messages:t,personas:n,focusGroupId:r,onThemesGenerated:s,onThemeDelete:a,onQuoteClick:o,onGenerateKeyThemes:l})=>{const c=()=>{if(!e||e.length===0){oe.warning("No themes to export",{description:"Generate some themes first before exporting."});return}let u=`# Key Themes Analysis `;const d=e.filter(g=>"source"in g&&g.source==="generated");if(d.length===0){oe.warning("No AI-generated themes to export",{description:"Only AI-generated themes are included in the export."});return}d.forEach((g,m)=>{u+=`## ${m+1}. ${g.title} @@ -645,7 +645,7 @@ ${I.researchBrief} `})),u+=`--- -`});const f=new Blob([u],{type:"text/markdown"}),h=URL.createObjectURL(f),p=document.createElement("a");p.href=h,p.download=`key-themes-${new Date().toISOString().split("T")[0]}.md`,document.body.appendChild(p),p.click(),document.body.removeChild(p),URL.revokeObjectURL(h),oe.success("Themes exported successfully",{description:`Downloaded ${d.length} themes as markdown file.`})};return i.jsxs("div",{className:"flex flex-col h-full",children:[i.jsxs("div",{className:"mb-4 space-y-2",children:[i.jsxs(te,{onClick:l,className:"w-full",children:[i.jsx(DW,{className:"mr-2 h-4 w-4"}),"Analyze Discussion for Key Themes"]}),i.jsxs(te,{onClick:c,disabled:!e||e.length===0,variant:"outline",className:"w-full",children:[i.jsx($l,{className:"mr-2 h-4 w-4"}),"Export Themes"]})]}),i.jsx("div",{className:"flex-grow overflow-hidden",children:i.jsx(iJ,{themes:e,messages:t,personas:n,onThemeDelete:a,focusGroupId:r,onQuoteClick:o})})]})};var lJ=Array.isArray,Kr=lJ,cJ=typeof _p=="object"&&_p&&_p.Object===Object&&_p,d3=cJ,uJ=d3,dJ=typeof self=="object"&&self&&self.Object===Object&&self,fJ=uJ||dJ||Function("return this")(),Fa=fJ,hJ=Fa,pJ=hJ.Symbol,pp=pJ,EC=pp,f3=Object.prototype,mJ=f3.hasOwnProperty,gJ=f3.toString,Td=EC?EC.toStringTag:void 0;function vJ(e){var t=mJ.call(e,Td),n=e[Td];try{e[Td]=void 0;var r=!0}catch{}var s=gJ.call(e);return r&&(t?e[Td]=n:delete e[Td]),s}var yJ=vJ,xJ=Object.prototype,bJ=xJ.toString;function wJ(e){return bJ.call(e)}var jJ=wJ,OC=pp,SJ=yJ,NJ=jJ,_J="[object Null]",PJ="[object Undefined]",kC=OC?OC.toStringTag:void 0;function AJ(e){return e==null?e===void 0?PJ:_J:kC&&kC in Object(e)?SJ(e):NJ(e)}var Ci=AJ;function CJ(e){return e!=null&&typeof e=="object"}var Ei=CJ,EJ=Ci,OJ=Ei,kJ="[object Symbol]";function TJ(e){return typeof e=="symbol"||OJ(e)&&EJ(e)==kJ}var td=TJ,$J=Kr,MJ=td,IJ=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,RJ=/^\w*$/;function DJ(e,t){if($J(e))return!1;var n=typeof e;return n=="number"||n=="symbol"||n=="boolean"||e==null||MJ(e)?!0:RJ.test(e)||!IJ.test(e)||t!=null&&e in Object(t)}var zN=DJ;function LJ(e){var t=typeof e;return e!=null&&(t=="object"||t=="function")}var Bo=LJ;const nd=Gt(Bo);var FJ=Ci,BJ=Bo,zJ="[object AsyncFunction]",UJ="[object Function]",VJ="[object GeneratorFunction]",WJ="[object Proxy]";function HJ(e){if(!BJ(e))return!1;var t=FJ(e);return t==UJ||t==VJ||t==zJ||t==WJ}var UN=HJ;const ht=Gt(UN);var GJ=Fa,qJ=GJ["__core-js_shared__"],KJ=qJ,C0=KJ,TC=function(){var e=/[^.]+$/.exec(C0&&C0.keys&&C0.keys.IE_PROTO||"");return e?"Symbol(src)_1."+e:""}();function XJ(e){return!!TC&&TC in e}var YJ=XJ,ZJ=Function.prototype,QJ=ZJ.toString;function JJ(e){if(e!=null){try{return QJ.call(e)}catch{}try{return e+""}catch{}}return""}var h3=JJ,eee=UN,tee=YJ,nee=Bo,ree=h3,see=/[\\^$.*+?()[\]{}|]/g,aee=/^\[object .+?Constructor\]$/,iee=Function.prototype,oee=Object.prototype,lee=iee.toString,cee=oee.hasOwnProperty,uee=RegExp("^"+lee.call(cee).replace(see,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");function dee(e){if(!nee(e)||tee(e))return!1;var t=eee(e)?uee:aee;return t.test(ree(e))}var fee=dee;function hee(e,t){return e==null?void 0:e[t]}var pee=hee,mee=fee,gee=pee;function vee(e,t){var n=gee(e,t);return mee(n)?n:void 0}var Ql=vee,yee=Ql,xee=yee(Object,"create"),Vy=xee,$C=Vy;function bee(){this.__data__=$C?$C(null):{},this.size=0}var wee=bee;function jee(e){var t=this.has(e)&&delete this.__data__[e];return this.size-=t?1:0,t}var See=jee,Nee=Vy,_ee="__lodash_hash_undefined__",Pee=Object.prototype,Aee=Pee.hasOwnProperty;function Cee(e){var t=this.__data__;if(Nee){var n=t[e];return n===_ee?void 0:n}return Aee.call(t,e)?t[e]:void 0}var Eee=Cee,Oee=Vy,kee=Object.prototype,Tee=kee.hasOwnProperty;function $ee(e){var t=this.__data__;return Oee?t[e]!==void 0:Tee.call(t,e)}var Mee=$ee,Iee=Vy,Ree="__lodash_hash_undefined__";function Dee(e,t){var n=this.__data__;return this.size+=this.has(e)?0:1,n[e]=Iee&&t===void 0?Ree:t,this}var Lee=Dee,Fee=wee,Bee=See,zee=Eee,Uee=Mee,Vee=Lee;function rd(e){var t=-1,n=e==null?0:e.length;for(this.clear();++t-1}var ite=ate,ote=Wy;function lte(e,t){var n=this.__data__,r=ote(n,e);return r<0?(++this.size,n.push([e,t])):n[r][1]=t,this}var cte=lte,ute=Gee,dte=ete,fte=rte,hte=ite,pte=cte;function sd(e){var t=-1,n=e==null?0:e.length;for(this.clear();++t-1}var fte=dte,hte=qy;function pte(e,t){var n=this.__data__,r=hte(n,e);return r<0?(++this.size,n.push([e,t])):n[r][1]=t,this}var mte=pte,gte=Qee,vte=ite,yte=cte,xte=fte,bte=mte;function sd(e){var t=-1,n=e==null?0:e.length;for(this.clear();++t0?1:-1},ll=function(t){return mp(t)&&t.indexOf("%")===t.length-1},Ae=function(t){return Ine(t)&&!id(t)},qn=function(t){return Ae(t)||mp(t)},Fne=0,od=function(t){var n=++Fne;return"".concat(t||"").concat(n)},Cr=function(t,n){var r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:0,s=arguments.length>3&&arguments[3]!==void 0?arguments[3]:!1;if(!Ae(t)&&!mp(t))return r;var a;if(ll(t)){var o=t.indexOf("%");a=n*parseFloat(t.slice(0,o))/100}else a=+t;return id(a)&&(a=r),s&&a>n&&(a=n),a},Hi=function(t){if(!t)return null;var n=Object.keys(t);return n&&n.length?t[n[0]]:null},Bne=function(t){if(!Array.isArray(t))return!1;for(var n=t.length,r={},s=0;s=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(n[r]=e[r])}return n}function Gne(e,t){if(e==null)return{};var n={};for(var r in e)if(Object.prototype.hasOwnProperty.call(e,r)){if(t.indexOf(r)>=0)continue;n[r]=e[r]}return n}function Hw(e){"@babel/helpers - typeof";return Hw=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Hw(e)}var BC={click:"onClick",mousedown:"onMouseDown",mouseup:"onMouseUp",mouseover:"onMouseOver",mousemove:"onMouseMove",mouseout:"onMouseOut",mouseenter:"onMouseEnter",mouseleave:"onMouseLeave",touchcancel:"onTouchCancel",touchend:"onTouchEnd",touchmove:"onTouchMove",touchstart:"onTouchStart"},li=function(t){return typeof t=="string"?t:t?t.displayName||t.name||"Component":""},zC=null,O0=null,QN=function e(t){if(t===zC&&Array.isArray(O0))return O0;var n=[];return v.Children.forEach(t,function(r){Nt(r)||(j3.isFragment(r)?n=n.concat(e(r.props.children)):n.push(r))}),O0=n,zC=t,n};function Ps(e,t){var n=[],r=[];return Array.isArray(t)?r=t.map(function(s){return li(s)}):r=[li(t)],QN(e).forEach(function(s){var a=ls(s,"type.displayName")||ls(s,"type.name");r.indexOf(a)!==-1&&n.push(s)}),n}function es(e,t){var n=Ps(e,t);return n&&n[0]}var UC=function(t){if(!t||!t.props)return!1;var n=t.props,r=n.width,s=n.height;return!(!Ae(r)||r<=0||!Ae(s)||s<=0)},qne=["a","altGlyph","altGlyphDef","altGlyphItem","animate","animateColor","animateMotion","animateTransform","circle","clipPath","color-profile","cursor","defs","desc","ellipse","feBlend","feColormatrix","feComponentTransfer","feComposite","feConvolveMatrix","feDiffuseLighting","feDisplacementMap","feDistantLight","feFlood","feFuncA","feFuncB","feFuncG","feFuncR","feGaussianBlur","feImage","feMerge","feMergeNode","feMorphology","feOffset","fePointLight","feSpecularLighting","feSpotLight","feTile","feTurbulence","filter","font","font-face","font-face-format","font-face-name","font-face-url","foreignObject","g","glyph","glyphRef","hkern","image","line","lineGradient","marker","mask","metadata","missing-glyph","mpath","path","pattern","polygon","polyline","radialGradient","rect","script","set","stop","style","svg","switch","symbol","text","textPath","title","tref","tspan","use","view","vkern"],Kne=function(t){return t&&t.type&&mp(t.type)&&qne.indexOf(t.type)>=0},Xne=function(t){return t&&Hw(t)==="object"&&"clipDot"in t},Yne=function(t,n,r,s){var a,o=(a=E0==null?void 0:E0[s])!==null&&a!==void 0?a:[];return!ht(t)&&(s&&o.includes(n)||Une.includes(n))||r&&ZN.includes(n)},Xe=function(t,n,r){if(!t||typeof t=="function"||typeof t=="boolean")return null;var s=t;if(v.isValidElement(t)&&(s=t.props),!nd(s))return null;var a={};return Object.keys(s).forEach(function(o){var l;Yne((l=s)===null||l===void 0?void 0:l[o],o,n,r)&&(a[o]=s[o])}),a},Gw=function e(t,n){if(t===n)return!0;var r=v.Children.count(t);if(r!==v.Children.count(n))return!1;if(r===0)return!0;if(r===1)return VC(Array.isArray(t)?t[0]:t,Array.isArray(n)?n[0]:n);for(var s=0;s=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(n[r]=e[r])}return n}function tre(e,t){if(e==null)return{};var n={};for(var r in e)if(Object.prototype.hasOwnProperty.call(e,r)){if(t.indexOf(r)>=0)continue;n[r]=e[r]}return n}function Kw(e){var t=e.children,n=e.width,r=e.height,s=e.viewBox,a=e.className,o=e.style,l=e.title,c=e.desc,u=ere(e,Jne),d=s||{width:n,height:r,x:0,y:0},f=wt("recharts-surface",a);return E.createElement("svg",qw({},Xe(u,!0,"svg"),{className:f,width:n,height:r,style:o,viewBox:"".concat(d.x," ").concat(d.y," ").concat(d.width," ").concat(d.height)}),E.createElement("title",null,l),E.createElement("desc",null,c),t)}var nre=["children","className"];function Xw(){return Xw=Object.assign?Object.assign.bind():function(e){for(var t=1;t=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(n[r]=e[r])}return n}function sre(e,t){if(e==null)return{};var n={};for(var r in e)if(Object.prototype.hasOwnProperty.call(e,r)){if(t.indexOf(r)>=0)continue;n[r]=e[r]}return n}var Rt=E.forwardRef(function(e,t){var n=e.children,r=e.className,s=rre(e,nre),a=wt("recharts-layer",r);return E.createElement("g",Xw({className:a},Xe(s,!0),{ref:t}),n)}),Js=function(t,n){for(var r=arguments.length,s=new Array(r>2?r-2:0),a=2;as?0:s+t),n=n>s?s:n,n<0&&(n+=s),s=t>n?0:n-t>>>0,t>>>=0;for(var a=Array(s);++r=r?e:ore(e,t,n)}var cre=lre,ure="\\ud800-\\udfff",dre="\\u0300-\\u036f",fre="\\ufe20-\\ufe2f",hre="\\u20d0-\\u20ff",pre=dre+fre+hre,mre="\\ufe0e\\ufe0f",gre="\\u200d",vre=RegExp("["+gre+ure+pre+mre+"]");function yre(e){return vre.test(e)}var N3=yre;function xre(e){return e.split("")}var bre=xre,_3="\\ud800-\\udfff",wre="\\u0300-\\u036f",jre="\\ufe20-\\ufe2f",Sre="\\u20d0-\\u20ff",Nre=wre+jre+Sre,_re="\\ufe0e\\ufe0f",Pre="["+_3+"]",Yw="["+Nre+"]",Zw="\\ud83c[\\udffb-\\udfff]",Are="(?:"+Yw+"|"+Zw+")",P3="[^"+_3+"]",A3="(?:\\ud83c[\\udde6-\\uddff]){2}",C3="[\\ud800-\\udbff][\\udc00-\\udfff]",Cre="\\u200d",E3=Are+"?",O3="["+_re+"]?",Ere="(?:"+Cre+"(?:"+[P3,A3,C3].join("|")+")"+O3+E3+")*",Ore=O3+E3+Ere,kre="(?:"+[P3+Yw+"?",Yw,A3,C3,Pre].join("|")+")",Tre=RegExp(Zw+"(?="+Zw+")|"+kre+Ore,"g");function $re(e){return e.match(Tre)||[]}var Mre=$re,Ire=bre,Rre=N3,Dre=Mre;function Lre(e){return Rre(e)?Dre(e):Ire(e)}var Fre=Lre,Bre=cre,zre=N3,Ure=Fre,Vre=v3;function Wre(e){return function(t){t=Vre(t);var n=zre(t)?Ure(t):void 0,r=n?n[0]:t.charAt(0),s=n?Bre(n,1).join(""):t.slice(1);return r[e]()+s}}var Hre=Wre,Gre=Hre,qre=Gre("toUpperCase"),Kre=qre;const sx=Gt(Kre);function rn(e){return function(){return e}}const k3=Math.cos,Vg=Math.sin,ua=Math.sqrt,Wg=Math.PI,ax=2*Wg,Qw=Math.PI,Jw=2*Qw,Zo=1e-6,Xre=Jw-Zo;function T3(e){this._+=e[0];for(let t=1,n=e.length;t=0))throw new Error(`invalid digits: ${e}`);if(t>15)return T3;const n=10**t;return function(r){this._+=r[0];for(let s=1,a=r.length;sZo)if(!(Math.abs(f*c-u*d)>Zo)||!a)this._append`L${this._x1=t},${this._y1=n}`;else{let p=r-o,g=s-l,m=c*c+u*u,y=p*p+g*g,b=Math.sqrt(m),x=Math.sqrt(h),w=a*Math.tan((Qw-Math.acos((m+h-y)/(2*b*x)))/2),j=w/x,S=w/b;Math.abs(j-1)>Zo&&this._append`L${t+j*d},${n+j*f}`,this._append`A${a},${a},0,0,${+(f*p>d*g)},${this._x1=t+S*c},${this._y1=n+S*u}`}}arc(t,n,r,s,a,o){if(t=+t,n=+n,r=+r,o=!!o,r<0)throw new Error(`negative radius: ${r}`);let l=r*Math.cos(s),c=r*Math.sin(s),u=t+l,d=n+c,f=1^o,h=o?s-a:a-s;this._x1===null?this._append`M${u},${d}`:(Math.abs(this._x1-u)>Zo||Math.abs(this._y1-d)>Zo)&&this._append`L${u},${d}`,r&&(h<0&&(h=h%Jw+Jw),h>Xre?this._append`A${r},${r},0,1,${f},${t-l},${n-c}A${r},${r},0,1,${f},${this._x1=u},${this._y1=d}`:h>Zo&&this._append`A${r},${r},0,${+(h>=Qw)},${f},${this._x1=t+r*Math.cos(a)},${this._y1=n+r*Math.sin(a)}`)}rect(t,n,r,s){this._append`M${this._x0=this._x1=+t},${this._y0=this._y1=+n}h${r=+r}v${+s}h${-r}Z`}toString(){return this._}}function JN(e){let t=3;return e.digits=function(n){if(!arguments.length)return t;if(n==null)t=null;else{const r=Math.floor(n);if(!(r>=0))throw new RangeError(`invalid digits: ${n}`);t=r}return e},()=>new Zre(t)}function e_(e){return typeof e=="object"&&"length"in e?e:Array.from(e)}function $3(e){this._context=e}$3.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._point=0},lineEnd:function(){(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line=1-this._line},point:function(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1,this._line?this._context.lineTo(e,t):this._context.moveTo(e,t);break;case 1:this._point=2;default:this._context.lineTo(e,t);break}}};function ix(e){return new $3(e)}function M3(e){return e[0]}function I3(e){return e[1]}function R3(e,t){var n=rn(!0),r=null,s=ix,a=null,o=JN(l);e=typeof e=="function"?e:e===void 0?M3:rn(e),t=typeof t=="function"?t:t===void 0?I3:rn(t);function l(c){var u,d=(c=e_(c)).length,f,h=!1,p;for(r==null&&(a=s(p=o())),u=0;u<=d;++u)!(u=p;--g)l.point(w[g],j[g]);l.lineEnd(),l.areaEnd()}b&&(w[h]=+e(y,h,f),j[h]=+t(y,h,f),l.point(r?+r(y,h,f):w[h],n?+n(y,h,f):j[h]))}if(x)return l=null,x+""||null}function d(){return R3().defined(s).curve(o).context(a)}return u.x=function(f){return arguments.length?(e=typeof f=="function"?f:rn(+f),r=null,u):e},u.x0=function(f){return arguments.length?(e=typeof f=="function"?f:rn(+f),u):e},u.x1=function(f){return arguments.length?(r=f==null?null:typeof f=="function"?f:rn(+f),u):r},u.y=function(f){return arguments.length?(t=typeof f=="function"?f:rn(+f),n=null,u):t},u.y0=function(f){return arguments.length?(t=typeof f=="function"?f:rn(+f),u):t},u.y1=function(f){return arguments.length?(n=f==null?null:typeof f=="function"?f:rn(+f),u):n},u.lineX0=u.lineY0=function(){return d().x(e).y(t)},u.lineY1=function(){return d().x(e).y(n)},u.lineX1=function(){return d().x(r).y(t)},u.defined=function(f){return arguments.length?(s=typeof f=="function"?f:rn(!!f),u):s},u.curve=function(f){return arguments.length?(o=f,a!=null&&(l=o(a)),u):o},u.context=function(f){return arguments.length?(f==null?a=l=null:l=o(a=f),u):a},u}class D3{constructor(t,n){this._context=t,this._x=n}areaStart(){this._line=0}areaEnd(){this._line=NaN}lineStart(){this._point=0}lineEnd(){(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line=1-this._line}point(t,n){switch(t=+t,n=+n,this._point){case 0:{this._point=1,this._line?this._context.lineTo(t,n):this._context.moveTo(t,n);break}case 1:this._point=2;default:{this._x?this._context.bezierCurveTo(this._x0=(this._x0+t)/2,this._y0,this._x0,n,t,n):this._context.bezierCurveTo(this._x0,this._y0=(this._y0+n)/2,t,this._y0,t,n);break}}this._x0=t,this._y0=n}}function Qre(e){return new D3(e,!0)}function Jre(e){return new D3(e,!1)}const t_={draw(e,t){const n=ua(t/Wg);e.moveTo(n,0),e.arc(0,0,n,0,ax)}},ese={draw(e,t){const n=ua(t/5)/2;e.moveTo(-3*n,-n),e.lineTo(-n,-n),e.lineTo(-n,-3*n),e.lineTo(n,-3*n),e.lineTo(n,-n),e.lineTo(3*n,-n),e.lineTo(3*n,n),e.lineTo(n,n),e.lineTo(n,3*n),e.lineTo(-n,3*n),e.lineTo(-n,n),e.lineTo(-3*n,n),e.closePath()}},L3=ua(1/3),tse=L3*2,nse={draw(e,t){const n=ua(t/tse),r=n*L3;e.moveTo(0,-n),e.lineTo(r,0),e.lineTo(0,n),e.lineTo(-r,0),e.closePath()}},rse={draw(e,t){const n=ua(t),r=-n/2;e.rect(r,r,n,n)}},sse=.8908130915292852,F3=Vg(Wg/10)/Vg(7*Wg/10),ase=Vg(ax/10)*F3,ise=-k3(ax/10)*F3,ose={draw(e,t){const n=ua(t*sse),r=ase*n,s=ise*n;e.moveTo(0,-n),e.lineTo(r,s);for(let a=1;a<5;++a){const o=ax*a/5,l=k3(o),c=Vg(o);e.lineTo(c*n,-l*n),e.lineTo(l*r-c*s,c*r+l*s)}e.closePath()}},k0=ua(3),lse={draw(e,t){const n=-ua(t/(k0*3));e.moveTo(0,n*2),e.lineTo(-k0*n,-n),e.lineTo(k0*n,-n),e.closePath()}},fs=-.5,hs=ua(3)/2,e1=1/ua(12),cse=(e1/2+1)*3,use={draw(e,t){const n=ua(t/cse),r=n/2,s=n*e1,a=r,o=n*e1+n,l=-a,c=o;e.moveTo(r,s),e.lineTo(a,o),e.lineTo(l,c),e.lineTo(fs*r-hs*s,hs*r+fs*s),e.lineTo(fs*a-hs*o,hs*a+fs*o),e.lineTo(fs*l-hs*c,hs*l+fs*c),e.lineTo(fs*r+hs*s,fs*s-hs*r),e.lineTo(fs*a+hs*o,fs*o-hs*a),e.lineTo(fs*l+hs*c,fs*c-hs*l),e.closePath()}};function dse(e,t){let n=null,r=JN(s);e=typeof e=="function"?e:rn(e||t_),t=typeof t=="function"?t:rn(t===void 0?64:+t);function s(){let a;if(n||(n=a=r()),e.apply(this,arguments).draw(n,+t.apply(this,arguments)),a)return n=null,a+""||null}return s.type=function(a){return arguments.length?(e=typeof a=="function"?a:rn(a),s):e},s.size=function(a){return arguments.length?(t=typeof a=="function"?a:rn(+a),s):t},s.context=function(a){return arguments.length?(n=a??null,s):n},s}function Hg(){}function Gg(e,t,n){e._context.bezierCurveTo((2*e._x0+e._x1)/3,(2*e._y0+e._y1)/3,(e._x0+2*e._x1)/3,(e._y0+2*e._y1)/3,(e._x0+4*e._x1+t)/6,(e._y0+4*e._y1+n)/6)}function B3(e){this._context=e}B3.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._y0=this._y1=NaN,this._point=0},lineEnd:function(){switch(this._point){case 3:Gg(this,this._x1,this._y1);case 2:this._context.lineTo(this._x1,this._y1);break}(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line=1-this._line},point:function(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1,this._line?this._context.lineTo(e,t):this._context.moveTo(e,t);break;case 1:this._point=2;break;case 2:this._point=3,this._context.lineTo((5*this._x0+this._x1)/6,(5*this._y0+this._y1)/6);default:Gg(this,e,t);break}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t}};function fse(e){return new B3(e)}function z3(e){this._context=e}z3.prototype={areaStart:Hg,areaEnd:Hg,lineStart:function(){this._x0=this._x1=this._x2=this._x3=this._x4=this._y0=this._y1=this._y2=this._y3=this._y4=NaN,this._point=0},lineEnd:function(){switch(this._point){case 1:{this._context.moveTo(this._x2,this._y2),this._context.closePath();break}case 2:{this._context.moveTo((this._x2+2*this._x3)/3,(this._y2+2*this._y3)/3),this._context.lineTo((this._x3+2*this._x2)/3,(this._y3+2*this._y2)/3),this._context.closePath();break}case 3:{this.point(this._x2,this._y2),this.point(this._x3,this._y3),this.point(this._x4,this._y4);break}}},point:function(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1,this._x2=e,this._y2=t;break;case 1:this._point=2,this._x3=e,this._y3=t;break;case 2:this._point=3,this._x4=e,this._y4=t,this._context.moveTo((this._x0+4*this._x1+e)/6,(this._y0+4*this._y1+t)/6);break;default:Gg(this,e,t);break}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t}};function hse(e){return new z3(e)}function U3(e){this._context=e}U3.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._y0=this._y1=NaN,this._point=0},lineEnd:function(){(this._line||this._line!==0&&this._point===3)&&this._context.closePath(),this._line=1-this._line},point:function(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1;break;case 1:this._point=2;break;case 2:this._point=3;var n=(this._x0+4*this._x1+e)/6,r=(this._y0+4*this._y1+t)/6;this._line?this._context.lineTo(n,r):this._context.moveTo(n,r);break;case 3:this._point=4;default:Gg(this,e,t);break}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t}};function pse(e){return new U3(e)}function V3(e){this._context=e}V3.prototype={areaStart:Hg,areaEnd:Hg,lineStart:function(){this._point=0},lineEnd:function(){this._point&&this._context.closePath()},point:function(e,t){e=+e,t=+t,this._point?this._context.lineTo(e,t):(this._point=1,this._context.moveTo(e,t))}};function mse(e){return new V3(e)}function HC(e){return e<0?-1:1}function GC(e,t,n){var r=e._x1-e._x0,s=t-e._x1,a=(e._y1-e._y0)/(r||s<0&&-0),o=(n-e._y1)/(s||r<0&&-0),l=(a*s+o*r)/(r+s);return(HC(a)+HC(o))*Math.min(Math.abs(a),Math.abs(o),.5*Math.abs(l))||0}function qC(e,t){var n=e._x1-e._x0;return n?(3*(e._y1-e._y0)/n-t)/2:t}function T0(e,t,n){var r=e._x0,s=e._y0,a=e._x1,o=e._y1,l=(a-r)/3;e._context.bezierCurveTo(r+l,s+l*t,a-l,o-l*n,a,o)}function qg(e){this._context=e}qg.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._y0=this._y1=this._t0=NaN,this._point=0},lineEnd:function(){switch(this._point){case 2:this._context.lineTo(this._x1,this._y1);break;case 3:T0(this,this._t0,qC(this,this._t0));break}(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line=1-this._line},point:function(e,t){var n=NaN;if(e=+e,t=+t,!(e===this._x1&&t===this._y1)){switch(this._point){case 0:this._point=1,this._line?this._context.lineTo(e,t):this._context.moveTo(e,t);break;case 1:this._point=2;break;case 2:this._point=3,T0(this,qC(this,n=GC(this,e,t)),n);break;default:T0(this,this._t0,n=GC(this,e,t));break}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t,this._t0=n}}};function W3(e){this._context=new H3(e)}(W3.prototype=Object.create(qg.prototype)).point=function(e,t){qg.prototype.point.call(this,t,e)};function H3(e){this._context=e}H3.prototype={moveTo:function(e,t){this._context.moveTo(t,e)},closePath:function(){this._context.closePath()},lineTo:function(e,t){this._context.lineTo(t,e)},bezierCurveTo:function(e,t,n,r,s,a){this._context.bezierCurveTo(t,e,r,n,a,s)}};function gse(e){return new qg(e)}function vse(e){return new W3(e)}function G3(e){this._context=e}G3.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x=[],this._y=[]},lineEnd:function(){var e=this._x,t=this._y,n=e.length;if(n)if(this._line?this._context.lineTo(e[0],t[0]):this._context.moveTo(e[0],t[0]),n===2)this._context.lineTo(e[1],t[1]);else for(var r=KC(e),s=KC(t),a=0,o=1;o=0;--t)s[t]=(o[t]-s[t+1])/a[t];for(a[n-1]=(e[n]+s[n-1])/2,t=0;t=0&&(this._t=1-this._t,this._line=1-this._line)},point:function(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1,this._line?this._context.lineTo(e,t):this._context.moveTo(e,t);break;case 1:this._point=2;default:{if(this._t<=0)this._context.lineTo(this._x,t),this._context.lineTo(e,t);else{var n=this._x*(1-this._t)+e*this._t;this._context.lineTo(n,this._y),this._context.lineTo(n,t)}break}}this._x=e,this._y=t}};function xse(e){return new ox(e,.5)}function bse(e){return new ox(e,0)}function wse(e){return new ox(e,1)}function pu(e,t){if((o=e.length)>1)for(var n=1,r,s,a=e[t[0]],o,l=a.length;n=0;)n[t]=t;return n}function jse(e,t){return e[t]}function Sse(e){const t=[];return t.key=e,t}function Nse(){var e=rn([]),t=t1,n=pu,r=jse;function s(a){var o=Array.from(e.apply(this,arguments),Sse),l,c=o.length,u=-1,d;for(const f of a)for(l=0,++u;l0){for(var n,r,s=0,a=e[0].length,o;s0){for(var n=0,r=e[t[0]],s,a=r.length;n0)||!((a=(s=e[t[0]]).length)>0))){for(var n=0,r=1,s,a,o;r=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(n[r]=e[r])}return n}function $se(e,t){if(e==null)return{};var n={};for(var r in e)if(Object.prototype.hasOwnProperty.call(e,r)){if(t.indexOf(r)>=0)continue;n[r]=e[r]}return n}var q3={symbolCircle:t_,symbolCross:ese,symbolDiamond:nse,symbolSquare:rse,symbolStar:ose,symbolTriangle:lse,symbolWye:use},Mse=Math.PI/180,Ise=function(t){var n="symbol".concat(sx(t));return q3[n]||t_},Rse=function(t,n,r){if(n==="area")return t;switch(r){case"cross":return 5*t*t/9;case"diamond":return .5*t*t/Math.sqrt(3);case"square":return t*t;case"star":{var s=18*Mse;return 1.25*t*t*(Math.tan(s)-Math.tan(s*2)*Math.pow(Math.tan(s),2))}case"triangle":return Math.sqrt(3)*t*t/4;case"wye":return(21-10*Math.sqrt(3))*t*t/8;default:return Math.PI*t*t/4}},Dse=function(t,n){q3["symbol".concat(sx(t))]=n},n_=function(t){var n=t.type,r=n===void 0?"circle":n,s=t.size,a=s===void 0?64:s,o=t.sizeType,l=o===void 0?"area":o,c=Tse(t,Cse),u=YC(YC({},c),{},{type:r,size:a,sizeType:l}),d=function(){var y=Ise(r),b=dse().type(y).size(Rse(a,l,r));return b()},f=u.className,h=u.cx,p=u.cy,g=Xe(u,!0);return h===+h&&p===+p&&a===+a?E.createElement("path",n1({},g,{className:wt("recharts-symbols",f),transform:"translate(".concat(h,", ").concat(p,")"),d:d()})):null};n_.registerSymbol=Dse;function mu(e){"@babel/helpers - typeof";return mu=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},mu(e)}function r1(){return r1=Object.assign?Object.assign.bind():function(e){for(var t=1;t0?1:-1},ll=function(t){return gp(t)&&t.indexOf("%")===t.length-1},Ae=function(t){return zne(t)&&!id(t)},qn=function(t){return Ae(t)||gp(t)},Gne=0,od=function(t){var n=++Gne;return"".concat(t||"").concat(n)},Cr=function(t,n){var r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:0,s=arguments.length>3&&arguments[3]!==void 0?arguments[3]:!1;if(!Ae(t)&&!gp(t))return r;var a;if(ll(t)){var o=t.indexOf("%");a=n*parseFloat(t.slice(0,o))/100}else a=+t;return id(a)&&(a=r),s&&a>n&&(a=n),a},Hi=function(t){if(!t)return null;var n=Object.keys(t);return n&&n.length?t[n[0]]:null},Hne=function(t){if(!Array.isArray(t))return!1;for(var n=t.length,r={},s=0;s=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(n[r]=e[r])}return n}function Qne(e,t){if(e==null)return{};var n={};for(var r in e)if(Object.prototype.hasOwnProperty.call(e,r)){if(t.indexOf(r)>=0)continue;n[r]=e[r]}return n}function qw(e){"@babel/helpers - typeof";return qw=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},qw(e)}var GC={click:"onClick",mousedown:"onMouseDown",mouseup:"onMouseUp",mouseover:"onMouseOver",mousemove:"onMouseMove",mouseout:"onMouseOut",mouseenter:"onMouseEnter",mouseleave:"onMouseLeave",touchcancel:"onTouchCancel",touchend:"onTouchEnd",touchmove:"onTouchMove",touchstart:"onTouchStart"},ui=function(t){return typeof t=="string"?t:t?t.displayName||t.name||"Component":""},HC=null,$0=null,r_=function e(t){if(t===HC&&Array.isArray($0))return $0;var n=[];return v.Children.forEach(t,function(r){Nt(r)||(_3.isFragment(r)?n=n.concat(e(r.props.children)):n.push(r))}),$0=n,HC=t,n};function As(e,t){var n=[],r=[];return Array.isArray(t)?r=t.map(function(s){return ui(s)}):r=[ui(t)],r_(e).forEach(function(s){var a=ls(s,"type.displayName")||ls(s,"type.name");r.indexOf(a)!==-1&&n.push(s)}),n}function es(e,t){var n=As(e,t);return n&&n[0]}var qC=function(t){if(!t||!t.props)return!1;var n=t.props,r=n.width,s=n.height;return!(!Ae(r)||r<=0||!Ae(s)||s<=0)},Jne=["a","altGlyph","altGlyphDef","altGlyphItem","animate","animateColor","animateMotion","animateTransform","circle","clipPath","color-profile","cursor","defs","desc","ellipse","feBlend","feColormatrix","feComponentTransfer","feComposite","feConvolveMatrix","feDiffuseLighting","feDisplacementMap","feDistantLight","feFlood","feFuncA","feFuncB","feFuncG","feFuncR","feGaussianBlur","feImage","feMerge","feMergeNode","feMorphology","feOffset","fePointLight","feSpecularLighting","feSpotLight","feTile","feTurbulence","filter","font","font-face","font-face-format","font-face-name","font-face-url","foreignObject","g","glyph","glyphRef","hkern","image","line","lineGradient","marker","mask","metadata","missing-glyph","mpath","path","pattern","polygon","polyline","radialGradient","rect","script","set","stop","style","svg","switch","symbol","text","textPath","title","tref","tspan","use","view","vkern"],ere=function(t){return t&&t.type&&gp(t.type)&&Jne.indexOf(t.type)>=0},tre=function(t){return t&&qw(t)==="object"&&"clipDot"in t},nre=function(t,n,r,s){var a,o=(a=T0==null?void 0:T0[s])!==null&&a!==void 0?a:[];return!ht(t)&&(s&&o.includes(n)||Kne.includes(n))||r&&n_.includes(n)},Xe=function(t,n,r){if(!t||typeof t=="function"||typeof t=="boolean")return null;var s=t;if(v.isValidElement(t)&&(s=t.props),!nd(s))return null;var a={};return Object.keys(s).forEach(function(o){var l;nre((l=s)===null||l===void 0?void 0:l[o],o,n,r)&&(a[o]=s[o])}),a},Kw=function e(t,n){if(t===n)return!0;var r=v.Children.count(t);if(r!==v.Children.count(n))return!1;if(r===0)return!0;if(r===1)return KC(Array.isArray(t)?t[0]:t,Array.isArray(n)?n[0]:n);for(var s=0;s=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(n[r]=e[r])}return n}function ore(e,t){if(e==null)return{};var n={};for(var r in e)if(Object.prototype.hasOwnProperty.call(e,r)){if(t.indexOf(r)>=0)continue;n[r]=e[r]}return n}function Yw(e){var t=e.children,n=e.width,r=e.height,s=e.viewBox,a=e.className,o=e.style,l=e.title,c=e.desc,u=ire(e,are),d=s||{width:n,height:r,x:0,y:0},f=jt("recharts-surface",a);return E.createElement("svg",Xw({},Xe(u,!0,"svg"),{className:f,width:n,height:r,style:o,viewBox:"".concat(d.x," ").concat(d.y," ").concat(d.width," ").concat(d.height)}),E.createElement("title",null,l),E.createElement("desc",null,c),t)}var lre=["children","className"];function Zw(){return Zw=Object.assign?Object.assign.bind():function(e){for(var t=1;t=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(n[r]=e[r])}return n}function ure(e,t){if(e==null)return{};var n={};for(var r in e)if(Object.prototype.hasOwnProperty.call(e,r)){if(t.indexOf(r)>=0)continue;n[r]=e[r]}return n}var Rt=E.forwardRef(function(e,t){var n=e.children,r=e.className,s=cre(e,lre),a=jt("recharts-layer",r);return E.createElement("g",Zw({className:a},Xe(s,!0),{ref:t}),n)}),Js=function(t,n){for(var r=arguments.length,s=new Array(r>2?r-2:0),a=2;as?0:s+t),n=n>s?s:n,n<0&&(n+=s),s=t>n?0:n-t>>>0,t>>>=0;for(var a=Array(s);++r=r?e:hre(e,t,n)}var mre=pre,gre="\\ud800-\\udfff",vre="\\u0300-\\u036f",yre="\\ufe20-\\ufe2f",xre="\\u20d0-\\u20ff",bre=vre+yre+xre,wre="\\ufe0e\\ufe0f",jre="\\u200d",Sre=RegExp("["+jre+gre+bre+wre+"]");function Nre(e){return Sre.test(e)}var A3=Nre;function _re(e){return e.split("")}var Pre=_re,C3="\\ud800-\\udfff",Are="\\u0300-\\u036f",Cre="\\ufe20-\\ufe2f",Ere="\\u20d0-\\u20ff",Ore=Are+Cre+Ere,kre="\\ufe0e\\ufe0f",Tre="["+C3+"]",Qw="["+Ore+"]",Jw="\\ud83c[\\udffb-\\udfff]",$re="(?:"+Qw+"|"+Jw+")",E3="[^"+C3+"]",O3="(?:\\ud83c[\\udde6-\\uddff]){2}",k3="[\\ud800-\\udbff][\\udc00-\\udfff]",Mre="\\u200d",T3=$re+"?",$3="["+kre+"]?",Ire="(?:"+Mre+"(?:"+[E3,O3,k3].join("|")+")"+$3+T3+")*",Rre=$3+T3+Ire,Dre="(?:"+[E3+Qw+"?",Qw,O3,k3,Tre].join("|")+")",Lre=RegExp(Jw+"(?="+Jw+")|"+Dre+Rre,"g");function Fre(e){return e.match(Lre)||[]}var Bre=Fre,zre=Pre,Ure=A3,Vre=Bre;function Wre(e){return Ure(e)?Vre(e):zre(e)}var Gre=Wre,Hre=mre,qre=A3,Kre=Gre,Xre=b3;function Yre(e){return function(t){t=Xre(t);var n=qre(t)?Kre(t):void 0,r=n?n[0]:t.charAt(0),s=n?Hre(n,1).join(""):t.slice(1);return r[e]()+s}}var Zre=Yre,Qre=Zre,Jre=Qre("toUpperCase"),ese=Jre;const ox=Ht(ese);function rn(e){return function(){return e}}const M3=Math.cos,Gg=Math.sin,ua=Math.sqrt,Hg=Math.PI,lx=2*Hg,e1=Math.PI,t1=2*e1,Zo=1e-6,tse=t1-Zo;function I3(e){this._+=e[0];for(let t=1,n=e.length;t=0))throw new Error(`invalid digits: ${e}`);if(t>15)return I3;const n=10**t;return function(r){this._+=r[0];for(let s=1,a=r.length;sZo)if(!(Math.abs(f*c-u*d)>Zo)||!a)this._append`L${this._x1=t},${this._y1=n}`;else{let p=r-o,g=s-l,m=c*c+u*u,y=p*p+g*g,b=Math.sqrt(m),x=Math.sqrt(h),w=a*Math.tan((e1-Math.acos((m+h-y)/(2*b*x)))/2),j=w/x,S=w/b;Math.abs(j-1)>Zo&&this._append`L${t+j*d},${n+j*f}`,this._append`A${a},${a},0,0,${+(f*p>d*g)},${this._x1=t+S*c},${this._y1=n+S*u}`}}arc(t,n,r,s,a,o){if(t=+t,n=+n,r=+r,o=!!o,r<0)throw new Error(`negative radius: ${r}`);let l=r*Math.cos(s),c=r*Math.sin(s),u=t+l,d=n+c,f=1^o,h=o?s-a:a-s;this._x1===null?this._append`M${u},${d}`:(Math.abs(this._x1-u)>Zo||Math.abs(this._y1-d)>Zo)&&this._append`L${u},${d}`,r&&(h<0&&(h=h%t1+t1),h>tse?this._append`A${r},${r},0,1,${f},${t-l},${n-c}A${r},${r},0,1,${f},${this._x1=u},${this._y1=d}`:h>Zo&&this._append`A${r},${r},0,${+(h>=e1)},${f},${this._x1=t+r*Math.cos(a)},${this._y1=n+r*Math.sin(a)}`)}rect(t,n,r,s){this._append`M${this._x0=this._x1=+t},${this._y0=this._y1=+n}h${r=+r}v${+s}h${-r}Z`}toString(){return this._}}function s_(e){let t=3;return e.digits=function(n){if(!arguments.length)return t;if(n==null)t=null;else{const r=Math.floor(n);if(!(r>=0))throw new RangeError(`invalid digits: ${n}`);t=r}return e},()=>new rse(t)}function a_(e){return typeof e=="object"&&"length"in e?e:Array.from(e)}function R3(e){this._context=e}R3.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._point=0},lineEnd:function(){(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line=1-this._line},point:function(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1,this._line?this._context.lineTo(e,t):this._context.moveTo(e,t);break;case 1:this._point=2;default:this._context.lineTo(e,t);break}}};function cx(e){return new R3(e)}function D3(e){return e[0]}function L3(e){return e[1]}function F3(e,t){var n=rn(!0),r=null,s=cx,a=null,o=s_(l);e=typeof e=="function"?e:e===void 0?D3:rn(e),t=typeof t=="function"?t:t===void 0?L3:rn(t);function l(c){var u,d=(c=a_(c)).length,f,h=!1,p;for(r==null&&(a=s(p=o())),u=0;u<=d;++u)!(u=p;--g)l.point(w[g],j[g]);l.lineEnd(),l.areaEnd()}b&&(w[h]=+e(y,h,f),j[h]=+t(y,h,f),l.point(r?+r(y,h,f):w[h],n?+n(y,h,f):j[h]))}if(x)return l=null,x+""||null}function d(){return F3().defined(s).curve(o).context(a)}return u.x=function(f){return arguments.length?(e=typeof f=="function"?f:rn(+f),r=null,u):e},u.x0=function(f){return arguments.length?(e=typeof f=="function"?f:rn(+f),u):e},u.x1=function(f){return arguments.length?(r=f==null?null:typeof f=="function"?f:rn(+f),u):r},u.y=function(f){return arguments.length?(t=typeof f=="function"?f:rn(+f),n=null,u):t},u.y0=function(f){return arguments.length?(t=typeof f=="function"?f:rn(+f),u):t},u.y1=function(f){return arguments.length?(n=f==null?null:typeof f=="function"?f:rn(+f),u):n},u.lineX0=u.lineY0=function(){return d().x(e).y(t)},u.lineY1=function(){return d().x(e).y(n)},u.lineX1=function(){return d().x(r).y(t)},u.defined=function(f){return arguments.length?(s=typeof f=="function"?f:rn(!!f),u):s},u.curve=function(f){return arguments.length?(o=f,a!=null&&(l=o(a)),u):o},u.context=function(f){return arguments.length?(f==null?a=l=null:l=o(a=f),u):a},u}class B3{constructor(t,n){this._context=t,this._x=n}areaStart(){this._line=0}areaEnd(){this._line=NaN}lineStart(){this._point=0}lineEnd(){(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line=1-this._line}point(t,n){switch(t=+t,n=+n,this._point){case 0:{this._point=1,this._line?this._context.lineTo(t,n):this._context.moveTo(t,n);break}case 1:this._point=2;default:{this._x?this._context.bezierCurveTo(this._x0=(this._x0+t)/2,this._y0,this._x0,n,t,n):this._context.bezierCurveTo(this._x0,this._y0=(this._y0+n)/2,t,this._y0,t,n);break}}this._x0=t,this._y0=n}}function sse(e){return new B3(e,!0)}function ase(e){return new B3(e,!1)}const i_={draw(e,t){const n=ua(t/Hg);e.moveTo(n,0),e.arc(0,0,n,0,lx)}},ise={draw(e,t){const n=ua(t/5)/2;e.moveTo(-3*n,-n),e.lineTo(-n,-n),e.lineTo(-n,-3*n),e.lineTo(n,-3*n),e.lineTo(n,-n),e.lineTo(3*n,-n),e.lineTo(3*n,n),e.lineTo(n,n),e.lineTo(n,3*n),e.lineTo(-n,3*n),e.lineTo(-n,n),e.lineTo(-3*n,n),e.closePath()}},z3=ua(1/3),ose=z3*2,lse={draw(e,t){const n=ua(t/ose),r=n*z3;e.moveTo(0,-n),e.lineTo(r,0),e.lineTo(0,n),e.lineTo(-r,0),e.closePath()}},cse={draw(e,t){const n=ua(t),r=-n/2;e.rect(r,r,n,n)}},use=.8908130915292852,U3=Gg(Hg/10)/Gg(7*Hg/10),dse=Gg(lx/10)*U3,fse=-M3(lx/10)*U3,hse={draw(e,t){const n=ua(t*use),r=dse*n,s=fse*n;e.moveTo(0,-n),e.lineTo(r,s);for(let a=1;a<5;++a){const o=lx*a/5,l=M3(o),c=Gg(o);e.lineTo(c*n,-l*n),e.lineTo(l*r-c*s,c*r+l*s)}e.closePath()}},M0=ua(3),pse={draw(e,t){const n=-ua(t/(M0*3));e.moveTo(0,n*2),e.lineTo(-M0*n,-n),e.lineTo(M0*n,-n),e.closePath()}},fs=-.5,hs=ua(3)/2,n1=1/ua(12),mse=(n1/2+1)*3,gse={draw(e,t){const n=ua(t/mse),r=n/2,s=n*n1,a=r,o=n*n1+n,l=-a,c=o;e.moveTo(r,s),e.lineTo(a,o),e.lineTo(l,c),e.lineTo(fs*r-hs*s,hs*r+fs*s),e.lineTo(fs*a-hs*o,hs*a+fs*o),e.lineTo(fs*l-hs*c,hs*l+fs*c),e.lineTo(fs*r+hs*s,fs*s-hs*r),e.lineTo(fs*a+hs*o,fs*o-hs*a),e.lineTo(fs*l+hs*c,fs*c-hs*l),e.closePath()}};function vse(e,t){let n=null,r=s_(s);e=typeof e=="function"?e:rn(e||i_),t=typeof t=="function"?t:rn(t===void 0?64:+t);function s(){let a;if(n||(n=a=r()),e.apply(this,arguments).draw(n,+t.apply(this,arguments)),a)return n=null,a+""||null}return s.type=function(a){return arguments.length?(e=typeof a=="function"?a:rn(a),s):e},s.size=function(a){return arguments.length?(t=typeof a=="function"?a:rn(+a),s):t},s.context=function(a){return arguments.length?(n=a??null,s):n},s}function qg(){}function Kg(e,t,n){e._context.bezierCurveTo((2*e._x0+e._x1)/3,(2*e._y0+e._y1)/3,(e._x0+2*e._x1)/3,(e._y0+2*e._y1)/3,(e._x0+4*e._x1+t)/6,(e._y0+4*e._y1+n)/6)}function V3(e){this._context=e}V3.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._y0=this._y1=NaN,this._point=0},lineEnd:function(){switch(this._point){case 3:Kg(this,this._x1,this._y1);case 2:this._context.lineTo(this._x1,this._y1);break}(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line=1-this._line},point:function(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1,this._line?this._context.lineTo(e,t):this._context.moveTo(e,t);break;case 1:this._point=2;break;case 2:this._point=3,this._context.lineTo((5*this._x0+this._x1)/6,(5*this._y0+this._y1)/6);default:Kg(this,e,t);break}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t}};function yse(e){return new V3(e)}function W3(e){this._context=e}W3.prototype={areaStart:qg,areaEnd:qg,lineStart:function(){this._x0=this._x1=this._x2=this._x3=this._x4=this._y0=this._y1=this._y2=this._y3=this._y4=NaN,this._point=0},lineEnd:function(){switch(this._point){case 1:{this._context.moveTo(this._x2,this._y2),this._context.closePath();break}case 2:{this._context.moveTo((this._x2+2*this._x3)/3,(this._y2+2*this._y3)/3),this._context.lineTo((this._x3+2*this._x2)/3,(this._y3+2*this._y2)/3),this._context.closePath();break}case 3:{this.point(this._x2,this._y2),this.point(this._x3,this._y3),this.point(this._x4,this._y4);break}}},point:function(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1,this._x2=e,this._y2=t;break;case 1:this._point=2,this._x3=e,this._y3=t;break;case 2:this._point=3,this._x4=e,this._y4=t,this._context.moveTo((this._x0+4*this._x1+e)/6,(this._y0+4*this._y1+t)/6);break;default:Kg(this,e,t);break}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t}};function xse(e){return new W3(e)}function G3(e){this._context=e}G3.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._y0=this._y1=NaN,this._point=0},lineEnd:function(){(this._line||this._line!==0&&this._point===3)&&this._context.closePath(),this._line=1-this._line},point:function(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1;break;case 1:this._point=2;break;case 2:this._point=3;var n=(this._x0+4*this._x1+e)/6,r=(this._y0+4*this._y1+t)/6;this._line?this._context.lineTo(n,r):this._context.moveTo(n,r);break;case 3:this._point=4;default:Kg(this,e,t);break}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t}};function bse(e){return new G3(e)}function H3(e){this._context=e}H3.prototype={areaStart:qg,areaEnd:qg,lineStart:function(){this._point=0},lineEnd:function(){this._point&&this._context.closePath()},point:function(e,t){e=+e,t=+t,this._point?this._context.lineTo(e,t):(this._point=1,this._context.moveTo(e,t))}};function wse(e){return new H3(e)}function YC(e){return e<0?-1:1}function ZC(e,t,n){var r=e._x1-e._x0,s=t-e._x1,a=(e._y1-e._y0)/(r||s<0&&-0),o=(n-e._y1)/(s||r<0&&-0),l=(a*s+o*r)/(r+s);return(YC(a)+YC(o))*Math.min(Math.abs(a),Math.abs(o),.5*Math.abs(l))||0}function QC(e,t){var n=e._x1-e._x0;return n?(3*(e._y1-e._y0)/n-t)/2:t}function I0(e,t,n){var r=e._x0,s=e._y0,a=e._x1,o=e._y1,l=(a-r)/3;e._context.bezierCurveTo(r+l,s+l*t,a-l,o-l*n,a,o)}function Xg(e){this._context=e}Xg.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._y0=this._y1=this._t0=NaN,this._point=0},lineEnd:function(){switch(this._point){case 2:this._context.lineTo(this._x1,this._y1);break;case 3:I0(this,this._t0,QC(this,this._t0));break}(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line=1-this._line},point:function(e,t){var n=NaN;if(e=+e,t=+t,!(e===this._x1&&t===this._y1)){switch(this._point){case 0:this._point=1,this._line?this._context.lineTo(e,t):this._context.moveTo(e,t);break;case 1:this._point=2;break;case 2:this._point=3,I0(this,QC(this,n=ZC(this,e,t)),n);break;default:I0(this,this._t0,n=ZC(this,e,t));break}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t,this._t0=n}}};function q3(e){this._context=new K3(e)}(q3.prototype=Object.create(Xg.prototype)).point=function(e,t){Xg.prototype.point.call(this,t,e)};function K3(e){this._context=e}K3.prototype={moveTo:function(e,t){this._context.moveTo(t,e)},closePath:function(){this._context.closePath()},lineTo:function(e,t){this._context.lineTo(t,e)},bezierCurveTo:function(e,t,n,r,s,a){this._context.bezierCurveTo(t,e,r,n,a,s)}};function jse(e){return new Xg(e)}function Sse(e){return new q3(e)}function X3(e){this._context=e}X3.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x=[],this._y=[]},lineEnd:function(){var e=this._x,t=this._y,n=e.length;if(n)if(this._line?this._context.lineTo(e[0],t[0]):this._context.moveTo(e[0],t[0]),n===2)this._context.lineTo(e[1],t[1]);else for(var r=JC(e),s=JC(t),a=0,o=1;o=0;--t)s[t]=(o[t]-s[t+1])/a[t];for(a[n-1]=(e[n]+s[n-1])/2,t=0;t=0&&(this._t=1-this._t,this._line=1-this._line)},point:function(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1,this._line?this._context.lineTo(e,t):this._context.moveTo(e,t);break;case 1:this._point=2;default:{if(this._t<=0)this._context.lineTo(this._x,t),this._context.lineTo(e,t);else{var n=this._x*(1-this._t)+e*this._t;this._context.lineTo(n,this._y),this._context.lineTo(n,t)}break}}this._x=e,this._y=t}};function _se(e){return new ux(e,.5)}function Pse(e){return new ux(e,0)}function Ase(e){return new ux(e,1)}function pu(e,t){if((o=e.length)>1)for(var n=1,r,s,a=e[t[0]],o,l=a.length;n=0;)n[t]=t;return n}function Cse(e,t){return e[t]}function Ese(e){const t=[];return t.key=e,t}function Ose(){var e=rn([]),t=r1,n=pu,r=Cse;function s(a){var o=Array.from(e.apply(this,arguments),Ese),l,c=o.length,u=-1,d;for(const f of a)for(l=0,++u;l0){for(var n,r,s=0,a=e[0].length,o;s0){for(var n=0,r=e[t[0]],s,a=r.length;n0)||!((a=(s=e[t[0]]).length)>0))){for(var n=0,r=1,s,a,o;r=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(n[r]=e[r])}return n}function Fse(e,t){if(e==null)return{};var n={};for(var r in e)if(Object.prototype.hasOwnProperty.call(e,r)){if(t.indexOf(r)>=0)continue;n[r]=e[r]}return n}var Y3={symbolCircle:i_,symbolCross:ise,symbolDiamond:lse,symbolSquare:cse,symbolStar:hse,symbolTriangle:pse,symbolWye:gse},Bse=Math.PI/180,zse=function(t){var n="symbol".concat(ox(t));return Y3[n]||i_},Use=function(t,n,r){if(n==="area")return t;switch(r){case"cross":return 5*t*t/9;case"diamond":return .5*t*t/Math.sqrt(3);case"square":return t*t;case"star":{var s=18*Bse;return 1.25*t*t*(Math.tan(s)-Math.tan(s*2)*Math.pow(Math.tan(s),2))}case"triangle":return Math.sqrt(3)*t*t/4;case"wye":return(21-10*Math.sqrt(3))*t*t/8;default:return Math.PI*t*t/4}},Vse=function(t,n){Y3["symbol".concat(ox(t))]=n},o_=function(t){var n=t.type,r=n===void 0?"circle":n,s=t.size,a=s===void 0?64:s,o=t.sizeType,l=o===void 0?"area":o,c=Lse(t,Mse),u=tE(tE({},c),{},{type:r,size:a,sizeType:l}),d=function(){var y=zse(r),b=vse().type(y).size(Use(a,l,r));return b()},f=u.className,h=u.cx,p=u.cy,g=Xe(u,!0);return h===+h&&p===+p&&a===+a?E.createElement("path",s1({},g,{className:jt("recharts-symbols",f),transform:"translate(".concat(h,", ").concat(p,")"),d:d()})):null};o_.registerSymbol=Vse;function mu(e){"@babel/helpers - typeof";return mu=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},mu(e)}function a1(){return a1=Object.assign?Object.assign.bind():function(e){for(var t=1;t`);var x=p.inactive?u:p.color;return E.createElement("li",r1({className:y,style:f,key:"legend-item-".concat(g)},Bl(r.props,p,g)),E.createElement(Kw,{width:o,height:o,viewBox:d,style:h},r.renderIcon(p)),E.createElement("span",{className:"recharts-legend-item-text",style:{color:x}},m?m(b,p,g):b))})}},{key:"render",value:function(){var r=this.props,s=r.payload,a=r.layout,o=r.align;if(!s||!s.length)return null;var l={padding:0,margin:0,textAlign:a==="horizontal"?o:"left"};return E.createElement("ul",{className:"recharts-default-legend",style:l},this.renderItems())}}])}(v.PureComponent);ch(r_,"displayName","Legend");ch(r_,"defaultProps",{iconSize:14,layout:"horizontal",align:"center",verticalAlign:"middle",inactiveColor:"#ccc"});var qse=Hy;function Kse(){this.__data__=new qse,this.size=0}var Xse=Kse;function Yse(e){var t=this.__data__,n=t.delete(e);return this.size=t.size,n}var Zse=Yse;function Qse(e){return this.__data__.get(e)}var Jse=Qse;function eae(e){return this.__data__.has(e)}var tae=eae,nae=Hy,rae=WN,sae=HN,aae=200;function iae(e,t){var n=this.__data__;if(n instanceof nae){var r=n.__data__;if(!rae||r.lengthl))return!1;var u=a.get(e),d=a.get(t);if(u&&d)return u==t&&d==e;var f=-1,h=!0,p=n&Cae?new Nae:void 0;for(a.set(e,t),a.set(t,e);++f-1&&e%1==0&&e-1&&e%1==0&&e<=Tie}var o_=$ie,Mie=Ci,Iie=o_,Rie=Ei,Die="[object Arguments]",Lie="[object Array]",Fie="[object Boolean]",Bie="[object Date]",zie="[object Error]",Uie="[object Function]",Vie="[object Map]",Wie="[object Number]",Hie="[object Object]",Gie="[object RegExp]",qie="[object Set]",Kie="[object String]",Xie="[object WeakMap]",Yie="[object ArrayBuffer]",Zie="[object DataView]",Qie="[object Float32Array]",Jie="[object Float64Array]",eoe="[object Int8Array]",toe="[object Int16Array]",noe="[object Int32Array]",roe="[object Uint8Array]",soe="[object Uint8ClampedArray]",aoe="[object Uint16Array]",ioe="[object Uint32Array]",cn={};cn[Qie]=cn[Jie]=cn[eoe]=cn[toe]=cn[noe]=cn[roe]=cn[soe]=cn[aoe]=cn[ioe]=!0;cn[Die]=cn[Lie]=cn[Yie]=cn[Fie]=cn[Zie]=cn[Bie]=cn[zie]=cn[Uie]=cn[Vie]=cn[Wie]=cn[Hie]=cn[Gie]=cn[qie]=cn[Kie]=cn[Xie]=!1;function ooe(e){return Rie(e)&&Iie(e.length)&&!!cn[Mie(e)]}var loe=ooe;function coe(e){return function(t){return e(t)}}var s5=coe,Zg={exports:{}};Zg.exports;(function(e,t){var n=d3,r=t&&!t.nodeType&&t,s=r&&!0&&e&&!e.nodeType&&e,a=s&&s.exports===r,o=a&&n.process,l=function(){try{var c=s&&s.require&&s.require("util").types;return c||o&&o.binding&&o.binding("util")}catch{}}();e.exports=l})(Zg,Zg.exports);var uoe=Zg.exports,doe=loe,foe=s5,rE=uoe,sE=rE&&rE.isTypedArray,hoe=sE?foe(sE):doe,a5=hoe,poe=vie,moe=a_,goe=Kr,voe=r5,yoe=i_,xoe=a5,boe=Object.prototype,woe=boe.hasOwnProperty;function joe(e,t){var n=goe(e),r=!n&&moe(e),s=!n&&!r&&voe(e),a=!n&&!r&&!s&&xoe(e),o=n||r||s||a,l=o?poe(e.length,String):[],c=l.length;for(var u in e)(t||woe.call(e,u))&&!(o&&(u=="length"||s&&(u=="offset"||u=="parent")||a&&(u=="buffer"||u=="byteLength"||u=="byteOffset")||yoe(u,c)))&&l.push(u);return l}var Soe=joe,Noe=Object.prototype;function _oe(e){var t=e&&e.constructor,n=typeof t=="function"&&t.prototype||Noe;return e===n}var Poe=_oe;function Aoe(e,t){return function(n){return e(t(n))}}var i5=Aoe,Coe=i5,Eoe=Coe(Object.keys,Object),Ooe=Eoe,koe=Poe,Toe=Ooe,$oe=Object.prototype,Moe=$oe.hasOwnProperty;function Ioe(e){if(!koe(e))return Toe(e);var t=[];for(var n in Object(e))Moe.call(e,n)&&n!="constructor"&&t.push(n);return t}var Roe=Ioe,Doe=UN,Loe=o_;function Foe(e){return e!=null&&Loe(e.length)&&!Doe(e)}var gp=Foe,Boe=Soe,zoe=Roe,Uoe=gp;function Voe(e){return Uoe(e)?Boe(e):zoe(e)}var lx=Voe,Woe=aie,Hoe=mie,Goe=lx;function qoe(e){return Woe(e,Goe,Hoe)}var Koe=qoe,aE=Koe,Xoe=1,Yoe=Object.prototype,Zoe=Yoe.hasOwnProperty;function Qoe(e,t,n,r,s,a){var o=n&Xoe,l=aE(e),c=l.length,u=aE(t),d=u.length;if(c!=d&&!o)return!1;for(var f=c;f--;){var h=l[f];if(!(o?h in t:Zoe.call(t,h)))return!1}var p=a.get(e),g=a.get(t);if(p&&g)return p==t&&g==e;var m=!0;a.set(e,t),a.set(t,e);for(var y=o;++f-1}var Yce=Xce;function Zce(e,t,n){for(var r=-1,s=e==null?0:e.length;++r=fue){var u=t?null:uue(e);if(u)return due(u);o=!1,s=cue,c=new iue}else c=t?[]:l;e:for(;++r=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(n[r]=e[r])}return n}function Cue(e,t){if(e==null)return{};var n={};for(var r in e)if(Object.prototype.hasOwnProperty.call(e,r)){if(t.indexOf(r)>=0)continue;n[r]=e[r]}return n}function Eue(e){return e.value}function Oue(e,t){if(E.isValidElement(e))return E.cloneElement(e,t);if(typeof e=="function")return E.createElement(e,t);t.ref;var n=Aue(t,xue);return E.createElement(r_,n)}var wE=1,ci=function(e){function t(){var n;bue(this,t);for(var r=arguments.length,s=new Array(r),a=0;awE||Math.abs(s.height-this.lastBoundingBox.height)>wE)&&(this.lastBoundingBox.width=s.width,this.lastBoundingBox.height=s.height,r&&r(s)):(this.lastBoundingBox.width!==-1||this.lastBoundingBox.height!==-1)&&(this.lastBoundingBox.width=-1,this.lastBoundingBox.height=-1,r&&r(null))}},{key:"getBBoxSnapshot",value:function(){return this.lastBoundingBox.width>=0&&this.lastBoundingBox.height>=0?Wa({},this.lastBoundingBox):{width:0,height:0}}},{key:"getDefaultPosition",value:function(r){var s=this.props,a=s.layout,o=s.align,l=s.verticalAlign,c=s.margin,u=s.chartWidth,d=s.chartHeight,f,h;if(!r||(r.left===void 0||r.left===null)&&(r.right===void 0||r.right===null))if(o==="center"&&a==="vertical"){var p=this.getBBoxSnapshot();f={left:((u||0)-p.width)/2}}else f=o==="right"?{right:c&&c.right||0}:{left:c&&c.left||0};if(!r||(r.top===void 0||r.top===null)&&(r.bottom===void 0||r.bottom===null))if(l==="middle"){var g=this.getBBoxSnapshot();h={top:((d||0)-g.height)/2}}else h=l==="bottom"?{bottom:c&&c.bottom||0}:{top:c&&c.top||0};return Wa(Wa({},f),h)}},{key:"render",value:function(){var r=this,s=this.props,a=s.content,o=s.width,l=s.height,c=s.wrapperStyle,u=s.payloadUniqBy,d=s.payload,f=Wa(Wa({position:"absolute",width:o||"auto",height:l||"auto"},this.getDefaultPosition(c)),c);return E.createElement("div",{className:"recharts-legend-wrapper",style:f,ref:function(p){r.wrapperNode=p}},Oue(a,Wa(Wa({},this.props),{},{payload:h5(d,u,Eue)})))}}],[{key:"getWithHeight",value:function(r,s){var a=Wa(Wa({},this.defaultProps),r.props),o=a.layout;return o==="vertical"&&Ae(r.props.height)?{height:r.props.height}:o==="horizontal"?{width:r.props.width||s}:null}}])}(v.PureComponent);cx(ci,"displayName","Legend");cx(ci,"defaultProps",{iconSize:14,layout:"horizontal",align:"center",verticalAlign:"bottom"});var jE=pp,kue=a_,Tue=Kr,SE=jE?jE.isConcatSpreadable:void 0;function $ue(e){return Tue(e)||kue(e)||!!(SE&&e&&e[SE])}var Mue=$ue,Iue=t5,Rue=Mue;function g5(e,t,n,r,s){var a=-1,o=e.length;for(n||(n=Rue),s||(s=[]);++a0&&n(l)?t>1?g5(l,t-1,n,r,s):Iue(s,l):r||(s[s.length]=l)}return s}var v5=g5;function Due(e){return function(t,n,r){for(var s=-1,a=Object(t),o=r(t),l=o.length;l--;){var c=o[e?l:++s];if(n(a[c],c,a)===!1)break}return t}}var Lue=Due,Fue=Lue,Bue=Fue(),zue=Bue,Uue=zue,Vue=lx;function Wue(e,t){return e&&Uue(e,t,Vue)}var y5=Wue,Hue=gp;function Gue(e,t){return function(n,r){if(n==null)return n;if(!Hue(n))return e(n,r);for(var s=n.length,a=t?s:-1,o=Object(n);(t?a--:++at||a&&o&&c&&!l&&!u||r&&o&&c||!n&&c||!s)return 1;if(!r&&!a&&!u&&e=l)return c;var u=n[r];return c*(u=="desc"?-1:1)}}return e.index-t.index}var ide=ade,R0=qN,ode=KN,lde=Ba,cde=x5,ude=tde,dde=s5,fde=ide,hde=ud,pde=Kr;function mde(e,t,n){t.length?t=R0(t,function(a){return pde(a)?function(o){return ode(o,a.length===1?a[0]:a)}:a}):t=[hde];var r=-1;t=R0(t,dde(lde));var s=cde(e,function(a,o,l){var c=R0(t,function(u){return u(a)});return{criteria:c,index:++r,value:a}});return ude(s,function(a,o){return fde(a,o,n)})}var gde=mde;function vde(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 yde=vde,xde=yde,_E=Math.max;function bde(e,t,n){return t=_E(t===void 0?e.length-1:t,0),function(){for(var r=arguments,s=-1,a=_E(r.length-t,0),o=Array(a);++s0){if(++t>=Ode)return arguments[0]}else t=0;return e.apply(void 0,arguments)}}var Mde=$de,Ide=Ede,Rde=Mde,Dde=Rde(Ide),Lde=Dde,Fde=ud,Bde=wde,zde=Lde;function Ude(e,t){return zde(Bde(e,t,Fde),e+"")}var Vde=Ude,Wde=VN,Hde=gp,Gde=i_,qde=Bo;function Kde(e,t,n){if(!qde(n))return!1;var r=typeof t;return(r=="number"?Hde(n)&&Gde(t,n.length):r=="string"&&t in n)?Wde(n[t],e):!1}var ux=Kde,Xde=v5,Yde=gde,Zde=Vde,AE=ux,Qde=Zde(function(e,t){if(e==null)return[];var n=t.length;return n>1&&AE(e,t[0],t[1])?t=[]:n>2&&AE(t[0],t[1],t[2])&&(t=[t[0]]),Yde(e,Xde(t,1),[])}),Jde=Qde;const u_=Gt(Jde);function uh(e){"@babel/helpers - typeof";return uh=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},uh(e)}function d1(){return d1=Object.assign?Object.assign.bind():function(e){for(var t=1;te.length)&&(t=e.length);for(var n=0,r=new Array(t);n=t.x),"".concat($d,"-left"),Ae(n)&&t&&Ae(t.x)&&n=t.y),"".concat($d,"-top"),Ae(r)&&t&&Ae(t.y)&&rm?Math.max(d,c[r]):Math.max(f,c[r])}function pfe(e){var t=e.translateX,n=e.translateY,r=e.useTranslate3d;return{transform:r?"translate3d(".concat(t,"px, ").concat(n,"px, 0)"):"translate(".concat(t,"px, ").concat(n,"px)")}}function mfe(e){var t=e.allowEscapeViewBox,n=e.coordinate,r=e.offsetTopLeft,s=e.position,a=e.reverseDirection,o=e.tooltipBox,l=e.useTranslate3d,c=e.viewBox,u,d,f;return o.height>0&&o.width>0&&n?(d=OE({allowEscapeViewBox:t,coordinate:n,key:"x",offsetTopLeft:r,position:s,reverseDirection:a,tooltipDimension:o.width,viewBox:c,viewBoxDimension:c.width}),f=OE({allowEscapeViewBox:t,coordinate:n,key:"y",offsetTopLeft:r,position:s,reverseDirection:a,tooltipDimension:o.height,viewBox:c,viewBoxDimension:c.height}),u=pfe({translateX:d,translateY:f,useTranslate3d:l})):u=ffe,{cssProperties:u,cssClasses:hfe({translateX:d,translateY:f,coordinate:n})}}function vu(e){"@babel/helpers - typeof";return vu=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},vu(e)}function kE(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(s){return Object.getOwnPropertyDescriptor(e,s).enumerable})),n.push.apply(n,r)}return n}function TE(e){for(var t=1;t$E||Math.abs(r.height-this.state.lastBoundingBox.height)>$E)&&this.setState({lastBoundingBox:{width:r.width,height:r.height}})}else(this.state.lastBoundingBox.width!==-1||this.state.lastBoundingBox.height!==-1)&&this.setState({lastBoundingBox:{width:-1,height:-1}})}},{key:"componentDidMount",value:function(){document.addEventListener("keydown",this.handleKeyDown),this.updateBBox()}},{key:"componentWillUnmount",value:function(){document.removeEventListener("keydown",this.handleKeyDown)}},{key:"componentDidUpdate",value:function(){var r,s;this.props.active&&this.updateBBox(),this.state.dismissed&&(((r=this.props.coordinate)===null||r===void 0?void 0:r.x)!==this.state.dismissedAtCoordinate.x||((s=this.props.coordinate)===null||s===void 0?void 0:s.y)!==this.state.dismissedAtCoordinate.y)&&(this.state.dismissed=!1)}},{key:"render",value:function(){var r=this,s=this.props,a=s.active,o=s.allowEscapeViewBox,l=s.animationDuration,c=s.animationEasing,u=s.children,d=s.coordinate,f=s.hasPayload,h=s.isAnimationActive,p=s.offset,g=s.position,m=s.reverseDirection,y=s.useTranslate3d,b=s.viewBox,x=s.wrapperStyle,w=mfe({allowEscapeViewBox:o,coordinate:d,offsetTopLeft:p,position:g,reverseDirection:m,tooltipBox:this.state.lastBoundingBox,useTranslate3d:y,viewBox:b}),j=w.cssClasses,S=w.cssProperties,N=TE(TE({transition:h&&a?"transform ".concat(l,"ms ").concat(c):void 0},S),{},{pointerEvents:"none",visibility:!this.state.dismissed&&a&&f?"visible":"hidden",position:"absolute",top:0,left:0},x);return E.createElement("div",{tabIndex:-1,className:j,style:N,ref:function(P){r.wrapperNode=P}},u)}}])}(v.PureComponent),_fe=function(){return!(typeof window<"u"&&window.document&&window.document.createElement&&window.setTimeout)},ea={isSsr:_fe(),get:function(t){return ea[t]},set:function(t,n){if(typeof t=="string")ea[t]=n;else{var r=Object.keys(t);r&&r.length&&r.forEach(function(s){ea[s]=t[s]})}}};function yu(e){"@babel/helpers - typeof";return yu=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},yu(e)}function ME(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(s){return Object.getOwnPropertyDescriptor(e,s).enumerable})),n.push.apply(n,r)}return n}function IE(e){for(var t=1;t0;return E.createElement(Nfe,{allowEscapeViewBox:o,animationDuration:l,animationEasing:c,isAnimationActive:h,active:a,coordinate:d,hasPayload:N,offset:p,position:y,reverseDirection:b,useTranslate3d:x,viewBox:w,wrapperStyle:j},Ife(u,IE(IE({},this.props),{},{payload:S})))}}])}(v.PureComponent);d_(mr,"displayName","Tooltip");d_(mr,"defaultProps",{accessibilityLayer:!1,allowEscapeViewBox:{x:!1,y:!1},animationDuration:400,animationEasing:"ease",contentStyle:{},coordinate:{x:0,y:0},cursor:!0,cursorStyle:{},filterNull:!0,isAnimationActive:!ea.isSsr,itemStyle:{},labelStyle:{},offset:10,reverseDirection:{x:!1,y:!1},separator:" : ",trigger:"hover",useTranslate3d:!1,viewBox:{x:0,y:0,height:0,width:0},wrapperStyle:{}});var Rfe=Fa,Dfe=function(){return Rfe.Date.now()},Lfe=Dfe,Ffe=/\s/;function Bfe(e){for(var t=e.length;t--&&Ffe.test(e.charAt(t)););return t}var zfe=Bfe,Ufe=zfe,Vfe=/^\s+/;function Wfe(e){return e&&e.slice(0,Ufe(e)+1).replace(Vfe,"")}var Hfe=Wfe,Gfe=Hfe,RE=Bo,qfe=td,DE=NaN,Kfe=/^[-+]0x[0-9a-f]+$/i,Xfe=/^0b[01]+$/i,Yfe=/^0o[0-7]+$/i,Zfe=parseInt;function Qfe(e){if(typeof e=="number")return e;if(qfe(e))return DE;if(RE(e)){var t=typeof e.valueOf=="function"?e.valueOf():e;e=RE(t)?t+"":t}if(typeof e!="string")return e===0?e:+e;e=Gfe(e);var n=Xfe.test(e);return n||Yfe.test(e)?Zfe(e.slice(2),n?2:8):Kfe.test(e)?DE:+e}var _5=Qfe,Jfe=Bo,L0=Lfe,LE=_5,ehe="Expected a function",the=Math.max,nhe=Math.min;function rhe(e,t,n){var r,s,a,o,l,c,u=0,d=!1,f=!1,h=!0;if(typeof e!="function")throw new TypeError(ehe);t=LE(t)||0,Jfe(n)&&(d=!!n.leading,f="maxWait"in n,a=f?the(LE(n.maxWait)||0,t):a,h="trailing"in n?!!n.trailing:h);function p(N){var _=r,P=s;return r=s=void 0,u=N,o=e.apply(P,_),o}function g(N){return u=N,l=setTimeout(b,t),d?p(N):o}function m(N){var _=N-c,P=N-u,k=t-_;return f?nhe(k,a-P):k}function y(N){var _=N-c,P=N-u;return c===void 0||_>=t||_<0||f&&P>=a}function b(){var N=L0();if(y(N))return x(N);l=setTimeout(b,m(N))}function x(N){return l=void 0,h&&r?p(N):(r=s=void 0,o)}function w(){l!==void 0&&clearTimeout(l),u=0,r=c=s=l=void 0}function j(){return l===void 0?o:x(L0())}function S(){var N=L0(),_=y(N);if(r=arguments,s=this,c=N,_){if(l===void 0)return g(c);if(f)return clearTimeout(l),l=setTimeout(b,t),p(c)}return l===void 0&&(l=setTimeout(b,t)),o}return S.cancel=w,S.flush=j,S}var she=rhe,ahe=she,ihe=Bo,ohe="Expected a function";function lhe(e,t,n){var r=!0,s=!0;if(typeof e!="function")throw new TypeError(ohe);return ihe(n)&&(r="leading"in n?!!n.leading:r,s="trailing"in n?!!n.trailing:s),ahe(e,t,{leading:r,maxWait:t,trailing:s})}var che=lhe;const P5=Gt(che);function fh(e){"@babel/helpers - typeof";return fh=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},fh(e)}function FE(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(s){return Object.getOwnPropertyDescriptor(e,s).enumerable})),n.push.apply(n,r)}return n}function tm(e){for(var t=1;te.length)&&(t=e.length);for(var n=0,r=new Array(t);n0&&($=P5($,m,{trailing:!0,leading:!1}));var L=new ResizeObserver($),H=S.current.getBoundingClientRect(),D=H.width,V=H.height;return M(D,V),L.observe(S.current),function(){L.disconnect()}},[M,m]);var A=v.useMemo(function(){var $=k.containerWidth,L=k.containerHeight;if($<0||L<0)return null;Js(ll(o)||ll(c),`The width(%s) and height(%s) are both fixed numbers, - maybe you don't need to use a ResponsiveContainer.`,o,c),Js(!n||n>0,"The aspect(%s) must be greater than zero.",n);var H=ll(o)?$:o,D=ll(c)?L:c;n&&n>0&&(H?D=H/n:D&&(H=D*n),h&&D>h&&(D=h)),Js(H>0||D>0,`The width(%s) and height(%s) of chart should be greater than 0, + A`).concat(o,",").concat(o,",0,1,1,").concat(l,",").concat(a),className:"recharts-legend-icon"});if(r.type==="rect")return E.createElement("path",{stroke:"none",fill:c,d:"M0,".concat(ps/8,"h").concat(ps,"v").concat(ps*3/4,"h").concat(-ps,"z"),className:"recharts-legend-icon"});if(E.isValidElement(r.legendIcon)){var u=Wse({},r);return delete u.legendIcon,E.cloneElement(r.legendIcon,u)}return E.createElement(o_,{fill:c,cx:a,cy:a,size:ps,sizeType:"diameter",type:r.type})}},{key:"renderItems",value:function(){var r=this,s=this.props,a=s.payload,o=s.iconSize,l=s.layout,c=s.formatter,u=s.inactiveColor,d={x:0,y:0,width:ps,height:ps},f={display:l==="horizontal"?"inline-block":"block",marginRight:10},h={display:"inline-block",verticalAlign:"middle",marginRight:4};return a.map(function(p,g){var m=p.formatter||c,y=jt(uh(uh({"recharts-legend-item":!0},"legend-item-".concat(g),!0),"inactive",p.inactive));if(p.type==="none")return null;var b=ht(p.value)?null:p.value;Js(!ht(p.value),`The name property is also required when using a function for the dataKey of a chart's cartesian components. Ex: `);var x=p.inactive?u:p.color;return E.createElement("li",a1({className:y,style:f,key:"legend-item-".concat(g)},Bl(r.props,p,g)),E.createElement(Yw,{width:o,height:o,viewBox:d,style:h},r.renderIcon(p)),E.createElement("span",{className:"recharts-legend-item-text",style:{color:x}},m?m(b,p,g):b))})}},{key:"render",value:function(){var r=this.props,s=r.payload,a=r.layout,o=r.align;if(!s||!s.length)return null;var l={padding:0,margin:0,textAlign:a==="horizontal"?o:"left"};return E.createElement("ul",{className:"recharts-default-legend",style:l},this.renderItems())}}])}(v.PureComponent);uh(l_,"displayName","Legend");uh(l_,"defaultProps",{iconSize:14,layout:"horizontal",align:"center",verticalAlign:"middle",inactiveColor:"#ccc"});var Jse=Ky;function eae(){this.__data__=new Jse,this.size=0}var tae=eae;function nae(e){var t=this.__data__,n=t.delete(e);return this.size=t.size,n}var rae=nae;function sae(e){return this.__data__.get(e)}var aae=sae;function iae(e){return this.__data__.has(e)}var oae=iae,lae=Ky,cae=XN,uae=YN,dae=200;function fae(e,t){var n=this.__data__;if(n instanceof lae){var r=n.__data__;if(!cae||r.lengthl))return!1;var u=a.get(e),d=a.get(t);if(u&&d)return u==t&&d==e;var f=-1,h=!0,p=n&Mae?new Oae:void 0;for(a.set(e,t),a.set(t,e);++f-1&&e%1==0&&e-1&&e%1==0&&e<=Lie}var f_=Fie,Bie=Ei,zie=f_,Uie=Oi,Vie="[object Arguments]",Wie="[object Array]",Gie="[object Boolean]",Hie="[object Date]",qie="[object Error]",Kie="[object Function]",Xie="[object Map]",Yie="[object Number]",Zie="[object Object]",Qie="[object RegExp]",Jie="[object Set]",eoe="[object String]",toe="[object WeakMap]",noe="[object ArrayBuffer]",roe="[object DataView]",soe="[object Float32Array]",aoe="[object Float64Array]",ioe="[object Int8Array]",ooe="[object Int16Array]",loe="[object Int32Array]",coe="[object Uint8Array]",uoe="[object Uint8ClampedArray]",doe="[object Uint16Array]",foe="[object Uint32Array]",cn={};cn[soe]=cn[aoe]=cn[ioe]=cn[ooe]=cn[loe]=cn[coe]=cn[uoe]=cn[doe]=cn[foe]=!0;cn[Vie]=cn[Wie]=cn[noe]=cn[Gie]=cn[roe]=cn[Hie]=cn[qie]=cn[Kie]=cn[Xie]=cn[Yie]=cn[Zie]=cn[Qie]=cn[Jie]=cn[eoe]=cn[toe]=!1;function hoe(e){return Uie(e)&&zie(e.length)&&!!cn[Bie(e)]}var poe=hoe;function moe(e){return function(t){return e(t)}}var o5=moe,Jg={exports:{}};Jg.exports;(function(e,t){var n=p3,r=t&&!t.nodeType&&t,s=r&&!0&&e&&!e.nodeType&&e,a=s&&s.exports===r,o=a&&n.process,l=function(){try{var c=s&&s.require&&s.require("util").types;return c||o&&o.binding&&o.binding("util")}catch{}}();e.exports=l})(Jg,Jg.exports);var goe=Jg.exports,voe=poe,yoe=o5,lE=goe,cE=lE&&lE.isTypedArray,xoe=cE?yoe(cE):voe,l5=xoe,boe=Sie,woe=u_,joe=Kr,Soe=i5,Noe=d_,_oe=l5,Poe=Object.prototype,Aoe=Poe.hasOwnProperty;function Coe(e,t){var n=joe(e),r=!n&&woe(e),s=!n&&!r&&Soe(e),a=!n&&!r&&!s&&_oe(e),o=n||r||s||a,l=o?boe(e.length,String):[],c=l.length;for(var u in e)(t||Aoe.call(e,u))&&!(o&&(u=="length"||s&&(u=="offset"||u=="parent")||a&&(u=="buffer"||u=="byteLength"||u=="byteOffset")||Noe(u,c)))&&l.push(u);return l}var Eoe=Coe,Ooe=Object.prototype;function koe(e){var t=e&&e.constructor,n=typeof t=="function"&&t.prototype||Ooe;return e===n}var Toe=koe;function $oe(e,t){return function(n){return e(t(n))}}var c5=$oe,Moe=c5,Ioe=Moe(Object.keys,Object),Roe=Ioe,Doe=Toe,Loe=Roe,Foe=Object.prototype,Boe=Foe.hasOwnProperty;function zoe(e){if(!Doe(e))return Loe(e);var t=[];for(var n in Object(e))Boe.call(e,n)&&n!="constructor"&&t.push(n);return t}var Uoe=zoe,Voe=qN,Woe=f_;function Goe(e){return e!=null&&Woe(e.length)&&!Voe(e)}var vp=Goe,Hoe=Eoe,qoe=Uoe,Koe=vp;function Xoe(e){return Koe(e)?Hoe(e):qoe(e)}var dx=Xoe,Yoe=die,Zoe=wie,Qoe=dx;function Joe(e){return Yoe(e,Qoe,Zoe)}var ele=Joe,uE=ele,tle=1,nle=Object.prototype,rle=nle.hasOwnProperty;function sle(e,t,n,r,s,a){var o=n&tle,l=uE(e),c=l.length,u=uE(t),d=u.length;if(c!=d&&!o)return!1;for(var f=c;f--;){var h=l[f];if(!(o?h in t:rle.call(t,h)))return!1}var p=a.get(e),g=a.get(t);if(p&&g)return p==t&&g==e;var m=!0;a.set(e,t),a.set(t,e);for(var y=o;++f-1}var nue=tue;function rue(e,t,n){for(var r=-1,s=e==null?0:e.length;++r=yue){var u=t?null:gue(e);if(u)return vue(u);o=!1,s=mue,c=new fue}else c=t?[]:l;e:for(;++r=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(n[r]=e[r])}return n}function Mue(e,t){if(e==null)return{};var n={};for(var r in e)if(Object.prototype.hasOwnProperty.call(e,r)){if(t.indexOf(r)>=0)continue;n[r]=e[r]}return n}function Iue(e){return e.value}function Rue(e,t){if(E.isValidElement(e))return E.cloneElement(e,t);if(typeof e=="function")return E.createElement(e,t);t.ref;var n=$ue(t,_ue);return E.createElement(l_,n)}var PE=1,di=function(e){function t(){var n;Pue(this,t);for(var r=arguments.length,s=new Array(r),a=0;aPE||Math.abs(s.height-this.lastBoundingBox.height)>PE)&&(this.lastBoundingBox.width=s.width,this.lastBoundingBox.height=s.height,r&&r(s)):(this.lastBoundingBox.width!==-1||this.lastBoundingBox.height!==-1)&&(this.lastBoundingBox.width=-1,this.lastBoundingBox.height=-1,r&&r(null))}},{key:"getBBoxSnapshot",value:function(){return this.lastBoundingBox.width>=0&&this.lastBoundingBox.height>=0?Ga({},this.lastBoundingBox):{width:0,height:0}}},{key:"getDefaultPosition",value:function(r){var s=this.props,a=s.layout,o=s.align,l=s.verticalAlign,c=s.margin,u=s.chartWidth,d=s.chartHeight,f,h;if(!r||(r.left===void 0||r.left===null)&&(r.right===void 0||r.right===null))if(o==="center"&&a==="vertical"){var p=this.getBBoxSnapshot();f={left:((u||0)-p.width)/2}}else f=o==="right"?{right:c&&c.right||0}:{left:c&&c.left||0};if(!r||(r.top===void 0||r.top===null)&&(r.bottom===void 0||r.bottom===null))if(l==="middle"){var g=this.getBBoxSnapshot();h={top:((d||0)-g.height)/2}}else h=l==="bottom"?{bottom:c&&c.bottom||0}:{top:c&&c.top||0};return Ga(Ga({},f),h)}},{key:"render",value:function(){var r=this,s=this.props,a=s.content,o=s.width,l=s.height,c=s.wrapperStyle,u=s.payloadUniqBy,d=s.payload,f=Ga(Ga({position:"absolute",width:o||"auto",height:l||"auto"},this.getDefaultPosition(c)),c);return E.createElement("div",{className:"recharts-legend-wrapper",style:f,ref:function(p){r.wrapperNode=p}},Rue(a,Ga(Ga({},this.props),{},{payload:g5(d,u,Iue)})))}}],[{key:"getWithHeight",value:function(r,s){var a=Ga(Ga({},this.defaultProps),r.props),o=a.layout;return o==="vertical"&&Ae(r.props.height)?{height:r.props.height}:o==="horizontal"?{width:r.props.width||s}:null}}])}(v.PureComponent);fx(di,"displayName","Legend");fx(di,"defaultProps",{iconSize:14,layout:"horizontal",align:"center",verticalAlign:"bottom"});var AE=mp,Due=u_,Lue=Kr,CE=AE?AE.isConcatSpreadable:void 0;function Fue(e){return Lue(e)||Due(e)||!!(CE&&e&&e[CE])}var Bue=Fue,zue=s5,Uue=Bue;function x5(e,t,n,r,s){var a=-1,o=e.length;for(n||(n=Uue),s||(s=[]);++a0&&n(l)?t>1?x5(l,t-1,n,r,s):zue(s,l):r||(s[s.length]=l)}return s}var b5=x5;function Vue(e){return function(t,n,r){for(var s=-1,a=Object(t),o=r(t),l=o.length;l--;){var c=o[e?l:++s];if(n(a[c],c,a)===!1)break}return t}}var Wue=Vue,Gue=Wue,Hue=Gue(),que=Hue,Kue=que,Xue=dx;function Yue(e,t){return e&&Kue(e,t,Xue)}var w5=Yue,Zue=vp;function Que(e,t){return function(n,r){if(n==null)return n;if(!Zue(n))return e(n,r);for(var s=n.length,a=t?s:-1,o=Object(n);(t?a--:++at||a&&o&&c&&!l&&!u||r&&o&&c||!n&&c||!s)return 1;if(!r&&!a&&!u&&e=l)return c;var u=n[r];return c*(u=="desc"?-1:1)}}return e.index-t.index}var fde=dde,F0=QN,hde=JN,pde=za,mde=j5,gde=ode,vde=o5,yde=fde,xde=ud,bde=Kr;function wde(e,t,n){t.length?t=F0(t,function(a){return bde(a)?function(o){return hde(o,a.length===1?a[0]:a)}:a}):t=[xde];var r=-1;t=F0(t,vde(pde));var s=mde(e,function(a,o,l){var c=F0(t,function(u){return u(a)});return{criteria:c,index:++r,value:a}});return gde(s,function(a,o){return yde(a,o,n)})}var jde=wde;function Sde(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 Nde=Sde,_de=Nde,OE=Math.max;function Pde(e,t,n){return t=OE(t===void 0?e.length-1:t,0),function(){for(var r=arguments,s=-1,a=OE(r.length-t,0),o=Array(a);++s0){if(++t>=Rde)return arguments[0]}else t=0;return e.apply(void 0,arguments)}}var Bde=Fde,zde=Ide,Ude=Bde,Vde=Ude(zde),Wde=Vde,Gde=ud,Hde=Ade,qde=Wde;function Kde(e,t){return qde(Hde(e,t,Gde),e+"")}var Xde=Kde,Yde=KN,Zde=vp,Qde=d_,Jde=Bo;function efe(e,t,n){if(!Jde(n))return!1;var r=typeof t;return(r=="number"?Zde(n)&&Qde(t,n.length):r=="string"&&t in n)?Yde(n[t],e):!1}var hx=efe,tfe=b5,nfe=jde,rfe=Xde,TE=hx,sfe=rfe(function(e,t){if(e==null)return[];var n=t.length;return n>1&&TE(e,t[0],t[1])?t=[]:n>2&&TE(t[0],t[1],t[2])&&(t=[t[0]]),nfe(e,tfe(t,1),[])}),afe=sfe;const m_=Ht(afe);function dh(e){"@babel/helpers - typeof";return dh=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},dh(e)}function h1(){return h1=Object.assign?Object.assign.bind():function(e){for(var t=1;te.length)&&(t=e.length);for(var n=0,r=new Array(t);n=t.x),"".concat($d,"-left"),Ae(n)&&t&&Ae(t.x)&&n=t.y),"".concat($d,"-top"),Ae(r)&&t&&Ae(t.y)&&rm?Math.max(d,c[r]):Math.max(f,c[r])}function bfe(e){var t=e.translateX,n=e.translateY,r=e.useTranslate3d;return{transform:r?"translate3d(".concat(t,"px, ").concat(n,"px, 0)"):"translate(".concat(t,"px, ").concat(n,"px)")}}function wfe(e){var t=e.allowEscapeViewBox,n=e.coordinate,r=e.offsetTopLeft,s=e.position,a=e.reverseDirection,o=e.tooltipBox,l=e.useTranslate3d,c=e.viewBox,u,d,f;return o.height>0&&o.width>0&&n?(d=IE({allowEscapeViewBox:t,coordinate:n,key:"x",offsetTopLeft:r,position:s,reverseDirection:a,tooltipDimension:o.width,viewBox:c,viewBoxDimension:c.width}),f=IE({allowEscapeViewBox:t,coordinate:n,key:"y",offsetTopLeft:r,position:s,reverseDirection:a,tooltipDimension:o.height,viewBox:c,viewBoxDimension:c.height}),u=bfe({translateX:d,translateY:f,useTranslate3d:l})):u=yfe,{cssProperties:u,cssClasses:xfe({translateX:d,translateY:f,coordinate:n})}}function vu(e){"@babel/helpers - typeof";return vu=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},vu(e)}function RE(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(s){return Object.getOwnPropertyDescriptor(e,s).enumerable})),n.push.apply(n,r)}return n}function DE(e){for(var t=1;tLE||Math.abs(r.height-this.state.lastBoundingBox.height)>LE)&&this.setState({lastBoundingBox:{width:r.width,height:r.height}})}else(this.state.lastBoundingBox.width!==-1||this.state.lastBoundingBox.height!==-1)&&this.setState({lastBoundingBox:{width:-1,height:-1}})}},{key:"componentDidMount",value:function(){document.addEventListener("keydown",this.handleKeyDown),this.updateBBox()}},{key:"componentWillUnmount",value:function(){document.removeEventListener("keydown",this.handleKeyDown)}},{key:"componentDidUpdate",value:function(){var r,s;this.props.active&&this.updateBBox(),this.state.dismissed&&(((r=this.props.coordinate)===null||r===void 0?void 0:r.x)!==this.state.dismissedAtCoordinate.x||((s=this.props.coordinate)===null||s===void 0?void 0:s.y)!==this.state.dismissedAtCoordinate.y)&&(this.state.dismissed=!1)}},{key:"render",value:function(){var r=this,s=this.props,a=s.active,o=s.allowEscapeViewBox,l=s.animationDuration,c=s.animationEasing,u=s.children,d=s.coordinate,f=s.hasPayload,h=s.isAnimationActive,p=s.offset,g=s.position,m=s.reverseDirection,y=s.useTranslate3d,b=s.viewBox,x=s.wrapperStyle,w=wfe({allowEscapeViewBox:o,coordinate:d,offsetTopLeft:p,position:g,reverseDirection:m,tooltipBox:this.state.lastBoundingBox,useTranslate3d:y,viewBox:b}),j=w.cssClasses,S=w.cssProperties,N=DE(DE({transition:h&&a?"transform ".concat(l,"ms ").concat(c):void 0},S),{},{pointerEvents:"none",visibility:!this.state.dismissed&&a&&f?"visible":"hidden",position:"absolute",top:0,left:0},x);return E.createElement("div",{tabIndex:-1,className:j,style:N,ref:function(P){r.wrapperNode=P}},u)}}])}(v.PureComponent),kfe=function(){return!(typeof window<"u"&&window.document&&window.document.createElement&&window.setTimeout)},ea={isSsr:kfe(),get:function(t){return ea[t]},set:function(t,n){if(typeof t=="string")ea[t]=n;else{var r=Object.keys(t);r&&r.length&&r.forEach(function(s){ea[s]=t[s]})}}};function yu(e){"@babel/helpers - typeof";return yu=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},yu(e)}function FE(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(s){return Object.getOwnPropertyDescriptor(e,s).enumerable})),n.push.apply(n,r)}return n}function BE(e){for(var t=1;t0;return E.createElement(Ofe,{allowEscapeViewBox:o,animationDuration:l,animationEasing:c,isAnimationActive:h,active:a,coordinate:d,hasPayload:N,offset:p,position:y,reverseDirection:b,useTranslate3d:x,viewBox:w,wrapperStyle:j},zfe(u,BE(BE({},this.props),{},{payload:S})))}}])}(v.PureComponent);g_(mr,"displayName","Tooltip");g_(mr,"defaultProps",{accessibilityLayer:!1,allowEscapeViewBox:{x:!1,y:!1},animationDuration:400,animationEasing:"ease",contentStyle:{},coordinate:{x:0,y:0},cursor:!0,cursorStyle:{},filterNull:!0,isAnimationActive:!ea.isSsr,itemStyle:{},labelStyle:{},offset:10,reverseDirection:{x:!1,y:!1},separator:" : ",trigger:"hover",useTranslate3d:!1,viewBox:{x:0,y:0,height:0,width:0},wrapperStyle:{}});var Ufe=Ba,Vfe=function(){return Ufe.Date.now()},Wfe=Vfe,Gfe=/\s/;function Hfe(e){for(var t=e.length;t--&&Gfe.test(e.charAt(t)););return t}var qfe=Hfe,Kfe=qfe,Xfe=/^\s+/;function Yfe(e){return e&&e.slice(0,Kfe(e)+1).replace(Xfe,"")}var Zfe=Yfe,Qfe=Zfe,zE=Bo,Jfe=td,UE=NaN,ehe=/^[-+]0x[0-9a-f]+$/i,the=/^0b[01]+$/i,nhe=/^0o[0-7]+$/i,rhe=parseInt;function she(e){if(typeof e=="number")return e;if(Jfe(e))return UE;if(zE(e)){var t=typeof e.valueOf=="function"?e.valueOf():e;e=zE(t)?t+"":t}if(typeof e!="string")return e===0?e:+e;e=Qfe(e);var n=the.test(e);return n||nhe.test(e)?rhe(e.slice(2),n?2:8):ehe.test(e)?UE:+e}var C5=she,ahe=Bo,z0=Wfe,VE=C5,ihe="Expected a function",ohe=Math.max,lhe=Math.min;function che(e,t,n){var r,s,a,o,l,c,u=0,d=!1,f=!1,h=!0;if(typeof e!="function")throw new TypeError(ihe);t=VE(t)||0,ahe(n)&&(d=!!n.leading,f="maxWait"in n,a=f?ohe(VE(n.maxWait)||0,t):a,h="trailing"in n?!!n.trailing:h);function p(N){var _=r,P=s;return r=s=void 0,u=N,o=e.apply(P,_),o}function g(N){return u=N,l=setTimeout(b,t),d?p(N):o}function m(N){var _=N-c,P=N-u,k=t-_;return f?lhe(k,a-P):k}function y(N){var _=N-c,P=N-u;return c===void 0||_>=t||_<0||f&&P>=a}function b(){var N=z0();if(y(N))return x(N);l=setTimeout(b,m(N))}function x(N){return l=void 0,h&&r?p(N):(r=s=void 0,o)}function w(){l!==void 0&&clearTimeout(l),u=0,r=c=s=l=void 0}function j(){return l===void 0?o:x(z0())}function S(){var N=z0(),_=y(N);if(r=arguments,s=this,c=N,_){if(l===void 0)return g(c);if(f)return clearTimeout(l),l=setTimeout(b,t),p(c)}return l===void 0&&(l=setTimeout(b,t)),o}return S.cancel=w,S.flush=j,S}var uhe=che,dhe=uhe,fhe=Bo,hhe="Expected a function";function phe(e,t,n){var r=!0,s=!0;if(typeof e!="function")throw new TypeError(hhe);return fhe(n)&&(r="leading"in n?!!n.leading:r,s="trailing"in n?!!n.trailing:s),dhe(e,t,{leading:r,maxWait:t,trailing:s})}var mhe=phe;const E5=Ht(mhe);function hh(e){"@babel/helpers - typeof";return hh=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},hh(e)}function WE(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(s){return Object.getOwnPropertyDescriptor(e,s).enumerable})),n.push.apply(n,r)}return n}function nm(e){for(var t=1;te.length)&&(t=e.length);for(var n=0,r=new Array(t);n0&&($=E5($,m,{trailing:!0,leading:!1}));var L=new ResizeObserver($),G=S.current.getBoundingClientRect(),D=G.width,V=G.height;return M(D,V),L.observe(S.current),function(){L.disconnect()}},[M,m]);var A=v.useMemo(function(){var $=k.containerWidth,L=k.containerHeight;if($<0||L<0)return null;Js(ll(o)||ll(c),`The width(%s) and height(%s) are both fixed numbers, + maybe you don't need to use a ResponsiveContainer.`,o,c),Js(!n||n>0,"The aspect(%s) must be greater than zero.",n);var G=ll(o)?$:o,D=ll(c)?L:c;n&&n>0&&(G?D=G/n:D&&(G=D*n),h&&D>h&&(D=h)),Js(G>0||D>0,`The width(%s) and height(%s) of chart should be greater than 0, please check the style of container, or the props width(%s) and height(%s), or add a minWidth(%s) or minHeight(%s) or use aspect(%s) to control the - height and width.`,H,D,o,c,d,f,n);var V=!Array.isArray(p)&&li(p.type).endsWith("Chart");return E.Children.map(p,function(T){return j3.isElement(T)?v.cloneElement(T,tm({width:H,height:D},V?{style:tm({height:"100%",width:"100%",maxHeight:D,maxWidth:H},T.props.style)}:{})):T})},[n,p,c,h,f,d,k,o]);return E.createElement("div",{id:y?"".concat(y):void 0,className:wt("recharts-responsive-container",b),style:tm(tm({},j),{},{width:o,height:c,minWidth:d,minHeight:f,maxHeight:h}),ref:S},A)}),vp=function(t){return null};vp.displayName="Cell";function hh(e){"@babel/helpers - typeof";return hh=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},hh(e)}function zE(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(s){return Object.getOwnPropertyDescriptor(e,s).enumerable})),n.push.apply(n,r)}return n}function m1(e){for(var t=1;t1&&arguments[1]!==void 0?arguments[1]:{};if(t==null||ea.isSsr)return{width:0,height:0};var r=She(n),s=JSON.stringify({text:t,copyStyle:r});if(lc.widthCache[s])return lc.widthCache[s];try{var a=document.getElementById(UE);a||(a=document.createElement("span"),a.setAttribute("id",UE),a.setAttribute("aria-hidden","true"),document.body.appendChild(a));var o=m1(m1({},jhe),r);Object.assign(a.style,o),a.textContent="".concat(t);var l=a.getBoundingClientRect(),c={width:l.width,height:l.height};return lc.widthCache[s]=c,++lc.cacheCount>whe&&(lc.cacheCount=0,lc.widthCache={}),c}catch{return{width:0,height:0}}},Nhe=function(t){return{top:t.top+window.scrollY-document.documentElement.clientTop,left:t.left+window.scrollX-document.documentElement.clientLeft}};function ph(e){"@babel/helpers - typeof";return ph=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},ph(e)}function tv(e,t){return Che(e)||Ahe(e,t)||Phe(e,t)||_he()}function _he(){throw new TypeError(`Invalid attempt to destructure non-iterable instance. -In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function Phe(e,t){if(e){if(typeof e=="string")return VE(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);if(n==="Object"&&e.constructor&&(n=e.constructor.name),n==="Map"||n==="Set")return Array.from(e);if(n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return VE(e,t)}}function VE(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(n[r]=e[r])}return n}function Uhe(e,t){if(e==null)return{};var n={};for(var r in e)if(Object.prototype.hasOwnProperty.call(e,r)){if(t.indexOf(r)>=0)continue;n[r]=e[r]}return n}function XE(e,t){return Ghe(e)||Hhe(e,t)||Whe(e,t)||Vhe()}function Vhe(){throw new TypeError(`Invalid attempt to destructure non-iterable instance. -In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function Whe(e,t){if(e){if(typeof e=="string")return YE(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);if(n==="Object"&&e.constructor&&(n=e.constructor.name),n==="Map"||n==="Set")return Array.from(e);if(n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return YE(e,t)}}function YE(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n0&&arguments[0]!==void 0?arguments[0]:[];return H.reduce(function(D,V){var T=V.word,F=V.width,q=D[D.length-1];if(q&&(s==null||a||q.width+F+rV.width?D:V})};if(!d)return p;for(var m="…",y=function(H){var D=f.slice(0,H),V=O5({breakAll:u,style:c,children:D+m}).wordsWithComputedWidth,T=h(V),F=T.length>o||g(T).width>Number(s);return[F,T]},b=0,x=f.length-1,w=0,j;b<=x&&w<=f.length-1;){var S=Math.floor((b+x)/2),N=S-1,_=y(N),P=XE(_,2),k=P[0],O=P[1],M=y(S),A=XE(M,1),$=A[0];if(!k&&!$&&(b=S+1),k&&$&&(x=S-1),!k&&$){j=O;break}w++}return j||p},ZE=function(t){var n=Nt(t)?[]:t.toString().split(E5);return[{words:n}]},Khe=function(t){var n=t.width,r=t.scaleToFit,s=t.children,a=t.style,o=t.breakAll,l=t.maxLines;if((n||r)&&!ea.isSsr){var c,u,d=O5({breakAll:o,children:s,style:a});if(d){var f=d.wordsWithComputedWidth,h=d.spaceWidth;c=f,u=h}else return ZE(s);return qhe({breakAll:o,children:s,maxLines:l,style:a},c,u,n,r)}return ZE(s)},QE="#808080",zl=function(t){var n=t.x,r=n===void 0?0:n,s=t.y,a=s===void 0?0:s,o=t.lineHeight,l=o===void 0?"1em":o,c=t.capHeight,u=c===void 0?"0.71em":c,d=t.scaleToFit,f=d===void 0?!1:d,h=t.textAnchor,p=h===void 0?"start":h,g=t.verticalAnchor,m=g===void 0?"end":g,y=t.fill,b=y===void 0?QE:y,x=KE(t,Bhe),w=v.useMemo(function(){return Khe({breakAll:x.breakAll,children:x.children,maxLines:x.maxLines,scaleToFit:f,style:x.style,width:x.width})},[x.breakAll,x.children,x.maxLines,f,x.style,x.width]),j=x.dx,S=x.dy,N=x.angle,_=x.className,P=x.breakAll,k=KE(x,zhe);if(!qn(r)||!qn(a))return null;var O=r+(Ae(j)?j:0),M=a+(Ae(S)?S:0),A;switch(m){case"start":A=F0("calc(".concat(u,")"));break;case"middle":A=F0("calc(".concat((w.length-1)/2," * -").concat(l," + (").concat(u," / 2))"));break;default:A=F0("calc(".concat(w.length-1," * -").concat(l,")"));break}var $=[];if(f){var L=w[0].width,H=x.width;$.push("scale(".concat((Ae(H)?H/L:1)/L,")"))}return N&&$.push("rotate(".concat(N,", ").concat(O,", ").concat(M,")")),$.length&&(k.transform=$.join(" ")),E.createElement("text",g1({},Xe(k,!0),{x:O,y:M,className:wt("recharts-text",_),textAnchor:p,fill:b.includes("url")?QE:b}),w.map(function(D,V){var T=D.words.join(P?"":" ");return E.createElement("tspan",{x:O,dy:V===0?A:l,key:"".concat(T,"-").concat(V)},T)}))};function xo(e,t){return e==null||t==null?NaN:et?1:e>=t?0:NaN}function Xhe(e,t){return e==null||t==null?NaN:te?1:t>=e?0:NaN}function f_(e){let t,n,r;e.length!==2?(t=xo,n=(l,c)=>xo(e(l),c),r=(l,c)=>e(l)-c):(t=e===xo||e===Xhe?e:Yhe,n=e,r=e);function s(l,c,u=0,d=l.length){if(u>>1;n(l[f],c)<0?u=f+1:d=f}while(u>>1;n(l[f],c)<=0?u=f+1:d=f}while(uu&&r(l[f-1],c)>-r(l[f],c)?f-1:f}return{left:s,center:o,right:a}}function Yhe(){return 0}function k5(e){return e===null?NaN:+e}function*Zhe(e,t){for(let n of e)n!=null&&(n=+n)>=n&&(yield n)}const Qhe=f_(xo),yp=Qhe.right;f_(k5).center;class JE extends Map{constructor(t,n=tpe){if(super(),Object.defineProperties(this,{_intern:{value:new Map},_key:{value:n}}),t!=null)for(const[r,s]of t)this.set(r,s)}get(t){return super.get(e2(this,t))}has(t){return super.has(e2(this,t))}set(t,n){return super.set(Jhe(this,t),n)}delete(t){return super.delete(epe(this,t))}}function e2({_intern:e,_key:t},n){const r=t(n);return e.has(r)?e.get(r):n}function Jhe({_intern:e,_key:t},n){const r=t(n);return e.has(r)?e.get(r):(e.set(r,n),n)}function epe({_intern:e,_key:t},n){const r=t(n);return e.has(r)&&(n=e.get(r),e.delete(r)),n}function tpe(e){return e!==null&&typeof e=="object"?e.valueOf():e}function npe(e=xo){if(e===xo)return T5;if(typeof e!="function")throw new TypeError("compare is not a function");return(t,n)=>{const r=e(t,n);return r||r===0?r:(e(n,n)===0)-(e(t,t)===0)}}function T5(e,t){return(e==null||!(e>=e))-(t==null||!(t>=t))||(et?1:0)}const rpe=Math.sqrt(50),spe=Math.sqrt(10),ape=Math.sqrt(2);function nv(e,t,n){const r=(t-e)/Math.max(0,n),s=Math.floor(Math.log10(r)),a=r/Math.pow(10,s),o=a>=rpe?10:a>=spe?5:a>=ape?2:1;let l,c,u;return s<0?(u=Math.pow(10,-s)/o,l=Math.round(e*u),c=Math.round(t*u),l/ut&&--c,u=-u):(u=Math.pow(10,s)*o,l=Math.round(e/u),c=Math.round(t/u),l*ut&&--c),c0))return[];if(e===t)return[e];const r=t=s))return[];const l=a-s+1,c=new Array(l);if(r)if(o<0)for(let u=0;u=r)&&(n=r);return n}function n2(e,t){let n;for(const r of e)r!=null&&(n>r||n===void 0&&r>=r)&&(n=r);return n}function $5(e,t,n=0,r=1/0,s){if(t=Math.floor(t),n=Math.floor(Math.max(0,n)),r=Math.floor(Math.min(e.length-1,r)),!(n<=t&&t<=r))return e;for(s=s===void 0?T5:npe(s);r>n;){if(r-n>600){const c=r-n+1,u=t-n+1,d=Math.log(c),f=.5*Math.exp(2*d/3),h=.5*Math.sqrt(d*f*(c-f)/c)*(u-c/2<0?-1:1),p=Math.max(n,Math.floor(t-u*f/c+h)),g=Math.min(r,Math.floor(t+(c-u)*f/c+h));$5(e,t,p,g,s)}const a=e[t];let o=n,l=r;for(Md(e,n,t),s(e[r],a)>0&&Md(e,n,r);o0;)--l}s(e[n],a)===0?Md(e,n,l):(++l,Md(e,l,r)),l<=t&&(n=l+1),t<=l&&(r=l-1)}return e}function Md(e,t,n){const r=e[t];e[t]=e[n],e[n]=r}function ipe(e,t,n){if(e=Float64Array.from(Zhe(e)),!(!(r=e.length)||isNaN(t=+t))){if(t<=0||r<2)return n2(e);if(t>=1)return t2(e);var r,s=(r-1)*t,a=Math.floor(s),o=t2($5(e,a).subarray(0,a+1)),l=n2(e.subarray(a+1));return o+(l-o)*(s-a)}}function ope(e,t,n=k5){if(!(!(r=e.length)||isNaN(t=+t))){if(t<=0||r<2)return+n(e[0],0,e);if(t>=1)return+n(e[r-1],r-1,e);var r,s=(r-1)*t,a=Math.floor(s),o=+n(e[a],a,e),l=+n(e[a+1],a+1,e);return o+(l-o)*(s-a)}}function lpe(e,t,n){e=+e,t=+t,n=(s=arguments.length)<2?(t=e,e=0,1):s<3?1:+n;for(var r=-1,s=Math.max(0,Math.ceil((t-e)/n))|0,a=new Array(s);++r>8&15|t>>4&240,t>>4&15|t&240,(t&15)<<4|t&15,1):n===8?rm(t>>24&255,t>>16&255,t>>8&255,(t&255)/255):n===4?rm(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=upe.exec(e))?new Br(t[1],t[2],t[3],1):(t=dpe.exec(e))?new Br(t[1]*255/100,t[2]*255/100,t[3]*255/100,1):(t=fpe.exec(e))?rm(t[1],t[2],t[3],t[4]):(t=hpe.exec(e))?rm(t[1]*255/100,t[2]*255/100,t[3]*255/100,t[4]):(t=ppe.exec(e))?c2(t[1],t[2]/100,t[3]/100,1):(t=mpe.exec(e))?c2(t[1],t[2]/100,t[3]/100,t[4]):r2.hasOwnProperty(e)?i2(r2[e]):e==="transparent"?new Br(NaN,NaN,NaN,0):null}function i2(e){return new Br(e>>16&255,e>>8&255,e&255,1)}function rm(e,t,n,r){return r<=0&&(e=t=n=NaN),new Br(e,t,n,r)}function ype(e){return e instanceof xp||(e=yh(e)),e?(e=e.rgb(),new Br(e.r,e.g,e.b,e.opacity)):new Br}function w1(e,t,n,r){return arguments.length===1?ype(e):new Br(e,t,n,r??1)}function Br(e,t,n,r){this.r=+e,this.g=+t,this.b=+n,this.opacity=+r}p_(Br,w1,I5(xp,{brighter(e){return e=e==null?rv:Math.pow(rv,e),new Br(this.r*e,this.g*e,this.b*e,this.opacity)},darker(e){return e=e==null?gh:Math.pow(gh,e),new Br(this.r*e,this.g*e,this.b*e,this.opacity)},rgb(){return this},clamp(){return new Br(Sl(this.r),Sl(this.g),Sl(this.b),sv(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:o2,formatHex:o2,formatHex8:xpe,formatRgb:l2,toString:l2}));function o2(){return`#${cl(this.r)}${cl(this.g)}${cl(this.b)}`}function xpe(){return`#${cl(this.r)}${cl(this.g)}${cl(this.b)}${cl((isNaN(this.opacity)?1:this.opacity)*255)}`}function l2(){const e=sv(this.opacity);return`${e===1?"rgb(":"rgba("}${Sl(this.r)}, ${Sl(this.g)}, ${Sl(this.b)}${e===1?")":`, ${e})`}`}function sv(e){return isNaN(e)?1:Math.max(0,Math.min(1,e))}function Sl(e){return Math.max(0,Math.min(255,Math.round(e)||0))}function cl(e){return e=Sl(e),(e<16?"0":"")+e.toString(16)}function c2(e,t,n,r){return r<=0?e=t=n=NaN:n<=0||n>=1?e=t=NaN:t<=0&&(e=NaN),new Gs(e,t,n,r)}function R5(e){if(e instanceof Gs)return new Gs(e.h,e.s,e.l,e.opacity);if(e instanceof xp||(e=yh(e)),!e)return new Gs;if(e instanceof Gs)return e;e=e.rgb();var t=e.r/255,n=e.g/255,r=e.b/255,s=Math.min(t,n,r),a=Math.max(t,n,r),o=NaN,l=a-s,c=(a+s)/2;return l?(t===a?o=(n-r)/l+(n0&&c<1?0:o,new Gs(o,l,c,e.opacity)}function bpe(e,t,n,r){return arguments.length===1?R5(e):new Gs(e,t,n,r??1)}function Gs(e,t,n,r){this.h=+e,this.s=+t,this.l=+n,this.opacity=+r}p_(Gs,bpe,I5(xp,{brighter(e){return e=e==null?rv:Math.pow(rv,e),new Gs(this.h,this.s,this.l*e,this.opacity)},darker(e){return e=e==null?gh:Math.pow(gh,e),new Gs(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,s=2*n-r;return new Br(B0(e>=240?e-240:e+120,s,r),B0(e,s,r),B0(e<120?e+240:e-120,s,r),this.opacity)},clamp(){return new Gs(u2(this.h),sm(this.s),sm(this.l),sv(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=sv(this.opacity);return`${e===1?"hsl(":"hsla("}${u2(this.h)}, ${sm(this.s)*100}%, ${sm(this.l)*100}%${e===1?")":`, ${e})`}`}}));function u2(e){return e=(e||0)%360,e<0?e+360:e}function sm(e){return Math.max(0,Math.min(1,e||0))}function B0(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 m_=e=>()=>e;function wpe(e,t){return function(n){return e+n*t}}function jpe(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 Spe(e){return(e=+e)==1?D5:function(t,n){return n-t?jpe(t,n,e):m_(isNaN(t)?n:t)}}function D5(e,t){var n=t-e;return n?wpe(e,n):m_(isNaN(e)?t:e)}const d2=function e(t){var n=Spe(t);function r(s,a){var o=n((s=w1(s)).r,(a=w1(a)).r),l=n(s.g,a.g),c=n(s.b,a.b),u=D5(s.opacity,a.opacity);return function(d){return s.r=o(d),s.g=l(d),s.b=c(d),s.opacity=u(d),s+""}}return r.gamma=e,r}(1);function Npe(e,t){t||(t=[]);var n=e?Math.min(t.length,e.length):0,r=t.slice(),s;return function(a){for(s=0;sn&&(a=t.slice(n,a),l[o]?l[o]+=a:l[++o]=a),(r=r[0])===(s=s[0])?l[o]?l[o]+=s:l[++o]=s:(l[++o]=null,c.push({i:o,x:av(r,s)})),n=z0.lastIndex;return nt&&(n=e,e=t,t=n),function(r){return Math.max(e,Math.min(t,r))}}function Ipe(e,t,n){var r=e[0],s=e[1],a=t[0],o=t[1];return s2?Rpe:Ipe,c=u=null,f}function f(h){return h==null||isNaN(h=+h)?a:(c||(c=l(e.map(r),t,n)))(r(o(h)))}return f.invert=function(h){return o(s((u||(u=l(t,e.map(r),av)))(h)))},f.domain=function(h){return arguments.length?(e=Array.from(h,iv),d()):e.slice()},f.range=function(h){return arguments.length?(t=Array.from(h),d()):t.slice()},f.rangeRound=function(h){return t=Array.from(h),n=g_,d()},f.clamp=function(h){return arguments.length?(o=h?!0:Er,d()):o!==Er},f.interpolate=function(h){return arguments.length?(n=h,d()):n},f.unknown=function(h){return arguments.length?(a=h,f):a},function(h,p){return r=h,s=p,d()}}function v_(){return dx()(Er,Er)}function Dpe(e){return Math.abs(e=Math.round(e))>=1e21?e.toLocaleString("en").replace(/,/g,""):e.toString(10)}function ov(e,t){if((n=(e=t?e.toExponential(t-1):e.toExponential()).indexOf("e"))<0)return null;var n,r=e.slice(0,n);return[r.length>1?r[0]+r.slice(2):r,+e.slice(n+1)]}function xu(e){return e=ov(Math.abs(e)),e?e[1]:NaN}function Lpe(e,t){return function(n,r){for(var s=n.length,a=[],o=0,l=e[0],c=0;s>0&&l>0&&(c+l+1>r&&(l=Math.max(1,r-c)),a.push(n.substring(s-=l,s+l)),!((c+=l+1)>r));)l=e[o=(o+1)%e.length];return a.reverse().join(t)}}function Fpe(e){return function(t){return t.replace(/[0-9]/g,function(n){return e[+n]})}}var Bpe=/^(?:(.)?([<>=^]))?([+\-( ])?([$#])?(0)?(\d+)?(,)?(\.\d+)?(~)?([a-z%])?$/i;function xh(e){if(!(t=Bpe.exec(e)))throw new Error("invalid format: "+e);var t;return new y_({fill:t[1],align:t[2],sign:t[3],symbol:t[4],zero:t[5],width:t[6],comma:t[7],precision:t[8]&&t[8].slice(1),trim:t[9],type:t[10]})}xh.prototype=y_.prototype;function y_(e){this.fill=e.fill===void 0?" ":e.fill+"",this.align=e.align===void 0?">":e.align+"",this.sign=e.sign===void 0?"-":e.sign+"",this.symbol=e.symbol===void 0?"":e.symbol+"",this.zero=!!e.zero,this.width=e.width===void 0?void 0:+e.width,this.comma=!!e.comma,this.precision=e.precision===void 0?void 0:+e.precision,this.trim=!!e.trim,this.type=e.type===void 0?"":e.type+""}y_.prototype.toString=function(){return this.fill+this.align+this.sign+this.symbol+(this.zero?"0":"")+(this.width===void 0?"":Math.max(1,this.width|0))+(this.comma?",":"")+(this.precision===void 0?"":"."+Math.max(0,this.precision|0))+(this.trim?"~":"")+this.type};function zpe(e){e:for(var t=e.length,n=1,r=-1,s;n0&&(r=0);break}return r>0?e.slice(0,r)+e.slice(s+1):e}var L5;function Upe(e,t){var n=ov(e,t);if(!n)return e+"";var r=n[0],s=n[1],a=s-(L5=Math.max(-8,Math.min(8,Math.floor(s/3)))*3)+1,o=r.length;return a===o?r:a>o?r+new Array(a-o+1).join("0"):a>0?r.slice(0,a)+"."+r.slice(a):"0."+new Array(1-a).join("0")+ov(e,Math.max(0,t+a-1))[0]}function h2(e,t){var n=ov(e,t);if(!n)return e+"";var r=n[0],s=n[1];return s<0?"0."+new Array(-s).join("0")+r:r.length>s+1?r.slice(0,s+1)+"."+r.slice(s+1):r+new Array(s-r.length+2).join("0")}const p2={"%":(e,t)=>(e*100).toFixed(t),b:e=>Math.round(e).toString(2),c:e=>e+"",d:Dpe,e:(e,t)=>e.toExponential(t),f:(e,t)=>e.toFixed(t),g:(e,t)=>e.toPrecision(t),o:e=>Math.round(e).toString(8),p:(e,t)=>h2(e*100,t),r:h2,s:Upe,X:e=>Math.round(e).toString(16).toUpperCase(),x:e=>Math.round(e).toString(16)};function m2(e){return e}var g2=Array.prototype.map,v2=["y","z","a","f","p","n","µ","m","","k","M","G","T","P","E","Z","Y"];function Vpe(e){var t=e.grouping===void 0||e.thousands===void 0?m2:Lpe(g2.call(e.grouping,Number),e.thousands+""),n=e.currency===void 0?"":e.currency[0]+"",r=e.currency===void 0?"":e.currency[1]+"",s=e.decimal===void 0?".":e.decimal+"",a=e.numerals===void 0?m2:Fpe(g2.call(e.numerals,String)),o=e.percent===void 0?"%":e.percent+"",l=e.minus===void 0?"−":e.minus+"",c=e.nan===void 0?"NaN":e.nan+"";function u(f){f=xh(f);var h=f.fill,p=f.align,g=f.sign,m=f.symbol,y=f.zero,b=f.width,x=f.comma,w=f.precision,j=f.trim,S=f.type;S==="n"?(x=!0,S="g"):p2[S]||(w===void 0&&(w=12),j=!0,S="g"),(y||h==="0"&&p==="=")&&(y=!0,h="0",p="=");var N=m==="$"?n:m==="#"&&/[boxX]/.test(S)?"0"+S.toLowerCase():"",_=m==="$"?r:/[%p]/.test(S)?o:"",P=p2[S],k=/[defgprs%]/.test(S);w=w===void 0?6:/[gprs]/.test(S)?Math.max(1,Math.min(21,w)):Math.max(0,Math.min(20,w));function O(M){var A=N,$=_,L,H,D;if(S==="c")$=P(M)+$,M="";else{M=+M;var V=M<0||1/M<0;if(M=isNaN(M)?c:P(Math.abs(M),w),j&&(M=zpe(M)),V&&+M==0&&g!=="+"&&(V=!1),A=(V?g==="("?g:l:g==="-"||g==="("?"":g)+A,$=(S==="s"?v2[8+L5/3]:"")+$+(V&&g==="("?")":""),k){for(L=-1,H=M.length;++LD||D>57){$=(D===46?s+M.slice(L+1):M.slice(L))+$,M=M.slice(0,L);break}}}x&&!y&&(M=t(M,1/0));var T=A.length+M.length+$.length,F=T>1)+A+M+$+F.slice(T);break;default:M=F+A+M+$;break}return a(M)}return O.toString=function(){return f+""},O}function d(f,h){var p=u((f=xh(f),f.type="f",f)),g=Math.max(-8,Math.min(8,Math.floor(xu(h)/3)))*3,m=Math.pow(10,-g),y=v2[8+g/3];return function(b){return p(m*b)+y}}return{format:u,formatPrefix:d}}var am,x_,F5;Wpe({thousands:",",grouping:[3],currency:["$",""]});function Wpe(e){return am=Vpe(e),x_=am.format,F5=am.formatPrefix,am}function Hpe(e){return Math.max(0,-xu(Math.abs(e)))}function Gpe(e,t){return Math.max(0,Math.max(-8,Math.min(8,Math.floor(xu(t)/3)))*3-xu(Math.abs(e)))}function qpe(e,t){return e=Math.abs(e),t=Math.abs(t)-e,Math.max(0,xu(t)-xu(e))+1}function B5(e,t,n,r){var s=x1(e,t,n),a;switch(r=xh(r??",f"),r.type){case"s":{var o=Math.max(Math.abs(e),Math.abs(t));return r.precision==null&&!isNaN(a=Gpe(s,o))&&(r.precision=a),F5(r,o)}case"":case"e":case"g":case"p":case"r":{r.precision==null&&!isNaN(a=qpe(s,Math.max(Math.abs(e),Math.abs(t))))&&(r.precision=a-(r.type==="e"));break}case"f":case"%":{r.precision==null&&!isNaN(a=Hpe(s))&&(r.precision=a-(r.type==="%")*2);break}}return x_(r)}function zo(e){var t=e.domain;return e.ticks=function(n){var r=t();return v1(r[0],r[r.length-1],n??10)},e.tickFormat=function(n,r){var s=t();return B5(s[0],s[s.length-1],n??10,r)},e.nice=function(n){n==null&&(n=10);var r=t(),s=0,a=r.length-1,o=r[s],l=r[a],c,u,d=10;for(l0;){if(u=y1(o,l,n),u===c)return r[s]=o,r[a]=l,t(r);if(u>0)o=Math.floor(o/u)*u,l=Math.ceil(l/u)*u;else if(u<0)o=Math.ceil(o*u)/u,l=Math.floor(l*u)/u;else break;c=u}return e},e}function lv(){var e=v_();return e.copy=function(){return bp(e,lv())},Ts.apply(e,arguments),zo(e)}function z5(e){var t;function n(r){return r==null||isNaN(r=+r)?t:r}return n.invert=n,n.domain=n.range=function(r){return arguments.length?(e=Array.from(r,iv),n):e.slice()},n.unknown=function(r){return arguments.length?(t=r,n):t},n.copy=function(){return z5(e).unknown(t)},e=arguments.length?Array.from(e,iv):[0,1],zo(n)}function U5(e,t){e=e.slice();var n=0,r=e.length-1,s=e[n],a=e[r],o;return aMath.pow(e,t)}function Qpe(e){return e===Math.E?Math.log:e===10&&Math.log10||e===2&&Math.log2||(e=Math.log(e),t=>Math.log(t)/e)}function b2(e){return(t,n)=>-e(-t,n)}function b_(e){const t=e(y2,x2),n=t.domain;let r=10,s,a;function o(){return s=Qpe(r),a=Zpe(r),n()[0]<0?(s=b2(s),a=b2(a),e(Kpe,Xpe)):e(y2,x2),t}return t.base=function(l){return arguments.length?(r=+l,o()):r},t.domain=function(l){return arguments.length?(n(l),o()):n()},t.ticks=l=>{const c=n();let u=c[0],d=c[c.length-1];const f=d0){for(;h<=p;++h)for(g=1;gd)break;b.push(m)}}else for(;h<=p;++h)for(g=r-1;g>=1;--g)if(m=h>0?g/a(-h):g*a(h),!(md)break;b.push(m)}b.length*2{if(l==null&&(l=10),c==null&&(c=r===10?"s":","),typeof c!="function"&&(!(r%1)&&(c=xh(c)).precision==null&&(c.trim=!0),c=x_(c)),l===1/0)return c;const u=Math.max(1,r*l/t.ticks().length);return d=>{let f=d/a(Math.round(s(d)));return f*rn(U5(n(),{floor:l=>a(Math.floor(s(l))),ceil:l=>a(Math.ceil(s(l)))})),t}function V5(){const e=b_(dx()).domain([1,10]);return e.copy=()=>bp(e,V5()).base(e.base()),Ts.apply(e,arguments),e}function w2(e){return function(t){return Math.sign(t)*Math.log1p(Math.abs(t/e))}}function j2(e){return function(t){return Math.sign(t)*Math.expm1(Math.abs(t))*e}}function w_(e){var t=1,n=e(w2(t),j2(t));return n.constant=function(r){return arguments.length?e(w2(t=+r),j2(t)):t},zo(n)}function W5(){var e=w_(dx());return e.copy=function(){return bp(e,W5()).constant(e.constant())},Ts.apply(e,arguments)}function S2(e){return function(t){return t<0?-Math.pow(-t,e):Math.pow(t,e)}}function Jpe(e){return e<0?-Math.sqrt(-e):Math.sqrt(e)}function eme(e){return e<0?-e*e:e*e}function j_(e){var t=e(Er,Er),n=1;function r(){return n===1?e(Er,Er):n===.5?e(Jpe,eme):e(S2(n),S2(1/n))}return t.exponent=function(s){return arguments.length?(n=+s,r()):n},zo(t)}function S_(){var e=j_(dx());return e.copy=function(){return bp(e,S_()).exponent(e.exponent())},Ts.apply(e,arguments),e}function tme(){return S_.apply(null,arguments).exponent(.5)}function N2(e){return Math.sign(e)*e*e}function nme(e){return Math.sign(e)*Math.sqrt(Math.abs(e))}function H5(){var e=v_(),t=[0,1],n=!1,r;function s(a){var o=nme(e(a));return isNaN(o)?r:n?Math.round(o):o}return s.invert=function(a){return e.invert(N2(a))},s.domain=function(a){return arguments.length?(e.domain(a),s):e.domain()},s.range=function(a){return arguments.length?(e.range((t=Array.from(a,iv)).map(N2)),s):t.slice()},s.rangeRound=function(a){return s.range(a).round(!0)},s.round=function(a){return arguments.length?(n=!!a,s):n},s.clamp=function(a){return arguments.length?(e.clamp(a),s):e.clamp()},s.unknown=function(a){return arguments.length?(r=a,s):r},s.copy=function(){return H5(e.domain(),t).round(n).clamp(e.clamp()).unknown(r)},Ts.apply(s,arguments),zo(s)}function G5(){var e=[],t=[],n=[],r;function s(){var o=0,l=Math.max(1,t.length);for(n=new Array(l-1);++o0?n[l-1]:e[0],l=n?[r[n-1],t]:[r[u-1],r[u]]},o.unknown=function(c){return arguments.length&&(a=c),o},o.thresholds=function(){return r.slice()},o.copy=function(){return q5().domain([e,t]).range(s).unknown(a)},Ts.apply(zo(o),arguments)}function K5(){var e=[.5],t=[0,1],n,r=1;function s(a){return a!=null&&a<=a?t[yp(e,a,0,r)]:n}return s.domain=function(a){return arguments.length?(e=Array.from(a),r=Math.min(e.length,t.length-1),s):e.slice()},s.range=function(a){return arguments.length?(t=Array.from(a),r=Math.min(e.length,t.length-1),s):t.slice()},s.invertExtent=function(a){var o=t.indexOf(a);return[e[o-1],e[o]]},s.unknown=function(a){return arguments.length?(n=a,s):n},s.copy=function(){return K5().domain(e).range(t).unknown(n)},Ts.apply(s,arguments)}const U0=new Date,V0=new Date;function Kn(e,t,n,r){function s(a){return e(a=arguments.length===0?new Date:new Date(+a)),a}return s.floor=a=>(e(a=new Date(+a)),a),s.ceil=a=>(e(a=new Date(a-1)),t(a,1),e(a),a),s.round=a=>{const o=s(a),l=s.ceil(a);return a-o(t(a=new Date(+a),o==null?1:Math.floor(o)),a),s.range=(a,o,l)=>{const c=[];if(a=s.ceil(a),l=l==null?1:Math.floor(l),!(a0))return c;let u;do c.push(u=new Date(+a)),t(a,l),e(a);while(uKn(o=>{if(o>=o)for(;e(o),!a(o);)o.setTime(o-1)},(o,l)=>{if(o>=o)if(l<0)for(;++l<=0;)for(;t(o,-1),!a(o););else for(;--l>=0;)for(;t(o,1),!a(o););}),n&&(s.count=(a,o)=>(U0.setTime(+a),V0.setTime(+o),e(U0),e(V0),Math.floor(n(U0,V0))),s.every=a=>(a=Math.floor(a),!isFinite(a)||!(a>0)?null:a>1?s.filter(r?o=>r(o)%a===0:o=>s.count(0,o)%a===0):s)),s}const cv=Kn(()=>{},(e,t)=>{e.setTime(+e+t)},(e,t)=>t-e);cv.every=e=>(e=Math.floor(e),!isFinite(e)||!(e>0)?null:e>1?Kn(t=>{t.setTime(Math.floor(t/e)*e)},(t,n)=>{t.setTime(+t+n*e)},(t,n)=>(n-t)/e):cv);cv.range;const ni=1e3,Ss=ni*60,ri=Ss*60,bi=ri*24,N_=bi*7,_2=bi*30,W0=bi*365,ul=Kn(e=>{e.setTime(e-e.getMilliseconds())},(e,t)=>{e.setTime(+e+t*ni)},(e,t)=>(t-e)/ni,e=>e.getUTCSeconds());ul.range;const __=Kn(e=>{e.setTime(e-e.getMilliseconds()-e.getSeconds()*ni)},(e,t)=>{e.setTime(+e+t*Ss)},(e,t)=>(t-e)/Ss,e=>e.getMinutes());__.range;const P_=Kn(e=>{e.setUTCSeconds(0,0)},(e,t)=>{e.setTime(+e+t*Ss)},(e,t)=>(t-e)/Ss,e=>e.getUTCMinutes());P_.range;const A_=Kn(e=>{e.setTime(e-e.getMilliseconds()-e.getSeconds()*ni-e.getMinutes()*Ss)},(e,t)=>{e.setTime(+e+t*ri)},(e,t)=>(t-e)/ri,e=>e.getHours());A_.range;const C_=Kn(e=>{e.setUTCMinutes(0,0,0)},(e,t)=>{e.setTime(+e+t*ri)},(e,t)=>(t-e)/ri,e=>e.getUTCHours());C_.range;const wp=Kn(e=>e.setHours(0,0,0,0),(e,t)=>e.setDate(e.getDate()+t),(e,t)=>(t-e-(t.getTimezoneOffset()-e.getTimezoneOffset())*Ss)/bi,e=>e.getDate()-1);wp.range;const fx=Kn(e=>{e.setUTCHours(0,0,0,0)},(e,t)=>{e.setUTCDate(e.getUTCDate()+t)},(e,t)=>(t-e)/bi,e=>e.getUTCDate()-1);fx.range;const X5=Kn(e=>{e.setUTCHours(0,0,0,0)},(e,t)=>{e.setUTCDate(e.getUTCDate()+t)},(e,t)=>(t-e)/bi,e=>Math.floor(e/bi));X5.range;function Jl(e){return Kn(t=>{t.setDate(t.getDate()-(t.getDay()+7-e)%7),t.setHours(0,0,0,0)},(t,n)=>{t.setDate(t.getDate()+n*7)},(t,n)=>(n-t-(n.getTimezoneOffset()-t.getTimezoneOffset())*Ss)/N_)}const hx=Jl(0),uv=Jl(1),rme=Jl(2),sme=Jl(3),bu=Jl(4),ame=Jl(5),ime=Jl(6);hx.range;uv.range;rme.range;sme.range;bu.range;ame.range;ime.range;function ec(e){return Kn(t=>{t.setUTCDate(t.getUTCDate()-(t.getUTCDay()+7-e)%7),t.setUTCHours(0,0,0,0)},(t,n)=>{t.setUTCDate(t.getUTCDate()+n*7)},(t,n)=>(n-t)/N_)}const px=ec(0),dv=ec(1),ome=ec(2),lme=ec(3),wu=ec(4),cme=ec(5),ume=ec(6);px.range;dv.range;ome.range;lme.range;wu.range;cme.range;ume.range;const E_=Kn(e=>{e.setDate(1),e.setHours(0,0,0,0)},(e,t)=>{e.setMonth(e.getMonth()+t)},(e,t)=>t.getMonth()-e.getMonth()+(t.getFullYear()-e.getFullYear())*12,e=>e.getMonth());E_.range;const O_=Kn(e=>{e.setUTCDate(1),e.setUTCHours(0,0,0,0)},(e,t)=>{e.setUTCMonth(e.getUTCMonth()+t)},(e,t)=>t.getUTCMonth()-e.getUTCMonth()+(t.getUTCFullYear()-e.getUTCFullYear())*12,e=>e.getUTCMonth());O_.range;const wi=Kn(e=>{e.setMonth(0,1),e.setHours(0,0,0,0)},(e,t)=>{e.setFullYear(e.getFullYear()+t)},(e,t)=>t.getFullYear()-e.getFullYear(),e=>e.getFullYear());wi.every=e=>!isFinite(e=Math.floor(e))||!(e>0)?null:Kn(t=>{t.setFullYear(Math.floor(t.getFullYear()/e)*e),t.setMonth(0,1),t.setHours(0,0,0,0)},(t,n)=>{t.setFullYear(t.getFullYear()+n*e)});wi.range;const ji=Kn(e=>{e.setUTCMonth(0,1),e.setUTCHours(0,0,0,0)},(e,t)=>{e.setUTCFullYear(e.getUTCFullYear()+t)},(e,t)=>t.getUTCFullYear()-e.getUTCFullYear(),e=>e.getUTCFullYear());ji.every=e=>!isFinite(e=Math.floor(e))||!(e>0)?null:Kn(t=>{t.setUTCFullYear(Math.floor(t.getUTCFullYear()/e)*e),t.setUTCMonth(0,1),t.setUTCHours(0,0,0,0)},(t,n)=>{t.setUTCFullYear(t.getUTCFullYear()+n*e)});ji.range;function Y5(e,t,n,r,s,a){const o=[[ul,1,ni],[ul,5,5*ni],[ul,15,15*ni],[ul,30,30*ni],[a,1,Ss],[a,5,5*Ss],[a,15,15*Ss],[a,30,30*Ss],[s,1,ri],[s,3,3*ri],[s,6,6*ri],[s,12,12*ri],[r,1,bi],[r,2,2*bi],[n,1,N_],[t,1,_2],[t,3,3*_2],[e,1,W0]];function l(u,d,f){const h=dy).right(o,h);if(p===o.length)return e.every(x1(u/W0,d/W0,f));if(p===0)return cv.every(Math.max(x1(u,d,f),1));const[g,m]=o[h/o[p-1][2]53)return null;"w"in ne||(ne.w=1),"Z"in ne?(ve=G0(Id(ne.y,0,1)),at=ve.getUTCDay(),ve=at>4||at===0?dv.ceil(ve):dv(ve),ve=fx.offset(ve,(ne.V-1)*7),ne.y=ve.getUTCFullYear(),ne.m=ve.getUTCMonth(),ne.d=ve.getUTCDate()+(ne.w+6)%7):(ve=H0(Id(ne.y,0,1)),at=ve.getDay(),ve=at>4||at===0?uv.ceil(ve):uv(ve),ve=wp.offset(ve,(ne.V-1)*7),ne.y=ve.getFullYear(),ne.m=ve.getMonth(),ne.d=ve.getDate()+(ne.w+6)%7)}else("W"in ne||"U"in ne)&&("w"in ne||(ne.w="u"in ne?ne.u%7:"W"in ne?1:0),at="Z"in ne?G0(Id(ne.y,0,1)).getUTCDay():H0(Id(ne.y,0,1)).getDay(),ne.m=0,ne.d="W"in ne?(ne.w+6)%7+ne.W*7-(at+5)%7:ne.w+ne.U*7-(at+6)%7);return"Z"in ne?(ne.H+=ne.Z/100|0,ne.M+=ne.Z%100,G0(ne)):H0(ne)}}function P(de,be,Pe,ne){for(var Je=0,ve=be.length,at=Pe.length,st,Mt;Je=at)return-1;if(st=be.charCodeAt(Je++),st===37){if(st=be.charAt(Je++),Mt=S[st in P2?be.charAt(Je++):st],!Mt||(ne=Mt(de,Pe,ne))<0)return-1}else if(st!=Pe.charCodeAt(ne++))return-1}return ne}function k(de,be,Pe){var ne=u.exec(be.slice(Pe));return ne?(de.p=d.get(ne[0].toLowerCase()),Pe+ne[0].length):-1}function O(de,be,Pe){var ne=p.exec(be.slice(Pe));return ne?(de.w=g.get(ne[0].toLowerCase()),Pe+ne[0].length):-1}function M(de,be,Pe){var ne=f.exec(be.slice(Pe));return ne?(de.w=h.get(ne[0].toLowerCase()),Pe+ne[0].length):-1}function A(de,be,Pe){var ne=b.exec(be.slice(Pe));return ne?(de.m=x.get(ne[0].toLowerCase()),Pe+ne[0].length):-1}function $(de,be,Pe){var ne=m.exec(be.slice(Pe));return ne?(de.m=y.get(ne[0].toLowerCase()),Pe+ne[0].length):-1}function L(de,be,Pe){return P(de,t,be,Pe)}function H(de,be,Pe){return P(de,n,be,Pe)}function D(de,be,Pe){return P(de,r,be,Pe)}function V(de){return o[de.getDay()]}function T(de){return a[de.getDay()]}function F(de){return c[de.getMonth()]}function q(de){return l[de.getMonth()]}function Z(de){return s[+(de.getHours()>=12)]}function re(de){return 1+~~(de.getMonth()/3)}function ge(de){return o[de.getUTCDay()]}function B(de){return a[de.getUTCDay()]}function le(de){return c[de.getUTCMonth()]}function se(de){return l[de.getUTCMonth()]}function ce(de){return s[+(de.getUTCHours()>=12)]}function De(de){return 1+~~(de.getUTCMonth()/3)}return{format:function(de){var be=N(de+="",w);return be.toString=function(){return de},be},parse:function(de){var be=_(de+="",!1);return be.toString=function(){return de},be},utcFormat:function(de){var be=N(de+="",j);return be.toString=function(){return de},be},utcParse:function(de){var be=_(de+="",!0);return be.toString=function(){return de},be}}}var P2={"-":"",_:" ",0:"0"},tr=/^\s*\d+/,gme=/^%/,vme=/[\\^$*+?|[\]().{}]/g;function Ut(e,t,n){var r=e<0?"-":"",s=(r?-e:e)+"",a=s.length;return r+(a[t.toLowerCase(),n]))}function xme(e,t,n){var r=tr.exec(t.slice(n,n+1));return r?(e.w=+r[0],n+r[0].length):-1}function bme(e,t,n){var r=tr.exec(t.slice(n,n+1));return r?(e.u=+r[0],n+r[0].length):-1}function wme(e,t,n){var r=tr.exec(t.slice(n,n+2));return r?(e.U=+r[0],n+r[0].length):-1}function jme(e,t,n){var r=tr.exec(t.slice(n,n+2));return r?(e.V=+r[0],n+r[0].length):-1}function Sme(e,t,n){var r=tr.exec(t.slice(n,n+2));return r?(e.W=+r[0],n+r[0].length):-1}function A2(e,t,n){var r=tr.exec(t.slice(n,n+4));return r?(e.y=+r[0],n+r[0].length):-1}function C2(e,t,n){var r=tr.exec(t.slice(n,n+2));return r?(e.y=+r[0]+(+r[0]>68?1900:2e3),n+r[0].length):-1}function Nme(e,t,n){var r=/^(Z)|([+-]\d\d)(?::?(\d\d))?/.exec(t.slice(n,n+6));return r?(e.Z=r[1]?0:-(r[2]+(r[3]||"00")),n+r[0].length):-1}function _me(e,t,n){var r=tr.exec(t.slice(n,n+1));return r?(e.q=r[0]*3-3,n+r[0].length):-1}function Pme(e,t,n){var r=tr.exec(t.slice(n,n+2));return r?(e.m=r[0]-1,n+r[0].length):-1}function E2(e,t,n){var r=tr.exec(t.slice(n,n+2));return r?(e.d=+r[0],n+r[0].length):-1}function Ame(e,t,n){var r=tr.exec(t.slice(n,n+3));return r?(e.m=0,e.d=+r[0],n+r[0].length):-1}function O2(e,t,n){var r=tr.exec(t.slice(n,n+2));return r?(e.H=+r[0],n+r[0].length):-1}function Cme(e,t,n){var r=tr.exec(t.slice(n,n+2));return r?(e.M=+r[0],n+r[0].length):-1}function Eme(e,t,n){var r=tr.exec(t.slice(n,n+2));return r?(e.S=+r[0],n+r[0].length):-1}function Ome(e,t,n){var r=tr.exec(t.slice(n,n+3));return r?(e.L=+r[0],n+r[0].length):-1}function kme(e,t,n){var r=tr.exec(t.slice(n,n+6));return r?(e.L=Math.floor(r[0]/1e3),n+r[0].length):-1}function Tme(e,t,n){var r=gme.exec(t.slice(n,n+1));return r?n+r[0].length:-1}function $me(e,t,n){var r=tr.exec(t.slice(n));return r?(e.Q=+r[0],n+r[0].length):-1}function Mme(e,t,n){var r=tr.exec(t.slice(n));return r?(e.s=+r[0],n+r[0].length):-1}function k2(e,t){return Ut(e.getDate(),t,2)}function Ime(e,t){return Ut(e.getHours(),t,2)}function Rme(e,t){return Ut(e.getHours()%12||12,t,2)}function Dme(e,t){return Ut(1+wp.count(wi(e),e),t,3)}function Z5(e,t){return Ut(e.getMilliseconds(),t,3)}function Lme(e,t){return Z5(e,t)+"000"}function Fme(e,t){return Ut(e.getMonth()+1,t,2)}function Bme(e,t){return Ut(e.getMinutes(),t,2)}function zme(e,t){return Ut(e.getSeconds(),t,2)}function Ume(e){var t=e.getDay();return t===0?7:t}function Vme(e,t){return Ut(hx.count(wi(e)-1,e),t,2)}function Q5(e){var t=e.getDay();return t>=4||t===0?bu(e):bu.ceil(e)}function Wme(e,t){return e=Q5(e),Ut(bu.count(wi(e),e)+(wi(e).getDay()===4),t,2)}function Hme(e){return e.getDay()}function Gme(e,t){return Ut(uv.count(wi(e)-1,e),t,2)}function qme(e,t){return Ut(e.getFullYear()%100,t,2)}function Kme(e,t){return e=Q5(e),Ut(e.getFullYear()%100,t,2)}function Xme(e,t){return Ut(e.getFullYear()%1e4,t,4)}function Yme(e,t){var n=e.getDay();return e=n>=4||n===0?bu(e):bu.ceil(e),Ut(e.getFullYear()%1e4,t,4)}function Zme(e){var t=e.getTimezoneOffset();return(t>0?"-":(t*=-1,"+"))+Ut(t/60|0,"0",2)+Ut(t%60,"0",2)}function T2(e,t){return Ut(e.getUTCDate(),t,2)}function Qme(e,t){return Ut(e.getUTCHours(),t,2)}function Jme(e,t){return Ut(e.getUTCHours()%12||12,t,2)}function ege(e,t){return Ut(1+fx.count(ji(e),e),t,3)}function J5(e,t){return Ut(e.getUTCMilliseconds(),t,3)}function tge(e,t){return J5(e,t)+"000"}function nge(e,t){return Ut(e.getUTCMonth()+1,t,2)}function rge(e,t){return Ut(e.getUTCMinutes(),t,2)}function sge(e,t){return Ut(e.getUTCSeconds(),t,2)}function age(e){var t=e.getUTCDay();return t===0?7:t}function ige(e,t){return Ut(px.count(ji(e)-1,e),t,2)}function eF(e){var t=e.getUTCDay();return t>=4||t===0?wu(e):wu.ceil(e)}function oge(e,t){return e=eF(e),Ut(wu.count(ji(e),e)+(ji(e).getUTCDay()===4),t,2)}function lge(e){return e.getUTCDay()}function cge(e,t){return Ut(dv.count(ji(e)-1,e),t,2)}function uge(e,t){return Ut(e.getUTCFullYear()%100,t,2)}function dge(e,t){return e=eF(e),Ut(e.getUTCFullYear()%100,t,2)}function fge(e,t){return Ut(e.getUTCFullYear()%1e4,t,4)}function hge(e,t){var n=e.getUTCDay();return e=n>=4||n===0?wu(e):wu.ceil(e),Ut(e.getUTCFullYear()%1e4,t,4)}function pge(){return"+0000"}function $2(){return"%"}function M2(e){return+e}function I2(e){return Math.floor(+e/1e3)}var cc,tF,nF;mge({dateTime:"%x, %X",date:"%-m/%-d/%Y",time:"%-I:%M:%S %p",periods:["AM","PM"],days:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],shortDays:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],months:["January","February","March","April","May","June","July","August","September","October","November","December"],shortMonths:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"]});function mge(e){return cc=mme(e),tF=cc.format,cc.parse,nF=cc.utcFormat,cc.utcParse,cc}function gge(e){return new Date(e)}function vge(e){return e instanceof Date?+e:+new Date(+e)}function k_(e,t,n,r,s,a,o,l,c,u){var d=v_(),f=d.invert,h=d.domain,p=u(".%L"),g=u(":%S"),m=u("%I:%M"),y=u("%I %p"),b=u("%a %d"),x=u("%b %d"),w=u("%B"),j=u("%Y");function S(N){return(c(N)t(s/(e.length-1)))},n.quantiles=function(r){return Array.from({length:r+1},(s,a)=>ipe(e,a/r))},n.copy=function(){return iF(t).domain(e)},Oi.apply(n,arguments)}function gx(){var e=0,t=.5,n=1,r=1,s,a,o,l,c,u=Er,d,f=!1,h;function p(m){return isNaN(m=+m)?h:(m=.5+((m=+d(m))-a)*(r*mt}var uF=Nge,_ge=vx,Pge=uF,Age=ud;function Cge(e){return e&&e.length?_ge(e,Age,Pge):void 0}var Ege=Cge;const eo=Gt(Ege);function Oge(e,t){return ee.e^a.s<0?1:-1;for(r=a.d.length,s=e.d.length,t=0,n=re.d[t]^a.s<0?1:-1;return r===s?0:r>s^a.s<0?1:-1};We.decimalPlaces=We.dp=function(){var e=this,t=e.d.length-1,n=(t-e.e)*un;if(t=e.d[t],t)for(;t%10==0;t/=10)n--;return n<0?0:n};We.dividedBy=We.div=function(e){return ui(this,new this.constructor(e))};We.dividedToIntegerBy=We.idiv=function(e){var t=this,n=t.constructor;return en(ui(t,new n(e),0,1),n.precision)};We.equals=We.eq=function(e){return!this.cmp(e)};We.exponent=function(){return Ln(this)};We.greaterThan=We.gt=function(e){return this.cmp(e)>0};We.greaterThanOrEqualTo=We.gte=function(e){return this.cmp(e)>=0};We.isInteger=We.isint=function(){return this.e>this.d.length-2};We.isNegative=We.isneg=function(){return this.s<0};We.isPositive=We.ispos=function(){return this.s>0};We.isZero=function(){return this.s===0};We.lessThan=We.lt=function(e){return this.cmp(e)<0};We.lessThanOrEqualTo=We.lte=function(e){return this.cmp(e)<1};We.logarithm=We.log=function(e){var t,n=this,r=n.constructor,s=r.precision,a=s+5;if(e===void 0)e=new r(10);else if(e=new r(e),e.s<1||e.eq(rs))throw Error(Es+"NaN");if(n.s<1)throw Error(Es+(n.s?"NaN":"-Infinity"));return n.eq(rs)?new r(0):(pn=!1,t=ui(bh(n,a),bh(e,a),a),pn=!0,en(t,s))};We.minus=We.sub=function(e){var t=this;return e=new t.constructor(e),t.s==e.s?mF(t,e):hF(t,(e.s=-e.s,e))};We.modulo=We.mod=function(e){var t,n=this,r=n.constructor,s=r.precision;if(e=new r(e),!e.s)throw Error(Es+"NaN");return n.s?(pn=!1,t=ui(n,e,0,1).times(e),pn=!0,n.minus(t)):en(new r(n),s)};We.naturalExponential=We.exp=function(){return pF(this)};We.naturalLogarithm=We.ln=function(){return bh(this)};We.negated=We.neg=function(){var e=new this.constructor(this);return e.s=-e.s||0,e};We.plus=We.add=function(e){var t=this;return e=new t.constructor(e),t.s==e.s?hF(t,e):mF(t,(e.s=-e.s,e))};We.precision=We.sd=function(e){var t,n,r,s=this;if(e!==void 0&&e!==!!e&&e!==1&&e!==0)throw Error(Nl+e);if(t=Ln(s)+1,r=s.d.length-1,n=r*un+1,r=s.d[r],r){for(;r%10==0;r/=10)n--;for(r=s.d[0];r>=10;r/=10)n++}return e&&t>n?t:n};We.squareRoot=We.sqrt=function(){var e,t,n,r,s,a,o,l=this,c=l.constructor;if(l.s<1){if(!l.s)return new c(0);throw Error(Es+"NaN")}for(e=Ln(l),pn=!1,s=Math.sqrt(+l),s==0||s==1/0?(t=Sa(l.d),(t.length+e)%2==0&&(t+="0"),s=Math.sqrt(t),e=hd((e+1)/2)-(e<0||e%2),s==1/0?t="5e"+e:(t=s.toExponential(),t=t.slice(0,t.indexOf("e")+1)+e),r=new c(t)):r=new c(s.toString()),n=c.precision,s=o=n+3;;)if(a=r,r=a.plus(ui(l,a,o+2)).times(.5),Sa(a.d).slice(0,o)===(t=Sa(r.d)).slice(0,o)){if(t=t.slice(o-3,o+1),s==o&&t=="4999"){if(en(a,n+1,0),a.times(a).eq(l)){r=a;break}}else if(t!="9999")break;o+=4}return pn=!0,en(r,n)};We.times=We.mul=function(e){var t,n,r,s,a,o,l,c,u,d=this,f=d.constructor,h=d.d,p=(e=new f(e)).d;if(!d.s||!e.s)return new f(0);for(e.s*=d.s,n=d.e+e.e,c=h.length,u=p.length,c=0;){for(t=0,s=c+r;s>r;)l=a[s]+p[r]*h[s-r-1]+t,a[s--]=l%Yn|0,t=l/Yn|0;a[s]=(a[s]+t)%Yn|0}for(;!a[--o];)a.pop();return t?++n:a.shift(),e.d=a,e.e=n,pn?en(e,f.precision):e};We.toDecimalPlaces=We.todp=function(e,t){var n=this,r=n.constructor;return n=new r(n),e===void 0?n:(Ra(e,0,fd),t===void 0?t=r.rounding:Ra(t,0,8),en(n,e+Ln(n)+1,t))};We.toExponential=function(e,t){var n,r=this,s=r.constructor;return e===void 0?n=Vl(r,!0):(Ra(e,0,fd),t===void 0?t=s.rounding:Ra(t,0,8),r=en(new s(r),e+1,t),n=Vl(r,!0,e+1)),n};We.toFixed=function(e,t){var n,r,s=this,a=s.constructor;return e===void 0?Vl(s):(Ra(e,0,fd),t===void 0?t=a.rounding:Ra(t,0,8),r=en(new a(s),e+Ln(s)+1,t),n=Vl(r.abs(),!1,e+Ln(r)+1),s.isneg()&&!s.isZero()?"-"+n:n)};We.toInteger=We.toint=function(){var e=this,t=e.constructor;return en(new t(e),Ln(e)+1,t.rounding)};We.toNumber=function(){return+this};We.toPower=We.pow=function(e){var t,n,r,s,a,o,l=this,c=l.constructor,u=12,d=+(e=new c(e));if(!e.s)return new c(rs);if(l=new c(l),!l.s){if(e.s<1)throw Error(Es+"Infinity");return l}if(l.eq(rs))return l;if(r=c.precision,e.eq(rs))return en(l,r);if(t=e.e,n=e.d.length-1,o=t>=n,a=l.s,o){if((n=d<0?-d:d)<=fF){for(s=new c(rs),t=Math.ceil(r/un+4),pn=!1;n%2&&(s=s.times(l),L2(s.d,t)),n=hd(n/2),n!==0;)l=l.times(l),L2(l.d,t);return pn=!0,e.s<0?new c(rs).div(s):en(s,r)}}else if(a<0)throw Error(Es+"NaN");return a=a<0&&e.d[Math.max(t,n)]&1?-1:1,l.s=1,pn=!1,s=e.times(bh(l,r+u)),pn=!0,s=pF(s),s.s=a,s};We.toPrecision=function(e,t){var n,r,s=this,a=s.constructor;return e===void 0?(n=Ln(s),r=Vl(s,n<=a.toExpNeg||n>=a.toExpPos)):(Ra(e,1,fd),t===void 0?t=a.rounding:Ra(t,0,8),s=en(new a(s),e,t),n=Ln(s),r=Vl(s,e<=n||n<=a.toExpNeg,e)),r};We.toSignificantDigits=We.tosd=function(e,t){var n=this,r=n.constructor;return e===void 0?(e=r.precision,t=r.rounding):(Ra(e,1,fd),t===void 0?t=r.rounding:Ra(t,0,8)),en(new r(n),e,t)};We.toString=We.valueOf=We.val=We.toJSON=We[Symbol.for("nodejs.util.inspect.custom")]=function(){var e=this,t=Ln(e),n=e.constructor;return Vl(e,t<=n.toExpNeg||t>=n.toExpPos)};function hF(e,t){var n,r,s,a,o,l,c,u,d=e.constructor,f=d.precision;if(!e.s||!t.s)return t.s||(t=new d(e)),pn?en(t,f):t;if(c=e.d,u=t.d,o=e.e,s=t.e,c=c.slice(),a=o-s,a){for(a<0?(r=c,a=-a,l=u.length):(r=u,s=o,l=c.length),o=Math.ceil(f/un),l=o>l?o+1:l+1,a>l&&(a=l,r.length=1),r.reverse();a--;)r.push(0);r.reverse()}for(l=c.length,a=u.length,l-a<0&&(a=l,r=u,u=c,c=r),n=0;a;)n=(c[--a]=c[a]+u[a]+n)/Yn|0,c[a]%=Yn;for(n&&(c.unshift(n),++s),l=c.length;c[--l]==0;)c.pop();return t.d=c,t.e=s,pn?en(t,f):t}function Ra(e,t,n){if(e!==~~e||en)throw Error(Nl+e)}function Sa(e){var t,n,r,s=e.length-1,a="",o=e[0];if(s>0){for(a+=o,t=1;to?1:-1;else for(l=c=0;ls[l]?1:-1;break}return c}function n(r,s,a){for(var o=0;a--;)r[a]-=o,o=r[a]1;)r.shift()}return function(r,s,a,o){var l,c,u,d,f,h,p,g,m,y,b,x,w,j,S,N,_,P,k=r.constructor,O=r.s==s.s?1:-1,M=r.d,A=s.d;if(!r.s)return new k(r);if(!s.s)throw Error(Es+"Division by zero");for(c=r.e-s.e,_=A.length,S=M.length,p=new k(O),g=p.d=[],u=0;A[u]==(M[u]||0);)++u;if(A[u]>(M[u]||0)&&--c,a==null?x=a=k.precision:o?x=a+(Ln(r)-Ln(s))+1:x=a,x<0)return new k(0);if(x=x/un+2|0,u=0,_==1)for(d=0,A=A[0],x++;(u1&&(A=e(A,d),M=e(M,d),_=A.length,S=M.length),j=_,m=M.slice(0,_),y=m.length;y<_;)m[y++]=0;P=A.slice(),P.unshift(0),N=A[0],A[1]>=Yn/2&&++N;do d=0,l=t(A,m,_,y),l<0?(b=m[0],_!=y&&(b=b*Yn+(m[1]||0)),d=b/N|0,d>1?(d>=Yn&&(d=Yn-1),f=e(A,d),h=f.length,y=m.length,l=t(f,m,h,y),l==1&&(d--,n(f,_16)throw Error(M_+Ln(e));if(!e.s)return new d(rs);for(t==null?(pn=!1,l=f):l=t,o=new d(.03125);e.abs().gte(.1);)e=e.times(o),u+=5;for(r=Math.log(Jo(2,u))/Math.LN10*2+5|0,l+=r,n=s=a=new d(rs),d.precision=l;;){if(s=en(s.times(e),l),n=n.times(++c),o=a.plus(ui(s,n,l)),Sa(o.d).slice(0,l)===Sa(a.d).slice(0,l)){for(;u--;)a=en(a.times(a),l);return d.precision=f,t==null?(pn=!0,en(a,f)):a}a=o}}function Ln(e){for(var t=e.e*un,n=e.d[0];n>=10;n/=10)t++;return t}function q0(e,t,n){if(t>e.LN10.sd())throw pn=!0,n&&(e.precision=n),Error(Es+"LN10 precision limit exceeded");return en(new e(e.LN10),t)}function Bi(e){for(var t="";e--;)t+="0";return t}function bh(e,t){var n,r,s,a,o,l,c,u,d,f=1,h=10,p=e,g=p.d,m=p.constructor,y=m.precision;if(p.s<1)throw Error(Es+(p.s?"NaN":"-Infinity"));if(p.eq(rs))return new m(0);if(t==null?(pn=!1,u=y):u=t,p.eq(10))return t==null&&(pn=!0),q0(m,u);if(u+=h,m.precision=u,n=Sa(g),r=n.charAt(0),a=Ln(p),Math.abs(a)<15e14){for(;r<7&&r!=1||r==1&&n.charAt(1)>3;)p=p.times(e),n=Sa(p.d),r=n.charAt(0),f++;a=Ln(p),r>1?(p=new m("0."+n),a++):p=new m(r+"."+n.slice(1))}else return c=q0(m,u+2,y).times(a+""),p=bh(new m(r+"."+n.slice(1)),u-h).plus(c),m.precision=y,t==null?(pn=!0,en(p,y)):p;for(l=o=p=ui(p.minus(rs),p.plus(rs),u),d=en(p.times(p),u),s=3;;){if(o=en(o.times(d),u),c=l.plus(ui(o,new m(s),u)),Sa(c.d).slice(0,u)===Sa(l.d).slice(0,u))return l=l.times(2),a!==0&&(l=l.plus(q0(m,u+2,y).times(a+""))),l=ui(l,new m(f),u),m.precision=y,t==null?(pn=!0,en(l,y)):l;l=c,s+=2}}function D2(e,t){var n,r,s;for((n=t.indexOf("."))>-1&&(t=t.replace(".","")),(r=t.search(/e/i))>0?(n<0&&(n=r),n+=+t.slice(r+1),t=t.substring(0,r)):n<0&&(n=t.length),r=0;t.charCodeAt(r)===48;)++r;for(s=t.length;t.charCodeAt(s-1)===48;)--s;if(t=t.slice(r,s),t){if(s-=r,n=n-r-1,e.e=hd(n/un),e.d=[],r=(n+1)%un,n<0&&(r+=un),rfv||e.e<-fv))throw Error(M_+n)}else e.s=0,e.e=0,e.d=[0];return e}function en(e,t,n){var r,s,a,o,l,c,u,d,f=e.d;for(o=1,a=f[0];a>=10;a/=10)o++;if(r=t-o,r<0)r+=un,s=t,u=f[d=0];else{if(d=Math.ceil((r+1)/un),a=f.length,d>=a)return e;for(u=a=f[d],o=1;a>=10;a/=10)o++;r%=un,s=r-un+o}if(n!==void 0&&(a=Jo(10,o-s-1),l=u/a%10|0,c=t<0||f[d+1]!==void 0||u%a,c=n<4?(l||c)&&(n==0||n==(e.s<0?3:2)):l>5||l==5&&(n==4||c||n==6&&(r>0?s>0?u/Jo(10,o-s):0:f[d-1])%10&1||n==(e.s<0?8:7))),t<1||!f[0])return c?(a=Ln(e),f.length=1,t=t-a-1,f[0]=Jo(10,(un-t%un)%un),e.e=hd(-t/un)||0):(f.length=1,f[0]=e.e=e.s=0),e;if(r==0?(f.length=d,a=1,d--):(f.length=d+1,a=Jo(10,un-r),f[d]=s>0?(u/Jo(10,o-s)%Jo(10,s)|0)*a:0),c)for(;;)if(d==0){(f[0]+=a)==Yn&&(f[0]=1,++e.e);break}else{if(f[d]+=a,f[d]!=Yn)break;f[d--]=0,a=1}for(r=f.length;f[--r]===0;)f.pop();if(pn&&(e.e>fv||e.e<-fv))throw Error(M_+Ln(e));return e}function mF(e,t){var n,r,s,a,o,l,c,u,d,f,h=e.constructor,p=h.precision;if(!e.s||!t.s)return t.s?t.s=-t.s:t=new h(e),pn?en(t,p):t;if(c=e.d,f=t.d,r=t.e,u=e.e,c=c.slice(),o=u-r,o){for(d=o<0,d?(n=c,o=-o,l=f.length):(n=f,r=u,l=c.length),s=Math.max(Math.ceil(p/un),l)+2,o>s&&(o=s,n.length=1),n.reverse(),s=o;s--;)n.push(0);n.reverse()}else{for(s=c.length,l=f.length,d=s0;--s)c[l++]=0;for(s=f.length;s>o;){if(c[--s]0?a=a.charAt(0)+"."+a.slice(1)+Bi(r):o>1&&(a=a.charAt(0)+"."+a.slice(1)),a=a+(s<0?"e":"e+")+s):s<0?(a="0."+Bi(-s-1)+a,n&&(r=n-o)>0&&(a+=Bi(r))):s>=o?(a+=Bi(s+1-o),n&&(r=n-s-1)>0&&(a=a+"."+Bi(r))):((r=s+1)0&&(s+1===o&&(a+="."),a+=Bi(r))),e.s<0?"-"+a:a}function L2(e,t){if(e.length>t)return e.length=t,!0}function gF(e){var t,n,r;function s(a){var o=this;if(!(o instanceof s))return new s(a);if(o.constructor=s,a instanceof s){o.s=a.s,o.e=a.e,o.d=(a=a.d)?a.slice():a;return}if(typeof a=="number"){if(a*0!==0)throw Error(Nl+a);if(a>0)o.s=1;else if(a<0)a=-a,o.s=-1;else{o.s=0,o.e=0,o.d=[0];return}if(a===~~a&&a<1e7){o.e=0,o.d=[a];return}return D2(o,a.toString())}else if(typeof a!="string")throw Error(Nl+a);if(a.charCodeAt(0)===45?(a=a.slice(1),o.s=-1):o.s=1,Zge.test(a))D2(o,a);else throw Error(Nl+a)}if(s.prototype=We,s.ROUND_UP=0,s.ROUND_DOWN=1,s.ROUND_CEIL=2,s.ROUND_FLOOR=3,s.ROUND_HALF_UP=4,s.ROUND_HALF_DOWN=5,s.ROUND_HALF_EVEN=6,s.ROUND_HALF_CEIL=7,s.ROUND_HALF_FLOOR=8,s.clone=gF,s.config=s.set=Qge,e===void 0&&(e={}),e)for(r=["precision","rounding","toExpNeg","toExpPos","LN10"],t=0;t=s[t+1]&&r<=s[t+2])this[n]=r;else throw Error(Nl+n+": "+r);if((r=e[n="LN10"])!==void 0)if(r==Math.LN10)this[n]=new this(r);else throw Error(Nl+n+": "+r);return this}var I_=gF(Yge);rs=new I_(1);const Jt=I_;function Jge(e){return rve(e)||nve(e)||tve(e)||eve()}function eve(){throw new TypeError(`Invalid attempt to spread non-iterable instance. -In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function tve(e,t){if(e){if(typeof e=="string")return N1(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);if(n==="Object"&&e.constructor&&(n=e.constructor.name),n==="Map"||n==="Set")return Array.from(e);if(n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return N1(e,t)}}function nve(e){if(typeof Symbol<"u"&&Symbol.iterator in Object(e))return Array.from(e)}function rve(e){if(Array.isArray(e))return N1(e)}function N1(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n=t?n.apply(void 0,s):e(t-o,F2(function(){for(var l=arguments.length,c=new Array(l),u=0;ue.length)&&(t=e.length);for(var n=0,r=new Array(t);n"u"||!(Symbol.iterator in Object(e)))){var n=[],r=!0,s=!1,a=void 0;try{for(var o=e[Symbol.iterator](),l;!(r=(l=o.next()).done)&&(n.push(l.value),!(t&&n.length===t));r=!0);}catch(c){s=!0,a=c}finally{try{!r&&o.return!=null&&o.return()}finally{if(s)throw a}}return n}}function yve(e){if(Array.isArray(e))return e}function wF(e){var t=wh(e,2),n=t[0],r=t[1],s=n,a=r;return n>r&&(s=r,a=n),[s,a]}function jF(e,t,n){if(e.lte(0))return new Jt(0);var r=bx.getDigitCount(e.toNumber()),s=new Jt(10).pow(r),a=e.div(s),o=r!==1?.05:.1,l=new Jt(Math.ceil(a.div(o).toNumber())).add(n).mul(o),c=l.mul(s);return t?c:new Jt(Math.ceil(c))}function xve(e,t,n){var r=1,s=new Jt(e);if(!s.isint()&&n){var a=Math.abs(e);a<1?(r=new Jt(10).pow(bx.getDigitCount(e)-1),s=new Jt(Math.floor(s.div(r).toNumber())).mul(r)):a>1&&(s=new Jt(Math.floor(e)))}else e===0?s=new Jt(Math.floor((t-1)/2)):n||(s=new Jt(Math.floor(e)));var o=Math.floor((t-1)/2),l=ove(ive(function(c){return s.add(new Jt(c-o).mul(r)).toNumber()}),_1);return l(0,t)}function SF(e,t,n,r){var s=arguments.length>4&&arguments[4]!==void 0?arguments[4]:0;if(!Number.isFinite((t-e)/(n-1)))return{step:new Jt(0),tickMin:new Jt(0),tickMax:new Jt(0)};var a=jF(new Jt(t).sub(e).div(n-1),r,s),o;e<=0&&t>=0?o=new Jt(0):(o=new Jt(e).add(t).div(2),o=o.sub(new Jt(o).mod(a)));var l=Math.ceil(o.sub(e).div(a).toNumber()),c=Math.ceil(new Jt(t).sub(o).div(a).toNumber()),u=l+c+1;return u>n?SF(e,t,n,r,s+1):(u0?c+(n-u):c,l=t>0?l:l+(n-u)),{step:a,tickMin:o.sub(new Jt(l).mul(a)),tickMax:o.add(new Jt(c).mul(a))})}function bve(e){var t=wh(e,2),n=t[0],r=t[1],s=arguments.length>1&&arguments[1]!==void 0?arguments[1]:6,a=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!0,o=Math.max(s,2),l=wF([n,r]),c=wh(l,2),u=c[0],d=c[1];if(u===-1/0||d===1/0){var f=d===1/0?[u].concat(A1(_1(0,s-1).map(function(){return 1/0}))):[].concat(A1(_1(0,s-1).map(function(){return-1/0})),[d]);return n>r?P1(f):f}if(u===d)return xve(u,s,a);var h=SF(u,d,o,a),p=h.step,g=h.tickMin,m=h.tickMax,y=bx.rangeStep(g,m.add(new Jt(.1).mul(p)),p);return n>r?P1(y):y}function wve(e,t){var n=wh(e,2),r=n[0],s=n[1],a=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!0,o=wF([r,s]),l=wh(o,2),c=l[0],u=l[1];if(c===-1/0||u===1/0)return[r,s];if(c===u)return[c];var d=Math.max(t,2),f=jF(new Jt(u).sub(c).div(d-1),a,0),h=[].concat(A1(bx.rangeStep(new Jt(c),new Jt(u).sub(new Jt(.99).mul(f)),f)),[u]);return r>s?P1(h):h}var jve=xF(bve),Sve=xF(wve),Nve="Invariant failed";function Wl(e,t){throw new Error(Nve)}var _ve=["offset","layout","width","dataKey","data","dataPointFormatter","xAxis","yAxis"];function ju(e){"@babel/helpers - typeof";return ju=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},ju(e)}function hv(){return hv=Object.assign?Object.assign.bind():function(e){for(var t=1;te.length)&&(t=e.length);for(var n=0,r=new Array(t);n=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(n[r]=e[r])}return n}function Tve(e,t){if(e==null)return{};var n={};for(var r in e)if(Object.prototype.hasOwnProperty.call(e,r)){if(t.indexOf(r)>=0)continue;n[r]=e[r]}return n}function $ve(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function Mve(e,t){for(var n=0;ne.length)&&(t=e.length);for(var n=0,r=new Array(t);n1&&arguments[1]!==void 0?arguments[1]:[],s=arguments.length>2?arguments[2]:void 0,a=arguments.length>3?arguments[3]:void 0,o=-1,l=(n=r==null?void 0:r.length)!==null&&n!==void 0?n:0;if(l<=1)return 0;if(a&&a.axisType==="angleAxis"&&Math.abs(Math.abs(a.range[1]-a.range[0])-360)<=1e-6)for(var c=a.range,u=0;u0?s[u-1].coordinate:s[l-1].coordinate,f=s[u].coordinate,h=u>=l-1?s[0].coordinate:s[u+1].coordinate,p=void 0;if(Ar(f-d)!==Ar(h-f)){var g=[];if(Ar(h-f)===Ar(c[1]-c[0])){p=h;var m=f+c[1]-c[0];g[0]=Math.min(m,(m+d)/2),g[1]=Math.max(m,(m+d)/2)}else{p=d;var y=h+c[1]-c[0];g[0]=Math.min(f,(y+f)/2),g[1]=Math.max(f,(y+f)/2)}var b=[Math.min(f,(p+f)/2),Math.max(f,(p+f)/2)];if(t>b[0]&&t<=b[1]||t>=g[0]&&t<=g[1]){o=s[u].index;break}}else{var x=Math.min(d,h),w=Math.max(d,h);if(t>(x+f)/2&&t<=(w+f)/2){o=s[u].index;break}}}else for(var j=0;j0&&j(r[j].coordinate+r[j-1].coordinate)/2&&t<=(r[j].coordinate+r[j+1].coordinate)/2||j===l-1&&t>(r[j].coordinate+r[j-1].coordinate)/2){o=r[j].index;break}return o},R_=function(t){var n,r=t,s=r.type.displayName,a=(n=t.type)!==null&&n!==void 0&&n.defaultProps?Nn(Nn({},t.type.defaultProps),t.props):t.props,o=a.stroke,l=a.fill,c;switch(s){case"Line":c=o;break;case"Area":case"Radar":c=o&&o!=="none"?o:l;break;default:c=l;break}return c},Zve=function(t){var n=t.barSize,r=t.totalSize,s=t.stackGroups,a=s===void 0?{}:s;if(!a)return{};for(var o={},l=Object.keys(a),c=0,u=l.length;c=0});if(b&&b.length){var x=b[0].type.defaultProps,w=x!==void 0?Nn(Nn({},x),b[0].props):b[0].props,j=w.barSize,S=w[y];o[S]||(o[S]=[]);var N=Nt(j)?n:j;o[S].push({item:b[0],stackList:b.slice(1),barSize:Nt(N)?void 0:Cr(N,r,0)})}}return o},Qve=function(t){var n=t.barGap,r=t.barCategoryGap,s=t.bandSize,a=t.sizeList,o=a===void 0?[]:a,l=t.maxBarSize,c=o.length;if(c<1)return null;var u=Cr(n,s,0,!0),d,f=[];if(o[0].barSize===+o[0].barSize){var h=!1,p=s/c,g=o.reduce(function(j,S){return j+S.barSize||0},0);g+=(c-1)*u,g>=s&&(g-=(c-1)*u,u=0),g>=s&&p>0&&(h=!0,p*=.9,g=c*p);var m=(s-g)/2>>0,y={offset:m-u,size:0};d=o.reduce(function(j,S){var N={item:S.item,position:{offset:y.offset+y.size+u,size:h?p:S.barSize}},_=[].concat(U2(j),[N]);return y=_[_.length-1].position,S.stackList&&S.stackList.length&&S.stackList.forEach(function(P){_.push({item:P,position:y})}),_},f)}else{var b=Cr(r,s,0,!0);s-2*b-(c-1)*u<=0&&(u=0);var x=(s-2*b-(c-1)*u)/c;x>1&&(x>>=0);var w=l===+l?Math.min(x,l):x;d=o.reduce(function(j,S,N){var _=[].concat(U2(j),[{item:S.item,position:{offset:b+(x+u)*N+(x-w)/2,size:w}}]);return S.stackList&&S.stackList.length&&S.stackList.forEach(function(P){_.push({item:P,position:_[_.length-1].position})}),_},f)}return d},Jve=function(t,n,r,s){var a=r.children,o=r.width,l=r.margin,c=o-(l.left||0)-(l.right||0),u=AF({children:a,legendWidth:c});if(u){var d=s||{},f=d.width,h=d.height,p=u.align,g=u.verticalAlign,m=u.layout;if((m==="vertical"||m==="horizontal"&&g==="middle")&&p!=="center"&&Ae(t[p]))return Nn(Nn({},t),{},Wc({},p,t[p]+(f||0)));if((m==="horizontal"||m==="vertical"&&p==="center")&&g!=="middle"&&Ae(t[g]))return Nn(Nn({},t),{},Wc({},g,t[g]+(h||0)))}return t},eye=function(t,n,r){return Nt(n)?!0:t==="horizontal"?n==="yAxis":t==="vertical"||r==="x"?n==="xAxis":r==="y"?n==="yAxis":!0},CF=function(t,n,r,s,a){var o=n.props.children,l=Ps(o,wx).filter(function(u){return eye(s,a,u.props.direction)});if(l&&l.length){var c=l.map(function(u){return u.props.dataKey});return t.reduce(function(u,d){var f=En(d,r);if(Nt(f))return u;var h=Array.isArray(f)?[yx(f),eo(f)]:[f,f],p=c.reduce(function(g,m){var y=En(d,m,0),b=h[0]-Math.abs(Array.isArray(y)?y[0]:y),x=h[1]+Math.abs(Array.isArray(y)?y[1]:y);return[Math.min(b,g[0]),Math.max(x,g[1])]},[1/0,-1/0]);return[Math.min(p[0],u[0]),Math.max(p[1],u[1])]},[1/0,-1/0])}return null},tye=function(t,n,r,s,a){var o=n.map(function(l){return CF(t,l,r,a,s)}).filter(function(l){return!Nt(l)});return o&&o.length?o.reduce(function(l,c){return[Math.min(l[0],c[0]),Math.max(l[1],c[1])]},[1/0,-1/0]):null},EF=function(t,n,r,s,a){var o=n.map(function(c){var u=c.props.dataKey;return r==="number"&&u&&CF(t,c,u,s)||hf(t,u,r,a)});if(r==="number")return o.reduce(function(c,u){return[Math.min(c[0],u[0]),Math.max(c[1],u[1])]},[1/0,-1/0]);var l={};return o.reduce(function(c,u){for(var d=0,f=u.length;d=2?Ar(l[0]-l[1])*2*u:u,n&&(t.ticks||t.niceTicks)){var d=(t.ticks||t.niceTicks).map(function(f){var h=a?a.indexOf(f):f;return{coordinate:s(h)+u,value:f,offset:u}});return d.filter(function(f){return!id(f.coordinate)})}return t.isCategorical&&t.categoricalDomain?t.categoricalDomain.map(function(f,h){return{coordinate:s(f)+u,value:f,index:h,offset:u}}):s.ticks&&!r?s.ticks(t.tickCount).map(function(f){return{coordinate:s(f)+u,value:f,offset:u}}):s.domain().map(function(f,h){return{coordinate:s(f)+u,value:a?a[f]:f,index:h,offset:u}})},K0=new WeakMap,im=function(t,n){if(typeof n!="function")return t;K0.has(t)||K0.set(t,new WeakMap);var r=K0.get(t);if(r.has(n))return r.get(n);var s=function(){t.apply(void 0,arguments),n.apply(void 0,arguments)};return r.set(n,s),s},TF=function(t,n,r){var s=t.scale,a=t.type,o=t.layout,l=t.axisType;if(s==="auto")return o==="radial"&&l==="radiusAxis"?{scale:mh(),realScaleType:"band"}:o==="radial"&&l==="angleAxis"?{scale:lv(),realScaleType:"linear"}:a==="category"&&n&&(n.indexOf("LineChart")>=0||n.indexOf("AreaChart")>=0||n.indexOf("ComposedChart")>=0&&!r)?{scale:ff(),realScaleType:"point"}:a==="category"?{scale:mh(),realScaleType:"band"}:{scale:lv(),realScaleType:"linear"};if(mp(s)){var c="scale".concat(sx(s));return{scale:(R2[c]||ff)(),realScaleType:R2[c]?c:"point"}}return ht(s)?{scale:s}:{scale:ff(),realScaleType:"point"}},W2=1e-4,$F=function(t){var n=t.domain();if(!(!n||n.length<=2)){var r=n.length,s=t.range(),a=Math.min(s[0],s[1])-W2,o=Math.max(s[0],s[1])+W2,l=t(n[0]),c=t(n[r-1]);(lo||co)&&t.domain([n[0],n[r-1]])}},nye=function(t,n){if(!t)return null;for(var r=0,s=t.length;rs)&&(a[1]=s),a[0]>s&&(a[0]=s),a[1]=0?(t[l][r][0]=a,t[l][r][1]=a+c,a=t[l][r][1]):(t[l][r][0]=o,t[l][r][1]=o+c,o=t[l][r][1])}},aye=function(t){var n=t.length;if(!(n<=0))for(var r=0,s=t[0].length;r=0?(t[o][r][0]=a,t[o][r][1]=a+l,a=t[o][r][1]):(t[o][r][0]=0,t[o][r][1]=0)}},iye={sign:sye,expand:_se,none:pu,silhouette:Pse,wiggle:Ase,positive:aye},oye=function(t,n,r){var s=n.map(function(l){return l.props.dataKey}),a=iye[r],o=Nse().keys(s).value(function(l,c){return+En(l,c,0)}).order(t1).offset(a);return o(t)},lye=function(t,n,r,s,a,o){if(!t)return null;var l=o?n.reverse():n,c={},u=l.reduce(function(f,h){var p,g=(p=h.type)!==null&&p!==void 0&&p.defaultProps?Nn(Nn({},h.type.defaultProps),h.props):h.props,m=g.stackId,y=g.hide;if(y)return f;var b=g[r],x=f[b]||{hasStack:!1,stackGroups:{}};if(qn(m)){var w=x.stackGroups[m]||{numericAxisId:r,cateAxisId:s,items:[]};w.items.push(h),x.hasStack=!0,x.stackGroups[m]=w}else x.stackGroups[od("_stackId_")]={numericAxisId:r,cateAxisId:s,items:[h]};return Nn(Nn({},f),{},Wc({},b,x))},c),d={};return Object.keys(u).reduce(function(f,h){var p=u[h];if(p.hasStack){var g={};p.stackGroups=Object.keys(p.stackGroups).reduce(function(m,y){var b=p.stackGroups[y];return Nn(Nn({},m),{},Wc({},y,{numericAxisId:r,cateAxisId:s,items:b.items,stackedData:oye(t,b.items,a)}))},g)}return Nn(Nn({},f),{},Wc({},h,p))},d)},MF=function(t,n){var r=n.realScaleType,s=n.type,a=n.tickCount,o=n.originalDomain,l=n.allowDecimals,c=r||n.scale;if(c!=="auto"&&c!=="linear")return null;if(a&&s==="number"&&o&&(o[0]==="auto"||o[1]==="auto")){var u=t.domain();if(!u.length)return null;var d=jve(u,a,l);return t.domain([yx(d),eo(d)]),{niceTicks:d}}if(a&&s==="number"){var f=t.domain(),h=Sve(f,a,l);return{niceTicks:h}}return null};function H2(e){var t=e.axis,n=e.ticks,r=e.bandSize,s=e.entry,a=e.index,o=e.dataKey;if(t.type==="category"){if(!t.allowDuplicatedCategory&&t.dataKey&&!Nt(s[t.dataKey])){var l=zg(n,"value",s[t.dataKey]);if(l)return l.coordinate+r/2}return n[a]?n[a].coordinate+r/2:null}var c=En(s,Nt(o)?t.dataKey:o);return Nt(c)?null:t.scale(c)}var G2=function(t){var n=t.axis,r=t.ticks,s=t.offset,a=t.bandSize,o=t.entry,l=t.index;if(n.type==="category")return r[l]?r[l].coordinate+s:null;var c=En(o,n.dataKey,n.domain[l]);return Nt(c)?null:n.scale(c)-a/2+s},cye=function(t){var n=t.numericAxis,r=n.scale.domain();if(n.type==="number"){var s=Math.min(r[0],r[1]),a=Math.max(r[0],r[1]);return s<=0&&a>=0?0:a<0?a:s}return r[0]},uye=function(t,n){var r,s=(r=t.type)!==null&&r!==void 0&&r.defaultProps?Nn(Nn({},t.type.defaultProps),t.props):t.props,a=s.stackId;if(qn(a)){var o=n[a];if(o){var l=o.items.indexOf(t);return l>=0?o.stackedData[l]:null}}return null},dye=function(t){return t.reduce(function(n,r){return[yx(r.concat([n[0]]).filter(Ae)),eo(r.concat([n[1]]).filter(Ae))]},[1/0,-1/0])},IF=function(t,n,r){return Object.keys(t).reduce(function(s,a){var o=t[a],l=o.stackedData,c=l.reduce(function(u,d){var f=dye(d.slice(n,r+1));return[Math.min(u[0],f[0]),Math.max(u[1],f[1])]},[1/0,-1/0]);return[Math.min(c[0],s[0]),Math.max(c[1],s[1])]},[1/0,-1/0]).map(function(s){return s===1/0||s===-1/0?0:s})},q2=/^dataMin[\s]*-[\s]*([0-9]+([.]{1}[0-9]+){0,1})$/,K2=/^dataMax[\s]*\+[\s]*([0-9]+([.]{1}[0-9]+){0,1})$/,k1=function(t,n,r){if(ht(t))return t(n,r);if(!Array.isArray(t))return n;var s=[];if(Ae(t[0]))s[0]=r?t[0]:Math.min(t[0],n[0]);else if(q2.test(t[0])){var a=+q2.exec(t[0])[1];s[0]=n[0]-a}else ht(t[0])?s[0]=t[0](n[0]):s[0]=n[0];if(Ae(t[1]))s[1]=r?t[1]:Math.max(t[1],n[1]);else if(K2.test(t[1])){var o=+K2.exec(t[1])[1];s[1]=n[1]+o}else ht(t[1])?s[1]=t[1](n[1]):s[1]=n[1];return s},mv=function(t,n,r){if(t&&t.scale&&t.scale.bandwidth){var s=t.scale.bandwidth();if(!r||s>0)return s}if(t&&n&&n.length>=2){for(var a=u_(n,function(f){return f.coordinate}),o=1/0,l=1,c=a.length;le.length)&&(t=e.length);for(var n=0,r=new Array(t);n2&&arguments[2]!==void 0?arguments[2]:{top:0,right:0,bottom:0,left:0};return Math.min(Math.abs(t-(r.left||0)-(r.right||0)),Math.abs(n-(r.top||0)-(r.bottom||0)))/2},FF=function(t,n,r,s,a){var o=t.width,l=t.height,c=t.startAngle,u=t.endAngle,d=Cr(t.cx,o,o/2),f=Cr(t.cy,l,l/2),h=LF(o,l,r),p=Cr(t.innerRadius,h,0),g=Cr(t.outerRadius,h,h*.8),m=Object.keys(n);return m.reduce(function(y,b){var x=n[b],w=x.domain,j=x.reversed,S;if(Nt(x.range))s==="angleAxis"?S=[c,u]:s==="radiusAxis"&&(S=[p,g]),j&&(S=[S[1],S[0]]);else{S=x.range;var N=S,_=pye(N,2);c=_[0],u=_[1]}var P=TF(x,a),k=P.realScaleType,O=P.scale;O.domain(w).range(S),$F(O);var M=MF(O,Xa(Xa({},x),{},{realScaleType:k})),A=Xa(Xa(Xa({},x),M),{},{range:S,radius:g,realScaleType:k,scale:O,cx:d,cy:f,innerRadius:p,outerRadius:g,startAngle:c,endAngle:u});return Xa(Xa({},y),{},DF({},b,A))},{})},bye=function(t,n){var r=t.x,s=t.y,a=n.x,o=n.y;return Math.sqrt(Math.pow(r-a,2)+Math.pow(s-o,2))},wye=function(t,n){var r=t.x,s=t.y,a=n.cx,o=n.cy,l=bye({x:r,y:s},{x:a,y:o});if(l<=0)return{radius:l};var c=(r-a)/l,u=Math.acos(c);return s>o&&(u=2*Math.PI-u),{radius:l,angle:xye(u),angleInRadian:u}},jye=function(t){var n=t.startAngle,r=t.endAngle,s=Math.floor(n/360),a=Math.floor(r/360),o=Math.min(s,a);return{startAngle:n-o*360,endAngle:r-o*360}},Sye=function(t,n){var r=n.startAngle,s=n.endAngle,a=Math.floor(r/360),o=Math.floor(s/360),l=Math.min(a,o);return t+l*360},Q2=function(t,n){var r=t.x,s=t.y,a=wye({x:r,y:s},n),o=a.radius,l=a.angle,c=n.innerRadius,u=n.outerRadius;if(ou)return!1;if(o===0)return!0;var d=jye(n),f=d.startAngle,h=d.endAngle,p=l,g;if(f<=h){for(;p>h;)p-=360;for(;p=f&&p<=h}else{for(;p>f;)p-=360;for(;p=h&&p<=f}return g?Xa(Xa({},n),{},{radius:o,angle:Sye(p,n)}):null},BF=function(t){return!v.isValidElement(t)&&!ht(t)&&typeof t!="boolean"?t.className:""};function _h(e){"@babel/helpers - typeof";return _h=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},_h(e)}var Nye=["offset"];function _ye(e){return Eye(e)||Cye(e)||Aye(e)||Pye()}function Pye(){throw new TypeError(`Invalid attempt to spread non-iterable instance. -In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function Aye(e,t){if(e){if(typeof e=="string")return T1(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);if(n==="Object"&&e.constructor&&(n=e.constructor.name),n==="Map"||n==="Set")return Array.from(e);if(n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return T1(e,t)}}function Cye(e){if(typeof Symbol<"u"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function Eye(e){if(Array.isArray(e))return T1(e)}function T1(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(n[r]=e[r])}return n}function kye(e,t){if(e==null)return{};var n={};for(var r in e)if(Object.prototype.hasOwnProperty.call(e,r)){if(t.indexOf(r)>=0)continue;n[r]=e[r]}return n}function J2(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(s){return Object.getOwnPropertyDescriptor(e,s).enumerable})),n.push.apply(n,r)}return n}function Bn(e){for(var t=1;t=0?1:-1,w,j;s==="insideStart"?(w=p+x*o,j=m):s==="insideEnd"?(w=g-x*o,j=!m):s==="end"&&(w=g+x*o,j=m),j=b<=0?j:!j;var S=Ht(u,d,y,w),N=Ht(u,d,y,w+(j?1:-1)*359),_="M".concat(S.x,",").concat(S.y,` + height and width.`,G,D,o,c,d,f,n);var V=!Array.isArray(p)&&ui(p.type).endsWith("Chart");return E.Children.map(p,function(T){return _3.isElement(T)?v.cloneElement(T,nm({width:G,height:D},V?{style:nm({height:"100%",width:"100%",maxHeight:D,maxWidth:G},T.props.style)}:{})):T})},[n,p,c,h,f,d,k,o]);return E.createElement("div",{id:y?"".concat(y):void 0,className:jt("recharts-responsive-container",b),style:nm(nm({},j),{},{width:o,height:c,minWidth:d,minHeight:f,maxHeight:h}),ref:S},A)}),yp=function(t){return null};yp.displayName="Cell";function ph(e){"@babel/helpers - typeof";return ph=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},ph(e)}function HE(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(s){return Object.getOwnPropertyDescriptor(e,s).enumerable})),n.push.apply(n,r)}return n}function v1(e){for(var t=1;t1&&arguments[1]!==void 0?arguments[1]:{};if(t==null||ea.isSsr)return{width:0,height:0};var r=Ehe(n),s=JSON.stringify({text:t,copyStyle:r});if(lc.widthCache[s])return lc.widthCache[s];try{var a=document.getElementById(qE);a||(a=document.createElement("span"),a.setAttribute("id",qE),a.setAttribute("aria-hidden","true"),document.body.appendChild(a));var o=v1(v1({},Che),r);Object.assign(a.style,o),a.textContent="".concat(t);var l=a.getBoundingClientRect(),c={width:l.width,height:l.height};return lc.widthCache[s]=c,++lc.cacheCount>Ahe&&(lc.cacheCount=0,lc.widthCache={}),c}catch{return{width:0,height:0}}},Ohe=function(t){return{top:t.top+window.scrollY-document.documentElement.clientTop,left:t.left+window.scrollX-document.documentElement.clientLeft}};function mh(e){"@babel/helpers - typeof";return mh=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},mh(e)}function rv(e,t){return Mhe(e)||$he(e,t)||The(e,t)||khe()}function khe(){throw new TypeError(`Invalid attempt to destructure non-iterable instance. +In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function The(e,t){if(e){if(typeof e=="string")return KE(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);if(n==="Object"&&e.constructor&&(n=e.constructor.name),n==="Map"||n==="Set")return Array.from(e);if(n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return KE(e,t)}}function KE(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(n[r]=e[r])}return n}function Khe(e,t){if(e==null)return{};var n={};for(var r in e)if(Object.prototype.hasOwnProperty.call(e,r)){if(t.indexOf(r)>=0)continue;n[r]=e[r]}return n}function e2(e,t){return Qhe(e)||Zhe(e,t)||Yhe(e,t)||Xhe()}function Xhe(){throw new TypeError(`Invalid attempt to destructure non-iterable instance. +In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function Yhe(e,t){if(e){if(typeof e=="string")return t2(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);if(n==="Object"&&e.constructor&&(n=e.constructor.name),n==="Map"||n==="Set")return Array.from(e);if(n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return t2(e,t)}}function t2(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n0&&arguments[0]!==void 0?arguments[0]:[];return G.reduce(function(D,V){var T=V.word,F=V.width,q=D[D.length-1];if(q&&(s==null||a||q.width+F+rV.width?D:V})};if(!d)return p;for(var m="…",y=function(G){var D=f.slice(0,G),V=$5({breakAll:u,style:c,children:D+m}).wordsWithComputedWidth,T=h(V),F=T.length>o||g(T).width>Number(s);return[F,T]},b=0,x=f.length-1,w=0,j;b<=x&&w<=f.length-1;){var S=Math.floor((b+x)/2),N=S-1,_=y(N),P=e2(_,2),k=P[0],O=P[1],M=y(S),A=e2(M,1),$=A[0];if(!k&&!$&&(b=S+1),k&&$&&(x=S-1),!k&&$){j=O;break}w++}return j||p},n2=function(t){var n=Nt(t)?[]:t.toString().split(T5);return[{words:n}]},epe=function(t){var n=t.width,r=t.scaleToFit,s=t.children,a=t.style,o=t.breakAll,l=t.maxLines;if((n||r)&&!ea.isSsr){var c,u,d=$5({breakAll:o,children:s,style:a});if(d){var f=d.wordsWithComputedWidth,h=d.spaceWidth;c=f,u=h}else return n2(s);return Jhe({breakAll:o,children:s,maxLines:l,style:a},c,u,n,r)}return n2(s)},r2="#808080",zl=function(t){var n=t.x,r=n===void 0?0:n,s=t.y,a=s===void 0?0:s,o=t.lineHeight,l=o===void 0?"1em":o,c=t.capHeight,u=c===void 0?"0.71em":c,d=t.scaleToFit,f=d===void 0?!1:d,h=t.textAnchor,p=h===void 0?"start":h,g=t.verticalAnchor,m=g===void 0?"end":g,y=t.fill,b=y===void 0?r2:y,x=JE(t,Hhe),w=v.useMemo(function(){return epe({breakAll:x.breakAll,children:x.children,maxLines:x.maxLines,scaleToFit:f,style:x.style,width:x.width})},[x.breakAll,x.children,x.maxLines,f,x.style,x.width]),j=x.dx,S=x.dy,N=x.angle,_=x.className,P=x.breakAll,k=JE(x,qhe);if(!qn(r)||!qn(a))return null;var O=r+(Ae(j)?j:0),M=a+(Ae(S)?S:0),A;switch(m){case"start":A=U0("calc(".concat(u,")"));break;case"middle":A=U0("calc(".concat((w.length-1)/2," * -").concat(l," + (").concat(u," / 2))"));break;default:A=U0("calc(".concat(w.length-1," * -").concat(l,")"));break}var $=[];if(f){var L=w[0].width,G=x.width;$.push("scale(".concat((Ae(G)?G/L:1)/L,")"))}return N&&$.push("rotate(".concat(N,", ").concat(O,", ").concat(M,")")),$.length&&(k.transform=$.join(" ")),E.createElement("text",y1({},Xe(k,!0),{x:O,y:M,className:jt("recharts-text",_),textAnchor:p,fill:b.includes("url")?r2:b}),w.map(function(D,V){var T=D.words.join(P?"":" ");return E.createElement("tspan",{x:O,dy:V===0?A:l,key:"".concat(T,"-").concat(V)},T)}))};function xo(e,t){return e==null||t==null?NaN:et?1:e>=t?0:NaN}function tpe(e,t){return e==null||t==null?NaN:te?1:t>=e?0:NaN}function v_(e){let t,n,r;e.length!==2?(t=xo,n=(l,c)=>xo(e(l),c),r=(l,c)=>e(l)-c):(t=e===xo||e===tpe?e:npe,n=e,r=e);function s(l,c,u=0,d=l.length){if(u>>1;n(l[f],c)<0?u=f+1:d=f}while(u>>1;n(l[f],c)<=0?u=f+1:d=f}while(uu&&r(l[f-1],c)>-r(l[f],c)?f-1:f}return{left:s,center:o,right:a}}function npe(){return 0}function M5(e){return e===null?NaN:+e}function*rpe(e,t){for(let n of e)n!=null&&(n=+n)>=n&&(yield n)}const spe=v_(xo),xp=spe.right;v_(M5).center;class s2 extends Map{constructor(t,n=ope){if(super(),Object.defineProperties(this,{_intern:{value:new Map},_key:{value:n}}),t!=null)for(const[r,s]of t)this.set(r,s)}get(t){return super.get(a2(this,t))}has(t){return super.has(a2(this,t))}set(t,n){return super.set(ape(this,t),n)}delete(t){return super.delete(ipe(this,t))}}function a2({_intern:e,_key:t},n){const r=t(n);return e.has(r)?e.get(r):n}function ape({_intern:e,_key:t},n){const r=t(n);return e.has(r)?e.get(r):(e.set(r,n),n)}function ipe({_intern:e,_key:t},n){const r=t(n);return e.has(r)&&(n=e.get(r),e.delete(r)),n}function ope(e){return e!==null&&typeof e=="object"?e.valueOf():e}function lpe(e=xo){if(e===xo)return I5;if(typeof e!="function")throw new TypeError("compare is not a function");return(t,n)=>{const r=e(t,n);return r||r===0?r:(e(n,n)===0)-(e(t,t)===0)}}function I5(e,t){return(e==null||!(e>=e))-(t==null||!(t>=t))||(et?1:0)}const cpe=Math.sqrt(50),upe=Math.sqrt(10),dpe=Math.sqrt(2);function sv(e,t,n){const r=(t-e)/Math.max(0,n),s=Math.floor(Math.log10(r)),a=r/Math.pow(10,s),o=a>=cpe?10:a>=upe?5:a>=dpe?2:1;let l,c,u;return s<0?(u=Math.pow(10,-s)/o,l=Math.round(e*u),c=Math.round(t*u),l/ut&&--c,u=-u):(u=Math.pow(10,s)*o,l=Math.round(e/u),c=Math.round(t/u),l*ut&&--c),c0))return[];if(e===t)return[e];const r=t=s))return[];const l=a-s+1,c=new Array(l);if(r)if(o<0)for(let u=0;u=r)&&(n=r);return n}function o2(e,t){let n;for(const r of e)r!=null&&(n>r||n===void 0&&r>=r)&&(n=r);return n}function R5(e,t,n=0,r=1/0,s){if(t=Math.floor(t),n=Math.floor(Math.max(0,n)),r=Math.floor(Math.min(e.length-1,r)),!(n<=t&&t<=r))return e;for(s=s===void 0?I5:lpe(s);r>n;){if(r-n>600){const c=r-n+1,u=t-n+1,d=Math.log(c),f=.5*Math.exp(2*d/3),h=.5*Math.sqrt(d*f*(c-f)/c)*(u-c/2<0?-1:1),p=Math.max(n,Math.floor(t-u*f/c+h)),g=Math.min(r,Math.floor(t+(c-u)*f/c+h));R5(e,t,p,g,s)}const a=e[t];let o=n,l=r;for(Md(e,n,t),s(e[r],a)>0&&Md(e,n,r);o0;)--l}s(e[n],a)===0?Md(e,n,l):(++l,Md(e,l,r)),l<=t&&(n=l+1),t<=l&&(r=l-1)}return e}function Md(e,t,n){const r=e[t];e[t]=e[n],e[n]=r}function fpe(e,t,n){if(e=Float64Array.from(rpe(e)),!(!(r=e.length)||isNaN(t=+t))){if(t<=0||r<2)return o2(e);if(t>=1)return i2(e);var r,s=(r-1)*t,a=Math.floor(s),o=i2(R5(e,a).subarray(0,a+1)),l=o2(e.subarray(a+1));return o+(l-o)*(s-a)}}function hpe(e,t,n=M5){if(!(!(r=e.length)||isNaN(t=+t))){if(t<=0||r<2)return+n(e[0],0,e);if(t>=1)return+n(e[r-1],r-1,e);var r,s=(r-1)*t,a=Math.floor(s),o=+n(e[a],a,e),l=+n(e[a+1],a+1,e);return o+(l-o)*(s-a)}}function ppe(e,t,n){e=+e,t=+t,n=(s=arguments.length)<2?(t=e,e=0,1):s<3?1:+n;for(var r=-1,s=Math.max(0,Math.ceil((t-e)/n))|0,a=new Array(s);++r>8&15|t>>4&240,t>>4&15|t&240,(t&15)<<4|t&15,1):n===8?sm(t>>24&255,t>>16&255,t>>8&255,(t&255)/255):n===4?sm(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=gpe.exec(e))?new Br(t[1],t[2],t[3],1):(t=vpe.exec(e))?new Br(t[1]*255/100,t[2]*255/100,t[3]*255/100,1):(t=ype.exec(e))?sm(t[1],t[2],t[3],t[4]):(t=xpe.exec(e))?sm(t[1]*255/100,t[2]*255/100,t[3]*255/100,t[4]):(t=bpe.exec(e))?p2(t[1],t[2]/100,t[3]/100,1):(t=wpe.exec(e))?p2(t[1],t[2]/100,t[3]/100,t[4]):l2.hasOwnProperty(e)?d2(l2[e]):e==="transparent"?new Br(NaN,NaN,NaN,0):null}function d2(e){return new Br(e>>16&255,e>>8&255,e&255,1)}function sm(e,t,n,r){return r<=0&&(e=t=n=NaN),new Br(e,t,n,r)}function Npe(e){return e instanceof bp||(e=xh(e)),e?(e=e.rgb(),new Br(e.r,e.g,e.b,e.opacity)):new Br}function S1(e,t,n,r){return arguments.length===1?Npe(e):new Br(e,t,n,r??1)}function Br(e,t,n,r){this.r=+e,this.g=+t,this.b=+n,this.opacity=+r}x_(Br,S1,L5(bp,{brighter(e){return e=e==null?av:Math.pow(av,e),new Br(this.r*e,this.g*e,this.b*e,this.opacity)},darker(e){return e=e==null?vh:Math.pow(vh,e),new Br(this.r*e,this.g*e,this.b*e,this.opacity)},rgb(){return this},clamp(){return new Br(Sl(this.r),Sl(this.g),Sl(this.b),iv(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:f2,formatHex:f2,formatHex8:_pe,formatRgb:h2,toString:h2}));function f2(){return`#${cl(this.r)}${cl(this.g)}${cl(this.b)}`}function _pe(){return`#${cl(this.r)}${cl(this.g)}${cl(this.b)}${cl((isNaN(this.opacity)?1:this.opacity)*255)}`}function h2(){const e=iv(this.opacity);return`${e===1?"rgb(":"rgba("}${Sl(this.r)}, ${Sl(this.g)}, ${Sl(this.b)}${e===1?")":`, ${e})`}`}function iv(e){return isNaN(e)?1:Math.max(0,Math.min(1,e))}function Sl(e){return Math.max(0,Math.min(255,Math.round(e)||0))}function cl(e){return e=Sl(e),(e<16?"0":"")+e.toString(16)}function p2(e,t,n,r){return r<=0?e=t=n=NaN:n<=0||n>=1?e=t=NaN:t<=0&&(e=NaN),new Hs(e,t,n,r)}function F5(e){if(e instanceof Hs)return new Hs(e.h,e.s,e.l,e.opacity);if(e instanceof bp||(e=xh(e)),!e)return new Hs;if(e instanceof Hs)return e;e=e.rgb();var t=e.r/255,n=e.g/255,r=e.b/255,s=Math.min(t,n,r),a=Math.max(t,n,r),o=NaN,l=a-s,c=(a+s)/2;return l?(t===a?o=(n-r)/l+(n0&&c<1?0:o,new Hs(o,l,c,e.opacity)}function Ppe(e,t,n,r){return arguments.length===1?F5(e):new Hs(e,t,n,r??1)}function Hs(e,t,n,r){this.h=+e,this.s=+t,this.l=+n,this.opacity=+r}x_(Hs,Ppe,L5(bp,{brighter(e){return e=e==null?av:Math.pow(av,e),new Hs(this.h,this.s,this.l*e,this.opacity)},darker(e){return e=e==null?vh:Math.pow(vh,e),new Hs(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,s=2*n-r;return new Br(V0(e>=240?e-240:e+120,s,r),V0(e,s,r),V0(e<120?e+240:e-120,s,r),this.opacity)},clamp(){return new Hs(m2(this.h),am(this.s),am(this.l),iv(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=iv(this.opacity);return`${e===1?"hsl(":"hsla("}${m2(this.h)}, ${am(this.s)*100}%, ${am(this.l)*100}%${e===1?")":`, ${e})`}`}}));function m2(e){return e=(e||0)%360,e<0?e+360:e}function am(e){return Math.max(0,Math.min(1,e||0))}function V0(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 b_=e=>()=>e;function Ape(e,t){return function(n){return e+n*t}}function Cpe(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 Epe(e){return(e=+e)==1?B5:function(t,n){return n-t?Cpe(t,n,e):b_(isNaN(t)?n:t)}}function B5(e,t){var n=t-e;return n?Ape(e,n):b_(isNaN(e)?t:e)}const g2=function e(t){var n=Epe(t);function r(s,a){var o=n((s=S1(s)).r,(a=S1(a)).r),l=n(s.g,a.g),c=n(s.b,a.b),u=B5(s.opacity,a.opacity);return function(d){return s.r=o(d),s.g=l(d),s.b=c(d),s.opacity=u(d),s+""}}return r.gamma=e,r}(1);function Ope(e,t){t||(t=[]);var n=e?Math.min(t.length,e.length):0,r=t.slice(),s;return function(a){for(s=0;sn&&(a=t.slice(n,a),l[o]?l[o]+=a:l[++o]=a),(r=r[0])===(s=s[0])?l[o]?l[o]+=s:l[++o]=s:(l[++o]=null,c.push({i:o,x:ov(r,s)})),n=W0.lastIndex;return nt&&(n=e,e=t,t=n),function(r){return Math.max(e,Math.min(t,r))}}function zpe(e,t,n){var r=e[0],s=e[1],a=t[0],o=t[1];return s2?Upe:zpe,c=u=null,f}function f(h){return h==null||isNaN(h=+h)?a:(c||(c=l(e.map(r),t,n)))(r(o(h)))}return f.invert=function(h){return o(s((u||(u=l(t,e.map(r),ov)))(h)))},f.domain=function(h){return arguments.length?(e=Array.from(h,lv),d()):e.slice()},f.range=function(h){return arguments.length?(t=Array.from(h),d()):t.slice()},f.rangeRound=function(h){return t=Array.from(h),n=w_,d()},f.clamp=function(h){return arguments.length?(o=h?!0:Er,d()):o!==Er},f.interpolate=function(h){return arguments.length?(n=h,d()):n},f.unknown=function(h){return arguments.length?(a=h,f):a},function(h,p){return r=h,s=p,d()}}function j_(){return px()(Er,Er)}function Vpe(e){return Math.abs(e=Math.round(e))>=1e21?e.toLocaleString("en").replace(/,/g,""):e.toString(10)}function cv(e,t){if((n=(e=t?e.toExponential(t-1):e.toExponential()).indexOf("e"))<0)return null;var n,r=e.slice(0,n);return[r.length>1?r[0]+r.slice(2):r,+e.slice(n+1)]}function xu(e){return e=cv(Math.abs(e)),e?e[1]:NaN}function Wpe(e,t){return function(n,r){for(var s=n.length,a=[],o=0,l=e[0],c=0;s>0&&l>0&&(c+l+1>r&&(l=Math.max(1,r-c)),a.push(n.substring(s-=l,s+l)),!((c+=l+1)>r));)l=e[o=(o+1)%e.length];return a.reverse().join(t)}}function Gpe(e){return function(t){return t.replace(/[0-9]/g,function(n){return e[+n]})}}var Hpe=/^(?:(.)?([<>=^]))?([+\-( ])?([$#])?(0)?(\d+)?(,)?(\.\d+)?(~)?([a-z%])?$/i;function bh(e){if(!(t=Hpe.exec(e)))throw new Error("invalid format: "+e);var t;return new S_({fill:t[1],align:t[2],sign:t[3],symbol:t[4],zero:t[5],width:t[6],comma:t[7],precision:t[8]&&t[8].slice(1),trim:t[9],type:t[10]})}bh.prototype=S_.prototype;function S_(e){this.fill=e.fill===void 0?" ":e.fill+"",this.align=e.align===void 0?">":e.align+"",this.sign=e.sign===void 0?"-":e.sign+"",this.symbol=e.symbol===void 0?"":e.symbol+"",this.zero=!!e.zero,this.width=e.width===void 0?void 0:+e.width,this.comma=!!e.comma,this.precision=e.precision===void 0?void 0:+e.precision,this.trim=!!e.trim,this.type=e.type===void 0?"":e.type+""}S_.prototype.toString=function(){return this.fill+this.align+this.sign+this.symbol+(this.zero?"0":"")+(this.width===void 0?"":Math.max(1,this.width|0))+(this.comma?",":"")+(this.precision===void 0?"":"."+Math.max(0,this.precision|0))+(this.trim?"~":"")+this.type};function qpe(e){e:for(var t=e.length,n=1,r=-1,s;n0&&(r=0);break}return r>0?e.slice(0,r)+e.slice(s+1):e}var z5;function Kpe(e,t){var n=cv(e,t);if(!n)return e+"";var r=n[0],s=n[1],a=s-(z5=Math.max(-8,Math.min(8,Math.floor(s/3)))*3)+1,o=r.length;return a===o?r:a>o?r+new Array(a-o+1).join("0"):a>0?r.slice(0,a)+"."+r.slice(a):"0."+new Array(1-a).join("0")+cv(e,Math.max(0,t+a-1))[0]}function y2(e,t){var n=cv(e,t);if(!n)return e+"";var r=n[0],s=n[1];return s<0?"0."+new Array(-s).join("0")+r:r.length>s+1?r.slice(0,s+1)+"."+r.slice(s+1):r+new Array(s-r.length+2).join("0")}const x2={"%":(e,t)=>(e*100).toFixed(t),b:e=>Math.round(e).toString(2),c:e=>e+"",d:Vpe,e:(e,t)=>e.toExponential(t),f:(e,t)=>e.toFixed(t),g:(e,t)=>e.toPrecision(t),o:e=>Math.round(e).toString(8),p:(e,t)=>y2(e*100,t),r:y2,s:Kpe,X:e=>Math.round(e).toString(16).toUpperCase(),x:e=>Math.round(e).toString(16)};function b2(e){return e}var w2=Array.prototype.map,j2=["y","z","a","f","p","n","µ","m","","k","M","G","T","P","E","Z","Y"];function Xpe(e){var t=e.grouping===void 0||e.thousands===void 0?b2:Wpe(w2.call(e.grouping,Number),e.thousands+""),n=e.currency===void 0?"":e.currency[0]+"",r=e.currency===void 0?"":e.currency[1]+"",s=e.decimal===void 0?".":e.decimal+"",a=e.numerals===void 0?b2:Gpe(w2.call(e.numerals,String)),o=e.percent===void 0?"%":e.percent+"",l=e.minus===void 0?"−":e.minus+"",c=e.nan===void 0?"NaN":e.nan+"";function u(f){f=bh(f);var h=f.fill,p=f.align,g=f.sign,m=f.symbol,y=f.zero,b=f.width,x=f.comma,w=f.precision,j=f.trim,S=f.type;S==="n"?(x=!0,S="g"):x2[S]||(w===void 0&&(w=12),j=!0,S="g"),(y||h==="0"&&p==="=")&&(y=!0,h="0",p="=");var N=m==="$"?n:m==="#"&&/[boxX]/.test(S)?"0"+S.toLowerCase():"",_=m==="$"?r:/[%p]/.test(S)?o:"",P=x2[S],k=/[defgprs%]/.test(S);w=w===void 0?6:/[gprs]/.test(S)?Math.max(1,Math.min(21,w)):Math.max(0,Math.min(20,w));function O(M){var A=N,$=_,L,G,D;if(S==="c")$=P(M)+$,M="";else{M=+M;var V=M<0||1/M<0;if(M=isNaN(M)?c:P(Math.abs(M),w),j&&(M=qpe(M)),V&&+M==0&&g!=="+"&&(V=!1),A=(V?g==="("?g:l:g==="-"||g==="("?"":g)+A,$=(S==="s"?j2[8+z5/3]:"")+$+(V&&g==="("?")":""),k){for(L=-1,G=M.length;++LD||D>57){$=(D===46?s+M.slice(L+1):M.slice(L))+$,M=M.slice(0,L);break}}}x&&!y&&(M=t(M,1/0));var T=A.length+M.length+$.length,F=T>1)+A+M+$+F.slice(T);break;default:M=F+A+M+$;break}return a(M)}return O.toString=function(){return f+""},O}function d(f,h){var p=u((f=bh(f),f.type="f",f)),g=Math.max(-8,Math.min(8,Math.floor(xu(h)/3)))*3,m=Math.pow(10,-g),y=j2[8+g/3];return function(b){return p(m*b)+y}}return{format:u,formatPrefix:d}}var im,N_,U5;Ype({thousands:",",grouping:[3],currency:["$",""]});function Ype(e){return im=Xpe(e),N_=im.format,U5=im.formatPrefix,im}function Zpe(e){return Math.max(0,-xu(Math.abs(e)))}function Qpe(e,t){return Math.max(0,Math.max(-8,Math.min(8,Math.floor(xu(t)/3)))*3-xu(Math.abs(e)))}function Jpe(e,t){return e=Math.abs(e),t=Math.abs(t)-e,Math.max(0,xu(t)-xu(e))+1}function V5(e,t,n,r){var s=w1(e,t,n),a;switch(r=bh(r??",f"),r.type){case"s":{var o=Math.max(Math.abs(e),Math.abs(t));return r.precision==null&&!isNaN(a=Qpe(s,o))&&(r.precision=a),U5(r,o)}case"":case"e":case"g":case"p":case"r":{r.precision==null&&!isNaN(a=Jpe(s,Math.max(Math.abs(e),Math.abs(t))))&&(r.precision=a-(r.type==="e"));break}case"f":case"%":{r.precision==null&&!isNaN(a=Zpe(s))&&(r.precision=a-(r.type==="%")*2);break}}return N_(r)}function zo(e){var t=e.domain;return e.ticks=function(n){var r=t();return x1(r[0],r[r.length-1],n??10)},e.tickFormat=function(n,r){var s=t();return V5(s[0],s[s.length-1],n??10,r)},e.nice=function(n){n==null&&(n=10);var r=t(),s=0,a=r.length-1,o=r[s],l=r[a],c,u,d=10;for(l0;){if(u=b1(o,l,n),u===c)return r[s]=o,r[a]=l,t(r);if(u>0)o=Math.floor(o/u)*u,l=Math.ceil(l/u)*u;else if(u<0)o=Math.ceil(o*u)/u,l=Math.floor(l*u)/u;else break;c=u}return e},e}function uv(){var e=j_();return e.copy=function(){return wp(e,uv())},$s.apply(e,arguments),zo(e)}function W5(e){var t;function n(r){return r==null||isNaN(r=+r)?t:r}return n.invert=n,n.domain=n.range=function(r){return arguments.length?(e=Array.from(r,lv),n):e.slice()},n.unknown=function(r){return arguments.length?(t=r,n):t},n.copy=function(){return W5(e).unknown(t)},e=arguments.length?Array.from(e,lv):[0,1],zo(n)}function G5(e,t){e=e.slice();var n=0,r=e.length-1,s=e[n],a=e[r],o;return aMath.pow(e,t)}function sme(e){return e===Math.E?Math.log:e===10&&Math.log10||e===2&&Math.log2||(e=Math.log(e),t=>Math.log(t)/e)}function _2(e){return(t,n)=>-e(-t,n)}function __(e){const t=e(S2,N2),n=t.domain;let r=10,s,a;function o(){return s=sme(r),a=rme(r),n()[0]<0?(s=_2(s),a=_2(a),e(eme,tme)):e(S2,N2),t}return t.base=function(l){return arguments.length?(r=+l,o()):r},t.domain=function(l){return arguments.length?(n(l),o()):n()},t.ticks=l=>{const c=n();let u=c[0],d=c[c.length-1];const f=d0){for(;h<=p;++h)for(g=1;gd)break;b.push(m)}}else for(;h<=p;++h)for(g=r-1;g>=1;--g)if(m=h>0?g/a(-h):g*a(h),!(md)break;b.push(m)}b.length*2{if(l==null&&(l=10),c==null&&(c=r===10?"s":","),typeof c!="function"&&(!(r%1)&&(c=bh(c)).precision==null&&(c.trim=!0),c=N_(c)),l===1/0)return c;const u=Math.max(1,r*l/t.ticks().length);return d=>{let f=d/a(Math.round(s(d)));return f*rn(G5(n(),{floor:l=>a(Math.floor(s(l))),ceil:l=>a(Math.ceil(s(l)))})),t}function H5(){const e=__(px()).domain([1,10]);return e.copy=()=>wp(e,H5()).base(e.base()),$s.apply(e,arguments),e}function P2(e){return function(t){return Math.sign(t)*Math.log1p(Math.abs(t/e))}}function A2(e){return function(t){return Math.sign(t)*Math.expm1(Math.abs(t))*e}}function P_(e){var t=1,n=e(P2(t),A2(t));return n.constant=function(r){return arguments.length?e(P2(t=+r),A2(t)):t},zo(n)}function q5(){var e=P_(px());return e.copy=function(){return wp(e,q5()).constant(e.constant())},$s.apply(e,arguments)}function C2(e){return function(t){return t<0?-Math.pow(-t,e):Math.pow(t,e)}}function ame(e){return e<0?-Math.sqrt(-e):Math.sqrt(e)}function ime(e){return e<0?-e*e:e*e}function A_(e){var t=e(Er,Er),n=1;function r(){return n===1?e(Er,Er):n===.5?e(ame,ime):e(C2(n),C2(1/n))}return t.exponent=function(s){return arguments.length?(n=+s,r()):n},zo(t)}function C_(){var e=A_(px());return e.copy=function(){return wp(e,C_()).exponent(e.exponent())},$s.apply(e,arguments),e}function ome(){return C_.apply(null,arguments).exponent(.5)}function E2(e){return Math.sign(e)*e*e}function lme(e){return Math.sign(e)*Math.sqrt(Math.abs(e))}function K5(){var e=j_(),t=[0,1],n=!1,r;function s(a){var o=lme(e(a));return isNaN(o)?r:n?Math.round(o):o}return s.invert=function(a){return e.invert(E2(a))},s.domain=function(a){return arguments.length?(e.domain(a),s):e.domain()},s.range=function(a){return arguments.length?(e.range((t=Array.from(a,lv)).map(E2)),s):t.slice()},s.rangeRound=function(a){return s.range(a).round(!0)},s.round=function(a){return arguments.length?(n=!!a,s):n},s.clamp=function(a){return arguments.length?(e.clamp(a),s):e.clamp()},s.unknown=function(a){return arguments.length?(r=a,s):r},s.copy=function(){return K5(e.domain(),t).round(n).clamp(e.clamp()).unknown(r)},$s.apply(s,arguments),zo(s)}function X5(){var e=[],t=[],n=[],r;function s(){var o=0,l=Math.max(1,t.length);for(n=new Array(l-1);++o0?n[l-1]:e[0],l=n?[r[n-1],t]:[r[u-1],r[u]]},o.unknown=function(c){return arguments.length&&(a=c),o},o.thresholds=function(){return r.slice()},o.copy=function(){return Y5().domain([e,t]).range(s).unknown(a)},$s.apply(zo(o),arguments)}function Z5(){var e=[.5],t=[0,1],n,r=1;function s(a){return a!=null&&a<=a?t[xp(e,a,0,r)]:n}return s.domain=function(a){return arguments.length?(e=Array.from(a),r=Math.min(e.length,t.length-1),s):e.slice()},s.range=function(a){return arguments.length?(t=Array.from(a),r=Math.min(e.length,t.length-1),s):t.slice()},s.invertExtent=function(a){var o=t.indexOf(a);return[e[o-1],e[o]]},s.unknown=function(a){return arguments.length?(n=a,s):n},s.copy=function(){return Z5().domain(e).range(t).unknown(n)},$s.apply(s,arguments)}const G0=new Date,H0=new Date;function Kn(e,t,n,r){function s(a){return e(a=arguments.length===0?new Date:new Date(+a)),a}return s.floor=a=>(e(a=new Date(+a)),a),s.ceil=a=>(e(a=new Date(a-1)),t(a,1),e(a),a),s.round=a=>{const o=s(a),l=s.ceil(a);return a-o(t(a=new Date(+a),o==null?1:Math.floor(o)),a),s.range=(a,o,l)=>{const c=[];if(a=s.ceil(a),l=l==null?1:Math.floor(l),!(a0))return c;let u;do c.push(u=new Date(+a)),t(a,l),e(a);while(uKn(o=>{if(o>=o)for(;e(o),!a(o);)o.setTime(o-1)},(o,l)=>{if(o>=o)if(l<0)for(;++l<=0;)for(;t(o,-1),!a(o););else for(;--l>=0;)for(;t(o,1),!a(o););}),n&&(s.count=(a,o)=>(G0.setTime(+a),H0.setTime(+o),e(G0),e(H0),Math.floor(n(G0,H0))),s.every=a=>(a=Math.floor(a),!isFinite(a)||!(a>0)?null:a>1?s.filter(r?o=>r(o)%a===0:o=>s.count(0,o)%a===0):s)),s}const dv=Kn(()=>{},(e,t)=>{e.setTime(+e+t)},(e,t)=>t-e);dv.every=e=>(e=Math.floor(e),!isFinite(e)||!(e>0)?null:e>1?Kn(t=>{t.setTime(Math.floor(t/e)*e)},(t,n)=>{t.setTime(+t+n*e)},(t,n)=>(n-t)/e):dv);dv.range;const si=1e3,Ns=si*60,ai=Ns*60,wi=ai*24,E_=wi*7,O2=wi*30,q0=wi*365,ul=Kn(e=>{e.setTime(e-e.getMilliseconds())},(e,t)=>{e.setTime(+e+t*si)},(e,t)=>(t-e)/si,e=>e.getUTCSeconds());ul.range;const O_=Kn(e=>{e.setTime(e-e.getMilliseconds()-e.getSeconds()*si)},(e,t)=>{e.setTime(+e+t*Ns)},(e,t)=>(t-e)/Ns,e=>e.getMinutes());O_.range;const k_=Kn(e=>{e.setUTCSeconds(0,0)},(e,t)=>{e.setTime(+e+t*Ns)},(e,t)=>(t-e)/Ns,e=>e.getUTCMinutes());k_.range;const T_=Kn(e=>{e.setTime(e-e.getMilliseconds()-e.getSeconds()*si-e.getMinutes()*Ns)},(e,t)=>{e.setTime(+e+t*ai)},(e,t)=>(t-e)/ai,e=>e.getHours());T_.range;const $_=Kn(e=>{e.setUTCMinutes(0,0,0)},(e,t)=>{e.setTime(+e+t*ai)},(e,t)=>(t-e)/ai,e=>e.getUTCHours());$_.range;const jp=Kn(e=>e.setHours(0,0,0,0),(e,t)=>e.setDate(e.getDate()+t),(e,t)=>(t-e-(t.getTimezoneOffset()-e.getTimezoneOffset())*Ns)/wi,e=>e.getDate()-1);jp.range;const mx=Kn(e=>{e.setUTCHours(0,0,0,0)},(e,t)=>{e.setUTCDate(e.getUTCDate()+t)},(e,t)=>(t-e)/wi,e=>e.getUTCDate()-1);mx.range;const Q5=Kn(e=>{e.setUTCHours(0,0,0,0)},(e,t)=>{e.setUTCDate(e.getUTCDate()+t)},(e,t)=>(t-e)/wi,e=>Math.floor(e/wi));Q5.range;function Jl(e){return Kn(t=>{t.setDate(t.getDate()-(t.getDay()+7-e)%7),t.setHours(0,0,0,0)},(t,n)=>{t.setDate(t.getDate()+n*7)},(t,n)=>(n-t-(n.getTimezoneOffset()-t.getTimezoneOffset())*Ns)/E_)}const gx=Jl(0),fv=Jl(1),cme=Jl(2),ume=Jl(3),bu=Jl(4),dme=Jl(5),fme=Jl(6);gx.range;fv.range;cme.range;ume.range;bu.range;dme.range;fme.range;function ec(e){return Kn(t=>{t.setUTCDate(t.getUTCDate()-(t.getUTCDay()+7-e)%7),t.setUTCHours(0,0,0,0)},(t,n)=>{t.setUTCDate(t.getUTCDate()+n*7)},(t,n)=>(n-t)/E_)}const vx=ec(0),hv=ec(1),hme=ec(2),pme=ec(3),wu=ec(4),mme=ec(5),gme=ec(6);vx.range;hv.range;hme.range;pme.range;wu.range;mme.range;gme.range;const M_=Kn(e=>{e.setDate(1),e.setHours(0,0,0,0)},(e,t)=>{e.setMonth(e.getMonth()+t)},(e,t)=>t.getMonth()-e.getMonth()+(t.getFullYear()-e.getFullYear())*12,e=>e.getMonth());M_.range;const I_=Kn(e=>{e.setUTCDate(1),e.setUTCHours(0,0,0,0)},(e,t)=>{e.setUTCMonth(e.getUTCMonth()+t)},(e,t)=>t.getUTCMonth()-e.getUTCMonth()+(t.getUTCFullYear()-e.getUTCFullYear())*12,e=>e.getUTCMonth());I_.range;const ji=Kn(e=>{e.setMonth(0,1),e.setHours(0,0,0,0)},(e,t)=>{e.setFullYear(e.getFullYear()+t)},(e,t)=>t.getFullYear()-e.getFullYear(),e=>e.getFullYear());ji.every=e=>!isFinite(e=Math.floor(e))||!(e>0)?null:Kn(t=>{t.setFullYear(Math.floor(t.getFullYear()/e)*e),t.setMonth(0,1),t.setHours(0,0,0,0)},(t,n)=>{t.setFullYear(t.getFullYear()+n*e)});ji.range;const Si=Kn(e=>{e.setUTCMonth(0,1),e.setUTCHours(0,0,0,0)},(e,t)=>{e.setUTCFullYear(e.getUTCFullYear()+t)},(e,t)=>t.getUTCFullYear()-e.getUTCFullYear(),e=>e.getUTCFullYear());Si.every=e=>!isFinite(e=Math.floor(e))||!(e>0)?null:Kn(t=>{t.setUTCFullYear(Math.floor(t.getUTCFullYear()/e)*e),t.setUTCMonth(0,1),t.setUTCHours(0,0,0,0)},(t,n)=>{t.setUTCFullYear(t.getUTCFullYear()+n*e)});Si.range;function J5(e,t,n,r,s,a){const o=[[ul,1,si],[ul,5,5*si],[ul,15,15*si],[ul,30,30*si],[a,1,Ns],[a,5,5*Ns],[a,15,15*Ns],[a,30,30*Ns],[s,1,ai],[s,3,3*ai],[s,6,6*ai],[s,12,12*ai],[r,1,wi],[r,2,2*wi],[n,1,E_],[t,1,O2],[t,3,3*O2],[e,1,q0]];function l(u,d,f){const h=dy).right(o,h);if(p===o.length)return e.every(w1(u/q0,d/q0,f));if(p===0)return dv.every(Math.max(w1(u,d,f),1));const[g,m]=o[h/o[p-1][2]53)return null;"w"in ne||(ne.w=1),"Z"in ne?(ve=X0(Id(ne.y,0,1)),at=ve.getUTCDay(),ve=at>4||at===0?hv.ceil(ve):hv(ve),ve=mx.offset(ve,(ne.V-1)*7),ne.y=ve.getUTCFullYear(),ne.m=ve.getUTCMonth(),ne.d=ve.getUTCDate()+(ne.w+6)%7):(ve=K0(Id(ne.y,0,1)),at=ve.getDay(),ve=at>4||at===0?fv.ceil(ve):fv(ve),ve=jp.offset(ve,(ne.V-1)*7),ne.y=ve.getFullYear(),ne.m=ve.getMonth(),ne.d=ve.getDate()+(ne.w+6)%7)}else("W"in ne||"U"in ne)&&("w"in ne||(ne.w="u"in ne?ne.u%7:"W"in ne?1:0),at="Z"in ne?X0(Id(ne.y,0,1)).getUTCDay():K0(Id(ne.y,0,1)).getDay(),ne.m=0,ne.d="W"in ne?(ne.w+6)%7+ne.W*7-(at+5)%7:ne.w+ne.U*7-(at+6)%7);return"Z"in ne?(ne.H+=ne.Z/100|0,ne.M+=ne.Z%100,X0(ne)):K0(ne)}}function P(de,be,Pe,ne){for(var Je=0,ve=be.length,at=Pe.length,st,Mt;Je=at)return-1;if(st=be.charCodeAt(Je++),st===37){if(st=be.charAt(Je++),Mt=S[st in k2?be.charAt(Je++):st],!Mt||(ne=Mt(de,Pe,ne))<0)return-1}else if(st!=Pe.charCodeAt(ne++))return-1}return ne}function k(de,be,Pe){var ne=u.exec(be.slice(Pe));return ne?(de.p=d.get(ne[0].toLowerCase()),Pe+ne[0].length):-1}function O(de,be,Pe){var ne=p.exec(be.slice(Pe));return ne?(de.w=g.get(ne[0].toLowerCase()),Pe+ne[0].length):-1}function M(de,be,Pe){var ne=f.exec(be.slice(Pe));return ne?(de.w=h.get(ne[0].toLowerCase()),Pe+ne[0].length):-1}function A(de,be,Pe){var ne=b.exec(be.slice(Pe));return ne?(de.m=x.get(ne[0].toLowerCase()),Pe+ne[0].length):-1}function $(de,be,Pe){var ne=m.exec(be.slice(Pe));return ne?(de.m=y.get(ne[0].toLowerCase()),Pe+ne[0].length):-1}function L(de,be,Pe){return P(de,t,be,Pe)}function G(de,be,Pe){return P(de,n,be,Pe)}function D(de,be,Pe){return P(de,r,be,Pe)}function V(de){return o[de.getDay()]}function T(de){return a[de.getDay()]}function F(de){return c[de.getMonth()]}function q(de){return l[de.getMonth()]}function Z(de){return s[+(de.getHours()>=12)]}function re(de){return 1+~~(de.getMonth()/3)}function ge(de){return o[de.getUTCDay()]}function B(de){return a[de.getUTCDay()]}function le(de){return c[de.getUTCMonth()]}function se(de){return l[de.getUTCMonth()]}function ce(de){return s[+(de.getUTCHours()>=12)]}function De(de){return 1+~~(de.getUTCMonth()/3)}return{format:function(de){var be=N(de+="",w);return be.toString=function(){return de},be},parse:function(de){var be=_(de+="",!1);return be.toString=function(){return de},be},utcFormat:function(de){var be=N(de+="",j);return be.toString=function(){return de},be},utcParse:function(de){var be=_(de+="",!0);return be.toString=function(){return de},be}}}var k2={"-":"",_:" ",0:"0"},nr=/^\s*\d+/,jme=/^%/,Sme=/[\\^$*+?|[\]().{}]/g;function Ut(e,t,n){var r=e<0?"-":"",s=(r?-e:e)+"",a=s.length;return r+(a[t.toLowerCase(),n]))}function _me(e,t,n){var r=nr.exec(t.slice(n,n+1));return r?(e.w=+r[0],n+r[0].length):-1}function Pme(e,t,n){var r=nr.exec(t.slice(n,n+1));return r?(e.u=+r[0],n+r[0].length):-1}function Ame(e,t,n){var r=nr.exec(t.slice(n,n+2));return r?(e.U=+r[0],n+r[0].length):-1}function Cme(e,t,n){var r=nr.exec(t.slice(n,n+2));return r?(e.V=+r[0],n+r[0].length):-1}function Eme(e,t,n){var r=nr.exec(t.slice(n,n+2));return r?(e.W=+r[0],n+r[0].length):-1}function T2(e,t,n){var r=nr.exec(t.slice(n,n+4));return r?(e.y=+r[0],n+r[0].length):-1}function $2(e,t,n){var r=nr.exec(t.slice(n,n+2));return r?(e.y=+r[0]+(+r[0]>68?1900:2e3),n+r[0].length):-1}function Ome(e,t,n){var r=/^(Z)|([+-]\d\d)(?::?(\d\d))?/.exec(t.slice(n,n+6));return r?(e.Z=r[1]?0:-(r[2]+(r[3]||"00")),n+r[0].length):-1}function kme(e,t,n){var r=nr.exec(t.slice(n,n+1));return r?(e.q=r[0]*3-3,n+r[0].length):-1}function Tme(e,t,n){var r=nr.exec(t.slice(n,n+2));return r?(e.m=r[0]-1,n+r[0].length):-1}function M2(e,t,n){var r=nr.exec(t.slice(n,n+2));return r?(e.d=+r[0],n+r[0].length):-1}function $me(e,t,n){var r=nr.exec(t.slice(n,n+3));return r?(e.m=0,e.d=+r[0],n+r[0].length):-1}function I2(e,t,n){var r=nr.exec(t.slice(n,n+2));return r?(e.H=+r[0],n+r[0].length):-1}function Mme(e,t,n){var r=nr.exec(t.slice(n,n+2));return r?(e.M=+r[0],n+r[0].length):-1}function Ime(e,t,n){var r=nr.exec(t.slice(n,n+2));return r?(e.S=+r[0],n+r[0].length):-1}function Rme(e,t,n){var r=nr.exec(t.slice(n,n+3));return r?(e.L=+r[0],n+r[0].length):-1}function Dme(e,t,n){var r=nr.exec(t.slice(n,n+6));return r?(e.L=Math.floor(r[0]/1e3),n+r[0].length):-1}function Lme(e,t,n){var r=jme.exec(t.slice(n,n+1));return r?n+r[0].length:-1}function Fme(e,t,n){var r=nr.exec(t.slice(n));return r?(e.Q=+r[0],n+r[0].length):-1}function Bme(e,t,n){var r=nr.exec(t.slice(n));return r?(e.s=+r[0],n+r[0].length):-1}function R2(e,t){return Ut(e.getDate(),t,2)}function zme(e,t){return Ut(e.getHours(),t,2)}function Ume(e,t){return Ut(e.getHours()%12||12,t,2)}function Vme(e,t){return Ut(1+jp.count(ji(e),e),t,3)}function eF(e,t){return Ut(e.getMilliseconds(),t,3)}function Wme(e,t){return eF(e,t)+"000"}function Gme(e,t){return Ut(e.getMonth()+1,t,2)}function Hme(e,t){return Ut(e.getMinutes(),t,2)}function qme(e,t){return Ut(e.getSeconds(),t,2)}function Kme(e){var t=e.getDay();return t===0?7:t}function Xme(e,t){return Ut(gx.count(ji(e)-1,e),t,2)}function tF(e){var t=e.getDay();return t>=4||t===0?bu(e):bu.ceil(e)}function Yme(e,t){return e=tF(e),Ut(bu.count(ji(e),e)+(ji(e).getDay()===4),t,2)}function Zme(e){return e.getDay()}function Qme(e,t){return Ut(fv.count(ji(e)-1,e),t,2)}function Jme(e,t){return Ut(e.getFullYear()%100,t,2)}function ege(e,t){return e=tF(e),Ut(e.getFullYear()%100,t,2)}function tge(e,t){return Ut(e.getFullYear()%1e4,t,4)}function nge(e,t){var n=e.getDay();return e=n>=4||n===0?bu(e):bu.ceil(e),Ut(e.getFullYear()%1e4,t,4)}function rge(e){var t=e.getTimezoneOffset();return(t>0?"-":(t*=-1,"+"))+Ut(t/60|0,"0",2)+Ut(t%60,"0",2)}function D2(e,t){return Ut(e.getUTCDate(),t,2)}function sge(e,t){return Ut(e.getUTCHours(),t,2)}function age(e,t){return Ut(e.getUTCHours()%12||12,t,2)}function ige(e,t){return Ut(1+mx.count(Si(e),e),t,3)}function nF(e,t){return Ut(e.getUTCMilliseconds(),t,3)}function oge(e,t){return nF(e,t)+"000"}function lge(e,t){return Ut(e.getUTCMonth()+1,t,2)}function cge(e,t){return Ut(e.getUTCMinutes(),t,2)}function uge(e,t){return Ut(e.getUTCSeconds(),t,2)}function dge(e){var t=e.getUTCDay();return t===0?7:t}function fge(e,t){return Ut(vx.count(Si(e)-1,e),t,2)}function rF(e){var t=e.getUTCDay();return t>=4||t===0?wu(e):wu.ceil(e)}function hge(e,t){return e=rF(e),Ut(wu.count(Si(e),e)+(Si(e).getUTCDay()===4),t,2)}function pge(e){return e.getUTCDay()}function mge(e,t){return Ut(hv.count(Si(e)-1,e),t,2)}function gge(e,t){return Ut(e.getUTCFullYear()%100,t,2)}function vge(e,t){return e=rF(e),Ut(e.getUTCFullYear()%100,t,2)}function yge(e,t){return Ut(e.getUTCFullYear()%1e4,t,4)}function xge(e,t){var n=e.getUTCDay();return e=n>=4||n===0?wu(e):wu.ceil(e),Ut(e.getUTCFullYear()%1e4,t,4)}function bge(){return"+0000"}function L2(){return"%"}function F2(e){return+e}function B2(e){return Math.floor(+e/1e3)}var cc,sF,aF;wge({dateTime:"%x, %X",date:"%-m/%-d/%Y",time:"%-I:%M:%S %p",periods:["AM","PM"],days:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],shortDays:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],months:["January","February","March","April","May","June","July","August","September","October","November","December"],shortMonths:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"]});function wge(e){return cc=wme(e),sF=cc.format,cc.parse,aF=cc.utcFormat,cc.utcParse,cc}function jge(e){return new Date(e)}function Sge(e){return e instanceof Date?+e:+new Date(+e)}function R_(e,t,n,r,s,a,o,l,c,u){var d=j_(),f=d.invert,h=d.domain,p=u(".%L"),g=u(":%S"),m=u("%I:%M"),y=u("%I %p"),b=u("%a %d"),x=u("%b %d"),w=u("%B"),j=u("%Y");function S(N){return(c(N)t(s/(e.length-1)))},n.quantiles=function(r){return Array.from({length:r+1},(s,a)=>fpe(e,a/r))},n.copy=function(){return cF(t).domain(e)},ki.apply(n,arguments)}function xx(){var e=0,t=.5,n=1,r=1,s,a,o,l,c,u=Er,d,f=!1,h;function p(m){return isNaN(m=+m)?h:(m=.5+((m=+d(m))-a)*(r*mt}var hF=Oge,kge=bx,Tge=hF,$ge=ud;function Mge(e){return e&&e.length?kge(e,$ge,Tge):void 0}var Ige=Mge;const to=Ht(Ige);function Rge(e,t){return ee.e^a.s<0?1:-1;for(r=a.d.length,s=e.d.length,t=0,n=re.d[t]^a.s<0?1:-1;return r===s?0:r>s^a.s<0?1:-1};We.decimalPlaces=We.dp=function(){var e=this,t=e.d.length-1,n=(t-e.e)*un;if(t=e.d[t],t)for(;t%10==0;t/=10)n--;return n<0?0:n};We.dividedBy=We.div=function(e){return fi(this,new this.constructor(e))};We.dividedToIntegerBy=We.idiv=function(e){var t=this,n=t.constructor;return en(fi(t,new n(e),0,1),n.precision)};We.equals=We.eq=function(e){return!this.cmp(e)};We.exponent=function(){return Ln(this)};We.greaterThan=We.gt=function(e){return this.cmp(e)>0};We.greaterThanOrEqualTo=We.gte=function(e){return this.cmp(e)>=0};We.isInteger=We.isint=function(){return this.e>this.d.length-2};We.isNegative=We.isneg=function(){return this.s<0};We.isPositive=We.ispos=function(){return this.s>0};We.isZero=function(){return this.s===0};We.lessThan=We.lt=function(e){return this.cmp(e)<0};We.lessThanOrEqualTo=We.lte=function(e){return this.cmp(e)<1};We.logarithm=We.log=function(e){var t,n=this,r=n.constructor,s=r.precision,a=s+5;if(e===void 0)e=new r(10);else if(e=new r(e),e.s<1||e.eq(rs))throw Error(Os+"NaN");if(n.s<1)throw Error(Os+(n.s?"NaN":"-Infinity"));return n.eq(rs)?new r(0):(pn=!1,t=fi(wh(n,a),wh(e,a),a),pn=!0,en(t,s))};We.minus=We.sub=function(e){var t=this;return e=new t.constructor(e),t.s==e.s?yF(t,e):gF(t,(e.s=-e.s,e))};We.modulo=We.mod=function(e){var t,n=this,r=n.constructor,s=r.precision;if(e=new r(e),!e.s)throw Error(Os+"NaN");return n.s?(pn=!1,t=fi(n,e,0,1).times(e),pn=!0,n.minus(t)):en(new r(n),s)};We.naturalExponential=We.exp=function(){return vF(this)};We.naturalLogarithm=We.ln=function(){return wh(this)};We.negated=We.neg=function(){var e=new this.constructor(this);return e.s=-e.s||0,e};We.plus=We.add=function(e){var t=this;return e=new t.constructor(e),t.s==e.s?gF(t,e):yF(t,(e.s=-e.s,e))};We.precision=We.sd=function(e){var t,n,r,s=this;if(e!==void 0&&e!==!!e&&e!==1&&e!==0)throw Error(Nl+e);if(t=Ln(s)+1,r=s.d.length-1,n=r*un+1,r=s.d[r],r){for(;r%10==0;r/=10)n--;for(r=s.d[0];r>=10;r/=10)n++}return e&&t>n?t:n};We.squareRoot=We.sqrt=function(){var e,t,n,r,s,a,o,l=this,c=l.constructor;if(l.s<1){if(!l.s)return new c(0);throw Error(Os+"NaN")}for(e=Ln(l),pn=!1,s=Math.sqrt(+l),s==0||s==1/0?(t=Sa(l.d),(t.length+e)%2==0&&(t+="0"),s=Math.sqrt(t),e=hd((e+1)/2)-(e<0||e%2),s==1/0?t="5e"+e:(t=s.toExponential(),t=t.slice(0,t.indexOf("e")+1)+e),r=new c(t)):r=new c(s.toString()),n=c.precision,s=o=n+3;;)if(a=r,r=a.plus(fi(l,a,o+2)).times(.5),Sa(a.d).slice(0,o)===(t=Sa(r.d)).slice(0,o)){if(t=t.slice(o-3,o+1),s==o&&t=="4999"){if(en(a,n+1,0),a.times(a).eq(l)){r=a;break}}else if(t!="9999")break;o+=4}return pn=!0,en(r,n)};We.times=We.mul=function(e){var t,n,r,s,a,o,l,c,u,d=this,f=d.constructor,h=d.d,p=(e=new f(e)).d;if(!d.s||!e.s)return new f(0);for(e.s*=d.s,n=d.e+e.e,c=h.length,u=p.length,c=0;){for(t=0,s=c+r;s>r;)l=a[s]+p[r]*h[s-r-1]+t,a[s--]=l%Yn|0,t=l/Yn|0;a[s]=(a[s]+t)%Yn|0}for(;!a[--o];)a.pop();return t?++n:a.shift(),e.d=a,e.e=n,pn?en(e,f.precision):e};We.toDecimalPlaces=We.todp=function(e,t){var n=this,r=n.constructor;return n=new r(n),e===void 0?n:(Da(e,0,fd),t===void 0?t=r.rounding:Da(t,0,8),en(n,e+Ln(n)+1,t))};We.toExponential=function(e,t){var n,r=this,s=r.constructor;return e===void 0?n=Vl(r,!0):(Da(e,0,fd),t===void 0?t=s.rounding:Da(t,0,8),r=en(new s(r),e+1,t),n=Vl(r,!0,e+1)),n};We.toFixed=function(e,t){var n,r,s=this,a=s.constructor;return e===void 0?Vl(s):(Da(e,0,fd),t===void 0?t=a.rounding:Da(t,0,8),r=en(new a(s),e+Ln(s)+1,t),n=Vl(r.abs(),!1,e+Ln(r)+1),s.isneg()&&!s.isZero()?"-"+n:n)};We.toInteger=We.toint=function(){var e=this,t=e.constructor;return en(new t(e),Ln(e)+1,t.rounding)};We.toNumber=function(){return+this};We.toPower=We.pow=function(e){var t,n,r,s,a,o,l=this,c=l.constructor,u=12,d=+(e=new c(e));if(!e.s)return new c(rs);if(l=new c(l),!l.s){if(e.s<1)throw Error(Os+"Infinity");return l}if(l.eq(rs))return l;if(r=c.precision,e.eq(rs))return en(l,r);if(t=e.e,n=e.d.length-1,o=t>=n,a=l.s,o){if((n=d<0?-d:d)<=mF){for(s=new c(rs),t=Math.ceil(r/un+4),pn=!1;n%2&&(s=s.times(l),V2(s.d,t)),n=hd(n/2),n!==0;)l=l.times(l),V2(l.d,t);return pn=!0,e.s<0?new c(rs).div(s):en(s,r)}}else if(a<0)throw Error(Os+"NaN");return a=a<0&&e.d[Math.max(t,n)]&1?-1:1,l.s=1,pn=!1,s=e.times(wh(l,r+u)),pn=!0,s=vF(s),s.s=a,s};We.toPrecision=function(e,t){var n,r,s=this,a=s.constructor;return e===void 0?(n=Ln(s),r=Vl(s,n<=a.toExpNeg||n>=a.toExpPos)):(Da(e,1,fd),t===void 0?t=a.rounding:Da(t,0,8),s=en(new a(s),e,t),n=Ln(s),r=Vl(s,e<=n||n<=a.toExpNeg,e)),r};We.toSignificantDigits=We.tosd=function(e,t){var n=this,r=n.constructor;return e===void 0?(e=r.precision,t=r.rounding):(Da(e,1,fd),t===void 0?t=r.rounding:Da(t,0,8)),en(new r(n),e,t)};We.toString=We.valueOf=We.val=We.toJSON=We[Symbol.for("nodejs.util.inspect.custom")]=function(){var e=this,t=Ln(e),n=e.constructor;return Vl(e,t<=n.toExpNeg||t>=n.toExpPos)};function gF(e,t){var n,r,s,a,o,l,c,u,d=e.constructor,f=d.precision;if(!e.s||!t.s)return t.s||(t=new d(e)),pn?en(t,f):t;if(c=e.d,u=t.d,o=e.e,s=t.e,c=c.slice(),a=o-s,a){for(a<0?(r=c,a=-a,l=u.length):(r=u,s=o,l=c.length),o=Math.ceil(f/un),l=o>l?o+1:l+1,a>l&&(a=l,r.length=1),r.reverse();a--;)r.push(0);r.reverse()}for(l=c.length,a=u.length,l-a<0&&(a=l,r=u,u=c,c=r),n=0;a;)n=(c[--a]=c[a]+u[a]+n)/Yn|0,c[a]%=Yn;for(n&&(c.unshift(n),++s),l=c.length;c[--l]==0;)c.pop();return t.d=c,t.e=s,pn?en(t,f):t}function Da(e,t,n){if(e!==~~e||en)throw Error(Nl+e)}function Sa(e){var t,n,r,s=e.length-1,a="",o=e[0];if(s>0){for(a+=o,t=1;to?1:-1;else for(l=c=0;ls[l]?1:-1;break}return c}function n(r,s,a){for(var o=0;a--;)r[a]-=o,o=r[a]1;)r.shift()}return function(r,s,a,o){var l,c,u,d,f,h,p,g,m,y,b,x,w,j,S,N,_,P,k=r.constructor,O=r.s==s.s?1:-1,M=r.d,A=s.d;if(!r.s)return new k(r);if(!s.s)throw Error(Os+"Division by zero");for(c=r.e-s.e,_=A.length,S=M.length,p=new k(O),g=p.d=[],u=0;A[u]==(M[u]||0);)++u;if(A[u]>(M[u]||0)&&--c,a==null?x=a=k.precision:o?x=a+(Ln(r)-Ln(s))+1:x=a,x<0)return new k(0);if(x=x/un+2|0,u=0,_==1)for(d=0,A=A[0],x++;(u1&&(A=e(A,d),M=e(M,d),_=A.length,S=M.length),j=_,m=M.slice(0,_),y=m.length;y<_;)m[y++]=0;P=A.slice(),P.unshift(0),N=A[0],A[1]>=Yn/2&&++N;do d=0,l=t(A,m,_,y),l<0?(b=m[0],_!=y&&(b=b*Yn+(m[1]||0)),d=b/N|0,d>1?(d>=Yn&&(d=Yn-1),f=e(A,d),h=f.length,y=m.length,l=t(f,m,h,y),l==1&&(d--,n(f,_16)throw Error(F_+Ln(e));if(!e.s)return new d(rs);for(t==null?(pn=!1,l=f):l=t,o=new d(.03125);e.abs().gte(.1);)e=e.times(o),u+=5;for(r=Math.log(Jo(2,u))/Math.LN10*2+5|0,l+=r,n=s=a=new d(rs),d.precision=l;;){if(s=en(s.times(e),l),n=n.times(++c),o=a.plus(fi(s,n,l)),Sa(o.d).slice(0,l)===Sa(a.d).slice(0,l)){for(;u--;)a=en(a.times(a),l);return d.precision=f,t==null?(pn=!0,en(a,f)):a}a=o}}function Ln(e){for(var t=e.e*un,n=e.d[0];n>=10;n/=10)t++;return t}function Y0(e,t,n){if(t>e.LN10.sd())throw pn=!0,n&&(e.precision=n),Error(Os+"LN10 precision limit exceeded");return en(new e(e.LN10),t)}function zi(e){for(var t="";e--;)t+="0";return t}function wh(e,t){var n,r,s,a,o,l,c,u,d,f=1,h=10,p=e,g=p.d,m=p.constructor,y=m.precision;if(p.s<1)throw Error(Os+(p.s?"NaN":"-Infinity"));if(p.eq(rs))return new m(0);if(t==null?(pn=!1,u=y):u=t,p.eq(10))return t==null&&(pn=!0),Y0(m,u);if(u+=h,m.precision=u,n=Sa(g),r=n.charAt(0),a=Ln(p),Math.abs(a)<15e14){for(;r<7&&r!=1||r==1&&n.charAt(1)>3;)p=p.times(e),n=Sa(p.d),r=n.charAt(0),f++;a=Ln(p),r>1?(p=new m("0."+n),a++):p=new m(r+"."+n.slice(1))}else return c=Y0(m,u+2,y).times(a+""),p=wh(new m(r+"."+n.slice(1)),u-h).plus(c),m.precision=y,t==null?(pn=!0,en(p,y)):p;for(l=o=p=fi(p.minus(rs),p.plus(rs),u),d=en(p.times(p),u),s=3;;){if(o=en(o.times(d),u),c=l.plus(fi(o,new m(s),u)),Sa(c.d).slice(0,u)===Sa(l.d).slice(0,u))return l=l.times(2),a!==0&&(l=l.plus(Y0(m,u+2,y).times(a+""))),l=fi(l,new m(f),u),m.precision=y,t==null?(pn=!0,en(l,y)):l;l=c,s+=2}}function U2(e,t){var n,r,s;for((n=t.indexOf("."))>-1&&(t=t.replace(".","")),(r=t.search(/e/i))>0?(n<0&&(n=r),n+=+t.slice(r+1),t=t.substring(0,r)):n<0&&(n=t.length),r=0;t.charCodeAt(r)===48;)++r;for(s=t.length;t.charCodeAt(s-1)===48;)--s;if(t=t.slice(r,s),t){if(s-=r,n=n-r-1,e.e=hd(n/un),e.d=[],r=(n+1)%un,n<0&&(r+=un),rpv||e.e<-pv))throw Error(F_+n)}else e.s=0,e.e=0,e.d=[0];return e}function en(e,t,n){var r,s,a,o,l,c,u,d,f=e.d;for(o=1,a=f[0];a>=10;a/=10)o++;if(r=t-o,r<0)r+=un,s=t,u=f[d=0];else{if(d=Math.ceil((r+1)/un),a=f.length,d>=a)return e;for(u=a=f[d],o=1;a>=10;a/=10)o++;r%=un,s=r-un+o}if(n!==void 0&&(a=Jo(10,o-s-1),l=u/a%10|0,c=t<0||f[d+1]!==void 0||u%a,c=n<4?(l||c)&&(n==0||n==(e.s<0?3:2)):l>5||l==5&&(n==4||c||n==6&&(r>0?s>0?u/Jo(10,o-s):0:f[d-1])%10&1||n==(e.s<0?8:7))),t<1||!f[0])return c?(a=Ln(e),f.length=1,t=t-a-1,f[0]=Jo(10,(un-t%un)%un),e.e=hd(-t/un)||0):(f.length=1,f[0]=e.e=e.s=0),e;if(r==0?(f.length=d,a=1,d--):(f.length=d+1,a=Jo(10,un-r),f[d]=s>0?(u/Jo(10,o-s)%Jo(10,s)|0)*a:0),c)for(;;)if(d==0){(f[0]+=a)==Yn&&(f[0]=1,++e.e);break}else{if(f[d]+=a,f[d]!=Yn)break;f[d--]=0,a=1}for(r=f.length;f[--r]===0;)f.pop();if(pn&&(e.e>pv||e.e<-pv))throw Error(F_+Ln(e));return e}function yF(e,t){var n,r,s,a,o,l,c,u,d,f,h=e.constructor,p=h.precision;if(!e.s||!t.s)return t.s?t.s=-t.s:t=new h(e),pn?en(t,p):t;if(c=e.d,f=t.d,r=t.e,u=e.e,c=c.slice(),o=u-r,o){for(d=o<0,d?(n=c,o=-o,l=f.length):(n=f,r=u,l=c.length),s=Math.max(Math.ceil(p/un),l)+2,o>s&&(o=s,n.length=1),n.reverse(),s=o;s--;)n.push(0);n.reverse()}else{for(s=c.length,l=f.length,d=s0;--s)c[l++]=0;for(s=f.length;s>o;){if(c[--s]0?a=a.charAt(0)+"."+a.slice(1)+zi(r):o>1&&(a=a.charAt(0)+"."+a.slice(1)),a=a+(s<0?"e":"e+")+s):s<0?(a="0."+zi(-s-1)+a,n&&(r=n-o)>0&&(a+=zi(r))):s>=o?(a+=zi(s+1-o),n&&(r=n-s-1)>0&&(a=a+"."+zi(r))):((r=s+1)0&&(s+1===o&&(a+="."),a+=zi(r))),e.s<0?"-"+a:a}function V2(e,t){if(e.length>t)return e.length=t,!0}function xF(e){var t,n,r;function s(a){var o=this;if(!(o instanceof s))return new s(a);if(o.constructor=s,a instanceof s){o.s=a.s,o.e=a.e,o.d=(a=a.d)?a.slice():a;return}if(typeof a=="number"){if(a*0!==0)throw Error(Nl+a);if(a>0)o.s=1;else if(a<0)a=-a,o.s=-1;else{o.s=0,o.e=0,o.d=[0];return}if(a===~~a&&a<1e7){o.e=0,o.d=[a];return}return U2(o,a.toString())}else if(typeof a!="string")throw Error(Nl+a);if(a.charCodeAt(0)===45?(a=a.slice(1),o.s=-1):o.s=1,rve.test(a))U2(o,a);else throw Error(Nl+a)}if(s.prototype=We,s.ROUND_UP=0,s.ROUND_DOWN=1,s.ROUND_CEIL=2,s.ROUND_FLOOR=3,s.ROUND_HALF_UP=4,s.ROUND_HALF_DOWN=5,s.ROUND_HALF_EVEN=6,s.ROUND_HALF_CEIL=7,s.ROUND_HALF_FLOOR=8,s.clone=xF,s.config=s.set=sve,e===void 0&&(e={}),e)for(r=["precision","rounding","toExpNeg","toExpPos","LN10"],t=0;t=s[t+1]&&r<=s[t+2])this[n]=r;else throw Error(Nl+n+": "+r);if((r=e[n="LN10"])!==void 0)if(r==Math.LN10)this[n]=new this(r);else throw Error(Nl+n+": "+r);return this}var B_=xF(nve);rs=new B_(1);const Jt=B_;function ave(e){return cve(e)||lve(e)||ove(e)||ive()}function ive(){throw new TypeError(`Invalid attempt to spread non-iterable instance. +In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function ove(e,t){if(e){if(typeof e=="string")return P1(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);if(n==="Object"&&e.constructor&&(n=e.constructor.name),n==="Map"||n==="Set")return Array.from(e);if(n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return P1(e,t)}}function lve(e){if(typeof Symbol<"u"&&Symbol.iterator in Object(e))return Array.from(e)}function cve(e){if(Array.isArray(e))return P1(e)}function P1(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n=t?n.apply(void 0,s):e(t-o,W2(function(){for(var l=arguments.length,c=new Array(l),u=0;ue.length)&&(t=e.length);for(var n=0,r=new Array(t);n"u"||!(Symbol.iterator in Object(e)))){var n=[],r=!0,s=!1,a=void 0;try{for(var o=e[Symbol.iterator](),l;!(r=(l=o.next()).done)&&(n.push(l.value),!(t&&n.length===t));r=!0);}catch(c){s=!0,a=c}finally{try{!r&&o.return!=null&&o.return()}finally{if(s)throw a}}return n}}function Nve(e){if(Array.isArray(e))return e}function NF(e){var t=jh(e,2),n=t[0],r=t[1],s=n,a=r;return n>r&&(s=r,a=n),[s,a]}function _F(e,t,n){if(e.lte(0))return new Jt(0);var r=Sx.getDigitCount(e.toNumber()),s=new Jt(10).pow(r),a=e.div(s),o=r!==1?.05:.1,l=new Jt(Math.ceil(a.div(o).toNumber())).add(n).mul(o),c=l.mul(s);return t?c:new Jt(Math.ceil(c))}function _ve(e,t,n){var r=1,s=new Jt(e);if(!s.isint()&&n){var a=Math.abs(e);a<1?(r=new Jt(10).pow(Sx.getDigitCount(e)-1),s=new Jt(Math.floor(s.div(r).toNumber())).mul(r)):a>1&&(s=new Jt(Math.floor(e)))}else e===0?s=new Jt(Math.floor((t-1)/2)):n||(s=new Jt(Math.floor(e)));var o=Math.floor((t-1)/2),l=hve(fve(function(c){return s.add(new Jt(c-o).mul(r)).toNumber()}),A1);return l(0,t)}function PF(e,t,n,r){var s=arguments.length>4&&arguments[4]!==void 0?arguments[4]:0;if(!Number.isFinite((t-e)/(n-1)))return{step:new Jt(0),tickMin:new Jt(0),tickMax:new Jt(0)};var a=_F(new Jt(t).sub(e).div(n-1),r,s),o;e<=0&&t>=0?o=new Jt(0):(o=new Jt(e).add(t).div(2),o=o.sub(new Jt(o).mod(a)));var l=Math.ceil(o.sub(e).div(a).toNumber()),c=Math.ceil(new Jt(t).sub(o).div(a).toNumber()),u=l+c+1;return u>n?PF(e,t,n,r,s+1):(u0?c+(n-u):c,l=t>0?l:l+(n-u)),{step:a,tickMin:o.sub(new Jt(l).mul(a)),tickMax:o.add(new Jt(c).mul(a))})}function Pve(e){var t=jh(e,2),n=t[0],r=t[1],s=arguments.length>1&&arguments[1]!==void 0?arguments[1]:6,a=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!0,o=Math.max(s,2),l=NF([n,r]),c=jh(l,2),u=c[0],d=c[1];if(u===-1/0||d===1/0){var f=d===1/0?[u].concat(E1(A1(0,s-1).map(function(){return 1/0}))):[].concat(E1(A1(0,s-1).map(function(){return-1/0})),[d]);return n>r?C1(f):f}if(u===d)return _ve(u,s,a);var h=PF(u,d,o,a),p=h.step,g=h.tickMin,m=h.tickMax,y=Sx.rangeStep(g,m.add(new Jt(.1).mul(p)),p);return n>r?C1(y):y}function Ave(e,t){var n=jh(e,2),r=n[0],s=n[1],a=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!0,o=NF([r,s]),l=jh(o,2),c=l[0],u=l[1];if(c===-1/0||u===1/0)return[r,s];if(c===u)return[c];var d=Math.max(t,2),f=_F(new Jt(u).sub(c).div(d-1),a,0),h=[].concat(E1(Sx.rangeStep(new Jt(c),new Jt(u).sub(new Jt(.99).mul(f)),f)),[u]);return r>s?C1(h):h}var Cve=jF(Pve),Eve=jF(Ave),Ove="Invariant failed";function Wl(e,t){throw new Error(Ove)}var kve=["offset","layout","width","dataKey","data","dataPointFormatter","xAxis","yAxis"];function ju(e){"@babel/helpers - typeof";return ju=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},ju(e)}function mv(){return mv=Object.assign?Object.assign.bind():function(e){for(var t=1;te.length)&&(t=e.length);for(var n=0,r=new Array(t);n=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(n[r]=e[r])}return n}function Lve(e,t){if(e==null)return{};var n={};for(var r in e)if(Object.prototype.hasOwnProperty.call(e,r)){if(t.indexOf(r)>=0)continue;n[r]=e[r]}return n}function Fve(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function Bve(e,t){for(var n=0;ne.length)&&(t=e.length);for(var n=0,r=new Array(t);n1&&arguments[1]!==void 0?arguments[1]:[],s=arguments.length>2?arguments[2]:void 0,a=arguments.length>3?arguments[3]:void 0,o=-1,l=(n=r==null?void 0:r.length)!==null&&n!==void 0?n:0;if(l<=1)return 0;if(a&&a.axisType==="angleAxis"&&Math.abs(Math.abs(a.range[1]-a.range[0])-360)<=1e-6)for(var c=a.range,u=0;u0?s[u-1].coordinate:s[l-1].coordinate,f=s[u].coordinate,h=u>=l-1?s[0].coordinate:s[u+1].coordinate,p=void 0;if(Ar(f-d)!==Ar(h-f)){var g=[];if(Ar(h-f)===Ar(c[1]-c[0])){p=h;var m=f+c[1]-c[0];g[0]=Math.min(m,(m+d)/2),g[1]=Math.max(m,(m+d)/2)}else{p=d;var y=h+c[1]-c[0];g[0]=Math.min(f,(y+f)/2),g[1]=Math.max(f,(y+f)/2)}var b=[Math.min(f,(p+f)/2),Math.max(f,(p+f)/2)];if(t>b[0]&&t<=b[1]||t>=g[0]&&t<=g[1]){o=s[u].index;break}}else{var x=Math.min(d,h),w=Math.max(d,h);if(t>(x+f)/2&&t<=(w+f)/2){o=s[u].index;break}}}else for(var j=0;j0&&j(r[j].coordinate+r[j-1].coordinate)/2&&t<=(r[j].coordinate+r[j+1].coordinate)/2||j===l-1&&t>(r[j].coordinate+r[j-1].coordinate)/2){o=r[j].index;break}return o},z_=function(t){var n,r=t,s=r.type.displayName,a=(n=t.type)!==null&&n!==void 0&&n.defaultProps?Nn(Nn({},t.type.defaultProps),t.props):t.props,o=a.stroke,l=a.fill,c;switch(s){case"Line":c=o;break;case"Area":case"Radar":c=o&&o!=="none"?o:l;break;default:c=l;break}return c},rye=function(t){var n=t.barSize,r=t.totalSize,s=t.stackGroups,a=s===void 0?{}:s;if(!a)return{};for(var o={},l=Object.keys(a),c=0,u=l.length;c=0});if(b&&b.length){var x=b[0].type.defaultProps,w=x!==void 0?Nn(Nn({},x),b[0].props):b[0].props,j=w.barSize,S=w[y];o[S]||(o[S]=[]);var N=Nt(j)?n:j;o[S].push({item:b[0],stackList:b.slice(1),barSize:Nt(N)?void 0:Cr(N,r,0)})}}return o},sye=function(t){var n=t.barGap,r=t.barCategoryGap,s=t.bandSize,a=t.sizeList,o=a===void 0?[]:a,l=t.maxBarSize,c=o.length;if(c<1)return null;var u=Cr(n,s,0,!0),d,f=[];if(o[0].barSize===+o[0].barSize){var h=!1,p=s/c,g=o.reduce(function(j,S){return j+S.barSize||0},0);g+=(c-1)*u,g>=s&&(g-=(c-1)*u,u=0),g>=s&&p>0&&(h=!0,p*=.9,g=c*p);var m=(s-g)/2>>0,y={offset:m-u,size:0};d=o.reduce(function(j,S){var N={item:S.item,position:{offset:y.offset+y.size+u,size:h?p:S.barSize}},_=[].concat(q2(j),[N]);return y=_[_.length-1].position,S.stackList&&S.stackList.length&&S.stackList.forEach(function(P){_.push({item:P,position:y})}),_},f)}else{var b=Cr(r,s,0,!0);s-2*b-(c-1)*u<=0&&(u=0);var x=(s-2*b-(c-1)*u)/c;x>1&&(x>>=0);var w=l===+l?Math.min(x,l):x;d=o.reduce(function(j,S,N){var _=[].concat(q2(j),[{item:S.item,position:{offset:b+(x+u)*N+(x-w)/2,size:w}}]);return S.stackList&&S.stackList.length&&S.stackList.forEach(function(P){_.push({item:P,position:_[_.length-1].position})}),_},f)}return d},aye=function(t,n,r,s){var a=r.children,o=r.width,l=r.margin,c=o-(l.left||0)-(l.right||0),u=OF({children:a,legendWidth:c});if(u){var d=s||{},f=d.width,h=d.height,p=u.align,g=u.verticalAlign,m=u.layout;if((m==="vertical"||m==="horizontal"&&g==="middle")&&p!=="center"&&Ae(t[p]))return Nn(Nn({},t),{},Wc({},p,t[p]+(f||0)));if((m==="horizontal"||m==="vertical"&&p==="center")&&g!=="middle"&&Ae(t[g]))return Nn(Nn({},t),{},Wc({},g,t[g]+(h||0)))}return t},iye=function(t,n,r){return Nt(n)?!0:t==="horizontal"?n==="yAxis":t==="vertical"||r==="x"?n==="xAxis":r==="y"?n==="yAxis":!0},kF=function(t,n,r,s,a){var o=n.props.children,l=As(o,Nx).filter(function(u){return iye(s,a,u.props.direction)});if(l&&l.length){var c=l.map(function(u){return u.props.dataKey});return t.reduce(function(u,d){var f=En(d,r);if(Nt(f))return u;var h=Array.isArray(f)?[wx(f),to(f)]:[f,f],p=c.reduce(function(g,m){var y=En(d,m,0),b=h[0]-Math.abs(Array.isArray(y)?y[0]:y),x=h[1]+Math.abs(Array.isArray(y)?y[1]:y);return[Math.min(b,g[0]),Math.max(x,g[1])]},[1/0,-1/0]);return[Math.min(p[0],u[0]),Math.max(p[1],u[1])]},[1/0,-1/0])}return null},oye=function(t,n,r,s,a){var o=n.map(function(l){return kF(t,l,r,a,s)}).filter(function(l){return!Nt(l)});return o&&o.length?o.reduce(function(l,c){return[Math.min(l[0],c[0]),Math.max(l[1],c[1])]},[1/0,-1/0]):null},TF=function(t,n,r,s,a){var o=n.map(function(c){var u=c.props.dataKey;return r==="number"&&u&&kF(t,c,u,s)||hf(t,u,r,a)});if(r==="number")return o.reduce(function(c,u){return[Math.min(c[0],u[0]),Math.max(c[1],u[1])]},[1/0,-1/0]);var l={};return o.reduce(function(c,u){for(var d=0,f=u.length;d=2?Ar(l[0]-l[1])*2*u:u,n&&(t.ticks||t.niceTicks)){var d=(t.ticks||t.niceTicks).map(function(f){var h=a?a.indexOf(f):f;return{coordinate:s(h)+u,value:f,offset:u}});return d.filter(function(f){return!id(f.coordinate)})}return t.isCategorical&&t.categoricalDomain?t.categoricalDomain.map(function(f,h){return{coordinate:s(f)+u,value:f,index:h,offset:u}}):s.ticks&&!r?s.ticks(t.tickCount).map(function(f){return{coordinate:s(f)+u,value:f,offset:u}}):s.domain().map(function(f,h){return{coordinate:s(f)+u,value:a?a[f]:f,index:h,offset:u}})},Z0=new WeakMap,om=function(t,n){if(typeof n!="function")return t;Z0.has(t)||Z0.set(t,new WeakMap);var r=Z0.get(t);if(r.has(n))return r.get(n);var s=function(){t.apply(void 0,arguments),n.apply(void 0,arguments)};return r.set(n,s),s},IF=function(t,n,r){var s=t.scale,a=t.type,o=t.layout,l=t.axisType;if(s==="auto")return o==="radial"&&l==="radiusAxis"?{scale:gh(),realScaleType:"band"}:o==="radial"&&l==="angleAxis"?{scale:uv(),realScaleType:"linear"}:a==="category"&&n&&(n.indexOf("LineChart")>=0||n.indexOf("AreaChart")>=0||n.indexOf("ComposedChart")>=0&&!r)?{scale:ff(),realScaleType:"point"}:a==="category"?{scale:gh(),realScaleType:"band"}:{scale:uv(),realScaleType:"linear"};if(gp(s)){var c="scale".concat(ox(s));return{scale:(z2[c]||ff)(),realScaleType:z2[c]?c:"point"}}return ht(s)?{scale:s}:{scale:ff(),realScaleType:"point"}},X2=1e-4,RF=function(t){var n=t.domain();if(!(!n||n.length<=2)){var r=n.length,s=t.range(),a=Math.min(s[0],s[1])-X2,o=Math.max(s[0],s[1])+X2,l=t(n[0]),c=t(n[r-1]);(lo||co)&&t.domain([n[0],n[r-1]])}},lye=function(t,n){if(!t)return null;for(var r=0,s=t.length;rs)&&(a[1]=s),a[0]>s&&(a[0]=s),a[1]=0?(t[l][r][0]=a,t[l][r][1]=a+c,a=t[l][r][1]):(t[l][r][0]=o,t[l][r][1]=o+c,o=t[l][r][1])}},dye=function(t){var n=t.length;if(!(n<=0))for(var r=0,s=t[0].length;r=0?(t[o][r][0]=a,t[o][r][1]=a+l,a=t[o][r][1]):(t[o][r][0]=0,t[o][r][1]=0)}},fye={sign:uye,expand:kse,none:pu,silhouette:Tse,wiggle:$se,positive:dye},hye=function(t,n,r){var s=n.map(function(l){return l.props.dataKey}),a=fye[r],o=Ose().keys(s).value(function(l,c){return+En(l,c,0)}).order(r1).offset(a);return o(t)},pye=function(t,n,r,s,a,o){if(!t)return null;var l=o?n.reverse():n,c={},u=l.reduce(function(f,h){var p,g=(p=h.type)!==null&&p!==void 0&&p.defaultProps?Nn(Nn({},h.type.defaultProps),h.props):h.props,m=g.stackId,y=g.hide;if(y)return f;var b=g[r],x=f[b]||{hasStack:!1,stackGroups:{}};if(qn(m)){var w=x.stackGroups[m]||{numericAxisId:r,cateAxisId:s,items:[]};w.items.push(h),x.hasStack=!0,x.stackGroups[m]=w}else x.stackGroups[od("_stackId_")]={numericAxisId:r,cateAxisId:s,items:[h]};return Nn(Nn({},f),{},Wc({},b,x))},c),d={};return Object.keys(u).reduce(function(f,h){var p=u[h];if(p.hasStack){var g={};p.stackGroups=Object.keys(p.stackGroups).reduce(function(m,y){var b=p.stackGroups[y];return Nn(Nn({},m),{},Wc({},y,{numericAxisId:r,cateAxisId:s,items:b.items,stackedData:hye(t,b.items,a)}))},g)}return Nn(Nn({},f),{},Wc({},h,p))},d)},DF=function(t,n){var r=n.realScaleType,s=n.type,a=n.tickCount,o=n.originalDomain,l=n.allowDecimals,c=r||n.scale;if(c!=="auto"&&c!=="linear")return null;if(a&&s==="number"&&o&&(o[0]==="auto"||o[1]==="auto")){var u=t.domain();if(!u.length)return null;var d=Cve(u,a,l);return t.domain([wx(d),to(d)]),{niceTicks:d}}if(a&&s==="number"){var f=t.domain(),h=Eve(f,a,l);return{niceTicks:h}}return null};function Y2(e){var t=e.axis,n=e.ticks,r=e.bandSize,s=e.entry,a=e.index,o=e.dataKey;if(t.type==="category"){if(!t.allowDuplicatedCategory&&t.dataKey&&!Nt(s[t.dataKey])){var l=Vg(n,"value",s[t.dataKey]);if(l)return l.coordinate+r/2}return n[a]?n[a].coordinate+r/2:null}var c=En(s,Nt(o)?t.dataKey:o);return Nt(c)?null:t.scale(c)}var Z2=function(t){var n=t.axis,r=t.ticks,s=t.offset,a=t.bandSize,o=t.entry,l=t.index;if(n.type==="category")return r[l]?r[l].coordinate+s:null;var c=En(o,n.dataKey,n.domain[l]);return Nt(c)?null:n.scale(c)-a/2+s},mye=function(t){var n=t.numericAxis,r=n.scale.domain();if(n.type==="number"){var s=Math.min(r[0],r[1]),a=Math.max(r[0],r[1]);return s<=0&&a>=0?0:a<0?a:s}return r[0]},gye=function(t,n){var r,s=(r=t.type)!==null&&r!==void 0&&r.defaultProps?Nn(Nn({},t.type.defaultProps),t.props):t.props,a=s.stackId;if(qn(a)){var o=n[a];if(o){var l=o.items.indexOf(t);return l>=0?o.stackedData[l]:null}}return null},vye=function(t){return t.reduce(function(n,r){return[wx(r.concat([n[0]]).filter(Ae)),to(r.concat([n[1]]).filter(Ae))]},[1/0,-1/0])},LF=function(t,n,r){return Object.keys(t).reduce(function(s,a){var o=t[a],l=o.stackedData,c=l.reduce(function(u,d){var f=vye(d.slice(n,r+1));return[Math.min(u[0],f[0]),Math.max(u[1],f[1])]},[1/0,-1/0]);return[Math.min(c[0],s[0]),Math.max(c[1],s[1])]},[1/0,-1/0]).map(function(s){return s===1/0||s===-1/0?0:s})},Q2=/^dataMin[\s]*-[\s]*([0-9]+([.]{1}[0-9]+){0,1})$/,J2=/^dataMax[\s]*\+[\s]*([0-9]+([.]{1}[0-9]+){0,1})$/,$1=function(t,n,r){if(ht(t))return t(n,r);if(!Array.isArray(t))return n;var s=[];if(Ae(t[0]))s[0]=r?t[0]:Math.min(t[0],n[0]);else if(Q2.test(t[0])){var a=+Q2.exec(t[0])[1];s[0]=n[0]-a}else ht(t[0])?s[0]=t[0](n[0]):s[0]=n[0];if(Ae(t[1]))s[1]=r?t[1]:Math.max(t[1],n[1]);else if(J2.test(t[1])){var o=+J2.exec(t[1])[1];s[1]=n[1]+o}else ht(t[1])?s[1]=t[1](n[1]):s[1]=n[1];return s},vv=function(t,n,r){if(t&&t.scale&&t.scale.bandwidth){var s=t.scale.bandwidth();if(!r||s>0)return s}if(t&&n&&n.length>=2){for(var a=m_(n,function(f){return f.coordinate}),o=1/0,l=1,c=a.length;le.length)&&(t=e.length);for(var n=0,r=new Array(t);n2&&arguments[2]!==void 0?arguments[2]:{top:0,right:0,bottom:0,left:0};return Math.min(Math.abs(t-(r.left||0)-(r.right||0)),Math.abs(n-(r.top||0)-(r.bottom||0)))/2},UF=function(t,n,r,s,a){var o=t.width,l=t.height,c=t.startAngle,u=t.endAngle,d=Cr(t.cx,o,o/2),f=Cr(t.cy,l,l/2),h=zF(o,l,r),p=Cr(t.innerRadius,h,0),g=Cr(t.outerRadius,h,h*.8),m=Object.keys(n);return m.reduce(function(y,b){var x=n[b],w=x.domain,j=x.reversed,S;if(Nt(x.range))s==="angleAxis"?S=[c,u]:s==="radiusAxis"&&(S=[p,g]),j&&(S=[S[1],S[0]]);else{S=x.range;var N=S,_=bye(N,2);c=_[0],u=_[1]}var P=IF(x,a),k=P.realScaleType,O=P.scale;O.domain(w).range(S),RF(O);var M=DF(O,Ya(Ya({},x),{},{realScaleType:k})),A=Ya(Ya(Ya({},x),M),{},{range:S,radius:g,realScaleType:k,scale:O,cx:d,cy:f,innerRadius:p,outerRadius:g,startAngle:c,endAngle:u});return Ya(Ya({},y),{},BF({},b,A))},{})},Pye=function(t,n){var r=t.x,s=t.y,a=n.x,o=n.y;return Math.sqrt(Math.pow(r-a,2)+Math.pow(s-o,2))},Aye=function(t,n){var r=t.x,s=t.y,a=n.cx,o=n.cy,l=Pye({x:r,y:s},{x:a,y:o});if(l<=0)return{radius:l};var c=(r-a)/l,u=Math.acos(c);return s>o&&(u=2*Math.PI-u),{radius:l,angle:_ye(u),angleInRadian:u}},Cye=function(t){var n=t.startAngle,r=t.endAngle,s=Math.floor(n/360),a=Math.floor(r/360),o=Math.min(s,a);return{startAngle:n-o*360,endAngle:r-o*360}},Eye=function(t,n){var r=n.startAngle,s=n.endAngle,a=Math.floor(r/360),o=Math.floor(s/360),l=Math.min(a,o);return t+l*360},rO=function(t,n){var r=t.x,s=t.y,a=Aye({x:r,y:s},n),o=a.radius,l=a.angle,c=n.innerRadius,u=n.outerRadius;if(ou)return!1;if(o===0)return!0;var d=Cye(n),f=d.startAngle,h=d.endAngle,p=l,g;if(f<=h){for(;p>h;)p-=360;for(;p=f&&p<=h}else{for(;p>f;)p-=360;for(;p=h&&p<=f}return g?Ya(Ya({},n),{},{radius:o,angle:Eye(p,n)}):null},VF=function(t){return!v.isValidElement(t)&&!ht(t)&&typeof t!="boolean"?t.className:""};function Ph(e){"@babel/helpers - typeof";return Ph=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Ph(e)}var Oye=["offset"];function kye(e){return Iye(e)||Mye(e)||$ye(e)||Tye()}function Tye(){throw new TypeError(`Invalid attempt to spread non-iterable instance. +In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function $ye(e,t){if(e){if(typeof e=="string")return M1(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);if(n==="Object"&&e.constructor&&(n=e.constructor.name),n==="Map"||n==="Set")return Array.from(e);if(n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return M1(e,t)}}function Mye(e){if(typeof Symbol<"u"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function Iye(e){if(Array.isArray(e))return M1(e)}function M1(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(n[r]=e[r])}return n}function Dye(e,t){if(e==null)return{};var n={};for(var r in e)if(Object.prototype.hasOwnProperty.call(e,r)){if(t.indexOf(r)>=0)continue;n[r]=e[r]}return n}function sO(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(s){return Object.getOwnPropertyDescriptor(e,s).enumerable})),n.push.apply(n,r)}return n}function Bn(e){for(var t=1;t=0?1:-1,w,j;s==="insideStart"?(w=p+x*o,j=m):s==="insideEnd"?(w=g-x*o,j=!m):s==="end"&&(w=g+x*o,j=m),j=b<=0?j:!j;var S=Gt(u,d,y,w),N=Gt(u,d,y,w+(j?1:-1)*359),_="M".concat(S.x,",").concat(S.y,` A`).concat(y,",").concat(y,",0,1,").concat(j?0:1,`, - `).concat(N.x,",").concat(N.y),P=Nt(t.id)?od("recharts-radial-line-"):t.id;return E.createElement("text",Ph({},r,{dominantBaseline:"central",className:wt("recharts-radial-bar-label",l)}),E.createElement("defs",null,E.createElement("path",{id:P,d:_})),E.createElement("textPath",{xlinkHref:"#".concat(P)},n))},Lye=function(t){var n=t.viewBox,r=t.offset,s=t.position,a=n,o=a.cx,l=a.cy,c=a.innerRadius,u=a.outerRadius,d=a.startAngle,f=a.endAngle,h=(d+f)/2;if(s==="outside"){var p=Ht(o,l,u+r,h),g=p.x,m=p.y;return{x:g,y:m,textAnchor:g>=o?"start":"end",verticalAnchor:"middle"}}if(s==="center")return{x:o,y:l,textAnchor:"middle",verticalAnchor:"middle"};if(s==="centerTop")return{x:o,y:l,textAnchor:"middle",verticalAnchor:"start"};if(s==="centerBottom")return{x:o,y:l,textAnchor:"middle",verticalAnchor:"end"};var y=(c+u)/2,b=Ht(o,l,y,h),x=b.x,w=b.y;return{x,y:w,textAnchor:"middle",verticalAnchor:"middle"}},Fye=function(t){var n=t.viewBox,r=t.parentViewBox,s=t.offset,a=t.position,o=n,l=o.x,c=o.y,u=o.width,d=o.height,f=d>=0?1:-1,h=f*s,p=f>0?"end":"start",g=f>0?"start":"end",m=u>=0?1:-1,y=m*s,b=m>0?"end":"start",x=m>0?"start":"end";if(a==="top"){var w={x:l+u/2,y:c-f*s,textAnchor:"middle",verticalAnchor:p};return Bn(Bn({},w),r?{height:Math.max(c-r.y,0),width:u}:{})}if(a==="bottom"){var j={x:l+u/2,y:c+d+h,textAnchor:"middle",verticalAnchor:g};return Bn(Bn({},j),r?{height:Math.max(r.y+r.height-(c+d),0),width:u}:{})}if(a==="left"){var S={x:l-y,y:c+d/2,textAnchor:b,verticalAnchor:"middle"};return Bn(Bn({},S),r?{width:Math.max(S.x-r.x,0),height:d}:{})}if(a==="right"){var N={x:l+u+y,y:c+d/2,textAnchor:x,verticalAnchor:"middle"};return Bn(Bn({},N),r?{width:Math.max(r.x+r.width-N.x,0),height:d}:{})}var _=r?{width:u,height:d}:{};return a==="insideLeft"?Bn({x:l+y,y:c+d/2,textAnchor:x,verticalAnchor:"middle"},_):a==="insideRight"?Bn({x:l+u-y,y:c+d/2,textAnchor:b,verticalAnchor:"middle"},_):a==="insideTop"?Bn({x:l+u/2,y:c+h,textAnchor:"middle",verticalAnchor:g},_):a==="insideBottom"?Bn({x:l+u/2,y:c+d-h,textAnchor:"middle",verticalAnchor:p},_):a==="insideTopLeft"?Bn({x:l+y,y:c+h,textAnchor:x,verticalAnchor:g},_):a==="insideTopRight"?Bn({x:l+u-y,y:c+h,textAnchor:b,verticalAnchor:g},_):a==="insideBottomLeft"?Bn({x:l+y,y:c+d-h,textAnchor:x,verticalAnchor:p},_):a==="insideBottomRight"?Bn({x:l+u-y,y:c+d-h,textAnchor:b,verticalAnchor:p},_):nd(a)&&(Ae(a.x)||ll(a.x))&&(Ae(a.y)||ll(a.y))?Bn({x:l+Cr(a.x,u),y:c+Cr(a.y,d),textAnchor:"end",verticalAnchor:"end"},_):Bn({x:l+u/2,y:c+d/2,textAnchor:"middle",verticalAnchor:"middle"},_)},Bye=function(t){return"cx"in t&&Ae(t.cx)};function Jn(e){var t=e.offset,n=t===void 0?5:t,r=Oye(e,Nye),s=Bn({offset:n},r),a=s.viewBox,o=s.position,l=s.value,c=s.children,u=s.content,d=s.className,f=d===void 0?"":d,h=s.textBreakAll;if(!a||Nt(l)&&Nt(c)&&!v.isValidElement(u)&&!ht(u))return null;if(v.isValidElement(u))return v.cloneElement(u,s);var p;if(ht(u)){if(p=v.createElement(u,s),v.isValidElement(p))return p}else p=Iye(s);var g=Bye(a),m=Xe(s,!0);if(g&&(o==="insideStart"||o==="insideEnd"||o==="end"))return Dye(s,p,m);var y=g?Lye(s):Fye(s);return E.createElement(zl,Ph({className:wt("recharts-label",f)},m,y,{breakAll:h}),p)}Jn.displayName="Label";var zF=function(t){var n=t.cx,r=t.cy,s=t.angle,a=t.startAngle,o=t.endAngle,l=t.r,c=t.radius,u=t.innerRadius,d=t.outerRadius,f=t.x,h=t.y,p=t.top,g=t.left,m=t.width,y=t.height,b=t.clockWise,x=t.labelViewBox;if(x)return x;if(Ae(m)&&Ae(y)){if(Ae(f)&&Ae(h))return{x:f,y:h,width:m,height:y};if(Ae(p)&&Ae(g))return{x:p,y:g,width:m,height:y}}return Ae(f)&&Ae(h)?{x:f,y:h,width:0,height:0}:Ae(n)&&Ae(r)?{cx:n,cy:r,startAngle:a||s||0,endAngle:o||s||0,innerRadius:u||0,outerRadius:d||c||l||0,clockWise:b}:t.viewBox?t.viewBox:{}},zye=function(t,n){return t?t===!0?E.createElement(Jn,{key:"label-implicit",viewBox:n}):qn(t)?E.createElement(Jn,{key:"label-implicit",viewBox:n,value:t}):v.isValidElement(t)?t.type===Jn?v.cloneElement(t,{key:"label-implicit",viewBox:n}):E.createElement(Jn,{key:"label-implicit",content:t,viewBox:n}):ht(t)?E.createElement(Jn,{key:"label-implicit",content:t,viewBox:n}):nd(t)?E.createElement(Jn,Ph({viewBox:n},t,{key:"label-implicit"})):null:null},Uye=function(t,n){var r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!0;if(!t||!t.children&&r&&!t.label)return null;var s=t.children,a=zF(t),o=Ps(s,Jn).map(function(c,u){return v.cloneElement(c,{viewBox:n||a,key:"label-".concat(u)})});if(!r)return o;var l=zye(t.label,n||a);return[l].concat(_ye(o))};Jn.parseViewBox=zF;Jn.renderCallByParent=Uye;function Vye(e){var t=e==null?0:e.length;return t?e[t-1]:void 0}var Wye=Vye;const UF=Gt(Wye);function Ah(e){"@babel/helpers - typeof";return Ah=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Ah(e)}var Hye=["valueAccessor"],Gye=["data","dataKey","clockWise","id","textBreakAll"];function qye(e){return Zye(e)||Yye(e)||Xye(e)||Kye()}function Kye(){throw new TypeError(`Invalid attempt to spread non-iterable instance. -In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function Xye(e,t){if(e){if(typeof e=="string")return $1(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);if(n==="Object"&&e.constructor&&(n=e.constructor.name),n==="Map"||n==="Set")return Array.from(e);if(n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return $1(e,t)}}function Yye(e){if(typeof Symbol<"u"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function Zye(e){if(Array.isArray(e))return $1(e)}function $1(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(n[r]=e[r])}return n}function txe(e,t){if(e==null)return{};var n={};for(var r in e)if(Object.prototype.hasOwnProperty.call(e,r)){if(t.indexOf(r)>=0)continue;n[r]=e[r]}return n}var nxe=function(t){return Array.isArray(t.value)?UF(t.value):t.value};function Ea(e){var t=e.valueAccessor,n=t===void 0?nxe:t,r=nO(e,Hye),s=r.data,a=r.dataKey,o=r.clockWise,l=r.id,c=r.textBreakAll,u=nO(r,Gye);return!s||!s.length?null:E.createElement(Rt,{className:"recharts-label-list"},s.map(function(d,f){var h=Nt(a)?n(d,f):En(d&&d.payload,a),p=Nt(l)?{}:{id:"".concat(l,"-").concat(f)};return E.createElement(Jn,vv({},Xe(d,!0),u,p,{parentViewBox:d.parentViewBox,value:h,textBreakAll:c,viewBox:Jn.parseViewBox(Nt(o)?d:tO(tO({},d),{},{clockWise:o})),key:"label-".concat(f),index:f}))}))}Ea.displayName="LabelList";function rxe(e,t){return e?e===!0?E.createElement(Ea,{key:"labelList-implicit",data:t}):E.isValidElement(e)||ht(e)?E.createElement(Ea,{key:"labelList-implicit",data:t,content:e}):nd(e)?E.createElement(Ea,vv({data:t},e,{key:"labelList-implicit"})):null:null}function sxe(e,t){var n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!0;if(!e||!e.children&&n&&!e.label)return null;var r=e.children,s=Ps(r,Ea).map(function(o,l){return v.cloneElement(o,{data:t,key:"labelList-".concat(l)})});if(!n)return s;var a=rxe(e.label,t);return[a].concat(qye(s))}Ea.renderCallByParent=sxe;function Ch(e){"@babel/helpers - typeof";return Ch=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Ch(e)}function M1(){return M1=Object.assign?Object.assign.bind():function(e){for(var t=1;t=o?"start":"end",verticalAnchor:"middle"}}if(s==="center")return{x:o,y:l,textAnchor:"middle",verticalAnchor:"middle"};if(s==="centerTop")return{x:o,y:l,textAnchor:"middle",verticalAnchor:"start"};if(s==="centerBottom")return{x:o,y:l,textAnchor:"middle",verticalAnchor:"end"};var y=(c+u)/2,b=Gt(o,l,y,h),x=b.x,w=b.y;return{x,y:w,textAnchor:"middle",verticalAnchor:"middle"}},Gye=function(t){var n=t.viewBox,r=t.parentViewBox,s=t.offset,a=t.position,o=n,l=o.x,c=o.y,u=o.width,d=o.height,f=d>=0?1:-1,h=f*s,p=f>0?"end":"start",g=f>0?"start":"end",m=u>=0?1:-1,y=m*s,b=m>0?"end":"start",x=m>0?"start":"end";if(a==="top"){var w={x:l+u/2,y:c-f*s,textAnchor:"middle",verticalAnchor:p};return Bn(Bn({},w),r?{height:Math.max(c-r.y,0),width:u}:{})}if(a==="bottom"){var j={x:l+u/2,y:c+d+h,textAnchor:"middle",verticalAnchor:g};return Bn(Bn({},j),r?{height:Math.max(r.y+r.height-(c+d),0),width:u}:{})}if(a==="left"){var S={x:l-y,y:c+d/2,textAnchor:b,verticalAnchor:"middle"};return Bn(Bn({},S),r?{width:Math.max(S.x-r.x,0),height:d}:{})}if(a==="right"){var N={x:l+u+y,y:c+d/2,textAnchor:x,verticalAnchor:"middle"};return Bn(Bn({},N),r?{width:Math.max(r.x+r.width-N.x,0),height:d}:{})}var _=r?{width:u,height:d}:{};return a==="insideLeft"?Bn({x:l+y,y:c+d/2,textAnchor:x,verticalAnchor:"middle"},_):a==="insideRight"?Bn({x:l+u-y,y:c+d/2,textAnchor:b,verticalAnchor:"middle"},_):a==="insideTop"?Bn({x:l+u/2,y:c+h,textAnchor:"middle",verticalAnchor:g},_):a==="insideBottom"?Bn({x:l+u/2,y:c+d-h,textAnchor:"middle",verticalAnchor:p},_):a==="insideTopLeft"?Bn({x:l+y,y:c+h,textAnchor:x,verticalAnchor:g},_):a==="insideTopRight"?Bn({x:l+u-y,y:c+h,textAnchor:b,verticalAnchor:g},_):a==="insideBottomLeft"?Bn({x:l+y,y:c+d-h,textAnchor:x,verticalAnchor:p},_):a==="insideBottomRight"?Bn({x:l+u-y,y:c+d-h,textAnchor:b,verticalAnchor:p},_):nd(a)&&(Ae(a.x)||ll(a.x))&&(Ae(a.y)||ll(a.y))?Bn({x:l+Cr(a.x,u),y:c+Cr(a.y,d),textAnchor:"end",verticalAnchor:"end"},_):Bn({x:l+u/2,y:c+d/2,textAnchor:"middle",verticalAnchor:"middle"},_)},Hye=function(t){return"cx"in t&&Ae(t.cx)};function Jn(e){var t=e.offset,n=t===void 0?5:t,r=Rye(e,Oye),s=Bn({offset:n},r),a=s.viewBox,o=s.position,l=s.value,c=s.children,u=s.content,d=s.className,f=d===void 0?"":d,h=s.textBreakAll;if(!a||Nt(l)&&Nt(c)&&!v.isValidElement(u)&&!ht(u))return null;if(v.isValidElement(u))return v.cloneElement(u,s);var p;if(ht(u)){if(p=v.createElement(u,s),v.isValidElement(p))return p}else p=zye(s);var g=Hye(a),m=Xe(s,!0);if(g&&(o==="insideStart"||o==="insideEnd"||o==="end"))return Vye(s,p,m);var y=g?Wye(s):Gye(s);return E.createElement(zl,Ah({className:jt("recharts-label",f)},m,y,{breakAll:h}),p)}Jn.displayName="Label";var WF=function(t){var n=t.cx,r=t.cy,s=t.angle,a=t.startAngle,o=t.endAngle,l=t.r,c=t.radius,u=t.innerRadius,d=t.outerRadius,f=t.x,h=t.y,p=t.top,g=t.left,m=t.width,y=t.height,b=t.clockWise,x=t.labelViewBox;if(x)return x;if(Ae(m)&&Ae(y)){if(Ae(f)&&Ae(h))return{x:f,y:h,width:m,height:y};if(Ae(p)&&Ae(g))return{x:p,y:g,width:m,height:y}}return Ae(f)&&Ae(h)?{x:f,y:h,width:0,height:0}:Ae(n)&&Ae(r)?{cx:n,cy:r,startAngle:a||s||0,endAngle:o||s||0,innerRadius:u||0,outerRadius:d||c||l||0,clockWise:b}:t.viewBox?t.viewBox:{}},qye=function(t,n){return t?t===!0?E.createElement(Jn,{key:"label-implicit",viewBox:n}):qn(t)?E.createElement(Jn,{key:"label-implicit",viewBox:n,value:t}):v.isValidElement(t)?t.type===Jn?v.cloneElement(t,{key:"label-implicit",viewBox:n}):E.createElement(Jn,{key:"label-implicit",content:t,viewBox:n}):ht(t)?E.createElement(Jn,{key:"label-implicit",content:t,viewBox:n}):nd(t)?E.createElement(Jn,Ah({viewBox:n},t,{key:"label-implicit"})):null:null},Kye=function(t,n){var r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!0;if(!t||!t.children&&r&&!t.label)return null;var s=t.children,a=WF(t),o=As(s,Jn).map(function(c,u){return v.cloneElement(c,{viewBox:n||a,key:"label-".concat(u)})});if(!r)return o;var l=qye(t.label,n||a);return[l].concat(kye(o))};Jn.parseViewBox=WF;Jn.renderCallByParent=Kye;function Xye(e){var t=e==null?0:e.length;return t?e[t-1]:void 0}var Yye=Xye;const GF=Ht(Yye);function Ch(e){"@babel/helpers - typeof";return Ch=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Ch(e)}var Zye=["valueAccessor"],Qye=["data","dataKey","clockWise","id","textBreakAll"];function Jye(e){return rxe(e)||nxe(e)||txe(e)||exe()}function exe(){throw new TypeError(`Invalid attempt to spread non-iterable instance. +In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function txe(e,t){if(e){if(typeof e=="string")return I1(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);if(n==="Object"&&e.constructor&&(n=e.constructor.name),n==="Map"||n==="Set")return Array.from(e);if(n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return I1(e,t)}}function nxe(e){if(typeof Symbol<"u"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function rxe(e){if(Array.isArray(e))return I1(e)}function I1(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(n[r]=e[r])}return n}function oxe(e,t){if(e==null)return{};var n={};for(var r in e)if(Object.prototype.hasOwnProperty.call(e,r)){if(t.indexOf(r)>=0)continue;n[r]=e[r]}return n}var lxe=function(t){return Array.isArray(t.value)?GF(t.value):t.value};function Ea(e){var t=e.valueAccessor,n=t===void 0?lxe:t,r=oO(e,Zye),s=r.data,a=r.dataKey,o=r.clockWise,l=r.id,c=r.textBreakAll,u=oO(r,Qye);return!s||!s.length?null:E.createElement(Rt,{className:"recharts-label-list"},s.map(function(d,f){var h=Nt(a)?n(d,f):En(d&&d.payload,a),p=Nt(l)?{}:{id:"".concat(l,"-").concat(f)};return E.createElement(Jn,xv({},Xe(d,!0),u,p,{parentViewBox:d.parentViewBox,value:h,textBreakAll:c,viewBox:Jn.parseViewBox(Nt(o)?d:iO(iO({},d),{},{clockWise:o})),key:"label-".concat(f),index:f}))}))}Ea.displayName="LabelList";function cxe(e,t){return e?e===!0?E.createElement(Ea,{key:"labelList-implicit",data:t}):E.isValidElement(e)||ht(e)?E.createElement(Ea,{key:"labelList-implicit",data:t,content:e}):nd(e)?E.createElement(Ea,xv({data:t},e,{key:"labelList-implicit"})):null:null}function uxe(e,t){var n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!0;if(!e||!e.children&&n&&!e.label)return null;var r=e.children,s=As(r,Ea).map(function(o,l){return v.cloneElement(o,{data:t,key:"labelList-".concat(l)})});if(!n)return s;var a=cxe(e.label,t);return[a].concat(Jye(s))}Ea.renderCallByParent=uxe;function Eh(e){"@babel/helpers - typeof";return Eh=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Eh(e)}function R1(){return R1=Object.assign?Object.assign.bind():function(e){for(var t=1;t180),",").concat(+(o>u),`, `).concat(f.x,",").concat(f.y,` - `);if(s>0){var p=Ht(n,r,s,o),g=Ht(n,r,s,u);h+="L ".concat(g.x,",").concat(g.y,` + `);if(s>0){var p=Gt(n,r,s,o),g=Gt(n,r,s,u);h+="L ".concat(g.x,",").concat(g.y,` A `).concat(s,",").concat(s,`,0, `).concat(+(Math.abs(c)>180),",").concat(+(o<=u),`, - `).concat(p.x,",").concat(p.y," Z")}else h+="L ".concat(n,",").concat(r," Z");return h},cxe=function(t){var n=t.cx,r=t.cy,s=t.innerRadius,a=t.outerRadius,o=t.cornerRadius,l=t.forceCornerRadius,c=t.cornerIsExternal,u=t.startAngle,d=t.endAngle,f=Ar(d-u),h=om({cx:n,cy:r,radius:a,angle:u,sign:f,cornerRadius:o,cornerIsExternal:c}),p=h.circleTangency,g=h.lineTangency,m=h.theta,y=om({cx:n,cy:r,radius:a,angle:d,sign:-f,cornerRadius:o,cornerIsExternal:c}),b=y.circleTangency,x=y.lineTangency,w=y.theta,j=c?Math.abs(u-d):Math.abs(u-d)-m-w;if(j<0)return l?"M ".concat(g.x,",").concat(g.y,` + `).concat(p.x,",").concat(p.y," Z")}else h+="L ".concat(n,",").concat(r," Z");return h},mxe=function(t){var n=t.cx,r=t.cy,s=t.innerRadius,a=t.outerRadius,o=t.cornerRadius,l=t.forceCornerRadius,c=t.cornerIsExternal,u=t.startAngle,d=t.endAngle,f=Ar(d-u),h=lm({cx:n,cy:r,radius:a,angle:u,sign:f,cornerRadius:o,cornerIsExternal:c}),p=h.circleTangency,g=h.lineTangency,m=h.theta,y=lm({cx:n,cy:r,radius:a,angle:d,sign:-f,cornerRadius:o,cornerIsExternal:c}),b=y.circleTangency,x=y.lineTangency,w=y.theta,j=c?Math.abs(u-d):Math.abs(u-d)-m-w;if(j<0)return l?"M ".concat(g.x,",").concat(g.y,` a`).concat(o,",").concat(o,",0,0,1,").concat(o*2,`,0 a`).concat(o,",").concat(o,",0,0,1,").concat(-o*2,`,0 - `):VF({cx:n,cy:r,innerRadius:s,outerRadius:a,startAngle:u,endAngle:d});var S="M ".concat(g.x,",").concat(g.y,` + `):HF({cx:n,cy:r,innerRadius:s,outerRadius:a,startAngle:u,endAngle:d});var S="M ".concat(g.x,",").concat(g.y,` A`).concat(o,",").concat(o,",0,0,").concat(+(f<0),",").concat(p.x,",").concat(p.y,` A`).concat(a,",").concat(a,",0,").concat(+(j>180),",").concat(+(f<0),",").concat(b.x,",").concat(b.y,` A`).concat(o,",").concat(o,",0,0,").concat(+(f<0),",").concat(x.x,",").concat(x.y,` - `);if(s>0){var N=om({cx:n,cy:r,radius:s,angle:u,sign:f,isExternal:!0,cornerRadius:o,cornerIsExternal:c}),_=N.circleTangency,P=N.lineTangency,k=N.theta,O=om({cx:n,cy:r,radius:s,angle:d,sign:-f,isExternal:!0,cornerRadius:o,cornerIsExternal:c}),M=O.circleTangency,A=O.lineTangency,$=O.theta,L=c?Math.abs(u-d):Math.abs(u-d)-k-$;if(L<0&&o===0)return"".concat(S,"L").concat(n,",").concat(r,"Z");S+="L".concat(A.x,",").concat(A.y,` + `);if(s>0){var N=lm({cx:n,cy:r,radius:s,angle:u,sign:f,isExternal:!0,cornerRadius:o,cornerIsExternal:c}),_=N.circleTangency,P=N.lineTangency,k=N.theta,O=lm({cx:n,cy:r,radius:s,angle:d,sign:-f,isExternal:!0,cornerRadius:o,cornerIsExternal:c}),M=O.circleTangency,A=O.lineTangency,$=O.theta,L=c?Math.abs(u-d):Math.abs(u-d)-k-$;if(L<0&&o===0)return"".concat(S,"L").concat(n,",").concat(r,"Z");S+="L".concat(A.x,",").concat(A.y,` A`).concat(o,",").concat(o,",0,0,").concat(+(f<0),",").concat(M.x,",").concat(M.y,` A`).concat(s,",").concat(s,",0,").concat(+(L>180),",").concat(+(f>0),",").concat(_.x,",").concat(_.y,` - A`).concat(o,",").concat(o,",0,0,").concat(+(f<0),",").concat(P.x,",").concat(P.y,"Z")}else S+="L".concat(n,",").concat(r,"Z");return S},uxe={cx:0,cy:0,innerRadius:0,outerRadius:0,startAngle:0,endAngle:0,cornerRadius:0,forceCornerRadius:!1,cornerIsExternal:!1},WF=function(t){var n=sO(sO({},uxe),t),r=n.cx,s=n.cy,a=n.innerRadius,o=n.outerRadius,l=n.cornerRadius,c=n.forceCornerRadius,u=n.cornerIsExternal,d=n.startAngle,f=n.endAngle,h=n.className;if(o0&&Math.abs(d-f)<360?y=cxe({cx:r,cy:s,innerRadius:a,outerRadius:o,cornerRadius:Math.min(m,g/2),forceCornerRadius:c,cornerIsExternal:u,startAngle:d,endAngle:f}):y=VF({cx:r,cy:s,innerRadius:a,outerRadius:o,startAngle:d,endAngle:f}),E.createElement("path",M1({},Xe(n,!0),{className:p,d:y,role:"img"}))};function Eh(e){"@babel/helpers - typeof";return Eh=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Eh(e)}function I1(){return I1=Object.assign?Object.assign.bind():function(e){for(var t=1;t0;)if(!n.equals(e[r],t[r],r,r,e,t,n))return!1;return!0}function _xe(e,t){return pd(e.getTime(),t.getTime())}function fO(e,t,n){if(e.size!==t.size)return!1;for(var r={},s=e.entries(),a=0,o,l;(o=s.next())&&!o.done;){for(var c=t.entries(),u=!1,d=0;(l=c.next())&&!l.done;){var f=o.value,h=f[0],p=f[1],g=l.value,m=g[0],y=g[1];!u&&!r[d]&&(u=n.equals(h,m,a,d,e,t,n)&&n.equals(p,y,h,m,e,t,n))&&(r[d]=!0),d++}if(!u)return!1;a++}return!0}function Pxe(e,t,n){var r=dO(e),s=r.length;if(dO(t).length!==s)return!1;for(var a;s-- >0;)if(a=r[s],a===XF&&(e.$$typeof||t.$$typeof)&&e.$$typeof!==t.$$typeof||!KF(t,a)||!n.equals(e[a],t[a],a,a,e,t,n))return!1;return!0}function Bd(e,t,n){var r=cO(e),s=r.length;if(cO(t).length!==s)return!1;for(var a,o,l;s-- >0;)if(a=r[s],a===XF&&(e.$$typeof||t.$$typeof)&&e.$$typeof!==t.$$typeof||!KF(t,a)||!n.equals(e[a],t[a],a,a,e,t,n)||(o=uO(e,a),l=uO(t,a),(o||l)&&(!o||!l||o.configurable!==l.configurable||o.enumerable!==l.enumerable||o.writable!==l.writable)))return!1;return!0}function Axe(e,t){return pd(e.valueOf(),t.valueOf())}function Cxe(e,t){return e.source===t.source&&e.flags===t.flags}function hO(e,t,n){if(e.size!==t.size)return!1;for(var r={},s=e.values(),a,o;(a=s.next())&&!a.done;){for(var l=t.values(),c=!1,u=0;(o=l.next())&&!o.done;)!c&&!r[u]&&(c=n.equals(a.value,o.value,a.value,o.value,e,t,n))&&(r[u]=!0),u++;if(!c)return!1}return!0}function Exe(e,t){var n=e.length;if(t.length!==n)return!1;for(;n-- >0;)if(e[n]!==t[n])return!1;return!0}var Oxe="[object Arguments]",kxe="[object Boolean]",Txe="[object Date]",$xe="[object Map]",Mxe="[object Number]",Ixe="[object Object]",Rxe="[object RegExp]",Dxe="[object Set]",Lxe="[object String]",Fxe=Array.isArray,pO=typeof ArrayBuffer=="function"&&ArrayBuffer.isView?ArrayBuffer.isView:null,mO=Object.assign,Bxe=Object.prototype.toString.call.bind(Object.prototype.toString);function zxe(e){var t=e.areArraysEqual,n=e.areDatesEqual,r=e.areMapsEqual,s=e.areObjectsEqual,a=e.arePrimitiveWrappersEqual,o=e.areRegExpsEqual,l=e.areSetsEqual,c=e.areTypedArraysEqual;return function(d,f,h){if(d===f)return!0;if(d==null||f==null||typeof d!="object"||typeof f!="object")return d!==d&&f!==f;var p=d.constructor;if(p!==f.constructor)return!1;if(p===Object)return s(d,f,h);if(Fxe(d))return t(d,f,h);if(pO!=null&&pO(d))return c(d,f,h);if(p===Date)return n(d,f,h);if(p===RegExp)return o(d,f,h);if(p===Map)return r(d,f,h);if(p===Set)return l(d,f,h);var g=Bxe(d);return g===Txe?n(d,f,h):g===Rxe?o(d,f,h):g===$xe?r(d,f,h):g===Dxe?l(d,f,h):g===Ixe?typeof d.then!="function"&&typeof f.then!="function"&&s(d,f,h):g===Oxe?s(d,f,h):g===kxe||g===Mxe||g===Lxe?a(d,f,h):!1}}function Uxe(e){var t=e.circular,n=e.createCustomConfig,r=e.strict,s={areArraysEqual:r?Bd:Nxe,areDatesEqual:_xe,areMapsEqual:r?lO(fO,Bd):fO,areObjectsEqual:r?Bd:Pxe,arePrimitiveWrappersEqual:Axe,areRegExpsEqual:Cxe,areSetsEqual:r?lO(hO,Bd):hO,areTypedArraysEqual:r?Bd:Exe};if(n&&(s=mO({},s,n(s))),t){var a=cm(s.areArraysEqual),o=cm(s.areMapsEqual),l=cm(s.areObjectsEqual),c=cm(s.areSetsEqual);s=mO({},s,{areArraysEqual:a,areMapsEqual:o,areObjectsEqual:l,areSetsEqual:c})}return s}function Vxe(e){return function(t,n,r,s,a,o,l){return e(t,n,l)}}function Wxe(e){var t=e.circular,n=e.comparator,r=e.createState,s=e.equals,a=e.strict;if(r)return function(c,u){var d=r(),f=d.cache,h=f===void 0?t?new WeakMap:void 0:f,p=d.meta;return n(c,u,{cache:h,equals:s,meta:p,strict:a})};if(t)return function(c,u){return n(c,u,{cache:new WeakMap,equals:s,meta:void 0,strict:a})};var o={cache:void 0,equals:s,meta:void 0,strict:a};return function(c,u){return n(c,u,o)}}var Hxe=Vo();Vo({strict:!0});Vo({circular:!0});Vo({circular:!0,strict:!0});Vo({createInternalComparator:function(){return pd}});Vo({strict:!0,createInternalComparator:function(){return pd}});Vo({circular:!0,createInternalComparator:function(){return pd}});Vo({circular:!0,createInternalComparator:function(){return pd},strict:!0});function Vo(e){e===void 0&&(e={});var t=e.circular,n=t===void 0?!1:t,r=e.createInternalComparator,s=e.createState,a=e.strict,o=a===void 0?!1:a,l=Uxe(e),c=zxe(l),u=r?r(c):Vxe(c);return Wxe({circular:n,comparator:c,createState:s,equals:u,strict:o})}function Gxe(e){typeof requestAnimationFrame<"u"&&requestAnimationFrame(e)}function gO(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,n=-1,r=function s(a){n<0&&(n=a),a-n>t?(e(a),n=-1):Gxe(s)};requestAnimationFrame(r)}function R1(e){"@babel/helpers - typeof";return R1=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},R1(e)}function qxe(e){return Zxe(e)||Yxe(e)||Xxe(e)||Kxe()}function Kxe(){throw new TypeError(`Invalid attempt to destructure non-iterable instance. -In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function Xxe(e,t){if(e){if(typeof e=="string")return vO(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);if(n==="Object"&&e.constructor&&(n=e.constructor.name),n==="Map"||n==="Set")return Array.from(e);if(n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return vO(e,t)}}function vO(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);ne.length)&&(t=e.length);for(var n=0,r=new Array(t);n1?1:b<0?0:b},m=function(b){for(var x=b>1?1:b,w=x,j=0;j<8;++j){var S=f(w)-x,N=p(w);if(Math.abs(S-x)0&&arguments[0]!==void 0?arguments[0]:{},n=t.stiff,r=n===void 0?100:n,s=t.damping,a=s===void 0?8:s,o=t.dt,l=o===void 0?17:o,c=function(d,f,h){var p=-(d-f)*r,g=h*a,m=h+(p-g)*l/1e3,y=h*l/1e3+d;return Math.abs(y-f)e.length)&&(t=e.length);for(var n=0,r=new Array(t);n=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(n[r]=e[r])}return n}function C0e(e,t){if(e==null)return{};var n={},r=Object.keys(e),s,a;for(a=0;a=0)&&(n[s]=e[s]);return n}function X0(e){return T0e(e)||k0e(e)||O0e(e)||E0e()}function E0e(){throw new TypeError(`Invalid attempt to spread non-iterable instance. -In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function O0e(e,t){if(e){if(typeof e=="string")return z1(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);if(n==="Object"&&e.constructor&&(n=e.constructor.name),n==="Map"||n==="Set")return Array.from(e);if(n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return z1(e,t)}}function k0e(e){if(typeof Symbol<"u"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function T0e(e){if(Array.isArray(e))return z1(e)}function z1(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}function bv(e){return bv=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(n){return n.__proto__||Object.getPrototypeOf(n)},bv(e)}var oa=function(e){D0e(n,e);var t=L0e(n);function n(r,s){var a;$0e(this,n),a=t.call(this,r,s);var o=a.props,l=o.isActive,c=o.attributeName,u=o.from,d=o.to,f=o.steps,h=o.children,p=o.duration;if(a.handleStyleChange=a.handleStyleChange.bind(W1(a)),a.changeStyle=a.changeStyle.bind(W1(a)),!l||p<=0)return a.state={style:{}},typeof h=="function"&&(a.state={style:d}),V1(a);if(f&&f.length)a.state={style:f[0].style};else if(u){if(typeof h=="function")return a.state={style:u},V1(a);a.state={style:c?Qd({},c,u):u}}else a.state={style:{}};return a}return I0e(n,[{key:"componentDidMount",value:function(){var s=this.props,a=s.isActive,o=s.canBegin;this.mounted=!0,!(!a||!o)&&this.runAnimation(this.props)}},{key:"componentDidUpdate",value:function(s){var a=this.props,o=a.isActive,l=a.canBegin,c=a.attributeName,u=a.shouldReAnimate,d=a.to,f=a.from,h=this.state.style;if(l){if(!o){var p={style:c?Qd({},c,d):d};this.state&&h&&(c&&h[c]!==d||!c&&h!==d)&&this.setState(p);return}if(!(Hxe(s.to,d)&&s.canBegin&&s.isActive)){var g=!s.canBegin||!s.isActive;this.manager&&this.manager.stop(),this.stopJSAnimation&&this.stopJSAnimation();var m=g||u?f:s.to;if(this.state&&h){var y={style:c?Qd({},c,m):m};(c&&h[c]!==m||!c&&h!==m)&&this.setState(y)}this.runAnimation(Ms(Ms({},this.props),{},{from:m,begin:0}))}}}},{key:"componentWillUnmount",value:function(){this.mounted=!1;var s=this.props.onAnimationEnd;this.unSubscribe&&this.unSubscribe(),this.manager&&(this.manager.stop(),this.manager=null),this.stopJSAnimation&&this.stopJSAnimation(),s&&s()}},{key:"handleStyleChange",value:function(s){this.changeStyle(s)}},{key:"changeStyle",value:function(s){this.mounted&&this.setState({style:s})}},{key:"runJSAnimation",value:function(s){var a=this,o=s.from,l=s.to,c=s.duration,u=s.easing,d=s.begin,f=s.onAnimationEnd,h=s.onAnimationStart,p=_0e(o,l,p0e(u),c,this.changeStyle),g=function(){a.stopJSAnimation=p()};this.manager.start([h,d,g,c,f])}},{key:"runStepAnimation",value:function(s){var a=this,o=s.steps,l=s.begin,c=s.onAnimationStart,u=o[0],d=u.style,f=u.duration,h=f===void 0?0:f,p=function(m,y,b){if(b===0)return m;var x=y.duration,w=y.easing,j=w===void 0?"ease":w,S=y.style,N=y.properties,_=y.onAnimationEnd,P=b>0?o[b-1]:y,k=N||Object.keys(S);if(typeof j=="function"||j==="spring")return[].concat(X0(m),[a.runJSAnimation.bind(a,{from:P.style,to:S,duration:x,easing:j}),x]);var O=bO(k,x,j),M=Ms(Ms(Ms({},P.style),S),{},{transition:O});return[].concat(X0(m),[M,x,_]).filter(n0e)};return this.manager.start([c].concat(X0(o.reduce(p,[d,Math.max(h,l)])),[s.onAnimationEnd]))}},{key:"runAnimation",value:function(s){this.manager||(this.manager=Qxe());var a=s.begin,o=s.duration,l=s.attributeName,c=s.to,u=s.easing,d=s.onAnimationStart,f=s.onAnimationEnd,h=s.steps,p=s.children,g=this.manager;if(this.unSubscribe=g.subscribe(this.handleStyleChange),typeof u=="function"||typeof p=="function"||u==="spring"){this.runJSAnimation(s);return}if(h.length>1){this.runStepAnimation(s);return}var m=l?Qd({},l,c):c,y=bO(Object.keys(m),o,u);g.start([d,a,Ms(Ms({},m),{},{transition:y}),o,f])}},{key:"render",value:function(){var s=this.props,a=s.children;s.begin;var o=s.duration;s.attributeName,s.easing;var l=s.isActive;s.steps,s.from,s.to,s.canBegin,s.onAnimationEnd,s.shouldReAnimate,s.onAnimationReStart;var c=A0e(s,P0e),u=v.Children.count(a),d=this.state.style;if(typeof a=="function")return a(d);if(!l||u===0||o<=0)return a;var f=function(p){var g=p.props,m=g.style,y=m===void 0?{}:m,b=g.className,x=v.cloneElement(p,Ms(Ms({},c),{},{style:Ms(Ms({},y),d),className:b}));return x};return u===1?f(v.Children.only(a)):E.createElement("div",null,v.Children.map(a,function(h){return f(h)}))}}]),n}(v.PureComponent);oa.displayName="Animate";oa.defaultProps={begin:0,duration:1e3,from:"",to:"",attributeName:"",easing:"ease",isActive:!0,canBegin:!0,steps:[],onAnimationEnd:function(){},onAnimationStart:function(){}};oa.propTypes={from:Et.oneOfType([Et.object,Et.string]),to:Et.oneOfType([Et.object,Et.string]),attributeName:Et.string,duration:Et.number,begin:Et.number,easing:Et.oneOfType([Et.string,Et.func]),steps:Et.arrayOf(Et.shape({duration:Et.number.isRequired,style:Et.object.isRequired,easing:Et.oneOfType([Et.oneOf(["ease","ease-in","ease-out","ease-in-out","linear"]),Et.func]),properties:Et.arrayOf("string"),onAnimationEnd:Et.func})),children:Et.oneOfType([Et.node,Et.func]),isActive:Et.bool,canBegin:Et.bool,onAnimationEnd:Et.func,shouldReAnimate:Et.bool,onAnimationStart:Et.func,onAnimationReStart:Et.func};Et.object,Et.object,Et.object,Et.element;Et.object,Et.object,Et.object,Et.oneOfType([Et.array,Et.element]),Et.any;function Th(e){"@babel/helpers - typeof";return Th=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Th(e)}function wv(){return wv=Object.assign?Object.assign.bind():function(e){for(var t=1;te.length)&&(t=e.length);for(var n=0,r=new Array(t);n=0?1:-1,c=r>=0?1:-1,u=s>=0&&r>=0||s<0&&r<0?1:0,d;if(o>0&&a instanceof Array){for(var f=[0,0,0,0],h=0,p=4;ho?o:a[h];d="M".concat(t,",").concat(n+l*f[0]),f[0]>0&&(d+="A ".concat(f[0],",").concat(f[0],",0,0,").concat(u,",").concat(t+c*f[0],",").concat(n)),d+="L ".concat(t+r-c*f[1],",").concat(n),f[1]>0&&(d+="A ".concat(f[1],",").concat(f[1],",0,0,").concat(u,`, + A`).concat(o,",").concat(o,",0,0,").concat(+(f<0),",").concat(P.x,",").concat(P.y,"Z")}else S+="L".concat(n,",").concat(r,"Z");return S},gxe={cx:0,cy:0,innerRadius:0,outerRadius:0,startAngle:0,endAngle:0,cornerRadius:0,forceCornerRadius:!1,cornerIsExternal:!1},qF=function(t){var n=cO(cO({},gxe),t),r=n.cx,s=n.cy,a=n.innerRadius,o=n.outerRadius,l=n.cornerRadius,c=n.forceCornerRadius,u=n.cornerIsExternal,d=n.startAngle,f=n.endAngle,h=n.className;if(o0&&Math.abs(d-f)<360?y=mxe({cx:r,cy:s,innerRadius:a,outerRadius:o,cornerRadius:Math.min(m,g/2),forceCornerRadius:c,cornerIsExternal:u,startAngle:d,endAngle:f}):y=HF({cx:r,cy:s,innerRadius:a,outerRadius:o,startAngle:d,endAngle:f}),E.createElement("path",R1({},Xe(n,!0),{className:p,d:y,role:"img"}))};function Oh(e){"@babel/helpers - typeof";return Oh=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Oh(e)}function D1(){return D1=Object.assign?Object.assign.bind():function(e){for(var t=1;t0;)if(!n.equals(e[r],t[r],r,r,e,t,n))return!1;return!0}function kxe(e,t){return pd(e.getTime(),t.getTime())}function vO(e,t,n){if(e.size!==t.size)return!1;for(var r={},s=e.entries(),a=0,o,l;(o=s.next())&&!o.done;){for(var c=t.entries(),u=!1,d=0;(l=c.next())&&!l.done;){var f=o.value,h=f[0],p=f[1],g=l.value,m=g[0],y=g[1];!u&&!r[d]&&(u=n.equals(h,m,a,d,e,t,n)&&n.equals(p,y,h,m,e,t,n))&&(r[d]=!0),d++}if(!u)return!1;a++}return!0}function Txe(e,t,n){var r=gO(e),s=r.length;if(gO(t).length!==s)return!1;for(var a;s-- >0;)if(a=r[s],a===QF&&(e.$$typeof||t.$$typeof)&&e.$$typeof!==t.$$typeof||!ZF(t,a)||!n.equals(e[a],t[a],a,a,e,t,n))return!1;return!0}function Bd(e,t,n){var r=pO(e),s=r.length;if(pO(t).length!==s)return!1;for(var a,o,l;s-- >0;)if(a=r[s],a===QF&&(e.$$typeof||t.$$typeof)&&e.$$typeof!==t.$$typeof||!ZF(t,a)||!n.equals(e[a],t[a],a,a,e,t,n)||(o=mO(e,a),l=mO(t,a),(o||l)&&(!o||!l||o.configurable!==l.configurable||o.enumerable!==l.enumerable||o.writable!==l.writable)))return!1;return!0}function $xe(e,t){return pd(e.valueOf(),t.valueOf())}function Mxe(e,t){return e.source===t.source&&e.flags===t.flags}function yO(e,t,n){if(e.size!==t.size)return!1;for(var r={},s=e.values(),a,o;(a=s.next())&&!a.done;){for(var l=t.values(),c=!1,u=0;(o=l.next())&&!o.done;)!c&&!r[u]&&(c=n.equals(a.value,o.value,a.value,o.value,e,t,n))&&(r[u]=!0),u++;if(!c)return!1}return!0}function Ixe(e,t){var n=e.length;if(t.length!==n)return!1;for(;n-- >0;)if(e[n]!==t[n])return!1;return!0}var Rxe="[object Arguments]",Dxe="[object Boolean]",Lxe="[object Date]",Fxe="[object Map]",Bxe="[object Number]",zxe="[object Object]",Uxe="[object RegExp]",Vxe="[object Set]",Wxe="[object String]",Gxe=Array.isArray,xO=typeof ArrayBuffer=="function"&&ArrayBuffer.isView?ArrayBuffer.isView:null,bO=Object.assign,Hxe=Object.prototype.toString.call.bind(Object.prototype.toString);function qxe(e){var t=e.areArraysEqual,n=e.areDatesEqual,r=e.areMapsEqual,s=e.areObjectsEqual,a=e.arePrimitiveWrappersEqual,o=e.areRegExpsEqual,l=e.areSetsEqual,c=e.areTypedArraysEqual;return function(d,f,h){if(d===f)return!0;if(d==null||f==null||typeof d!="object"||typeof f!="object")return d!==d&&f!==f;var p=d.constructor;if(p!==f.constructor)return!1;if(p===Object)return s(d,f,h);if(Gxe(d))return t(d,f,h);if(xO!=null&&xO(d))return c(d,f,h);if(p===Date)return n(d,f,h);if(p===RegExp)return o(d,f,h);if(p===Map)return r(d,f,h);if(p===Set)return l(d,f,h);var g=Hxe(d);return g===Lxe?n(d,f,h):g===Uxe?o(d,f,h):g===Fxe?r(d,f,h):g===Vxe?l(d,f,h):g===zxe?typeof d.then!="function"&&typeof f.then!="function"&&s(d,f,h):g===Rxe?s(d,f,h):g===Dxe||g===Bxe||g===Wxe?a(d,f,h):!1}}function Kxe(e){var t=e.circular,n=e.createCustomConfig,r=e.strict,s={areArraysEqual:r?Bd:Oxe,areDatesEqual:kxe,areMapsEqual:r?hO(vO,Bd):vO,areObjectsEqual:r?Bd:Txe,arePrimitiveWrappersEqual:$xe,areRegExpsEqual:Mxe,areSetsEqual:r?hO(yO,Bd):yO,areTypedArraysEqual:r?Bd:Ixe};if(n&&(s=bO({},s,n(s))),t){var a=um(s.areArraysEqual),o=um(s.areMapsEqual),l=um(s.areObjectsEqual),c=um(s.areSetsEqual);s=bO({},s,{areArraysEqual:a,areMapsEqual:o,areObjectsEqual:l,areSetsEqual:c})}return s}function Xxe(e){return function(t,n,r,s,a,o,l){return e(t,n,l)}}function Yxe(e){var t=e.circular,n=e.comparator,r=e.createState,s=e.equals,a=e.strict;if(r)return function(c,u){var d=r(),f=d.cache,h=f===void 0?t?new WeakMap:void 0:f,p=d.meta;return n(c,u,{cache:h,equals:s,meta:p,strict:a})};if(t)return function(c,u){return n(c,u,{cache:new WeakMap,equals:s,meta:void 0,strict:a})};var o={cache:void 0,equals:s,meta:void 0,strict:a};return function(c,u){return n(c,u,o)}}var Zxe=Vo();Vo({strict:!0});Vo({circular:!0});Vo({circular:!0,strict:!0});Vo({createInternalComparator:function(){return pd}});Vo({strict:!0,createInternalComparator:function(){return pd}});Vo({circular:!0,createInternalComparator:function(){return pd}});Vo({circular:!0,createInternalComparator:function(){return pd},strict:!0});function Vo(e){e===void 0&&(e={});var t=e.circular,n=t===void 0?!1:t,r=e.createInternalComparator,s=e.createState,a=e.strict,o=a===void 0?!1:a,l=Kxe(e),c=qxe(l),u=r?r(c):Xxe(c);return Yxe({circular:n,comparator:c,createState:s,equals:u,strict:o})}function Qxe(e){typeof requestAnimationFrame<"u"&&requestAnimationFrame(e)}function wO(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,n=-1,r=function s(a){n<0&&(n=a),a-n>t?(e(a),n=-1):Qxe(s)};requestAnimationFrame(r)}function L1(e){"@babel/helpers - typeof";return L1=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},L1(e)}function Jxe(e){return r0e(e)||n0e(e)||t0e(e)||e0e()}function e0e(){throw new TypeError(`Invalid attempt to destructure non-iterable instance. +In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function t0e(e,t){if(e){if(typeof e=="string")return jO(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);if(n==="Object"&&e.constructor&&(n=e.constructor.name),n==="Map"||n==="Set")return Array.from(e);if(n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return jO(e,t)}}function jO(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);ne.length)&&(t=e.length);for(var n=0,r=new Array(t);n1?1:b<0?0:b},m=function(b){for(var x=b>1?1:b,w=x,j=0;j<8;++j){var S=f(w)-x,N=p(w);if(Math.abs(S-x)0&&arguments[0]!==void 0?arguments[0]:{},n=t.stiff,r=n===void 0?100:n,s=t.damping,a=s===void 0?8:s,o=t.dt,l=o===void 0?17:o,c=function(d,f,h){var p=-(d-f)*r,g=h*a,m=h+(p-g)*l/1e3,y=h*l/1e3+d;return Math.abs(y-f)e.length)&&(t=e.length);for(var n=0,r=new Array(t);n=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(n[r]=e[r])}return n}function M0e(e,t){if(e==null)return{};var n={},r=Object.keys(e),s,a;for(a=0;a=0)&&(n[s]=e[s]);return n}function Q0(e){return L0e(e)||D0e(e)||R0e(e)||I0e()}function I0e(){throw new TypeError(`Invalid attempt to spread non-iterable instance. +In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function R0e(e,t){if(e){if(typeof e=="string")return V1(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);if(n==="Object"&&e.constructor&&(n=e.constructor.name),n==="Map"||n==="Set")return Array.from(e);if(n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return V1(e,t)}}function D0e(e){if(typeof Symbol<"u"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function L0e(e){if(Array.isArray(e))return V1(e)}function V1(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}function jv(e){return jv=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(n){return n.__proto__||Object.getPrototypeOf(n)},jv(e)}var oa=function(e){V0e(n,e);var t=W0e(n);function n(r,s){var a;F0e(this,n),a=t.call(this,r,s);var o=a.props,l=o.isActive,c=o.attributeName,u=o.from,d=o.to,f=o.steps,h=o.children,p=o.duration;if(a.handleStyleChange=a.handleStyleChange.bind(H1(a)),a.changeStyle=a.changeStyle.bind(H1(a)),!l||p<=0)return a.state={style:{}},typeof h=="function"&&(a.state={style:d}),G1(a);if(f&&f.length)a.state={style:f[0].style};else if(u){if(typeof h=="function")return a.state={style:u},G1(a);a.state={style:c?Qd({},c,u):u}}else a.state={style:{}};return a}return z0e(n,[{key:"componentDidMount",value:function(){var s=this.props,a=s.isActive,o=s.canBegin;this.mounted=!0,!(!a||!o)&&this.runAnimation(this.props)}},{key:"componentDidUpdate",value:function(s){var a=this.props,o=a.isActive,l=a.canBegin,c=a.attributeName,u=a.shouldReAnimate,d=a.to,f=a.from,h=this.state.style;if(l){if(!o){var p={style:c?Qd({},c,d):d};this.state&&h&&(c&&h[c]!==d||!c&&h!==d)&&this.setState(p);return}if(!(Zxe(s.to,d)&&s.canBegin&&s.isActive)){var g=!s.canBegin||!s.isActive;this.manager&&this.manager.stop(),this.stopJSAnimation&&this.stopJSAnimation();var m=g||u?f:s.to;if(this.state&&h){var y={style:c?Qd({},c,m):m};(c&&h[c]!==m||!c&&h!==m)&&this.setState(y)}this.runAnimation(Is(Is({},this.props),{},{from:m,begin:0}))}}}},{key:"componentWillUnmount",value:function(){this.mounted=!1;var s=this.props.onAnimationEnd;this.unSubscribe&&this.unSubscribe(),this.manager&&(this.manager.stop(),this.manager=null),this.stopJSAnimation&&this.stopJSAnimation(),s&&s()}},{key:"handleStyleChange",value:function(s){this.changeStyle(s)}},{key:"changeStyle",value:function(s){this.mounted&&this.setState({style:s})}},{key:"runJSAnimation",value:function(s){var a=this,o=s.from,l=s.to,c=s.duration,u=s.easing,d=s.begin,f=s.onAnimationEnd,h=s.onAnimationStart,p=k0e(o,l,b0e(u),c,this.changeStyle),g=function(){a.stopJSAnimation=p()};this.manager.start([h,d,g,c,f])}},{key:"runStepAnimation",value:function(s){var a=this,o=s.steps,l=s.begin,c=s.onAnimationStart,u=o[0],d=u.style,f=u.duration,h=f===void 0?0:f,p=function(m,y,b){if(b===0)return m;var x=y.duration,w=y.easing,j=w===void 0?"ease":w,S=y.style,N=y.properties,_=y.onAnimationEnd,P=b>0?o[b-1]:y,k=N||Object.keys(S);if(typeof j=="function"||j==="spring")return[].concat(Q0(m),[a.runJSAnimation.bind(a,{from:P.style,to:S,duration:x,easing:j}),x]);var O=_O(k,x,j),M=Is(Is(Is({},P.style),S),{},{transition:O});return[].concat(Q0(m),[M,x,_]).filter(l0e)};return this.manager.start([c].concat(Q0(o.reduce(p,[d,Math.max(h,l)])),[s.onAnimationEnd]))}},{key:"runAnimation",value:function(s){this.manager||(this.manager=s0e());var a=s.begin,o=s.duration,l=s.attributeName,c=s.to,u=s.easing,d=s.onAnimationStart,f=s.onAnimationEnd,h=s.steps,p=s.children,g=this.manager;if(this.unSubscribe=g.subscribe(this.handleStyleChange),typeof u=="function"||typeof p=="function"||u==="spring"){this.runJSAnimation(s);return}if(h.length>1){this.runStepAnimation(s);return}var m=l?Qd({},l,c):c,y=_O(Object.keys(m),o,u);g.start([d,a,Is(Is({},m),{},{transition:y}),o,f])}},{key:"render",value:function(){var s=this.props,a=s.children;s.begin;var o=s.duration;s.attributeName,s.easing;var l=s.isActive;s.steps,s.from,s.to,s.canBegin,s.onAnimationEnd,s.shouldReAnimate,s.onAnimationReStart;var c=$0e(s,T0e),u=v.Children.count(a),d=this.state.style;if(typeof a=="function")return a(d);if(!l||u===0||o<=0)return a;var f=function(p){var g=p.props,m=g.style,y=m===void 0?{}:m,b=g.className,x=v.cloneElement(p,Is(Is({},c),{},{style:Is(Is({},y),d),className:b}));return x};return u===1?f(v.Children.only(a)):E.createElement("div",null,v.Children.map(a,function(h){return f(h)}))}}]),n}(v.PureComponent);oa.displayName="Animate";oa.defaultProps={begin:0,duration:1e3,from:"",to:"",attributeName:"",easing:"ease",isActive:!0,canBegin:!0,steps:[],onAnimationEnd:function(){},onAnimationStart:function(){}};oa.propTypes={from:Et.oneOfType([Et.object,Et.string]),to:Et.oneOfType([Et.object,Et.string]),attributeName:Et.string,duration:Et.number,begin:Et.number,easing:Et.oneOfType([Et.string,Et.func]),steps:Et.arrayOf(Et.shape({duration:Et.number.isRequired,style:Et.object.isRequired,easing:Et.oneOfType([Et.oneOf(["ease","ease-in","ease-out","ease-in-out","linear"]),Et.func]),properties:Et.arrayOf("string"),onAnimationEnd:Et.func})),children:Et.oneOfType([Et.node,Et.func]),isActive:Et.bool,canBegin:Et.bool,onAnimationEnd:Et.func,shouldReAnimate:Et.bool,onAnimationStart:Et.func,onAnimationReStart:Et.func};Et.object,Et.object,Et.object,Et.element;Et.object,Et.object,Et.object,Et.oneOfType([Et.array,Et.element]),Et.any;function $h(e){"@babel/helpers - typeof";return $h=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},$h(e)}function Sv(){return Sv=Object.assign?Object.assign.bind():function(e){for(var t=1;te.length)&&(t=e.length);for(var n=0,r=new Array(t);n=0?1:-1,c=r>=0?1:-1,u=s>=0&&r>=0||s<0&&r<0?1:0,d;if(o>0&&a instanceof Array){for(var f=[0,0,0,0],h=0,p=4;ho?o:a[h];d="M".concat(t,",").concat(n+l*f[0]),f[0]>0&&(d+="A ".concat(f[0],",").concat(f[0],",0,0,").concat(u,",").concat(t+c*f[0],",").concat(n)),d+="L ".concat(t+r-c*f[1],",").concat(n),f[1]>0&&(d+="A ".concat(f[1],",").concat(f[1],",0,0,").concat(u,`, `).concat(t+r,",").concat(n+l*f[1])),d+="L ".concat(t+r,",").concat(n+s-l*f[2]),f[2]>0&&(d+="A ".concat(f[2],",").concat(f[2],",0,0,").concat(u,`, `).concat(t+r-c*f[2],",").concat(n+s)),d+="L ".concat(t+c*f[3],",").concat(n+s),f[3]>0&&(d+="A ".concat(f[3],",").concat(f[3],",0,0,").concat(u,`, `).concat(t,",").concat(n+s-l*f[3])),d+="Z"}else if(o>0&&a===+a&&a>0){var g=Math.min(o,a);d="M ".concat(t,",").concat(n+l*g,` @@ -708,16 +708,16 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho L `).concat(t+r,",").concat(n+s-l*g,` A `).concat(g,",").concat(g,",0,0,").concat(u,",").concat(t+r-c*g,",").concat(n+s,` L `).concat(t+c*g,",").concat(n+s,` - A `).concat(g,",").concat(g,",0,0,").concat(u,",").concat(t,",").concat(n+s-l*g," Z")}else d="M ".concat(t,",").concat(n," h ").concat(r," v ").concat(s," h ").concat(-r," Z");return d},K0e=function(t,n){if(!t||!n)return!1;var r=t.x,s=t.y,a=n.x,o=n.y,l=n.width,c=n.height;if(Math.abs(l)>0&&Math.abs(c)>0){var u=Math.min(a,a+l),d=Math.max(a,a+l),f=Math.min(o,o+c),h=Math.max(o,o+c);return r>=u&&r<=d&&s>=f&&s<=h}return!1},X0e={x:0,y:0,width:0,height:0,radius:0,isAnimationActive:!1,isUpdateAnimationActive:!1,animationBegin:0,animationDuration:1500,animationEasing:"ease"},D_=function(t){var n=CO(CO({},X0e),t),r=v.useRef(),s=v.useState(-1),a=B0e(s,2),o=a[0],l=a[1];v.useEffect(function(){if(r.current&&r.current.getTotalLength)try{var j=r.current.getTotalLength();j&&l(j)}catch{}},[]);var c=n.x,u=n.y,d=n.width,f=n.height,h=n.radius,p=n.className,g=n.animationEasing,m=n.animationDuration,y=n.animationBegin,b=n.isAnimationActive,x=n.isUpdateAnimationActive;if(c!==+c||u!==+u||d!==+d||f!==+f||d===0||f===0)return null;var w=wt("recharts-rectangle",p);return x?E.createElement(oa,{canBegin:o>0,from:{width:d,height:f,x:c,y:u},to:{width:d,height:f,x:c,y:u},duration:m,animationEasing:g,isActive:x},function(j){var S=j.width,N=j.height,_=j.x,P=j.y;return E.createElement(oa,{canBegin:o>0,from:"0px ".concat(o===-1?1:o,"px"),to:"".concat(o,"px 0px"),attributeName:"strokeDasharray",begin:y,duration:m,isActive:b,easing:g},E.createElement("path",wv({},Xe(n,!0),{className:w,d:EO(_,P,S,N,h),ref:r})))}):E.createElement("path",wv({},Xe(n,!0),{className:w,d:EO(c,u,d,f,h)}))},Y0e=["points","className","baseLinePoints","connectNulls"];function Ac(){return Ac=Object.assign?Object.assign.bind():function(e){for(var t=1;t=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(n[r]=e[r])}return n}function Q0e(e,t){if(e==null)return{};var n={};for(var r in e)if(Object.prototype.hasOwnProperty.call(e,r)){if(t.indexOf(r)>=0)continue;n[r]=e[r]}return n}function OO(e){return nbe(e)||tbe(e)||ebe(e)||J0e()}function J0e(){throw new TypeError(`Invalid attempt to spread non-iterable instance. -In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function ebe(e,t){if(e){if(typeof e=="string")return H1(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);if(n==="Object"&&e.constructor&&(n=e.constructor.name),n==="Map"||n==="Set")return Array.from(e);if(n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return H1(e,t)}}function tbe(e){if(typeof Symbol<"u"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function nbe(e){if(Array.isArray(e))return H1(e)}function H1(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n0&&arguments[0]!==void 0?arguments[0]:[],n=[[]];return t.forEach(function(r){kO(r)?n[n.length-1].push(r):n[n.length-1].length>0&&n.push([])}),kO(t[0])&&n[n.length-1].push(t[0]),n[n.length-1].length<=0&&(n=n.slice(0,-1)),n},mf=function(t,n){var r=rbe(t);n&&(r=[r.reduce(function(a,o){return[].concat(OO(a),OO(o))},[])]);var s=r.map(function(a){return a.reduce(function(o,l,c){return"".concat(o).concat(c===0?"M":"L").concat(l.x,",").concat(l.y)},"")}).join("");return r.length===1?"".concat(s,"Z"):s},sbe=function(t,n,r){var s=mf(t,r);return"".concat(s.slice(-1)==="Z"?s.slice(0,-1):s,"L").concat(mf(n.reverse(),r).slice(1))},n6=function(t){var n=t.points,r=t.className,s=t.baseLinePoints,a=t.connectNulls,o=Z0e(t,Y0e);if(!n||!n.length)return null;var l=wt("recharts-polygon",r);if(s&&s.length){var c=o.stroke&&o.stroke!=="none",u=sbe(n,s,a);return E.createElement("g",{className:l},E.createElement("path",Ac({},Xe(o,!0),{fill:u.slice(-1)==="Z"?o.fill:"none",stroke:"none",d:u})),c?E.createElement("path",Ac({},Xe(o,!0),{fill:"none",d:mf(n,a)})):null,c?E.createElement("path",Ac({},Xe(o,!0),{fill:"none",d:mf(s,a)})):null)}var d=mf(n,a);return E.createElement("path",Ac({},Xe(o,!0),{fill:d.slice(-1)==="Z"?o.fill:"none",className:l,d}))};function G1(){return G1=Object.assign?Object.assign.bind():function(e){for(var t=1;t=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(n[r]=e[r])}return n}function dbe(e,t){if(e==null)return{};var n={};for(var r in e)if(Object.prototype.hasOwnProperty.call(e,r)){if(t.indexOf(r)>=0)continue;n[r]=e[r]}return n}var fbe=function(t,n,r,s,a,o){return"M".concat(t,",").concat(a,"v").concat(s,"M").concat(o,",").concat(n,"h").concat(r)},hbe=function(t){var n=t.x,r=n===void 0?0:n,s=t.y,a=s===void 0?0:s,o=t.top,l=o===void 0?0:o,c=t.left,u=c===void 0?0:c,d=t.width,f=d===void 0?0:d,h=t.height,p=h===void 0?0:h,g=t.className,m=ube(t,abe),y=ibe({x:r,y:a,top:l,left:u,width:f,height:p},m);return!Ae(r)||!Ae(a)||!Ae(f)||!Ae(p)||!Ae(l)||!Ae(u)?null:E.createElement("path",q1({},Xe(y,!0),{className:wt("recharts-cross",g),d:fbe(r,a,f,p,l,u)}))},pbe=["cx","cy","innerRadius","outerRadius","gridType","radialLines"];function Mh(e){"@babel/helpers - typeof";return Mh=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Mh(e)}function mbe(e,t){if(e==null)return{};var n=gbe(e,t),r,s;if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(s=0;s=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(n[r]=e[r])}return n}function gbe(e,t){if(e==null)return{};var n={};for(var r in e)if(Object.prototype.hasOwnProperty.call(e,r)){if(t.indexOf(r)>=0)continue;n[r]=e[r]}return n}function Si(){return Si=Object.assign?Object.assign.bind():function(e){for(var t=1;t=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(n[r]=e[r])}return n}function Fbe(e,t){if(e==null)return{};var n={};for(var r in e)if(Object.prototype.hasOwnProperty.call(e,r)){if(t.indexOf(r)>=0)continue;n[r]=e[r]}return n}function Bbe(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function RO(e,t){for(var n=0;nFO?o=s==="outer"?"start":"end":a<-FO?o=s==="outer"?"end":"start":o="middle",o}},{key:"renderAxisLine",value:function(){var r=this.props,s=r.cx,a=r.cy,o=r.radius,l=r.axisLine,c=r.axisLineType,u=Ko(Ko({},Xe(this.props,!1)),{},{fill:"none"},Xe(l,!1));if(c==="circle")return E.createElement(jp,el({className:"recharts-polar-angle-axis-line"},u,{cx:s,cy:a,r:o}));var d=this.props.ticks,f=d.map(function(h){return Ht(s,a,o,h.coordinate)});return E.createElement(n6,el({className:"recharts-polar-angle-axis-line"},u,{points:f}))}},{key:"renderTicks",value:function(){var r=this,s=this.props,a=s.ticks,o=s.tick,l=s.tickLine,c=s.tickFormatter,u=s.stroke,d=Xe(this.props,!1),f=Xe(o,!1),h=Ko(Ko({},d),{},{fill:"none"},Xe(l,!1)),p=a.map(function(g,m){var y=r.getTickLineCoord(g),b=r.getTickTextAnchor(g),x=Ko(Ko(Ko({textAnchor:b},d),{},{stroke:"none",fill:u},f),{},{index:m,payload:g,x:y.x2,y:y.y2});return E.createElement(Rt,el({className:wt("recharts-polar-angle-axis-tick",BF(o)),key:"tick-".concat(g.coordinate)},Bl(r.props,g,m)),l&&E.createElement("line",el({className:"recharts-polar-angle-axis-tick-line"},h,y)),o&&t.renderTickItem(o,x,c?c(g.value,m):g.value))});return E.createElement(Rt,{className:"recharts-polar-angle-axis-ticks"},p)}},{key:"render",value:function(){var r=this.props,s=r.ticks,a=r.radius,o=r.axisLine;return a<=0||!s||!s.length?null:E.createElement(Rt,{className:wt("recharts-polar-angle-axis",this.props.className)},o&&this.renderAxisLine(),this.renderTicks())}}],[{key:"renderTickItem",value:function(r,s,a){var o;return E.isValidElement(r)?o=E.cloneElement(r,s):ht(r)?o=r(s):o=E.createElement(zl,el({},s,{className:"recharts-polar-angle-axis-tick-value"}),a),o}}])}(v.PureComponent);Sx(gd,"displayName","PolarAngleAxis");Sx(gd,"axisType","angleAxis");Sx(gd,"defaultProps",{type:"category",angleAxisId:0,scale:"auto",cx:0,cy:0,orientation:"outer",axisLine:!0,tickLine:!0,tickSize:8,tick:!0,hide:!1,allowDuplicatedCategory:!0});var twe=i5,nwe=twe(Object.getPrototypeOf,Object),rwe=nwe,swe=Ci,awe=rwe,iwe=Ei,owe="[object Object]",lwe=Function.prototype,cwe=Object.prototype,l6=lwe.toString,uwe=cwe.hasOwnProperty,dwe=l6.call(Object);function fwe(e){if(!iwe(e)||swe(e)!=owe)return!1;var t=awe(e);if(t===null)return!0;var n=uwe.call(t,"constructor")&&t.constructor;return typeof n=="function"&&n instanceof n&&l6.call(n)==dwe}var hwe=fwe;const pwe=Gt(hwe);var mwe=Ci,gwe=Ei,vwe="[object Boolean]";function ywe(e){return e===!0||e===!1||gwe(e)&&mwe(e)==vwe}var xwe=ywe;const bwe=Gt(xwe);function Rh(e){"@babel/helpers - typeof";return Rh=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Rh(e)}function Nv(){return Nv=Object.assign?Object.assign.bind():function(e){for(var t=1;te.length)&&(t=e.length);for(var n=0,r=new Array(t);n0,from:{upperWidth:0,lowerWidth:0,height:h,x:c,y:u},to:{upperWidth:d,lowerWidth:f,height:h,x:c,y:u},duration:m,animationEasing:g,isActive:b},function(w){var j=w.upperWidth,S=w.lowerWidth,N=w.height,_=w.x,P=w.y;return E.createElement(oa,{canBegin:o>0,from:"0px ".concat(o===-1?1:o,"px"),to:"".concat(o,"px 0px"),attributeName:"strokeDasharray",begin:y,duration:m,easing:g},E.createElement("path",Nv({},Xe(n,!0),{className:x,d:VO(_,P,j,S,N),ref:r})))}):E.createElement("g",null,E.createElement("path",Nv({},Xe(n,!0),{className:x,d:VO(c,u,d,f,h)})))},kwe=["option","shapeType","propTransformer","activeClassName","isActive"];function Dh(e){"@babel/helpers - typeof";return Dh=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Dh(e)}function Twe(e,t){if(e==null)return{};var n=$we(e,t),r,s;if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(s=0;s=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(n[r]=e[r])}return n}function $we(e,t){if(e==null)return{};var n={};for(var r in e)if(Object.prototype.hasOwnProperty.call(e,r)){if(t.indexOf(r)>=0)continue;n[r]=e[r]}return n}function WO(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(s){return Object.getOwnPropertyDescriptor(e,s).enumerable})),n.push.apply(n,r)}return n}function _v(e){for(var t=1;t0?ls(w,"paddingAngle",0):0;if(S){var _=Qn(S.endAngle-S.startAngle,w.endAngle-w.startAngle),P=nn(nn({},w),{},{startAngle:x+N,endAngle:x+_(m)+N});y.push(P),x=P.endAngle}else{var k=w.endAngle,O=w.startAngle,M=Qn(0,k-O),A=M(m),$=nn(nn({},w),{},{startAngle:x+N,endAngle:x+A+N});y.push($),x=$.endAngle}}),E.createElement(Rt,null,r.renderSectorsStatically(y))})}},{key:"attachKeyboardHandlers",value:function(r){var s=this;r.onkeydown=function(a){if(!a.altKey)switch(a.key){case"ArrowLeft":{var o=++s.state.sectorToFocus%s.sectorRefs.length;s.sectorRefs[o].focus(),s.setState({sectorToFocus:o});break}case"ArrowRight":{var l=--s.state.sectorToFocus<0?s.sectorRefs.length-1:s.state.sectorToFocus%s.sectorRefs.length;s.sectorRefs[l].focus(),s.setState({sectorToFocus:l});break}case"Escape":{s.sectorRefs[s.state.sectorToFocus].blur(),s.setState({sectorToFocus:0});break}}}}},{key:"renderSectors",value:function(){var r=this.props,s=r.sectors,a=r.isAnimationActive,o=this.state.prevSectors;return a&&s&&s.length&&(!o||!Ul(o,s))?this.renderSectorsWithAnimation():this.renderSectorsStatically(s)}},{key:"componentDidMount",value:function(){this.pieRef&&this.attachKeyboardHandlers(this.pieRef)}},{key:"render",value:function(){var r=this,s=this.props,a=s.hide,o=s.sectors,l=s.className,c=s.label,u=s.cx,d=s.cy,f=s.innerRadius,h=s.outerRadius,p=s.isAnimationActive,g=this.state.isAnimationFinished;if(a||!o||!o.length||!Ae(u)||!Ae(d)||!Ae(f)||!Ae(h))return null;var m=wt("recharts-pie",l);return E.createElement(Rt,{tabIndex:this.props.rootTabIndex,className:m,ref:function(b){r.pieRef=b}},this.renderSectors(),c&&this.renderLabels(o),Jn.renderCallByParent(this.props,null,!1),(!p||g)&&Ea.renderCallByParent(this.props,o,!1))}}],[{key:"getDerivedStateFromProps",value:function(r,s){return s.prevIsAnimationActive!==r.isAnimationActive?{prevIsAnimationActive:r.isAnimationActive,prevAnimationId:r.animationId,curSectors:r.sectors,prevSectors:[],isAnimationFinished:!0}:r.isAnimationActive&&r.animationId!==s.prevAnimationId?{prevAnimationId:r.animationId,curSectors:r.sectors,prevSectors:s.curSectors,isAnimationFinished:!0}:r.sectors!==s.curSectors?{curSectors:r.sectors,isAnimationFinished:!0}:null}},{key:"getTextAnchor",value:function(r,s){return r>s?"start":r0&&Math.abs(c)>0){var u=Math.min(a,a+l),d=Math.max(a,a+l),f=Math.min(o,o+c),h=Math.max(o,o+c);return r>=u&&r<=d&&s>=f&&s<=h}return!1},tbe={x:0,y:0,width:0,height:0,radius:0,isAnimationActive:!1,isUpdateAnimationActive:!1,animationBegin:0,animationDuration:1500,animationEasing:"ease"},U_=function(t){var n=$O($O({},tbe),t),r=v.useRef(),s=v.useState(-1),a=H0e(s,2),o=a[0],l=a[1];v.useEffect(function(){if(r.current&&r.current.getTotalLength)try{var j=r.current.getTotalLength();j&&l(j)}catch{}},[]);var c=n.x,u=n.y,d=n.width,f=n.height,h=n.radius,p=n.className,g=n.animationEasing,m=n.animationDuration,y=n.animationBegin,b=n.isAnimationActive,x=n.isUpdateAnimationActive;if(c!==+c||u!==+u||d!==+d||f!==+f||d===0||f===0)return null;var w=jt("recharts-rectangle",p);return x?E.createElement(oa,{canBegin:o>0,from:{width:d,height:f,x:c,y:u},to:{width:d,height:f,x:c,y:u},duration:m,animationEasing:g,isActive:x},function(j){var S=j.width,N=j.height,_=j.x,P=j.y;return E.createElement(oa,{canBegin:o>0,from:"0px ".concat(o===-1?1:o,"px"),to:"".concat(o,"px 0px"),attributeName:"strokeDasharray",begin:y,duration:m,isActive:b,easing:g},E.createElement("path",Sv({},Xe(n,!0),{className:w,d:MO(_,P,S,N,h),ref:r})))}):E.createElement("path",Sv({},Xe(n,!0),{className:w,d:MO(c,u,d,f,h)}))},nbe=["points","className","baseLinePoints","connectNulls"];function Ac(){return Ac=Object.assign?Object.assign.bind():function(e){for(var t=1;t=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(n[r]=e[r])}return n}function sbe(e,t){if(e==null)return{};var n={};for(var r in e)if(Object.prototype.hasOwnProperty.call(e,r)){if(t.indexOf(r)>=0)continue;n[r]=e[r]}return n}function IO(e){return lbe(e)||obe(e)||ibe(e)||abe()}function abe(){throw new TypeError(`Invalid attempt to spread non-iterable instance. +In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function ibe(e,t){if(e){if(typeof e=="string")return q1(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);if(n==="Object"&&e.constructor&&(n=e.constructor.name),n==="Map"||n==="Set")return Array.from(e);if(n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return q1(e,t)}}function obe(e){if(typeof Symbol<"u"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function lbe(e){if(Array.isArray(e))return q1(e)}function q1(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n0&&arguments[0]!==void 0?arguments[0]:[],n=[[]];return t.forEach(function(r){RO(r)?n[n.length-1].push(r):n[n.length-1].length>0&&n.push([])}),RO(t[0])&&n[n.length-1].push(t[0]),n[n.length-1].length<=0&&(n=n.slice(0,-1)),n},mf=function(t,n){var r=cbe(t);n&&(r=[r.reduce(function(a,o){return[].concat(IO(a),IO(o))},[])]);var s=r.map(function(a){return a.reduce(function(o,l,c){return"".concat(o).concat(c===0?"M":"L").concat(l.x,",").concat(l.y)},"")}).join("");return r.length===1?"".concat(s,"Z"):s},ube=function(t,n,r){var s=mf(t,r);return"".concat(s.slice(-1)==="Z"?s.slice(0,-1):s,"L").concat(mf(n.reverse(),r).slice(1))},a6=function(t){var n=t.points,r=t.className,s=t.baseLinePoints,a=t.connectNulls,o=rbe(t,nbe);if(!n||!n.length)return null;var l=jt("recharts-polygon",r);if(s&&s.length){var c=o.stroke&&o.stroke!=="none",u=ube(n,s,a);return E.createElement("g",{className:l},E.createElement("path",Ac({},Xe(o,!0),{fill:u.slice(-1)==="Z"?o.fill:"none",stroke:"none",d:u})),c?E.createElement("path",Ac({},Xe(o,!0),{fill:"none",d:mf(n,a)})):null,c?E.createElement("path",Ac({},Xe(o,!0),{fill:"none",d:mf(s,a)})):null)}var d=mf(n,a);return E.createElement("path",Ac({},Xe(o,!0),{fill:d.slice(-1)==="Z"?o.fill:"none",className:l,d}))};function K1(){return K1=Object.assign?Object.assign.bind():function(e){for(var t=1;t=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(n[r]=e[r])}return n}function vbe(e,t){if(e==null)return{};var n={};for(var r in e)if(Object.prototype.hasOwnProperty.call(e,r)){if(t.indexOf(r)>=0)continue;n[r]=e[r]}return n}var ybe=function(t,n,r,s,a,o){return"M".concat(t,",").concat(a,"v").concat(s,"M").concat(o,",").concat(n,"h").concat(r)},xbe=function(t){var n=t.x,r=n===void 0?0:n,s=t.y,a=s===void 0?0:s,o=t.top,l=o===void 0?0:o,c=t.left,u=c===void 0?0:c,d=t.width,f=d===void 0?0:d,h=t.height,p=h===void 0?0:h,g=t.className,m=gbe(t,dbe),y=fbe({x:r,y:a,top:l,left:u,width:f,height:p},m);return!Ae(r)||!Ae(a)||!Ae(f)||!Ae(p)||!Ae(l)||!Ae(u)?null:E.createElement("path",X1({},Xe(y,!0),{className:jt("recharts-cross",g),d:ybe(r,a,f,p,l,u)}))},bbe=["cx","cy","innerRadius","outerRadius","gridType","radialLines"];function Ih(e){"@babel/helpers - typeof";return Ih=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Ih(e)}function wbe(e,t){if(e==null)return{};var n=jbe(e,t),r,s;if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(s=0;s=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(n[r]=e[r])}return n}function jbe(e,t){if(e==null)return{};var n={};for(var r in e)if(Object.prototype.hasOwnProperty.call(e,r)){if(t.indexOf(r)>=0)continue;n[r]=e[r]}return n}function Ni(){return Ni=Object.assign?Object.assign.bind():function(e){for(var t=1;t=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(n[r]=e[r])}return n}function Gbe(e,t){if(e==null)return{};var n={};for(var r in e)if(Object.prototype.hasOwnProperty.call(e,r)){if(t.indexOf(r)>=0)continue;n[r]=e[r]}return n}function Hbe(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function zO(e,t){for(var n=0;nWO?o=s==="outer"?"start":"end":a<-WO?o=s==="outer"?"end":"start":o="middle",o}},{key:"renderAxisLine",value:function(){var r=this.props,s=r.cx,a=r.cy,o=r.radius,l=r.axisLine,c=r.axisLineType,u=Ko(Ko({},Xe(this.props,!1)),{},{fill:"none"},Xe(l,!1));if(c==="circle")return E.createElement(Sp,el({className:"recharts-polar-angle-axis-line"},u,{cx:s,cy:a,r:o}));var d=this.props.ticks,f=d.map(function(h){return Gt(s,a,o,h.coordinate)});return E.createElement(a6,el({className:"recharts-polar-angle-axis-line"},u,{points:f}))}},{key:"renderTicks",value:function(){var r=this,s=this.props,a=s.ticks,o=s.tick,l=s.tickLine,c=s.tickFormatter,u=s.stroke,d=Xe(this.props,!1),f=Xe(o,!1),h=Ko(Ko({},d),{},{fill:"none"},Xe(l,!1)),p=a.map(function(g,m){var y=r.getTickLineCoord(g),b=r.getTickTextAnchor(g),x=Ko(Ko(Ko({textAnchor:b},d),{},{stroke:"none",fill:u},f),{},{index:m,payload:g,x:y.x2,y:y.y2});return E.createElement(Rt,el({className:jt("recharts-polar-angle-axis-tick",VF(o)),key:"tick-".concat(g.coordinate)},Bl(r.props,g,m)),l&&E.createElement("line",el({className:"recharts-polar-angle-axis-tick-line"},h,y)),o&&t.renderTickItem(o,x,c?c(g.value,m):g.value))});return E.createElement(Rt,{className:"recharts-polar-angle-axis-ticks"},p)}},{key:"render",value:function(){var r=this.props,s=r.ticks,a=r.radius,o=r.axisLine;return a<=0||!s||!s.length?null:E.createElement(Rt,{className:jt("recharts-polar-angle-axis",this.props.className)},o&&this.renderAxisLine(),this.renderTicks())}}],[{key:"renderTickItem",value:function(r,s,a){var o;return E.isValidElement(r)?o=E.cloneElement(r,s):ht(r)?o=r(s):o=E.createElement(zl,el({},s,{className:"recharts-polar-angle-axis-tick-value"}),a),o}}])}(v.PureComponent);Px(gd,"displayName","PolarAngleAxis");Px(gd,"axisType","angleAxis");Px(gd,"defaultProps",{type:"category",angleAxisId:0,scale:"auto",cx:0,cy:0,orientation:"outer",axisLine:!0,tickLine:!0,tickSize:8,tick:!0,hide:!1,allowDuplicatedCategory:!0});var owe=c5,lwe=owe(Object.getPrototypeOf,Object),cwe=lwe,uwe=Ei,dwe=cwe,fwe=Oi,hwe="[object Object]",pwe=Function.prototype,mwe=Object.prototype,d6=pwe.toString,gwe=mwe.hasOwnProperty,vwe=d6.call(Object);function ywe(e){if(!fwe(e)||uwe(e)!=hwe)return!1;var t=dwe(e);if(t===null)return!0;var n=gwe.call(t,"constructor")&&t.constructor;return typeof n=="function"&&n instanceof n&&d6.call(n)==vwe}var xwe=ywe;const bwe=Ht(xwe);var wwe=Ei,jwe=Oi,Swe="[object Boolean]";function Nwe(e){return e===!0||e===!1||jwe(e)&&wwe(e)==Swe}var _we=Nwe;const Pwe=Ht(_we);function Dh(e){"@babel/helpers - typeof";return Dh=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Dh(e)}function Pv(){return Pv=Object.assign?Object.assign.bind():function(e){for(var t=1;te.length)&&(t=e.length);for(var n=0,r=new Array(t);n0,from:{upperWidth:0,lowerWidth:0,height:h,x:c,y:u},to:{upperWidth:d,lowerWidth:f,height:h,x:c,y:u},duration:m,animationEasing:g,isActive:b},function(w){var j=w.upperWidth,S=w.lowerWidth,N=w.height,_=w.x,P=w.y;return E.createElement(oa,{canBegin:o>0,from:"0px ".concat(o===-1?1:o,"px"),to:"".concat(o,"px 0px"),attributeName:"strokeDasharray",begin:y,duration:m,easing:g},E.createElement("path",Pv({},Xe(n,!0),{className:x,d:KO(_,P,j,S,N),ref:r})))}):E.createElement("g",null,E.createElement("path",Pv({},Xe(n,!0),{className:x,d:KO(c,u,d,f,h)})))},Dwe=["option","shapeType","propTransformer","activeClassName","isActive"];function Lh(e){"@babel/helpers - typeof";return Lh=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Lh(e)}function Lwe(e,t){if(e==null)return{};var n=Fwe(e,t),r,s;if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(s=0;s=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(n[r]=e[r])}return n}function Fwe(e,t){if(e==null)return{};var n={};for(var r in e)if(Object.prototype.hasOwnProperty.call(e,r)){if(t.indexOf(r)>=0)continue;n[r]=e[r]}return n}function XO(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(s){return Object.getOwnPropertyDescriptor(e,s).enumerable})),n.push.apply(n,r)}return n}function Av(e){for(var t=1;t0?ls(w,"paddingAngle",0):0;if(S){var _=Qn(S.endAngle-S.startAngle,w.endAngle-w.startAngle),P=nn(nn({},w),{},{startAngle:x+N,endAngle:x+_(m)+N});y.push(P),x=P.endAngle}else{var k=w.endAngle,O=w.startAngle,M=Qn(0,k-O),A=M(m),$=nn(nn({},w),{},{startAngle:x+N,endAngle:x+A+N});y.push($),x=$.endAngle}}),E.createElement(Rt,null,r.renderSectorsStatically(y))})}},{key:"attachKeyboardHandlers",value:function(r){var s=this;r.onkeydown=function(a){if(!a.altKey)switch(a.key){case"ArrowLeft":{var o=++s.state.sectorToFocus%s.sectorRefs.length;s.sectorRefs[o].focus(),s.setState({sectorToFocus:o});break}case"ArrowRight":{var l=--s.state.sectorToFocus<0?s.sectorRefs.length-1:s.state.sectorToFocus%s.sectorRefs.length;s.sectorRefs[l].focus(),s.setState({sectorToFocus:l});break}case"Escape":{s.sectorRefs[s.state.sectorToFocus].blur(),s.setState({sectorToFocus:0});break}}}}},{key:"renderSectors",value:function(){var r=this.props,s=r.sectors,a=r.isAnimationActive,o=this.state.prevSectors;return a&&s&&s.length&&(!o||!Ul(o,s))?this.renderSectorsWithAnimation():this.renderSectorsStatically(s)}},{key:"componentDidMount",value:function(){this.pieRef&&this.attachKeyboardHandlers(this.pieRef)}},{key:"render",value:function(){var r=this,s=this.props,a=s.hide,o=s.sectors,l=s.className,c=s.label,u=s.cx,d=s.cy,f=s.innerRadius,h=s.outerRadius,p=s.isAnimationActive,g=this.state.isAnimationFinished;if(a||!o||!o.length||!Ae(u)||!Ae(d)||!Ae(f)||!Ae(h))return null;var m=jt("recharts-pie",l);return E.createElement(Rt,{tabIndex:this.props.rootTabIndex,className:m,ref:function(b){r.pieRef=b}},this.renderSectors(),c&&this.renderLabels(o),Jn.renderCallByParent(this.props,null,!1),(!p||g)&&Ea.renderCallByParent(this.props,o,!1))}}],[{key:"getDerivedStateFromProps",value:function(r,s){return s.prevIsAnimationActive!==r.isAnimationActive?{prevIsAnimationActive:r.isAnimationActive,prevAnimationId:r.animationId,curSectors:r.sectors,prevSectors:[],isAnimationFinished:!0}:r.isAnimationActive&&r.animationId!==s.prevAnimationId?{prevAnimationId:r.animationId,curSectors:r.sectors,prevSectors:s.curSectors,isAnimationFinished:!0}:r.sectors!==s.curSectors?{curSectors:r.sectors,isAnimationFinished:!0}:null}},{key:"getTextAnchor",value:function(r,s){return r>s?"start":r=360?x:x-1)*c,j=y-x*p-w,S=s.reduce(function(P,k){var O=En(k,b,0);return P+(Ae(O)?O:0)},0),N;if(S>0){var _;N=s.map(function(P,k){var O=En(P,b,0),M=En(P,d,k),A=(Ae(O)?O:0)/S,$;k?$=_.endAngle+Ar(m)*c*(O!==0?1:0):$=o;var L=$+Ar(m)*((O!==0?p:0)+A*j),H=($+L)/2,D=(g.innerRadius+g.outerRadius)/2,V=[{name:M,value:O,payload:P,dataKey:b,type:h}],T=Ht(g.cx,g.cy,D,H);return _=nn(nn(nn({percent:A,cornerRadius:a,name:M,tooltipPayload:V,midAngle:H,middleRadius:D,tooltipPosition:T},P),g),{},{value:En(P,b),startAngle:$,endAngle:L,payload:P,paddingAngle:Ar(m)*c}),_})}return nn(nn({},g),{},{sectors:N,data:s})});function e1e(e){return e&&e.length?e[0]:void 0}var t1e=e1e,n1e=t1e;const r1e=Gt(n1e);var s1e=["key"];function Au(e){"@babel/helpers - typeof";return Au=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Au(e)}function a1e(e,t){if(e==null)return{};var n=i1e(e,t),r,s;if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(s=0;s=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(n[r]=e[r])}return n}function i1e(e,t){if(e==null)return{};var n={};for(var r in e)if(Object.prototype.hasOwnProperty.call(e,r)){if(t.indexOf(r)>=0)continue;n[r]=e[r]}return n}function Av(){return Av=Object.assign?Object.assign.bind():function(e){for(var t=1;t=2&&(c=!0),u.push(Sr(Sr({},Ht(o,l,x,y)),{},{name:g,value:m,cx:o,cy:l,radius:x,angle:y,payload:h}))});var f=[];return c&&u.forEach(function(h){if(Array.isArray(h.value)){var p=r1e(h.value),g=Nt(p)?void 0:t.scale(p);f.push(Sr(Sr({},h),{},{radius:g},Ht(o,l,g,h.angle)))}else f.push(h)}),{points:u,isRange:c,baseLinePoints:f}});var p1e=Math.ceil,m1e=Math.max;function g1e(e,t,n,r){for(var s=-1,a=m1e(p1e((t-e)/(n||1)),0),o=Array(a);a--;)o[r?a:++s]=e,e+=n;return o}var v1e=g1e,y1e=_5,YO=1/0,x1e=17976931348623157e292;function b1e(e){if(!e)return e===0?e:0;if(e=y1e(e),e===YO||e===-YO){var t=e<0?-1:1;return t*x1e}return e===e?e:0}var p6=b1e,w1e=v1e,j1e=ux,Y0=p6;function S1e(e){return function(t,n,r){return r&&typeof r!="number"&&j1e(t,n,r)&&(n=r=void 0),t=Y0(t),n===void 0?(n=t,t=0):n=Y0(n),r=r===void 0?t0&&r.handleDrag(s.changedTouches[0])}),Yr(r,"handleDragEnd",function(){r.setState({isTravellerMoving:!1,isSlideMoving:!1},function(){var s=r.props,a=s.endIndex,o=s.onDragEnd,l=s.startIndex;o==null||o({endIndex:a,startIndex:l})}),r.detachDragEndListener()}),Yr(r,"handleLeaveWrapper",function(){(r.state.isTravellerMoving||r.state.isSlideMoving)&&(r.leaveTimer=window.setTimeout(r.handleDragEnd,r.props.leaveTimeOut))}),Yr(r,"handleEnterSlideOrTraveller",function(){r.setState({isTextActive:!0})}),Yr(r,"handleLeaveSlideOrTraveller",function(){r.setState({isTextActive:!1})}),Yr(r,"handleSlideDragStart",function(s){var a=tk(s)?s.changedTouches[0]:s;r.setState({isTravellerMoving:!1,isSlideMoving:!0,slideMoveStartX:a.pageX}),r.attachDragEndListener()}),r.travellerDragStartHandlers={startX:r.handleTravellerDragStart.bind(r,"startX"),endX:r.handleTravellerDragStart.bind(r,"endX")},r.state={},r}return D1e(t,e),$1e(t,[{key:"componentWillUnmount",value:function(){this.leaveTimer&&(clearTimeout(this.leaveTimer),this.leaveTimer=null),this.detachDragEndListener()}},{key:"getIndex",value:function(r){var s=r.startX,a=r.endX,o=this.state.scaleValues,l=this.props,c=l.gap,u=l.data,d=u.length-1,f=Math.min(s,a),h=Math.max(s,a),p=t.getIndexInRange(o,f),g=t.getIndexInRange(o,h);return{startIndex:p-p%c,endIndex:g===d?d:g-g%c}}},{key:"getTextOfTick",value:function(r){var s=this.props,a=s.data,o=s.tickFormatter,l=s.dataKey,c=En(a[r],l,r);return ht(o)?o(c,r):c}},{key:"attachDragEndListener",value:function(){window.addEventListener("mouseup",this.handleDragEnd,!0),window.addEventListener("touchend",this.handleDragEnd,!0),window.addEventListener("mousemove",this.handleDrag,!0)}},{key:"detachDragEndListener",value:function(){window.removeEventListener("mouseup",this.handleDragEnd,!0),window.removeEventListener("touchend",this.handleDragEnd,!0),window.removeEventListener("mousemove",this.handleDrag,!0)}},{key:"handleSlideDrag",value:function(r){var s=this.state,a=s.slideMoveStartX,o=s.startX,l=s.endX,c=this.props,u=c.x,d=c.width,f=c.travellerWidth,h=c.startIndex,p=c.endIndex,g=c.onChange,m=r.pageX-a;m>0?m=Math.min(m,u+d-f-l,u+d-f-o):m<0&&(m=Math.max(m,u-o,u-l));var y=this.getIndex({startX:o+m,endX:l+m});(y.startIndex!==h||y.endIndex!==p)&&g&&g(y),this.setState({startX:o+m,endX:l+m,slideMoveStartX:r.pageX})}},{key:"handleTravellerDragStart",value:function(r,s){var a=tk(s)?s.changedTouches[0]:s;this.setState({isSlideMoving:!1,isTravellerMoving:!0,movingTravellerId:r,brushMoveStartX:a.pageX}),this.attachDragEndListener()}},{key:"handleTravellerMove",value:function(r){var s=this.state,a=s.brushMoveStartX,o=s.movingTravellerId,l=s.endX,c=s.startX,u=this.state[o],d=this.props,f=d.x,h=d.width,p=d.travellerWidth,g=d.onChange,m=d.gap,y=d.data,b={startX:this.state.startX,endX:this.state.endX},x=r.pageX-a;x>0?x=Math.min(x,f+h-p-u):x<0&&(x=Math.max(x,f-u)),b[o]=u+x;var w=this.getIndex(b),j=w.startIndex,S=w.endIndex,N=function(){var P=y.length-1;return o==="startX"&&(l>c?j%m===0:S%m===0)||lc?S%m===0:j%m===0)||l>c&&S===P};this.setState(Yr(Yr({},o,u+x),"brushMoveStartX",r.pageX),function(){g&&N()&&g(w)})}},{key:"handleTravellerMoveKeyboard",value:function(r,s){var a=this,o=this.state,l=o.scaleValues,c=o.startX,u=o.endX,d=this.state[s],f=l.indexOf(d);if(f!==-1){var h=f+r;if(!(h===-1||h>=l.length)){var p=l[h];s==="startX"&&p>=u||s==="endX"&&p<=c||this.setState(Yr({},s,p),function(){a.props.onChange(a.getIndex({startX:a.state.startX,endX:a.state.endX}))})}}}},{key:"renderBackground",value:function(){var r=this.props,s=r.x,a=r.y,o=r.width,l=r.height,c=r.fill,u=r.stroke;return E.createElement("rect",{stroke:u,fill:c,x:s,y:a,width:o,height:l})}},{key:"renderPanorama",value:function(){var r=this.props,s=r.x,a=r.y,o=r.width,l=r.height,c=r.data,u=r.children,d=r.padding,f=v.Children.only(u);return f?E.cloneElement(f,{x:s,y:a,width:o,height:l,margin:d,compact:!0,data:c}):null}},{key:"renderTravellerLayer",value:function(r,s){var a,o,l=this,c=this.props,u=c.y,d=c.travellerWidth,f=c.height,h=c.traveller,p=c.ariaLabel,g=c.data,m=c.startIndex,y=c.endIndex,b=Math.max(r,this.props.x),x=Z0(Z0({},Xe(this.props,!1)),{},{x:b,y:u,width:d,height:f}),w=p||"Min value: ".concat((a=g[m])===null||a===void 0?void 0:a.name,", Max value: ").concat((o=g[y])===null||o===void 0?void 0:o.name);return E.createElement(Rt,{tabIndex:0,role:"slider","aria-label":w,"aria-valuenow":r,className:"recharts-brush-traveller",onMouseEnter:this.handleEnterSlideOrTraveller,onMouseLeave:this.handleLeaveSlideOrTraveller,onMouseDown:this.travellerDragStartHandlers[s],onTouchStart:this.travellerDragStartHandlers[s],onKeyDown:function(S){["ArrowLeft","ArrowRight"].includes(S.key)&&(S.preventDefault(),S.stopPropagation(),l.handleTravellerMoveKeyboard(S.key==="ArrowRight"?1:-1,s))},onFocus:function(){l.setState({isTravellerFocused:!0})},onBlur:function(){l.setState({isTravellerFocused:!1})},style:{cursor:"col-resize"}},t.renderTraveller(h,x))}},{key:"renderSlide",value:function(r,s){var a=this.props,o=a.y,l=a.height,c=a.stroke,u=a.travellerWidth,d=Math.min(r,s)+u,f=Math.max(Math.abs(s-r)-u,0);return E.createElement("rect",{className:"recharts-brush-slide",onMouseEnter:this.handleEnterSlideOrTraveller,onMouseLeave:this.handleLeaveSlideOrTraveller,onMouseDown:this.handleSlideDragStart,onTouchStart:this.handleSlideDragStart,style:{cursor:"move"},stroke:"none",fill:c,fillOpacity:.2,x:d,y:o,width:f,height:l})}},{key:"renderText",value:function(){var r=this.props,s=r.startIndex,a=r.endIndex,o=r.y,l=r.height,c=r.travellerWidth,u=r.stroke,d=this.state,f=d.startX,h=d.endX,p=5,g={pointerEvents:"none",fill:u};return E.createElement(Rt,{className:"recharts-brush-texts"},E.createElement(zl,Ov({textAnchor:"end",verticalAnchor:"middle",x:Math.min(f,h)-p,y:o+l/2},g),this.getTextOfTick(s)),E.createElement(zl,Ov({textAnchor:"start",verticalAnchor:"middle",x:Math.max(f,h)+c+p,y:o+l/2},g),this.getTextOfTick(a)))}},{key:"render",value:function(){var r=this.props,s=r.data,a=r.className,o=r.children,l=r.x,c=r.y,u=r.width,d=r.height,f=r.alwaysShowText,h=this.state,p=h.startX,g=h.endX,m=h.isTextActive,y=h.isSlideMoving,b=h.isTravellerMoving,x=h.isTravellerFocused;if(!s||!s.length||!Ae(l)||!Ae(c)||!Ae(u)||!Ae(d)||u<=0||d<=0)return null;var w=wt("recharts-brush",a),j=E.Children.count(o)===1,S=k1e("userSelect","none");return E.createElement(Rt,{className:w,onMouseLeave:this.handleLeaveWrapper,onTouchMove:this.handleTouchMove,style:S},this.renderBackground(),j&&this.renderPanorama(),this.renderSlide(p,g),this.renderTravellerLayer(p,"startX"),this.renderTravellerLayer(g,"endX"),(m||y||b||x||f)&&this.renderText())}}],[{key:"renderDefaultTraveller",value:function(r){var s=r.x,a=r.y,o=r.width,l=r.height,c=r.stroke,u=Math.floor(a+l/2)-1;return E.createElement(E.Fragment,null,E.createElement("rect",{x:s,y:a,width:o,height:l,fill:c,stroke:"none"}),E.createElement("line",{x1:s+1,y1:u,x2:s+o-1,y2:u,fill:"none",stroke:"#fff"}),E.createElement("line",{x1:s+1,y1:u+2,x2:s+o-1,y2:u+2,fill:"none",stroke:"#fff"}))}},{key:"renderTraveller",value:function(r,s){var a;return E.isValidElement(r)?a=E.cloneElement(r,s):ht(r)?a=r(s):a=t.renderDefaultTraveller(s),a}},{key:"getDerivedStateFromProps",value:function(r,s){var a=r.data,o=r.width,l=r.x,c=r.travellerWidth,u=r.updateId,d=r.startIndex,f=r.endIndex;if(a!==s.prevData||u!==s.prevUpdateId)return Z0({prevData:a,prevTravellerWidth:c,prevUpdateId:u,prevX:l,prevWidth:o},a&&a.length?F1e({data:a,width:o,x:l,travellerWidth:c,startIndex:d,endIndex:f}):{scale:null,scaleValues:null});if(s.scale&&(o!==s.prevWidth||l!==s.prevX||c!==s.prevTravellerWidth)){s.scale.range([l,l+o-c]);var h=s.scale.domain().map(function(p){return s.scale(p)});return{prevData:a,prevTravellerWidth:c,prevUpdateId:u,prevX:l,prevWidth:o,startX:s.scale(r.startIndex),endX:s.scale(r.endIndex),scaleValues:h}}return null}},{key:"getIndexInRange",value:function(r,s){for(var a=r.length,o=0,l=a-1;l-o>1;){var c=Math.floor((o+l)/2);r[c]>s?l=c:o=c}return s>=r[l]?l:o}}])}(v.PureComponent);Yr(Eu,"displayName","Brush");Yr(Eu,"defaultProps",{height:40,travellerWidth:5,gap:1,fill:"#fff",stroke:"#666",padding:{top:1,right:1,bottom:1,left:1},leaveTimeOut:1e3,alwaysShowText:!1});var B1e=c_;function z1e(e,t){var n;return B1e(e,function(r,s,a){return n=t(r,s,a),!n}),!!n}var U1e=z1e,V1e=Q3,W1e=Ba,H1e=U1e,G1e=Kr,q1e=ux;function K1e(e,t,n){var r=G1e(e)?V1e:H1e;return n&&q1e(e,t,n)&&(t=void 0),r(e,W1e(t))}var X1e=K1e;const Y1e=Gt(X1e);var Oa=function(t,n){var r=t.alwaysShow,s=t.ifOverflow;return r&&(s="extendDomain"),s===n},nk=b5;function Z1e(e,t,n){t=="__proto__"&&nk?nk(e,t,{configurable:!0,enumerable:!0,value:n,writable:!0}):e[t]=n}var Q1e=Z1e,J1e=Q1e,eje=y5,tje=Ba;function nje(e,t){var n={};return t=tje(t),eje(e,function(r,s,a){J1e(n,s,t(r,s,a))}),n}var rje=nje;const sje=Gt(rje);function aje(e,t){for(var n=-1,r=e==null?0:e.length;++n=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(n[r]=e[r])}return n}function jje(e,t){if(e==null)return{};var n={};for(var r in e)if(Object.prototype.hasOwnProperty.call(e,r)){if(t.indexOf(r)>=0)continue;n[r]=e[r]}return n}function Sje(e,t){var n=e.x,r=e.y,s=wje(e,vje),a="".concat(n),o=parseInt(a,10),l="".concat(r),c=parseInt(l,10),u="".concat(t.height||s.height),d=parseInt(u,10),f="".concat(t.width||s.width),h=parseInt(f,10);return zd(zd(zd(zd(zd({},t),s),o?{x:o}:{}),c?{y:c}:{}),{},{height:d,width:h,name:t.name,radius:t.radius})}function sk(e){return E.createElement(c6,J1({shapeType:"rectangle",propTransformer:Sje,activeClassName:"recharts-active-bar"},e))}var Nje=function(t){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0;return function(r,s){if(typeof t=="number")return t;var a=typeof r=="number";return a?t(r,s):(a||Wl(),n)}},_je=["value","background"],x6;function Ou(e){"@babel/helpers - typeof";return Ou=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Ou(e)}function Pje(e,t){if(e==null)return{};var n=Aje(e,t),r,s;if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(s=0;s=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(n[r]=e[r])}return n}function Aje(e,t){if(e==null)return{};var n={};for(var r in e)if(Object.prototype.hasOwnProperty.call(e,r)){if(t.indexOf(r)>=0)continue;n[r]=e[r]}return n}function Tv(){return Tv=Object.assign?Object.assign.bind():function(e){for(var t=1;t0&&Math.abs(H)0&&Math.abs(L)0&&($=Math.min((B||0)-(L[le-1]||0),$))}),Number.isFinite($)){var H=$/A,D=m.layout==="vertical"?r.height:r.width;if(m.padding==="gap"&&(_=H*D/2),m.padding==="no-gap"){var V=Cr(t.barCategoryGap,H*D),T=H*D/2;_=T-V-(T-V)/D*V}}}s==="xAxis"?P=[r.left+(w.left||0)+(_||0),r.left+r.width-(w.right||0)-(_||0)]:s==="yAxis"?P=c==="horizontal"?[r.top+r.height-(w.bottom||0),r.top+(w.top||0)]:[r.top+(w.top||0)+(_||0),r.top+r.height-(w.bottom||0)-(_||0)]:P=m.range,S&&(P=[P[1],P[0]]);var F=TF(m,a,h),q=F.scale,Z=F.realScaleType;q.domain(b).range(P),$F(q);var re=MF(q,Vs(Vs({},m),{},{realScaleType:Z}));s==="xAxis"?(M=y==="top"&&!j||y==="bottom"&&j,k=r.left,O=f[N]-M*m.height):s==="yAxis"&&(M=y==="left"&&!j||y==="right"&&j,k=f[N]-M*m.width,O=r.top);var ge=Vs(Vs(Vs({},m),re),{},{realScaleType:Z,x:k,y:O,scale:q,width:s==="xAxis"?r.width:m.width,height:s==="yAxis"?r.height:m.height});return ge.bandSize=mv(ge,re),!m.hide&&s==="xAxis"?f[N]+=(M?-1:1)*ge.height:m.hide||(f[N]+=(M?-1:1)*ge.width),Vs(Vs({},p),{},Px({},g,ge))},{})},N6=function(t,n){var r=t.x,s=t.y,a=n.x,o=n.y;return{x:Math.min(r,a),y:Math.min(s,o),width:Math.abs(a-r),height:Math.abs(o-s)}},Lje=function(t){var n=t.x1,r=t.y1,s=t.x2,a=t.y2;return N6({x:n,y:r},{x:s,y:a})},_6=function(){function e(t){Ije(this,e),this.scale=t}return Rje(e,[{key:"domain",get:function(){return this.scale.domain}},{key:"range",get:function(){return this.scale.range}},{key:"rangeMin",get:function(){return this.range()[0]}},{key:"rangeMax",get:function(){return this.range()[1]}},{key:"bandwidth",get:function(){return this.scale.bandwidth}},{key:"apply",value:function(n){var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},s=r.bandAware,a=r.position;if(n!==void 0){if(a)switch(a){case"start":return this.scale(n);case"middle":{var o=this.bandwidth?this.bandwidth()/2:0;return this.scale(n)+o}case"end":{var l=this.bandwidth?this.bandwidth():0;return this.scale(n)+l}default:return this.scale(n)}if(s){var c=this.bandwidth?this.bandwidth()/2:0;return this.scale(n)+c}return this.scale(n)}}},{key:"isInRange",value:function(n){var r=this.range(),s=r[0],a=r[r.length-1];return s<=a?n>=s&&n<=a:n>=a&&n<=s}}],[{key:"create",value:function(n){return new e(n)}}])}();Px(_6,"EPS",1e-4);var L_=function(t){var n=Object.keys(t).reduce(function(r,s){return Vs(Vs({},r),{},Px({},s,_6.create(t[s])))},{});return Vs(Vs({},n),{},{apply:function(s){var a=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},o=a.bandAware,l=a.position;return sje(s,function(c,u){return n[u].apply(c,{bandAware:o,position:l})})},isInRange:function(s){return y6(s,function(a,o){return n[o].isInRange(a)})}})};function Fje(e){return(e%180+180)%180}var Bje=function(t){var n=t.width,r=t.height,s=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,a=Fje(s),o=a*Math.PI/180,l=Math.atan(r/n),c=o>l&&o-1?s[a?t[o]:o]:void 0}}var Hje=Wje,Gje=p6;function qje(e){var t=Gje(e),n=t%1;return t===t?n?t-n:t:0}var Kje=qje,Xje=f5,Yje=Ba,Zje=Kje,Qje=Math.max;function Jje(e,t,n){var r=e==null?0:e.length;if(!r)return-1;var s=n==null?0:Zje(n);return s<0&&(s=Qje(r+s,0)),Xje(e,Yje(t),s)}var eSe=Jje,tSe=Hje,nSe=eSe,rSe=tSe(nSe),sSe=rSe;const aSe=Gt(sSe);var iSe=Wte(function(e){return{x:e.left,y:e.top,width:e.width,height:e.height}},function(e){return["l",e.left,"t",e.top,"w",e.width,"h",e.height].join("")}),F_=v.createContext(void 0),B_=v.createContext(void 0),P6=v.createContext(void 0),A6=v.createContext({}),C6=v.createContext(void 0),E6=v.createContext(0),O6=v.createContext(0),ck=function(t){var n=t.state,r=n.xAxisMap,s=n.yAxisMap,a=n.offset,o=t.clipPathId,l=t.children,c=t.width,u=t.height,d=iSe(a);return E.createElement(F_.Provider,{value:r},E.createElement(B_.Provider,{value:s},E.createElement(A6.Provider,{value:a},E.createElement(P6.Provider,{value:d},E.createElement(C6.Provider,{value:o},E.createElement(E6.Provider,{value:u},E.createElement(O6.Provider,{value:c},l)))))))},oSe=function(){return v.useContext(C6)},k6=function(t){var n=v.useContext(F_);n==null&&Wl();var r=n[t];return r==null&&Wl(),r},lSe=function(){var t=v.useContext(F_);return Hi(t)},cSe=function(){var t=v.useContext(B_),n=aSe(t,function(r){return y6(r.domain,Number.isFinite)});return n||Hi(t)},T6=function(t){var n=v.useContext(B_);n==null&&Wl();var r=n[t];return r==null&&Wl(),r},uSe=function(){var t=v.useContext(P6);return t},dSe=function(){return v.useContext(A6)},z_=function(){return v.useContext(O6)},U_=function(){return v.useContext(E6)};function ku(e){"@babel/helpers - typeof";return ku=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},ku(e)}function fSe(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function hSe(e,t){for(var n=0;ne.length)&&(t=e.length);for(var n=0,r=new Array(t);ne*s)return!1;var a=n();return e*(t-e*a/2-r)>=0&&e*(t+e*a/2-s)<=0}function KSe(e,t){return F6(e,t+1)}function XSe(e,t,n,r,s){for(var a=(r||[]).slice(),o=t.start,l=t.end,c=0,u=1,d=o,f=function(){var g=r==null?void 0:r[c];if(g===void 0)return{v:F6(r,u)};var m=c,y,b=function(){return y===void 0&&(y=n(g,m)),y},x=g.coordinate,w=c===0||Dv(e,x,b,d,l);w||(c=0,d=o,u+=1),w&&(d=x+e*(b()/2+s),c+=u)},h;u<=a.length;)if(h=f(),h)return h.v;return[]}function Uh(e){"@babel/helpers - typeof";return Uh=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Uh(e)}function vk(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(s){return Object.getOwnPropertyDescriptor(e,s).enumerable})),n.push.apply(n,r)}return n}function hr(e){for(var t=1;t0?p.coordinate-y*e:p.coordinate})}else a[h]=p=hr(hr({},p),{},{tickCoord:p.coordinate});var b=Dv(e,p.tickCoord,m,l,c);b&&(c=p.tickCoord-e*(m()/2+s),a[h]=hr(hr({},p),{},{isShow:!0}))},d=o-1;d>=0;d--)u(d);return a}function eNe(e,t,n,r,s,a){var o=(r||[]).slice(),l=o.length,c=t.start,u=t.end;if(a){var d=r[l-1],f=n(d,l-1),h=e*(d.coordinate+e*f/2-u);o[l-1]=d=hr(hr({},d),{},{tickCoord:h>0?d.coordinate-h*e:d.coordinate});var p=Dv(e,d.tickCoord,function(){return f},c,u);p&&(u=d.tickCoord-e*(f/2+s),o[l-1]=hr(hr({},d),{},{isShow:!0}))}for(var g=a?l-1:l,m=function(x){var w=o[x],j,S=function(){return j===void 0&&(j=n(w,x)),j};if(x===0){var N=e*(w.coordinate-e*S()/2-c);o[x]=w=hr(hr({},w),{},{tickCoord:N<0?w.coordinate-N*e:w.coordinate})}else o[x]=w=hr(hr({},w),{},{tickCoord:w.coordinate});var _=Dv(e,w.tickCoord,S,c,u);_&&(c=w.tickCoord+e*(S()/2+s),o[x]=hr(hr({},w),{},{isShow:!0}))},y=0;y=2?Ar(s[1].coordinate-s[0].coordinate):1,b=qSe(a,y,p);return c==="equidistantPreserveStart"?XSe(y,b,m,s,o):(c==="preserveStart"||c==="preserveStartEnd"?h=eNe(y,b,m,s,o,c==="preserveStartEnd"):h=JSe(y,b,m,s,o),h.filter(function(x){return x.isShow}))}var tNe=["viewBox"],nNe=["viewBox"],rNe=["ticks"];function Mu(e){"@babel/helpers - typeof";return Mu=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Mu(e)}function Ec(){return Ec=Object.assign?Object.assign.bind():function(e){for(var t=1;t=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(n[r]=e[r])}return n}function sNe(e,t){if(e==null)return{};var n={};for(var r in e)if(Object.prototype.hasOwnProperty.call(e,r)){if(t.indexOf(r)>=0)continue;n[r]=e[r]}return n}function aNe(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function xk(e,t){for(var n=0;n0?c(this.props):c(p)),o<=0||l<=0||!g||!g.length?null:E.createElement(Rt,{className:wt("recharts-cartesian-axis",u),ref:function(y){r.layerReference=y}},a&&this.renderAxisLine(),this.renderTicks(g,this.state.fontSize,this.state.letterSpacing),Jn.renderCallByParent(this.props))}}],[{key:"renderTickItem",value:function(r,s,a){var o;return E.isValidElement(r)?o=E.cloneElement(r,s):ht(r)?o=r(s):o=E.createElement(zl,Ec({},s,{className:"recharts-cartesian-axis-tick-value"}),a),o}}])}(v.Component);G_(vd,"displayName","CartesianAxis");G_(vd,"defaultProps",{x:0,y:0,width:0,height:0,viewBox:{x:0,y:0,width:0,height:0},orientation:"bottom",ticks:[],stroke:"#666",tickLine:!0,axisLine:!0,tick:!0,mirror:!1,minTickGap:5,tickSize:6,tickMargin:2,interval:"preserveEnd"});var fNe=["x1","y1","x2","y2","key"],hNe=["offset"];function Hl(e){"@babel/helpers - typeof";return Hl=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Hl(e)}function bk(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(s){return Object.getOwnPropertyDescriptor(e,s).enumerable})),n.push.apply(n,r)}return n}function vr(e){for(var t=1;t=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(n[r]=e[r])}return n}function vNe(e,t){if(e==null)return{};var n={};for(var r in e)if(Object.prototype.hasOwnProperty.call(e,r)){if(t.indexOf(r)>=0)continue;n[r]=e[r]}return n}var yNe=function(t){var n=t.fill;if(!n||n==="none")return null;var r=t.fillOpacity,s=t.x,a=t.y,o=t.width,l=t.height,c=t.ry;return E.createElement("rect",{x:s,y:a,ry:c,width:o,height:l,stroke:"none",fill:n,fillOpacity:r,className:"recharts-cartesian-grid-bg"})};function U6(e,t){var n;if(E.isValidElement(e))n=E.cloneElement(e,t);else if(ht(e))n=e(t);else{var r=t.x1,s=t.y1,a=t.x2,o=t.y2,l=t.key,c=wk(t,fNe),u=Xe(c,!1);u.offset;var d=wk(u,hNe);n=E.createElement("line",dl({},d,{x1:r,y1:s,x2:a,y2:o,fill:"none",key:l}))}return n}function xNe(e){var t=e.x,n=e.width,r=e.horizontal,s=r===void 0?!0:r,a=e.horizontalPoints;if(!s||!a||!a.length)return null;var o=a.map(function(l,c){var u=vr(vr({},e),{},{x1:t,y1:l,x2:t+n,y2:l,key:"line-".concat(c),index:c});return U6(s,u)});return E.createElement("g",{className:"recharts-cartesian-grid-horizontal"},o)}function bNe(e){var t=e.y,n=e.height,r=e.vertical,s=r===void 0?!0:r,a=e.verticalPoints;if(!s||!a||!a.length)return null;var o=a.map(function(l,c){var u=vr(vr({},e),{},{x1:l,y1:t,x2:l,y2:t+n,key:"line-".concat(c),index:c});return U6(s,u)});return E.createElement("g",{className:"recharts-cartesian-grid-vertical"},o)}function wNe(e){var t=e.horizontalFill,n=e.fillOpacity,r=e.x,s=e.y,a=e.width,o=e.height,l=e.horizontalPoints,c=e.horizontal,u=c===void 0?!0:c;if(!u||!t||!t.length)return null;var d=l.map(function(h){return Math.round(h+s-s)}).sort(function(h,p){return h-p});s!==d[0]&&d.unshift(0);var f=d.map(function(h,p){var g=!d[p+1],m=g?s+o-h:d[p+1]-h;if(m<=0)return null;var y=p%t.length;return E.createElement("rect",{key:"react-".concat(p),y:h,x:r,height:m,width:a,stroke:"none",fill:t[y],fillOpacity:n,className:"recharts-cartesian-grid-bg"})});return E.createElement("g",{className:"recharts-cartesian-gridstripes-horizontal"},f)}function jNe(e){var t=e.vertical,n=t===void 0?!0:t,r=e.verticalFill,s=e.fillOpacity,a=e.x,o=e.y,l=e.width,c=e.height,u=e.verticalPoints;if(!n||!r||!r.length)return null;var d=u.map(function(h){return Math.round(h+a-a)}).sort(function(h,p){return h-p});a!==d[0]&&d.unshift(0);var f=d.map(function(h,p){var g=!d[p+1],m=g?a+l-h:d[p+1]-h;if(m<=0)return null;var y=p%r.length;return E.createElement("rect",{key:"react-".concat(p),x:h,y:o,width:m,height:c,stroke:"none",fill:r[y],fillOpacity:s,className:"recharts-cartesian-grid-bg"})});return E.createElement("g",{className:"recharts-cartesian-gridstripes-vertical"},f)}var SNe=function(t,n){var r=t.xAxis,s=t.width,a=t.height,o=t.offset;return kF(H_(vr(vr(vr({},vd.defaultProps),r),{},{ticks:si(r,!0),viewBox:{x:0,y:0,width:s,height:a}})),o.left,o.left+o.width,n)},NNe=function(t,n){var r=t.yAxis,s=t.width,a=t.height,o=t.offset;return kF(H_(vr(vr(vr({},vd.defaultProps),r),{},{ticks:si(r,!0),viewBox:{x:0,y:0,width:s,height:a}})),o.top,o.top+o.height,n)},uc={horizontal:!0,vertical:!0,horizontalPoints:[],verticalPoints:[],stroke:"#ccc",fill:"none",verticalFill:[],horizontalFill:[]};function Vh(e){var t,n,r,s,a,o,l=z_(),c=U_(),u=dSe(),d=vr(vr({},e),{},{stroke:(t=e.stroke)!==null&&t!==void 0?t:uc.stroke,fill:(n=e.fill)!==null&&n!==void 0?n:uc.fill,horizontal:(r=e.horizontal)!==null&&r!==void 0?r:uc.horizontal,horizontalFill:(s=e.horizontalFill)!==null&&s!==void 0?s:uc.horizontalFill,vertical:(a=e.vertical)!==null&&a!==void 0?a:uc.vertical,verticalFill:(o=e.verticalFill)!==null&&o!==void 0?o:uc.verticalFill,x:Ae(e.x)?e.x:u.left,y:Ae(e.y)?e.y:u.top,width:Ae(e.width)?e.width:u.width,height:Ae(e.height)?e.height:u.height}),f=d.x,h=d.y,p=d.width,g=d.height,m=d.syncWithTicks,y=d.horizontalValues,b=d.verticalValues,x=lSe(),w=cSe();if(!Ae(p)||p<=0||!Ae(g)||g<=0||!Ae(f)||f!==+f||!Ae(h)||h!==+h)return null;var j=d.verticalCoordinatesGenerator||SNe,S=d.horizontalCoordinatesGenerator||NNe,N=d.horizontalPoints,_=d.verticalPoints;if((!N||!N.length)&&ht(S)){var P=y&&y.length,k=S({yAxis:w?vr(vr({},w),{},{ticks:P?y:w.ticks}):void 0,width:l,height:c,offset:u},P?!0:m);Js(Array.isArray(k),"horizontalCoordinatesGenerator should return Array but instead it returned [".concat(Hl(k),"]")),Array.isArray(k)&&(N=k)}if((!_||!_.length)&&ht(j)){var O=b&&b.length,M=j({xAxis:x?vr(vr({},x),{},{ticks:O?b:x.ticks}):void 0,width:l,height:c,offset:u},O?!0:m);Js(Array.isArray(M),"verticalCoordinatesGenerator should return Array but instead it returned [".concat(Hl(M),"]")),Array.isArray(M)&&(_=M)}return E.createElement("g",{className:"recharts-cartesian-grid"},E.createElement(yNe,{fill:d.fill,fillOpacity:d.fillOpacity,x:d.x,y:d.y,width:d.width,height:d.height,ry:d.ry}),E.createElement(xNe,dl({},d,{offset:u,horizontalPoints:N,xAxis:x,yAxis:w})),E.createElement(bNe,dl({},d,{offset:u,verticalPoints:_,xAxis:x,yAxis:w})),E.createElement(wNe,dl({},d,{horizontalPoints:N})),E.createElement(jNe,dl({},d,{verticalPoints:_})))}Vh.displayName="CartesianGrid";var _Ne=["layout","type","stroke","connectNulls","isRange","ref"],PNe=["key"],V6;function Iu(e){"@babel/helpers - typeof";return Iu=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Iu(e)}function W6(e,t){if(e==null)return{};var n=ANe(e,t),r,s;if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(s=0;s=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(n[r]=e[r])}return n}function ANe(e,t){if(e==null)return{};var n={};for(var r in e)if(Object.prototype.hasOwnProperty.call(e,r)){if(t.indexOf(r)>=0)continue;n[r]=e[r]}return n}function fl(){return fl=Object.assign?Object.assign.bind():function(e){for(var t=1;t0||!Ul(d,o)||!Ul(f,l))?this.renderAreaWithAnimation(r,s):this.renderAreaStatically(o,l,r,s)}},{key:"render",value:function(){var r,s=this.props,a=s.hide,o=s.dot,l=s.points,c=s.className,u=s.top,d=s.left,f=s.xAxis,h=s.yAxis,p=s.width,g=s.height,m=s.isAnimationActive,y=s.id;if(a||!l||!l.length)return null;var b=this.state.isAnimationFinished,x=l.length===1,w=wt("recharts-area",c),j=f&&f.allowDataOverflow,S=h&&h.allowDataOverflow,N=j||S,_=Nt(y)?this.id:y,P=(r=Xe(o,!1))!==null&&r!==void 0?r:{r:3,strokeWidth:2},k=P.r,O=k===void 0?3:k,M=P.strokeWidth,A=M===void 0?2:M,$=Xne(o)?o:{},L=$.clipDot,H=L===void 0?!0:L,D=O*2+A;return E.createElement(Rt,{className:w},j||S?E.createElement("defs",null,E.createElement("clipPath",{id:"clipPath-".concat(_)},E.createElement("rect",{x:j?d:d-p/2,y:S?u:u-g/2,width:j?p:p*2,height:S?g:g*2})),!H&&E.createElement("clipPath",{id:"clipPath-dots-".concat(_)},E.createElement("rect",{x:d-D/2,y:u-D/2,width:p+D,height:g+D}))):null,x?null:this.renderArea(N,_),(o||x)&&this.renderDots(N,H,_),(!m||b)&&Ea.renderCallByParent(this.props,l))}}],[{key:"getDerivedStateFromProps",value:function(r,s){return r.animationId!==s.prevAnimationId?{prevAnimationId:r.animationId,curPoints:r.points,curBaseLine:r.baseLine,prevPoints:s.curPoints,prevBaseLine:s.curBaseLine}:r.points!==s.curPoints||r.baseLine!==s.curBaseLine?{curPoints:r.points,curBaseLine:r.baseLine}:null}}])}(v.PureComponent);V6=ta;Na(ta,"displayName","Area");Na(ta,"defaultProps",{stroke:"#3182bd",fill:"#3182bd",fillOpacity:.6,xAxisId:0,yAxisId:0,legendType:"line",connectNulls:!1,points:[],dot:!1,activeDot:!0,hide:!1,isAnimationActive:!ea.isSsr,animationBegin:0,animationDuration:1500,animationEasing:"ease"});Na(ta,"getBaseValue",function(e,t,n,r){var s=e.layout,a=e.baseValue,o=t.props.baseValue,l=o??a;if(Ae(l)&&typeof l=="number")return l;var c=s==="horizontal"?r:n,u=c.scale.domain();if(c.type==="number"){var d=Math.max(u[0],u[1]),f=Math.min(u[0],u[1]);return l==="dataMin"?f:l==="dataMax"||d<0?d:Math.max(Math.min(u[0],u[1]),0)}return l==="dataMin"?u[0]:l==="dataMax"?u[1]:u[0]});Na(ta,"getComposedData",function(e){var t=e.props,n=e.item,r=e.xAxis,s=e.yAxis,a=e.xAxisTicks,o=e.yAxisTicks,l=e.bandSize,c=e.dataKey,u=e.stackedData,d=e.dataStartIndex,f=e.displayedData,h=e.offset,p=t.layout,g=u&&u.length,m=V6.getBaseValue(t,n,r,s),y=p==="horizontal",b=!1,x=f.map(function(j,S){var N;g?N=u[d+S]:(N=En(j,c),Array.isArray(N)?b=!0:N=[m,N]);var _=N[1]==null||g&&En(j,c)==null;return y?{x:H2({axis:r,ticks:a,bandSize:l,entry:j,index:S}),y:_?null:s.scale(N[1]),value:N,payload:j}:{x:_?null:r.scale(N[1]),y:H2({axis:s,ticks:o,bandSize:l,entry:j,index:S}),value:N,payload:j}}),w;return g||b?w=x.map(function(j){var S=Array.isArray(j.value)?j.value[0]:null;return y?{x:j.x,y:S!=null&&j.y!=null?s.scale(S):null}:{x:S!=null?r.scale(S):null,y:j.y}}):w=y?s.scale(m):r.scale(m),Ri({points:x,baseLine:w,layout:p,isRange:b},h)});Na(ta,"renderDotItem",function(e,t){var n;if(E.isValidElement(e))n=E.cloneElement(e,t);else if(ht(e))n=e(t);else{var r=wt("recharts-area-dot",typeof e!="boolean"?e.className:""),s=t.key,a=W6(t,PNe);n=E.createElement(jp,fl({},a,{key:s,className:r}))}return n});function Ru(e){"@babel/helpers - typeof";return Ru=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Ru(e)}function INe(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function RNe(e,t){for(var n=0;ne.length)&&(t=e.length);for(var n=0,r=new Array(t);n=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(n[r]=e[r])}return n}function j_e(e,t){if(e==null)return{};var n={};for(var r in e)if(Object.prototype.hasOwnProperty.call(e,r)){if(t.indexOf(r)>=0)continue;n[r]=e[r]}return n}function S_e(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function N_e(e,t){for(var n=0;ne.length)&&(t=e.length);for(var n=0,r=new Array(t);n0?o:t&&t.length&&Ae(s)&&Ae(a)?t.slice(s,a+1):[]};function iB(e){return e==="number"?[0,"auto"]:void 0}var vj=function(t,n,r,s){var a=t.graphicalItems,o=t.tooltipAxis,l=kx(n,t);return r<0||!a||!a.length||r>=l.length?null:a.reduce(function(c,u){var d,f=(d=u.props.data)!==null&&d!==void 0?d:n;f&&t.dataStartIndex+t.dataEndIndex!==0&&t.dataEndIndex-t.dataStartIndex>=r&&(f=f.slice(t.dataStartIndex,t.dataEndIndex+1));var h;if(o.dataKey&&!o.allowDuplicatedCategory){var p=f===void 0?l:f;h=zg(p,o.dataKey,s)}else h=f&&f[r]||l[r];return h?[].concat(Fu(c),[RF(u,h)]):c},[])},Ek=function(t,n,r,s){var a=s||{x:t.chartX,y:t.chartY},o=R_e(a,r),l=t.orderedTooltipTicks,c=t.tooltipAxis,u=t.tooltipTicks,d=Yve(o,l,u,c);if(d>=0&&u){var f=u[d]&&u[d].value,h=vj(t,n,d,f),p=D_e(r,l,d,a);return{activeTooltipIndex:d,activeLabel:f,activePayload:h,activeCoordinate:p}}return null},L_e=function(t,n){var r=n.axes,s=n.graphicalItems,a=n.axisType,o=n.axisIdKey,l=n.stackGroups,c=n.dataStartIndex,u=n.dataEndIndex,d=t.layout,f=t.children,h=t.stackOffset,p=OF(d,a);return r.reduce(function(g,m){var y,b=m.type.defaultProps!==void 0?ue(ue({},m.type.defaultProps),m.props):m.props,x=b.type,w=b.dataKey,j=b.allowDataOverflow,S=b.allowDuplicatedCategory,N=b.scale,_=b.ticks,P=b.includeHidden,k=b[o];if(g[k])return g;var O=kx(t.data,{graphicalItems:s.filter(function(re){var ge,B=o in re.props?re.props[o]:(ge=re.type.defaultProps)===null||ge===void 0?void 0:ge[o];return B===k}),dataStartIndex:c,dataEndIndex:u}),M=O.length,A,$,L;u_e(b.domain,j,x)&&(A=k1(b.domain,null,j),p&&(x==="number"||N!=="auto")&&(L=hf(O,w,"category")));var H=iB(x);if(!A||A.length===0){var D,V=(D=b.domain)!==null&&D!==void 0?D:H;if(w){if(A=hf(O,w,x),x==="category"&&p){var T=Bne(A);S&&T?($=A,A=Ev(0,M)):S||(A=X2(V,A,m).reduce(function(re,ge){return re.indexOf(ge)>=0?re:[].concat(Fu(re),[ge])},[]))}else if(x==="category")S?A=A.filter(function(re){return re!==""&&!Nt(re)}):A=X2(V,A,m).reduce(function(re,ge){return re.indexOf(ge)>=0||ge===""||Nt(ge)?re:[].concat(Fu(re),[ge])},[]);else if(x==="number"){var F=tye(O,s.filter(function(re){var ge,B,le=o in re.props?re.props[o]:(ge=re.type.defaultProps)===null||ge===void 0?void 0:ge[o],se="hide"in re.props?re.props.hide:(B=re.type.defaultProps)===null||B===void 0?void 0:B.hide;return le===k&&(P||!se)}),w,a,d);F&&(A=F)}p&&(x==="number"||N!=="auto")&&(L=hf(O,w,"category"))}else p?A=Ev(0,M):l&&l[k]&&l[k].hasStack&&x==="number"?A=h==="expand"?[0,1]:IF(l[k].stackGroups,c,u):A=EF(O,s.filter(function(re){var ge=o in re.props?re.props[o]:re.type.defaultProps[o],B="hide"in re.props?re.props.hide:re.type.defaultProps.hide;return ge===k&&(P||!B)}),x,d,!0);if(x==="number")A=pj(f,A,k,a,_),V&&(A=k1(V,A,j));else if(x==="category"&&V){var q=V,Z=A.every(function(re){return q.indexOf(re)>=0});Z&&(A=q)}}return ue(ue({},g),{},vt({},k,ue(ue({},b),{},{axisType:a,domain:A,categoricalDomain:L,duplicateDomain:$,originalDomain:(y=b.domain)!==null&&y!==void 0?y:H,isCategorical:p,layout:d})))},{})},F_e=function(t,n){var r=n.graphicalItems,s=n.Axis,a=n.axisType,o=n.axisIdKey,l=n.stackGroups,c=n.dataStartIndex,u=n.dataEndIndex,d=t.layout,f=t.children,h=kx(t.data,{graphicalItems:r,dataStartIndex:c,dataEndIndex:u}),p=h.length,g=OF(d,a),m=-1;return r.reduce(function(y,b){var x=b.type.defaultProps!==void 0?ue(ue({},b.type.defaultProps),b.props):b.props,w=x[o],j=iB("number");if(!y[w]){m++;var S;return g?S=Ev(0,p):l&&l[w]&&l[w].hasStack?(S=IF(l[w].stackGroups,c,u),S=pj(f,S,w,a)):(S=k1(j,EF(h,r.filter(function(N){var _,P,k=o in N.props?N.props[o]:(_=N.type.defaultProps)===null||_===void 0?void 0:_[o],O="hide"in N.props?N.props.hide:(P=N.type.defaultProps)===null||P===void 0?void 0:P.hide;return k===w&&!O}),"number",d),s.defaultProps.allowDataOverflow),S=pj(f,S,w,a)),ue(ue({},y),{},vt({},w,ue(ue({axisType:a},s.defaultProps),{},{hide:!0,orientation:ls(M_e,"".concat(a,".").concat(m%2),null),domain:S,originalDomain:j,isCategorical:g,layout:d})))}return y},{})},B_e=function(t,n){var r=n.axisType,s=r===void 0?"xAxis":r,a=n.AxisComp,o=n.graphicalItems,l=n.stackGroups,c=n.dataStartIndex,u=n.dataEndIndex,d=t.children,f="".concat(s,"Id"),h=Ps(d,a),p={};return h&&h.length?p=L_e(t,{axes:h,graphicalItems:o,axisType:s,axisIdKey:f,stackGroups:l,dataStartIndex:c,dataEndIndex:u}):o&&o.length&&(p=F_e(t,{Axis:a,graphicalItems:o,axisType:s,axisIdKey:f,stackGroups:l,dataStartIndex:c,dataEndIndex:u})),p},z_e=function(t){var n=Hi(t),r=si(n,!1,!0);return{tooltipTicks:r,orderedTooltipTicks:u_(r,function(s){return s.coordinate}),tooltipAxis:n,tooltipAxisBandSize:mv(n,r)}},Ok=function(t){var n=t.children,r=t.defaultShowTooltip,s=es(n,Eu),a=0,o=0;return t.data&&t.data.length!==0&&(o=t.data.length-1),s&&s.props&&(s.props.startIndex>=0&&(a=s.props.startIndex),s.props.endIndex>=0&&(o=s.props.endIndex)),{chartX:0,chartY:0,dataStartIndex:a,dataEndIndex:o,activeTooltipIndex:-1,isTooltipActive:!!r}},U_e=function(t){return!t||!t.length?!1:t.some(function(n){var r=li(n&&n.type);return r&&r.indexOf("Bar")>=0})},kk=function(t){return t==="horizontal"?{numericAxisName:"yAxis",cateAxisName:"xAxis"}:t==="vertical"?{numericAxisName:"xAxis",cateAxisName:"yAxis"}:t==="centric"?{numericAxisName:"radiusAxis",cateAxisName:"angleAxis"}:{numericAxisName:"angleAxis",cateAxisName:"radiusAxis"}},V_e=function(t,n){var r=t.props,s=t.graphicalItems,a=t.xAxisMap,o=a===void 0?{}:a,l=t.yAxisMap,c=l===void 0?{}:l,u=r.width,d=r.height,f=r.children,h=r.margin||{},p=es(f,Eu),g=es(f,ci),m=Object.keys(c).reduce(function(S,N){var _=c[N],P=_.orientation;return!_.mirror&&!_.hide?ue(ue({},S),{},vt({},P,S[P]+_.width)):S},{left:h.left||0,right:h.right||0}),y=Object.keys(o).reduce(function(S,N){var _=o[N],P=_.orientation;return!_.mirror&&!_.hide?ue(ue({},S),{},vt({},P,ls(S,"".concat(P))+_.height)):S},{top:h.top||0,bottom:h.bottom||0}),b=ue(ue({},y),m),x=b.bottom;p&&(b.bottom+=p.props.height||Eu.defaultProps.height),g&&n&&(b=Jve(b,s,r,n));var w=u-b.left-b.right,j=d-b.top-b.bottom;return ue(ue({brushBottom:x},b),{},{width:Math.max(w,0),height:Math.max(j,0)})},W_e=function(t,n){if(n==="xAxis")return t[n].width;if(n==="yAxis")return t[n].height},Tx=function(t){var n=t.chartName,r=t.GraphicalChild,s=t.defaultTooltipEventType,a=s===void 0?"axis":s,o=t.validateTooltipEventTypes,l=o===void 0?["axis"]:o,c=t.axisComponents,u=t.legendContent,d=t.formatAxisMap,f=t.defaultProps,h=function(y,b){var x=b.graphicalItems,w=b.stackGroups,j=b.offset,S=b.updateId,N=b.dataStartIndex,_=b.dataEndIndex,P=y.barSize,k=y.layout,O=y.barGap,M=y.barCategoryGap,A=y.maxBarSize,$=kk(k),L=$.numericAxisName,H=$.cateAxisName,D=U_e(x),V=[];return x.forEach(function(T,F){var q=kx(y.data,{graphicalItems:[T],dataStartIndex:N,dataEndIndex:_}),Z=T.type.defaultProps!==void 0?ue(ue({},T.type.defaultProps),T.props):T.props,re=Z.dataKey,ge=Z.maxBarSize,B=Z["".concat(L,"Id")],le=Z["".concat(H,"Id")],se={},ce=c.reduce(function(U,X){var Q=b["".concat(X.axisType,"Map")],z=Z["".concat(X.axisType,"Id")];Q&&Q[z]||X.axisType==="zAxis"||Wl();var ee=Q[z];return ue(ue({},U),{},vt(vt({},X.axisType,ee),"".concat(X.axisType,"Ticks"),si(ee)))},se),De=ce[H],de=ce["".concat(H,"Ticks")],be=w&&w[B]&&w[B].hasStack&&uye(T,w[B].stackGroups),Pe=li(T.type).indexOf("Bar")>=0,ne=mv(De,de),Je=[],ve=D&&Zve({barSize:P,stackGroups:w,totalSize:W_e(ce,H)});if(Pe){var at,st,Mt=Nt(ge)?A:ge,C=(at=(st=mv(De,de,!0))!==null&&st!==void 0?st:Mt)!==null&&at!==void 0?at:0;Je=Qve({barGap:O,barCategoryGap:M,bandSize:C!==ne?C:ne,sizeList:ve[le],maxBarSize:Mt}),C!==ne&&(Je=Je.map(function(U){return ue(ue({},U),{},{position:ue(ue({},U.position),{},{offset:U.position.offset-C/2})})}))}var R=T&&T.type&&T.type.getComposedData;R&&V.push({props:ue(ue({},R(ue(ue({},ce),{},{displayedData:q,props:y,dataKey:re,item:T,bandSize:ne,barPosition:Je,offset:j,stackedData:be,layout:k,dataStartIndex:N,dataEndIndex:_}))),{},vt(vt(vt({key:T.key||"item-".concat(F)},L,ce[L]),H,ce[H]),"animationId",S)),childIndex:Qne(T,y.children),item:T})}),V},p=function(y,b){var x=y.props,w=y.dataStartIndex,j=y.dataEndIndex,S=y.updateId;if(!UC({props:x}))return null;var N=x.children,_=x.layout,P=x.stackOffset,k=x.data,O=x.reverseStackOrder,M=kk(_),A=M.numericAxisName,$=M.cateAxisName,L=Ps(N,r),H=lye(k,L,"".concat(A,"Id"),"".concat($,"Id"),P,O),D=c.reduce(function(Z,re){var ge="".concat(re.axisType,"Map");return ue(ue({},Z),{},vt({},ge,B_e(x,ue(ue({},re),{},{graphicalItems:L,stackGroups:re.axisType===A&&H,dataStartIndex:w,dataEndIndex:j}))))},{}),V=V_e(ue(ue({},D),{},{props:x,graphicalItems:L}),b==null?void 0:b.legendBBox);Object.keys(D).forEach(function(Z){D[Z]=d(x,D[Z],V,Z.replace("Map",""),n)});var T=D["".concat($,"Map")],F=z_e(T),q=h(x,ue(ue({},D),{},{dataStartIndex:w,dataEndIndex:j,updateId:S,graphicalItems:L,stackGroups:H,offset:V}));return ue(ue({formattedGraphicalItems:q,graphicalItems:L,offset:V,stackGroups:H},F),D)},g=function(m){function y(b){var x,w,j;return S_e(this,y),j=P_e(this,y,[b]),vt(j,"eventEmitterSymbol",Symbol("rechartsEventEmitter")),vt(j,"accessibilityManager",new c_e),vt(j,"handleLegendBBoxUpdate",function(S){if(S){var N=j.state,_=N.dataStartIndex,P=N.dataEndIndex,k=N.updateId;j.setState(ue({legendBBox:S},p({props:j.props,dataStartIndex:_,dataEndIndex:P,updateId:k},ue(ue({},j.state),{},{legendBBox:S}))))}}),vt(j,"handleReceiveSyncEvent",function(S,N,_){if(j.props.syncId===S){if(_===j.eventEmitterSymbol&&typeof j.props.syncMethod!="function")return;j.applySyncEvent(N)}}),vt(j,"handleBrushChange",function(S){var N=S.startIndex,_=S.endIndex;if(N!==j.state.dataStartIndex||_!==j.state.dataEndIndex){var P=j.state.updateId;j.setState(function(){return ue({dataStartIndex:N,dataEndIndex:_},p({props:j.props,dataStartIndex:N,dataEndIndex:_,updateId:P},j.state))}),j.triggerSyncEvent({dataStartIndex:N,dataEndIndex:_})}}),vt(j,"handleMouseEnter",function(S){var N=j.getMouseInfo(S);if(N){var _=ue(ue({},N),{},{isTooltipActive:!0});j.setState(_),j.triggerSyncEvent(_);var P=j.props.onMouseEnter;ht(P)&&P(_,S)}}),vt(j,"triggeredAfterMouseMove",function(S){var N=j.getMouseInfo(S),_=N?ue(ue({},N),{},{isTooltipActive:!0}):{isTooltipActive:!1};j.setState(_),j.triggerSyncEvent(_);var P=j.props.onMouseMove;ht(P)&&P(_,S)}),vt(j,"handleItemMouseEnter",function(S){j.setState(function(){return{isTooltipActive:!0,activeItem:S,activePayload:S.tooltipPayload,activeCoordinate:S.tooltipPosition||{x:S.cx,y:S.cy}}})}),vt(j,"handleItemMouseLeave",function(){j.setState(function(){return{isTooltipActive:!1}})}),vt(j,"handleMouseMove",function(S){S.persist(),j.throttleTriggeredAfterMouseMove(S)}),vt(j,"handleMouseLeave",function(S){j.throttleTriggeredAfterMouseMove.cancel();var N={isTooltipActive:!1};j.setState(N),j.triggerSyncEvent(N);var _=j.props.onMouseLeave;ht(_)&&_(N,S)}),vt(j,"handleOuterEvent",function(S){var N=Zne(S),_=ls(j.props,"".concat(N));if(N&&ht(_)){var P,k;/.*touch.*/i.test(N)?k=j.getMouseInfo(S.changedTouches[0]):k=j.getMouseInfo(S),_((P=k)!==null&&P!==void 0?P:{},S)}}),vt(j,"handleClick",function(S){var N=j.getMouseInfo(S);if(N){var _=ue(ue({},N),{},{isTooltipActive:!0});j.setState(_),j.triggerSyncEvent(_);var P=j.props.onClick;ht(P)&&P(_,S)}}),vt(j,"handleMouseDown",function(S){var N=j.props.onMouseDown;if(ht(N)){var _=j.getMouseInfo(S);N(_,S)}}),vt(j,"handleMouseUp",function(S){var N=j.props.onMouseUp;if(ht(N)){var _=j.getMouseInfo(S);N(_,S)}}),vt(j,"handleTouchMove",function(S){S.changedTouches!=null&&S.changedTouches.length>0&&j.throttleTriggeredAfterMouseMove(S.changedTouches[0])}),vt(j,"handleTouchStart",function(S){S.changedTouches!=null&&S.changedTouches.length>0&&j.handleMouseDown(S.changedTouches[0])}),vt(j,"handleTouchEnd",function(S){S.changedTouches!=null&&S.changedTouches.length>0&&j.handleMouseUp(S.changedTouches[0])}),vt(j,"triggerSyncEvent",function(S){j.props.syncId!==void 0&&J0.emit(eb,j.props.syncId,S,j.eventEmitterSymbol)}),vt(j,"applySyncEvent",function(S){var N=j.props,_=N.layout,P=N.syncMethod,k=j.state.updateId,O=S.dataStartIndex,M=S.dataEndIndex;if(S.dataStartIndex!==void 0||S.dataEndIndex!==void 0)j.setState(ue({dataStartIndex:O,dataEndIndex:M},p({props:j.props,dataStartIndex:O,dataEndIndex:M,updateId:k},j.state)));else if(S.activeTooltipIndex!==void 0){var A=S.chartX,$=S.chartY,L=S.activeTooltipIndex,H=j.state,D=H.offset,V=H.tooltipTicks;if(!D)return;if(typeof P=="function")L=P(V,S);else if(P==="value"){L=-1;for(var T=0;T=0){var be,Pe;if(A.dataKey&&!A.allowDuplicatedCategory){var ne=typeof A.dataKey=="function"?de:"payload.".concat(A.dataKey.toString());be=zg(T,ne,L),Pe=F&&q&&zg(q,ne,L)}else be=T==null?void 0:T[$],Pe=F&&q&&q[$];if(le||B){var Je=S.props.activeIndex!==void 0?S.props.activeIndex:$;return[v.cloneElement(S,ue(ue(ue({},P.props),ce),{},{activeIndex:Je})),null,null]}if(!Nt(be))return[De].concat(Fu(j.renderActivePoints({item:P,activePoint:be,basePoint:Pe,childIndex:$,isRange:F})))}else{var ve,at=(ve=j.getItemByXY(j.state.activeCoordinate))!==null&&ve!==void 0?ve:{graphicalItem:De},st=at.graphicalItem,Mt=st.item,C=Mt===void 0?S:Mt,R=st.childIndex,U=ue(ue(ue({},P.props),ce),{},{activeIndex:R});return[v.cloneElement(C,U),null,null]}return F?[De,null,null]:[De,null]}),vt(j,"renderCustomized",function(S,N,_){return v.cloneElement(S,ue(ue({key:"recharts-customized-".concat(_)},j.props),j.state))}),vt(j,"renderMap",{CartesianGrid:{handler:dm,once:!0},ReferenceArea:{handler:j.renderReferenceElement},ReferenceLine:{handler:dm},ReferenceDot:{handler:j.renderReferenceElement},XAxis:{handler:dm},YAxis:{handler:dm},Brush:{handler:j.renderBrush,once:!0},Bar:{handler:j.renderGraphicChild},Line:{handler:j.renderGraphicChild},Area:{handler:j.renderGraphicChild},Radar:{handler:j.renderGraphicChild},RadialBar:{handler:j.renderGraphicChild},Scatter:{handler:j.renderGraphicChild},Pie:{handler:j.renderGraphicChild},Funnel:{handler:j.renderGraphicChild},Tooltip:{handler:j.renderCursor,once:!0},PolarGrid:{handler:j.renderPolarGrid,once:!0},PolarAngleAxis:{handler:j.renderPolarAxis},PolarRadiusAxis:{handler:j.renderPolarAxis},Customized:{handler:j.renderCustomized}}),j.clipPathId="".concat((x=b.id)!==null&&x!==void 0?x:od("recharts"),"-clip"),j.throttleTriggeredAfterMouseMove=P5(j.triggeredAfterMouseMove,(w=b.throttleDelay)!==null&&w!==void 0?w:1e3/60),j.state={},j}return E_e(y,m),__e(y,[{key:"componentDidMount",value:function(){var x,w;this.addListener(),this.accessibilityManager.setDetails({container:this.container,offset:{left:(x=this.props.margin.left)!==null&&x!==void 0?x:0,top:(w=this.props.margin.top)!==null&&w!==void 0?w:0},coordinateList:this.state.tooltipTicks,mouseHandlerCallback:this.triggeredAfterMouseMove,layout:this.props.layout}),this.displayDefaultTooltip()}},{key:"displayDefaultTooltip",value:function(){var x=this.props,w=x.children,j=x.data,S=x.height,N=x.layout,_=es(w,mr);if(_){var P=_.props.defaultIndex;if(!(typeof P!="number"||P<0||P>this.state.tooltipTicks.length-1)){var k=this.state.tooltipTicks[P]&&this.state.tooltipTicks[P].value,O=vj(this.state,j,P,k),M=this.state.tooltipTicks[P].coordinate,A=(this.state.offset.top+S)/2,$=N==="horizontal",L=$?{x:M,y:A}:{y:M,x:A},H=this.state.formattedGraphicalItems.find(function(V){var T=V.item;return T.type.name==="Scatter"});H&&(L=ue(ue({},L),H.props.points[P].tooltipPosition),O=H.props.points[P].tooltipPayload);var D={activeTooltipIndex:P,isTooltipActive:!0,activeLabel:k,activePayload:O,activeCoordinate:L};this.setState(D),this.renderCursor(_),this.accessibilityManager.setIndex(P)}}}},{key:"getSnapshotBeforeUpdate",value:function(x,w){if(!this.props.accessibilityLayer)return null;if(this.state.tooltipTicks!==w.tooltipTicks&&this.accessibilityManager.setDetails({coordinateList:this.state.tooltipTicks}),this.props.layout!==x.layout&&this.accessibilityManager.setDetails({layout:this.props.layout}),this.props.margin!==x.margin){var j,S;this.accessibilityManager.setDetails({offset:{left:(j=this.props.margin.left)!==null&&j!==void 0?j:0,top:(S=this.props.margin.top)!==null&&S!==void 0?S:0}})}return null}},{key:"componentDidUpdate",value:function(x){Gw([es(x.children,mr)],[es(this.props.children,mr)])||this.displayDefaultTooltip()}},{key:"componentWillUnmount",value:function(){this.removeListener(),this.throttleTriggeredAfterMouseMove.cancel()}},{key:"getTooltipEventType",value:function(){var x=es(this.props.children,mr);if(x&&typeof x.props.shared=="boolean"){var w=x.props.shared?"axis":"item";return l.indexOf(w)>=0?w:a}return a}},{key:"getMouseInfo",value:function(x){if(!this.container)return null;var w=this.container,j=w.getBoundingClientRect(),S=Nhe(j),N={chartX:Math.round(x.pageX-S.left),chartY:Math.round(x.pageY-S.top)},_=j.width/w.offsetWidth||1,P=this.inRange(N.chartX,N.chartY,_);if(!P)return null;var k=this.state,O=k.xAxisMap,M=k.yAxisMap,A=this.getTooltipEventType();if(A!=="axis"&&O&&M){var $=Hi(O).scale,L=Hi(M).scale,H=$&&$.invert?$.invert(N.chartX):null,D=L&&L.invert?L.invert(N.chartY):null;return ue(ue({},N),{},{xValue:H,yValue:D})}var V=Ek(this.state,this.props.data,this.props.layout,P);return V?ue(ue({},N),V):null}},{key:"inRange",value:function(x,w){var j=arguments.length>2&&arguments[2]!==void 0?arguments[2]:1,S=this.props.layout,N=x/j,_=w/j;if(S==="horizontal"||S==="vertical"){var P=this.state.offset,k=N>=P.left&&N<=P.left+P.width&&_>=P.top&&_<=P.top+P.height;return k?{x:N,y:_}:null}var O=this.state,M=O.angleAxisMap,A=O.radiusAxisMap;if(M&&A){var $=Hi(M);return Q2({x:N,y:_},$)}return null}},{key:"parseEventsOfWrapper",value:function(){var x=this.props.children,w=this.getTooltipEventType(),j=es(x,mr),S={};j&&w==="axis"&&(j.props.trigger==="click"?S={onClick:this.handleClick}:S={onMouseEnter:this.handleMouseEnter,onMouseMove:this.handleMouseMove,onMouseLeave:this.handleMouseLeave,onTouchMove:this.handleTouchMove,onTouchStart:this.handleTouchStart,onTouchEnd:this.handleTouchEnd});var N=Ug(this.props,this.handleOuterEvent);return ue(ue({},N),S)}},{key:"addListener",value:function(){J0.on(eb,this.handleReceiveSyncEvent)}},{key:"removeListener",value:function(){J0.removeListener(eb,this.handleReceiveSyncEvent)}},{key:"filterFormatItem",value:function(x,w,j){for(var S=this.state.formattedGraphicalItems,N=0,_=S.length;N<_;N++){var P=S[N];if(P.item===x||P.props.key===x.key||w===li(P.item.type)&&j===P.childIndex)return P}return null}},{key:"renderClipPath",value:function(){var x=this.clipPathId,w=this.state.offset,j=w.left,S=w.top,N=w.height,_=w.width;return E.createElement("defs",null,E.createElement("clipPath",{id:x},E.createElement("rect",{x:j,y:S,height:N,width:_})))}},{key:"getXScales",value:function(){var x=this.state.xAxisMap;return x?Object.entries(x).reduce(function(w,j){var S=Pk(j,2),N=S[0],_=S[1];return ue(ue({},w),{},vt({},N,_.scale))},{}):null}},{key:"getYScales",value:function(){var x=this.state.yAxisMap;return x?Object.entries(x).reduce(function(w,j){var S=Pk(j,2),N=S[0],_=S[1];return ue(ue({},w),{},vt({},N,_.scale))},{}):null}},{key:"getXScaleByAxisId",value:function(x){var w;return(w=this.state.xAxisMap)===null||w===void 0||(w=w[x])===null||w===void 0?void 0:w.scale}},{key:"getYScaleByAxisId",value:function(x){var w;return(w=this.state.yAxisMap)===null||w===void 0||(w=w[x])===null||w===void 0?void 0:w.scale}},{key:"getItemByXY",value:function(x){var w=this.state,j=w.formattedGraphicalItems,S=w.activeItem;if(j&&j.length)for(var N=0,_=j.length;N<_;N++){var P=j[N],k=P.props,O=P.item,M=O.type.defaultProps!==void 0?ue(ue({},O.type.defaultProps),O.props):O.props,A=li(O.type);if(A==="Bar"){var $=(k.data||[]).find(function(V){return K0e(x,V)});if($)return{graphicalItem:P,payload:$}}else if(A==="RadialBar"){var L=(k.data||[]).find(function(V){return Q2(x,V)});if(L)return{graphicalItem:P,payload:L}}else if(Nx(P,S)||_x(P,S)||Lh(P,S)){var H=Gwe({graphicalItem:P,activeTooltipItem:S,itemData:M.data}),D=M.activeIndex===void 0?H:M.activeIndex;return{graphicalItem:ue(ue({},P),{},{childIndex:D}),payload:Lh(P,S)?M.data[H]:P.props.data[H]}}}return null}},{key:"render",value:function(){var x=this;if(!UC(this))return null;var w=this.props,j=w.children,S=w.className,N=w.width,_=w.height,P=w.style,k=w.compact,O=w.title,M=w.desc,A=Ak(w,y_e),$=Xe(A,!1);if(k)return E.createElement(ck,{state:this.state,width:this.props.width,height:this.props.height,clipPathId:this.clipPathId},E.createElement(Kw,vf({},$,{width:N,height:_,title:O,desc:M}),this.renderClipPath(),WC(j,this.renderMap)));if(this.props.accessibilityLayer){var L,H;$.tabIndex=(L=this.props.tabIndex)!==null&&L!==void 0?L:0,$.role=(H=this.props.role)!==null&&H!==void 0?H:"application",$.onKeyDown=function(V){x.accessibilityManager.keyboardEvent(V)},$.onFocus=function(){x.accessibilityManager.focus()}}var D=this.parseEventsOfWrapper();return E.createElement(ck,{state:this.state,width:this.props.width,height:this.props.height,clipPathId:this.clipPathId},E.createElement("div",vf({className:wt("recharts-wrapper",S),style:ue({position:"relative",cursor:"default",width:N,height:_},P)},D,{ref:function(T){x.container=T}}),E.createElement(Kw,vf({},$,{width:N,height:_,title:O,desc:M,style:I_e}),this.renderClipPath(),WC(j,this.renderMap)),this.renderLegend(),this.renderTooltip()))}}])}(v.Component);return vt(g,"displayName",n),vt(g,"defaultProps",ue({layout:"horizontal",stackOffset:"none",barCategoryGap:"10%",barGap:4,margin:{top:5,right:5,bottom:5,left:5},reverseStackOrder:!1,syncMethod:"index"},f)),vt(g,"getDerivedStateFromProps",function(m,y){var b=m.dataKey,x=m.data,w=m.children,j=m.width,S=m.height,N=m.layout,_=m.stackOffset,P=m.margin,k=y.dataStartIndex,O=y.dataEndIndex;if(y.updateId===void 0){var M=Ok(m);return ue(ue(ue({},M),{},{updateId:0},p(ue(ue({props:m},M),{},{updateId:0}),y)),{},{prevDataKey:b,prevData:x,prevWidth:j,prevHeight:S,prevLayout:N,prevStackOffset:_,prevMargin:P,prevChildren:w})}if(b!==y.prevDataKey||x!==y.prevData||j!==y.prevWidth||S!==y.prevHeight||N!==y.prevLayout||_!==y.prevStackOffset||!Uc(P,y.prevMargin)){var A=Ok(m),$={chartX:y.chartX,chartY:y.chartY,isTooltipActive:y.isTooltipActive},L=ue(ue({},Ek(y,x,N)),{},{updateId:y.updateId+1}),H=ue(ue(ue({},A),$),L);return ue(ue(ue({},H),p(ue({props:m},H),y)),{},{prevDataKey:b,prevData:x,prevWidth:j,prevHeight:S,prevLayout:N,prevStackOffset:_,prevMargin:P,prevChildren:w})}if(!Gw(w,y.prevChildren)){var D,V,T,F,q=es(w,Eu),Z=q&&(D=(V=q.props)===null||V===void 0?void 0:V.startIndex)!==null&&D!==void 0?D:k,re=q&&(T=(F=q.props)===null||F===void 0?void 0:F.endIndex)!==null&&T!==void 0?T:O,ge=Z!==k||re!==O,B=!Nt(x),le=B&&!ge?y.updateId:y.updateId+1;return ue(ue({updateId:le},p(ue(ue({props:m},y),{},{updateId:le,dataStartIndex:Z,dataEndIndex:re}),y)),{},{prevChildren:w,dataStartIndex:Z,dataEndIndex:re})}return null}),vt(g,"renderActiveDot",function(m,y,b){var x;return v.isValidElement(m)?x=v.cloneElement(m,y):ht(m)?x=m(y):x=E.createElement(jp,y),E.createElement(Rt,{className:"recharts-active-dot",key:b},x)}),function(y){return E.createElement(g,y)}},oB=Tx({chartName:"BarChart",GraphicalChild:Wo,defaultTooltipEventType:"axis",validateTooltipEventTypes:["axis","item"],axisComponents:[{axisType:"xAxis",AxisComp:ko},{axisType:"yAxis",AxisComp:To}],formatAxisMap:S6}),q_=Tx({chartName:"PieChart",GraphicalChild:da,validateTooltipEventTypes:["item"],defaultTooltipEventType:"item",legendContent:"children",axisComponents:[{axisType:"angleAxis",AxisComp:gd},{axisType:"radiusAxis",AxisComp:md}],formatAxisMap:FF,defaultProps:{layout:"centric",startAngle:0,endAngle:360,cx:"50%",cy:"50%",innerRadius:0,outerRadius:"80%"}}),H_e=Tx({chartName:"RadarChart",GraphicalChild:Sp,axisComponents:[{axisType:"angleAxis",AxisComp:gd},{axisType:"radiusAxis",AxisComp:md}],formatAxisMap:FF,defaultProps:{layout:"centric",startAngle:90,endAngle:-270,cx:"50%",cy:"50%",innerRadius:0,outerRadius:"80%"}}),lB=Tx({chartName:"AreaChart",GraphicalChild:ta,axisComponents:[{axisType:"xAxis",AxisComp:ko},{axisType:"yAxis",AxisComp:To}],formatAxisMap:S6});const G_e=({messages:e,themes:t,personas:n=[]})=>{var g;const[r,s]=v.useState([{name:"Very Positive",value:0,color:"#4ade80"},{name:"Positive",value:0,color:"#a3e635"},{name:"Neutral",value:0,color:"#93c5fd"},{name:"Negative",value:0,color:"#fb923c"},{name:"Very Negative",value:0,color:"#f87171"}]),[a,o]=v.useState([]),[l,c]=v.useState({}),[u,d]=v.useState({isBalanced:!1,score:0,reason:""}),f=m=>{const y=n.find(b=>b.id===m);return y?y.name:`Participant ${m}`};v.useEffect(()=>{if(e.length===0)return;const m={"Very Positive":0,Positive:0,Neutral:0,Negative:0,"Very Negative":0},y={},b={};e.forEach(j=>{if(j.senderId!=="moderator"&&j.senderId!=="facilitator"){const S=j.text.toLowerCase();let N="Neutral";S.includes("love")||S.includes("excellent")||S.includes("amazing")?N="Very Positive":S.includes("good")||S.includes("like")||S.includes("great")?N="Positive":S.includes("bad")||S.includes("issue")||S.includes("problem")?N="Negative":(S.includes("terrible")||S.includes("hate")||S.includes("awful"))&&(N="Very Negative"),m[N]++,b[j.senderId]||(b[j.senderId]={"Very Positive":0,Positive:0,Neutral:0,Negative:0,"Very Negative":0}),b[j.senderId][N]++,y[j.senderId]=(y[j.senderId]||0)+1}}),s(j=>j.map(S=>({...S,value:m[S.name]||0})));const x=Object.entries(y).map(([j,S])=>({name:f(j),messages:S}));o(x);const w={};Object.entries(b).forEach(([j,S])=>{w[j]={name:f(j),sentiments:S}}),c(w),h(y,b)},[e,n,f]);const h=(m,y)=>{if(Object.keys(m).length===0){d({isBalanced:!1,score:0,reason:"No participant data available"});return}const x=Object.values(m).reduce((V,T)=>V+T,0)/Object.keys(m).length,w=Object.values(m).map(V=>Math.abs(V-x)/x),j=w.reduce((V,T)=>V+T,0)/w.length,S=Object.values(y).map(V=>Object.values(V).filter(T=>T>0).length),N=S.reduce((V,T)=>V+T,0)/S.length,_=["Very Positive","Positive","Neutral","Negative","Very Negative"],P=Object.values(y).map(V=>{const T=Math.max(...Object.values(V));return _.find(F=>V[F]===T)||"Neutral"}),k=new Set(P).size,O=k/_.length,M=Math.max(0,100-j*100),A=N/5*100,$=O*100,L=Math.round(M*.6+A*.2+$*.2);let H="";const D=L>=70;j>.3&&(H+="Participation is uneven among participants. "),N<2&&(H+="Limited range of sentiments expressed. "),k<=1?H+="Participants show similar sentiment patterns, suggesting potential group-think. ":k>=4&&(H+="Wide divergence in participant sentiments, showing healthy diversity of opinions. "),H===""&&(H=D?"Good mix of participation and diverse opinions.":"Multiple factors affecting balance."),d({isBalanced:D,score:L,reason:H})},p=m=>{const y=l[m];if(!y)return"N/A";const b=y.sentiments;let x=0,w="Neutral";return Object.entries(b).forEach(([j,S])=>{S>x&&(x=S,w=j)}),w};return i.jsx("div",{className:"glass-panel rounded-xl p-4",children:i.jsxs(Fo,{defaultValue:"sentiment",children:[i.jsxs(Pi,{className:"grid grid-cols-2 mb-4",children:[i.jsxs(Xt,{value:"sentiment",className:"flex items-center",children:[i.jsx(fW,{className:"h-4 w-4 mr-2"}),"Sentiment"]}),i.jsxs(Xt,{value:"participation",className:"flex items-center",children:[i.jsx(cw,{className:"h-4 w-4 mr-2"}),"Participation"]})]}),i.jsx(Yt,{value:"sentiment",children:i.jsx(rt,{children:i.jsxs(bt,{className:"pt-6",children:[i.jsxs("div",{className:"flex items-center justify-between mb-4",children:[i.jsx("h3",{className:"text-lg font-semibold",children:"Sentiment Analysis"}),i.jsxs("div",{className:`px-3 py-1 rounded-full text-sm ${u.isBalanced?"bg-green-100 text-green-800":"bg-amber-100 text-amber-800"}`,children:["Balance score: ",u.score,"/100"]})]}),i.jsx("div",{className:"h-60",children:i.jsx(yo,{width:"100%",height:"100%",children:i.jsxs(q_,{children:[i.jsx(mr,{}),i.jsx(da,{data:r,dataKey:"value",nameKey:"name",cx:"50%",cy:"50%",outerRadius:80,label:({name:m,percent:y})=>y>0?`${m} ${(y*100).toFixed(0)}%`:"",children:r.map((m,y)=>i.jsx(vp,{fill:m.color},`cell-${y}`))}),i.jsx(ci,{})]})})}),i.jsxs("div",{className:"mt-4",children:[i.jsx("h4",{className:"text-sm font-medium mb-2",children:"Sentiment by Participant"}),i.jsx("div",{className:"space-y-2 max-h-60 overflow-y-auto pr-2",children:Object.entries(l).map(([m,y])=>{var w;const b=p(m),x=((w=r.find(j=>j.name===b))==null?void 0:w.color)||"#93c5fd";return i.jsxs("div",{className:"flex items-center justify-between p-2 bg-slate-50 rounded",children:[i.jsxs("div",{className:"flex items-center",children:[i.jsx(fg,{className:"h-4 w-4 text-slate-400 mr-2"}),i.jsx("span",{className:"text-sm",children:y.name})]}),i.jsxs("div",{className:"flex items-center",children:[i.jsx("span",{className:"text-xs mr-2",children:"Predominant:"}),i.jsx("span",{className:"text-xs font-medium px-2 py-0.5 rounded",style:{backgroundColor:`${x}30`,color:x},children:b})]})]},m)})})]}),i.jsxs("div",{className:"mt-4 pt-4 border-t",children:[i.jsx("h4",{className:"text-sm font-medium mb-2",children:"Focus Group Balance Assessment"}),i.jsxs("div",{className:`p-3 rounded text-sm ${u.isBalanced?"bg-green-50 text-green-700":"bg-amber-50 text-amber-700"}`,children:[i.jsx("span",{className:"font-medium",children:u.isBalanced?"Balanced Focus Group":"Potential Balance Issues"}),i.jsx("p",{className:"mt-1 text-xs",children:u.reason})]})]})]})})}),i.jsx(Yt,{value:"participation",children:i.jsx(rt,{children:i.jsxs(bt,{className:"pt-6",children:[i.jsx("h3",{className:"text-lg font-semibold mb-4",children:"Participation Distribution"}),i.jsx("div",{className:"h-60",children:i.jsx(yo,{width:"100%",height:"100%",children:i.jsxs(oB,{data:a,layout:"vertical",margin:{top:5,right:30,left:20,bottom:5},children:[i.jsx(Vh,{strokeDasharray:"3 3"}),i.jsx(ko,{type:"number"}),i.jsx(To,{dataKey:"name",type:"category",width:100}),i.jsx(mr,{}),i.jsx(Wo,{dataKey:"messages",fill:"#8884d8",name:"Messages"})]})})}),i.jsx("p",{className:"text-sm text-muted-foreground mt-4",children:a.length>0?`Most active: ${(g=a.sort((m,y)=>y.messages-m.messages)[0])==null?void 0:g.name}`:"No participation data available"})]})})})]})})},q_e=({focusGroupId:e,personas:t,isVisible:n,onToggle:r})=>{const[s,a]=v.useState(null),[o,l]=v.useState(null),[c,u]=v.useState(null),[d,f]=v.useState(null),[h,p]=v.useState(!1),[g,m]=v.useState(null),[y,b]=v.useState(null);v.useEffect(()=>{if(n&&e){x();const _=setInterval(x,3e4);return()=>clearInterval(_)}},[n,e]);const x=async()=>{p(!0),m(null);try{const[_,P,k,O]=await Promise.allSettled([jn.getConversationAnalytics(e),jn.getConversationState(e),jn.getAutonomousConversationStatus(e),jn.getConversationInsights(e)]);_.status==="fulfilled"&&a(_.value.data.analytics),P.status==="fulfilled"&&l(P.value.data.state),k.status==="fulfilled"&&u(k.value.data.status),O.status==="fulfilled"&&f(O.value.data.insights),b(new Date)}catch(_){console.error("Error fetching dashboard data:",_),m("Failed to load dashboard data")}finally{p(!1)}},w=()=>{x()},j=_=>{switch(_){case"running":return"bg-green-500";case"paused":return"bg-amber-500";case"completed":return"bg-blue-500";case"error":return"bg-red-500";default:return"bg-gray-500"}},S=_=>{switch(_){case"positive":return"text-green-600";case"negative":return"text-red-600";default:return"text-gray-600"}},N=_=>{switch(_){case"excellent":return"text-green-600";case"good":return"text-blue-600";case"fair":return"text-amber-600";case"poor":return"text-red-600";default:return"text-gray-600"}};return n?i.jsxs("div",{className:"fixed right-4 top-4 bottom-4 w-80 bg-white rounded-lg shadow-lg border border-gray-200 flex flex-col overflow-hidden z-50",children:[i.jsxs("div",{className:"p-4 border-b border-gray-200 bg-gray-50",children:[i.jsxs("div",{className:"flex items-center justify-between",children:[i.jsxs("div",{className:"flex items-center gap-2",children:[i.jsx(fo,{className:"h-5 w-5 text-blue-600"}),i.jsx("h3",{className:"font-semibold text-gray-900",children:"AI Dashboard"})]}),i.jsxs("div",{className:"flex items-center gap-2",children:[i.jsx(te,{variant:"ghost",size:"sm",onClick:w,disabled:h,className:"p-1",children:i.jsx(Lc,{className:`h-4 w-4 ${h?"animate-spin":""}`})}),i.jsx(te,{variant:"ghost",size:"sm",onClick:r,className:"p-1",children:i.jsx(vW,{className:"h-4 w-4"})})]})]}),y&&i.jsxs("p",{className:"text-xs text-gray-500 mt-1",children:["Last updated: ",y.toLocaleTimeString()]})]}),i.jsxs("div",{className:"flex-1 overflow-y-auto p-4 space-y-4",children:[g&&i.jsx("div",{className:"bg-red-50 border border-red-200 rounded-lg p-3",children:i.jsxs("div",{className:"flex items-center gap-2",children:[i.jsx(hW,{className:"h-4 w-4 text-red-600"}),i.jsx("span",{className:"text-sm text-red-800",children:g})]})}),c&&i.jsxs(rt,{children:[i.jsx(Dr,{className:"pb-3",children:i.jsxs(ts,{className:"text-sm flex items-center gap-2",children:[i.jsx("div",{className:`w-3 h-3 rounded-full ${j(c.conversation_state)}`}),"Autonomous Status"]})}),i.jsx(bt,{className:"pt-0",children:i.jsxs("div",{className:"space-y-2",children:[i.jsxs("div",{className:"flex justify-between text-sm",children:[i.jsx("span",{children:"State:"}),i.jsx(Wn,{variant:c.conversation_state==="running"?"default":"secondary",children:c.conversation_state})]}),i.jsxs("div",{className:"flex justify-between text-sm",children:[i.jsx("span",{children:"Actions:"}),i.jsx("span",{className:"font-medium",children:c.action_count||0})]})]})})]}),o&&i.jsxs(rt,{children:[i.jsx(Dr,{className:"pb-3",children:i.jsxs(ts,{className:"text-sm flex items-center gap-2",children:[i.jsx(Za,{className:"h-4 w-4"}),"Conversation Health"]})}),i.jsx(bt,{className:"pt-0",children:i.jsxs("div",{className:"space-y-3",children:[i.jsxs("div",{className:"flex justify-between items-center",children:[i.jsx("span",{className:"text-sm",children:"Overall Health:"}),i.jsx(Wn,{className:N(o.conversation_health.status),children:o.conversation_health.status})]}),i.jsxs("div",{className:"space-y-2",children:[i.jsxs("div",{className:"flex justify-between text-sm",children:[i.jsx("span",{children:"Score:"}),i.jsxs("span",{className:"font-medium",children:[o.conversation_health.score,"/100"]})]}),i.jsx(al,{value:o.conversation_health.score,className:"h-2"})]}),i.jsxs("div",{className:"space-y-1",children:[i.jsx("span",{className:"text-xs text-gray-600",children:"Indicators:"}),i.jsx("div",{className:"flex flex-wrap gap-1",children:o.conversation_health.indicators.map((_,P)=>i.jsx(Wn,{variant:"outline",className:"text-xs",children:_.replace("_"," ")},P))})]})]})})]}),s&&i.jsxs(rt,{children:[i.jsx(Dr,{className:"pb-3",children:i.jsxs(ts,{className:"text-sm flex items-center gap-2",children:[i.jsx(or,{className:"h-4 w-4"}),"Participation"]})}),i.jsx(bt,{className:"pt-0",children:i.jsxs("div",{className:"space-y-3",children:[i.jsxs("div",{className:"grid grid-cols-2 gap-3",children:[i.jsxs("div",{className:"text-center",children:[i.jsx("div",{className:"text-lg font-semibold text-blue-600",children:s.overview.active_participants}),i.jsx("div",{className:"text-xs text-gray-600",children:"Active"})]}),i.jsxs("div",{className:"text-center",children:[i.jsx("div",{className:"text-lg font-semibold text-green-600",children:s.overview.participant_messages}),i.jsx("div",{className:"text-xs text-gray-600",children:"Messages"})]})]}),i.jsxs("div",{className:"space-y-2",children:[i.jsxs("div",{className:"flex justify-between text-sm",children:[i.jsx("span",{children:"Balance:"}),i.jsx(Wn,{variant:s.participation.participation_balance==="balanced"?"default":"secondary",children:s.participation.participation_balance.replace("_"," ")})]}),s.participation.dominant_participants.length>0&&i.jsxs("div",{className:"text-xs text-amber-600",children:["Dominant: ",s.participation.dominant_participants.length," participant(s)"]}),s.participation.quiet_participants.length>0&&i.jsxs("div",{className:"text-xs text-blue-600",children:["Quiet: ",s.participation.quiet_participants.length," participant(s)"]})]})]})})]}),s&&i.jsxs(rt,{children:[i.jsx(Dr,{className:"pb-3",children:i.jsxs(ts,{className:"text-sm flex items-center gap-2",children:[i.jsx(IW,{className:"h-4 w-4"}),"Sentiment"]})}),i.jsx(bt,{className:"pt-0",children:i.jsxs("div",{className:"space-y-3",children:[i.jsxs("div",{className:"flex justify-between items-center",children:[i.jsx("span",{className:"text-sm",children:"Overall:"}),i.jsx(Wn,{className:S(s.sentiment_analysis.overall_sentiment),children:s.sentiment_analysis.overall_sentiment})]}),i.jsxs("div",{className:"space-y-2",children:[i.jsxs("div",{className:"flex justify-between text-xs",children:[i.jsxs("span",{children:["Positive: ",s.sentiment_analysis.sentiment_distribution.positive]}),i.jsxs("span",{children:["Neutral: ",s.sentiment_analysis.sentiment_distribution.neutral]}),i.jsxs("span",{children:["Negative: ",s.sentiment_analysis.sentiment_distribution.negative]})]}),i.jsxs("div",{className:"flex justify-between text-sm",children:[i.jsx("span",{children:"Trend:"}),i.jsx("span",{className:"font-medium",children:s.sentiment_analysis.sentiment_trend})]})]})]})})]}),s&&i.jsxs(rt,{children:[i.jsx(Dr,{className:"pb-3",children:i.jsxs(ts,{className:"text-sm flex items-center gap-2",children:[i.jsx(dW,{className:"h-4 w-4"}),"Quality Metrics"]})}),i.jsx(bt,{className:"pt-0",children:i.jsxs("div",{className:"space-y-3",children:[i.jsxs("div",{className:"space-y-2",children:[i.jsxs("div",{className:"flex justify-between text-sm",children:[i.jsx("span",{children:"Engagement:"}),i.jsxs("span",{className:"font-medium",children:[Math.round(s.quality_metrics.engagement_score),"/100"]})]}),i.jsx(al,{value:s.quality_metrics.engagement_score,className:"h-2"})]}),i.jsxs("div",{className:"space-y-2",children:[i.jsxs("div",{className:"flex justify-between text-sm",children:[i.jsx("span",{children:"Depth:"}),i.jsxs("span",{className:"font-medium",children:[Math.round(s.quality_metrics.depth_score),"/100"]})]}),i.jsx(al,{value:s.quality_metrics.depth_score,className:"h-2"})]}),i.jsxs("div",{className:"space-y-2",children:[i.jsxs("div",{className:"flex justify-between text-sm",children:[i.jsx("span",{children:"Overall:"}),i.jsxs("span",{className:"font-medium",children:[Math.round(s.quality_metrics.quality_score),"/100"]})]}),i.jsx(al,{value:s.quality_metrics.quality_score,className:"h-2"})]})]})})]}),d&&i.jsxs(rt,{children:[i.jsx(Dr,{className:"pb-3",children:i.jsxs(ts,{className:"text-sm flex items-center gap-2",children:[i.jsx(Ml,{className:"h-4 w-4"}),"AI Insights"]})}),i.jsx(bt,{className:"pt-0",children:i.jsxs("div",{className:"space-y-2",children:[i.jsxs("div",{className:"flex justify-between text-sm",children:[i.jsx("span",{children:"Energy:"}),i.jsx(Wn,{variant:d.conversation_energy==="high"?"default":"secondary",children:d.conversation_energy})]}),i.jsxs("div",{className:"flex justify-between text-sm",children:[i.jsx("span",{children:"Engagement:"}),i.jsx(Wn,{variant:d.topic_engagement==="high"?"default":"secondary",children:d.topic_engagement})]}),d.next_suggested_action&&i.jsx("div",{className:"bg-blue-50 border border-blue-200 rounded-lg p-2 mt-2",children:i.jsxs("div",{className:"text-xs text-blue-800",children:[i.jsx("strong",{children:"Suggestion:"})," ",d.next_suggested_action]})})]})})]}),s&&s.recommendations.length>0&&i.jsxs(rt,{children:[i.jsx(Dr,{className:"pb-3",children:i.jsxs(ts,{className:"text-sm flex items-center gap-2",children:[i.jsx($S,{className:"h-4 w-4"}),"Recommendations"]})}),i.jsx(bt,{className:"pt-0",children:i.jsx("div",{className:"space-y-2",children:s.recommendations.map((_,P)=>i.jsx("div",{className:"bg-amber-50 border border-amber-200 rounded-lg p-2",children:i.jsx("div",{className:"text-xs text-amber-800",children:_})},P))})})]})]})]}):null},K_e=({discussionGuide:e,moderatorStatus:t,onSectionSelect:n,onSetPosition:r,onSave:s,focusGroupId:a,isOpen:o,onToggle:l,className:c,onEditingChange:u})=>{const d=v.useRef(!1),f=v.useCallback(y=>{d.current=y,u==null||u(y)},[u]),[h,p]=v.useState(!1),g=async()=>{if(!e){oe.error("No discussion guide available",{description:"The discussion guide is not available for download"});return}p(!0);try{await St.downloadDiscussionGuide(a),oe.success("Discussion guide downloaded",{description:"The guide has been saved to your downloads folder"})}catch(y){console.error("Error downloading discussion guide:",y),oe.error("Download failed",{description:"Unable to download the discussion guide. Please try again."})}finally{p(!1)}},m=e&&typeof e=="object"&&e.sections;return i.jsx("div",{className:Me("w-full border-b bg-white shadow-sm",c),children:i.jsxs(cp,{open:o,onOpenChange:l,children:[i.jsx(up,{asChild:!0,children:i.jsxs("div",{className:"w-full px-4 py-3 flex items-center justify-between hover:bg-slate-50 transition-colors cursor-pointer",children:[i.jsxs("div",{className:"flex items-center gap-3",children:[i.jsx(gW,{className:"h-5 w-5 text-slate-600"}),i.jsxs("div",{children:[i.jsx("h2",{className:"font-semibold text-slate-900",children:"Discussion Guide"}),m&&i.jsxs("p",{className:"text-xs text-slate-500",children:[e.title," • ",e.total_duration," minutes"]})]})]}),i.jsxs("div",{className:"flex items-center gap-2",children:[i.jsx(te,{variant:"ghost",size:"sm",onClick:y=>{y.stopPropagation(),g()},disabled:!e||h,className:"h-8",children:h?i.jsx(ii,{className:"h-4 w-4 animate-spin"}):i.jsx($l,{className:"h-4 w-4"})}),o?i.jsx(Tl,{className:"h-4 w-4 text-slate-500"}):i.jsx(yi,{className:"h-4 w-4 text-slate-500"})]})]})}),i.jsx(dp,{children:i.jsx("div",{className:"border-t bg-slate-50",children:i.jsx(rt,{className:"mx-4 mb-4 mt-2",children:i.jsx(bt,{className:"p-4",children:i.jsx("div",{className:"max-h-[70vh] overflow-y-auto",children:i.jsx(RN,{discussionGuide:e,moderatorStatus:t,onSectionSelect:n,onSetPosition:r,onSave:s,showProgress:!0,collapsible:!0,defaultExpanded:!0,focusGroupId:a,onEditingChange:f})})})})})})]})})},X_e=({focusGroupId:e,focusGroupName:t="Focus Group",onNoteClick:n})=>{const[r,s]=v.useState([]),[a,o]=v.useState(!0),[l,c]=v.useState(null);v.useEffect(()=>{u()},[e]);const u=async()=>{try{o(!0);const x=await St.getNotes(e);if(x.data&&Array.isArray(x.data)){const w=x.data.map(j=>({...j,timestamp:new Date(j.timestamp),createdAt:new Date(j.createdAt)}));s(y(w))}}catch(x){console.error("Error fetching notes:",x),oe.error("Failed to load notes",{description:"Please refresh the page to try again."})}finally{o(!1)}},d=async x=>{c(x);try{await St.deleteNote(e,x),s(r.filter(w=>w.id!==x)),oe.success("Note deleted successfully")}catch(w){console.error("Error deleting note:",w),oe.error("Failed to delete note",{description:"Please try again."})}finally{c(null)}},f=x=>{x.associatedMessageId&&n?n(x.associatedMessageId):oe.info("No associated message",{description:"This note is not linked to a specific discussion point."})},h=()=>{if(r.length===0){oe.warning("No notes to export",{description:"Create some notes first before exporting."});return}const x=p(),w=document.createElement("a"),j=new Blob([x],{type:"text/markdown"});w.href=URL.createObjectURL(j),w.download=`${t.replace(/[^a-z0-9]/gi,"_").toLowerCase()}_notes.md`,document.body.appendChild(w),w.click(),document.body.removeChild(w),oe.success("Notes exported successfully",{description:`Downloaded ${r.length} notes as Markdown file.`})},p=()=>{const x=[`# Notes: ${t}`,"",`Exported on: ${new Date().toLocaleString()}`,`Total notes: ${r.length}`,"","---",""];return r.forEach((w,j)=>{var S;x.push(`## Note ${j+1}`),x.push(""),x.push(`**Created:** ${w.createdAt.toLocaleString()}`),(S=w.sectionInfo)!=null&&S.sectionTitle&&x.push(`**Section:** ${w.sectionInfo.sectionTitle}`),x.push(`**Elapsed Time:** ${g(w.elapsedTime)}`),x.push(""),x.push("**Content:**"),x.push(w.content),x.push(""),x.push("---"),x.push("")}),x.join(` -`)},g=x=>{const w=Math.floor(x/1e3),j=Math.floor(w/60),S=w%60;return`${j}:${S.toString().padStart(2,"0")}`},m=x=>x.toLocaleString(void 0,{month:"short",day:"numeric",hour:"2-digit",minute:"2-digit"}),y=x=>[...x].sort((w,j)=>j.createdAt.getTime()-w.createdAt.getTime()),b=x=>{s(w=>y([...w,x]))};return v.useEffect(()=>(window.notesPanelAddNote=b,()=>{delete window.notesPanelAddNote}),[]),a?i.jsx("div",{className:"flex items-center justify-center h-64",children:i.jsx("div",{className:"animate-spin rounded-full h-8 w-8 border-b-2 border-primary"})}):i.jsxs("div",{className:"flex flex-col h-full",children:[i.jsxs("div",{className:"flex items-center justify-between mb-4",children:[i.jsxs("div",{className:"flex items-center",children:[i.jsx(dg,{className:"h-5 w-5 text-primary mr-2"}),i.jsx("h2",{className:"font-sf text-xl font-semibold",children:"Notes"}),r.length>0&&i.jsxs("span",{className:"ml-2 text-sm text-slate-500",children:["(",r.length,")"]})]}),i.jsxs(te,{variant:"outline",size:"sm",onClick:h,disabled:r.length===0,children:[i.jsx($l,{className:"mr-2 h-4 w-4"}),"Export Notes"]})]}),i.jsx(Uy,{className:"flex-1",children:r.length===0?i.jsxs("div",{className:"flex flex-col items-center justify-center p-8 text-center bg-slate-50 rounded-lg",children:[i.jsx(dg,{className:"h-8 w-8 text-slate-400 mb-3"}),i.jsx("p",{className:"text-slate-600",children:"No notes yet."}),i.jsx("p",{className:"text-sm text-slate-500 mt-2",children:'Click the "Note" button during the session to add contextual notes.'})]}):i.jsx("div",{className:"space-y-4",children:r.map(x=>{var w;return i.jsxs(rt,{className:"hover:shadow-md transition-shadow cursor-pointer group",onClick:()=>f(x),children:[i.jsx(Dr,{className:"pb-2",children:i.jsxs("div",{className:"flex items-start justify-between",children:[i.jsxs("div",{className:"flex-1",children:[i.jsx(ts,{className:"text-sm font-medium text-slate-600",children:m(x.createdAt)}),((w=x.sectionInfo)==null?void 0:w.sectionTitle)&&i.jsx("div",{className:"text-xs text-slate-500 mt-1",children:i.jsx("span",{children:x.sectionInfo.sectionTitle})})]}),i.jsxs("div",{className:"flex items-center space-x-1 opacity-0 group-hover:opacity-100 transition-opacity",children:[x.associatedMessageId&&i.jsx(te,{variant:"ghost",size:"sm",className:"h-6 w-6 p-0",onClick:j=>{j.stopPropagation(),f(x)},title:"Go to discussion point",children:i.jsx(CW,{className:"h-3 w-3"})}),i.jsx(te,{variant:"ghost",size:"sm",className:"h-6 w-6 p-0 text-red-600 hover:text-red-700",onClick:j=>{j.stopPropagation(),d(x.id)},disabled:l===x.id,title:"Delete note",children:i.jsx(_n,{className:"h-3 w-3"})})]})]})}),i.jsx(bt,{className:"pt-0",children:i.jsx("p",{className:"text-sm text-slate-700 whitespace-pre-wrap",children:x.content})})]},x.id)})})})]})},Y_e=({isOpen:e,onClose:t,focusGroupId:n,associatedMessageId:r,sectionInfo:s,messageTimestamp:a,onNoteSaved:o})=>{const[l,c]=v.useState(""),[u,d]=v.useState(!1),f=async()=>{if(!l.trim()){oe.error("Note content cannot be empty");return}d(!0);try{const p={content:l.trim(),associatedMessageId:r,sectionInfo:s,elapsedTime:0,timestamp:a.toISOString(),createdAt:new Date().toISOString()},g=await St.createNote(n,p);if(g.data){const m={...g.data,timestamp:new Date(g.data.timestamp),createdAt:new Date(g.data.createdAt)},y=s!=null&&s.sectionTitle?`'${s.sectionTitle}'`:"current section",b=a.toLocaleTimeString([],{hour:"2-digit",minute:"2-digit"});oe.success("Quick note saved",{description:`Note linked to ${y} at ${b}`}),o&&o(m),c(""),t()}}catch(p){console.error("Error saving note:",p),oe.error("Failed to save note",{description:"Please try again or check your connection."})}finally{d(!1)}},h=()=>{c(""),t()};return i.jsx(wl,{open:e,onOpenChange:h,children:i.jsxs(ho,{className:"sm:max-w-md",children:[i.jsx(po,{children:i.jsx(go,{children:"Quick Note"})}),i.jsxs("div",{className:"space-y-4",children:[i.jsxs("div",{className:"text-sm text-slate-600",children:[i.jsxs("div",{children:[i.jsx("strong",{children:"Section:"})," ",(s==null?void 0:s.sectionTitle)||"Unknown section"]}),i.jsxs("div",{children:[i.jsx("strong",{children:"Time:"})," ",a.toLocaleTimeString([],{hour:"2-digit",minute:"2-digit"})]})]}),i.jsx(nt,{placeholder:"Enter your note here...",value:l,onChange:p=>c(p.target.value),className:"min-h-[100px] resize-none",autoFocus:!0})]}),i.jsxs(mo,{children:[i.jsx(te,{variant:"outline",onClick:h,disabled:u,children:"Cancel"}),i.jsx(te,{onClick:f,disabled:u,children:u?"Saving...":"Save Note"})]})]})})},Z_e=()=>{const{id:e}=QM(),t=Tn(),[n,r]=v.useState([]),[s,a]=v.useState([]),[o,l]=v.useState([]),[c,u]=v.useState(null),[d,f]=v.useState([]),[h,p]=v.useState("chat"),[g,m]=v.useState(null),[y,b]=v.useState(!1),[x,w]=v.useState(!1),[j,S]=v.useState(!0),[N,_]=v.useState(!1),[P,k]=v.useState(!1),O=v.useRef(!1),[M,A]=v.useState(!1),$=v.useRef(c);$.current=c;const[L,H]=v.useState([]),[D,V]=v.useState(!1),[T,F]=v.useState(""),[q,Z]=v.useState(!1),[re,ge]=v.useState(!1),[B,le]=v.useState(null),[se,ce]=v.useState([]),[De,de]=v.useState(!1),[be,Pe]=v.useState(!1),[ne,Je]=v.useState(!1),[ve,at]=v.useState({isOpen:!1}),st=v.useRef(!1),[Mt,C]=v.useState(""),R=v.useRef(""),U=v.useRef(!1),X=async()=>{var J;if(e)try{const Y=await jn.getModeratorStatus(e);if((J=Y==null?void 0:Y.data)!=null&&J.status){const ye=Y.data.status;if(g){const xe=g.current_section_id!==ye.current_section_id||g.current_item_id!==ye.current_item_id||g.progress!==ye.progress}O.current||m(ye)}}catch(Y){console.error("Error fetching moderator status:",Y)}},Q=async()=>{if(!e)return{aiActive:!1,sessionStatus:""};try{if(typeof(St==null?void 0:St.getById)!="function")return console.error("focusGroupsApi.getById is not a function:",typeof(St==null?void 0:St.getById)),{aiActive:x,sessionStatus:Mt};const J=await St.getById(e);if(!J||typeof J!="object")return console.error("Invalid response object received:",J),{aiActive:x,sessionStatus:Mt};if(!J.data||typeof J.data!="object")return console.warn("Focus group response missing data property:",J),{aiActive:x,sessionStatus:Mt};const Y=J.data.status;if(typeof Y>"u")return console.warn("Focus group response missing status field:",J.data),{aiActive:x,sessionStatus:Mt};const ye=Y==="ai_mode";return Y==="autonomous_active"?console.warn('Detected legacy "autonomous_active" status - backend may need updating to "ai_mode"'):["ai_mode","active","completed","paused","draft","in-progress"].includes(Y)||console.warn("Unexpected focus group status value:",Y),{aiActive:ye,sessionStatus:Y}}catch(J){console.error("Error checking AI mode status:",J);const Y={focusGroupId:e,currentAiModeStatus:x,errorType:"unknown",timestamp:new Date().toISOString()};return J.response?(Y.errorType="api_error",Y.status=J.response.status,Y.data=J.response.data,console.error("API error response:",J.response.status,J.response.data),J.response.status===404?console.warn("Focus group not found - may have been deleted"):J.response.status===500&&console.error("Server error during status check - backend issue")):J.request?(Y.errorType="network_error",console.error("Network error - no response received, check connectivity")):(Y.errorType="request_setup",Y.message=J.message,console.error("Request setup error:",J.message)),console.debug("Status check error details:",Y),{aiActive:x,sessionStatus:Mt}}},z=async(J,Y)=>{if(!e||U.current)return;const ye=["completed","paused"],je=["ai_mode","autonomous_active","active","in-progress"].includes(Y),Qe=ye.includes(J);if(je&&Qe){U.current=!0;try{let I="session_ended";J==="completed"?I="auto_complete":J==="paused"&&(I="manual_stop");const K=await jn.endSession(e,I);K!=null&&K.data&&(Ke.success("Session concluded",{description:"The focus group session has ended with a concluding statement from the moderator."}),setTimeout(()=>{ee()},1e3))}catch(I){console.error("❌ Error ending session with concluding statement:",I),Ke.error("Error ending session",{description:"Failed to add concluding statement, but the session has ended."})}}},ee=async()=>{var J;if(e)try{const Y=await St.getMessages(e);let ye=[],xe=[];Y&&Y.data&&(Array.isArray(Y.data)?(ye=Y.data,xe=[]):Y.data.messages||Y.data.mode_events?(ye=Y.data.messages||[],xe=Y.data.mode_events||[]):(ye=Array.isArray(Y.data)?Y.data:[],xe=[]));const je=ye.map(W=>({id:W._id||W.id||`msg-${Date.now()}`,senderId:W.senderId,text:W.text,timestamp:new Date(W.timestamp||W.created_at||new Date),type:W.type||"response",highlighted:W.highlighted||!1})),Qe=xe.map(W=>({id:W._id||W.id||`event-${Date.now()}`,focus_group_id:W.focus_group_id,event_type:W.event_type,timestamp:new Date(W.timestamp||W.created_at||new Date),user_id:W.user_id,created_at:new Date(W.created_at||new Date)}));a(Qe),je.length>0?r(W=>{if(W.length===0)return je;{const ie=new Map;W.forEach(Wt=>ie.set(Wt.id,Wt));const he=je.map(Wt=>{if(ie.has(Wt.id)){const It=ie.get(Wt.id);return{...Wt,highlighted:It.highlighted}}return Wt}),ke=new Set(he.map(Wt=>Wt.id)),qe=W.filter(Wt=>!ke.has(Wt.id));return[...he,...qe].sort((Wt,It)=>Wt.timestamp.getTime()-It.timestamp.getTime())}}):je.length===0&&r(W=>W.length===0?[]:W);const I=je.filter(W=>W.highlighted),K=I.length>0?I.map(W=>({id:`theme-${W.id}`,text:W.text.substring(0,40)+(W.text.length>40?"...":""),count:1,messages:[W.id],source:"highlight"})):[];try{const W=await jn.getKeyThemes(e);if((J=W==null?void 0:W.data)!=null&&J.themes&&Array.isArray(W.data.themes)){const ie=W.data.themes;l([...K,...ie])}else l(K)}catch(W){console.error("Error fetching AI-generated themes:",W),l(K)}}catch(Y){console.error("Error fetching messages:",Y),n.length===0&&Ke.error("Failed to fetch messages",{description:"Please try again later or restart the session."})}},me=async()=>{if(!e)return!1;try{const Y=(await Dn.getAll()).data||[],ye=await St.getById(e);if(ye&&ye.data){const xe=ye.data;console.log("Focus group data from API:",xe);const je={id:xe._id||xe.id,name:xe.name,status:xe.status||"in-progress",participants:xe.participants||[],date:xe.date||new Date().toISOString(),duration:xe.duration||60,topic:xe.topic||"general",discussionGuide:xe.discussionGuide||"",llm_model:xe.llm_model||"gemini-2.5-pro"};if(u(je),F(je.llm_model||"gemini-2.5-pro"),xe.participants_data&&Array.isArray(xe.participants_data))f(xe.participants_data.map(I=>({...I,id:I._id||I.id})));else if(je.participants&&Array.isArray(je.participants)){console.log("Matching participants from DB:",{focusGroupParticipants:je.participants,allPersonas:Y.map(K=>({id:K._id||K.id,name:K.name}))});const I=Y.filter(K=>{const W=K._id||K.id;return je.participants.includes(W)});console.log("Matched participants:",I.map(K=>K.name)),f(I)}await ee(),await X();const Qe=await Q();return w(Qe.aiActive),C(Qe.sessionStatus),st.current=Qe.aiActive,R.current=Qe.sessionStatus,!0}return!1}catch(J){return console.error("Error fetching focus group:",J),!1}},Se=async J=>{if(console.log("🔧 updateFocusGroupModel called with:",{id:e,focusGroup:!!c,newModel:J}),!e||!c){console.log("❌ updateFocusGroupModel: Missing id or focusGroup",{id:e,focusGroup:!!c});return}Z(!0);try{console.log("🔧 Making API call to update focus group model:",{id:e,newModel:J});const Y=await St.update(e,{llm_model:J});console.log("🔧 API response:",Y),Y&&Y.data?(u(ye=>ye?{...ye,llm_model:J}:null),Ke.success("AI Model Updated",{description:`Focus group will now use ${J==="gemini-2.5-pro"?"Gemini 2.5 Pro":"GPT-4.1"} for AI responses`}),V(!1),console.log("✅ Model update successful")):console.log("❌ API response missing data:",Y)}catch(Y){console.error("❌ Error updating focus group model:",Y),Ke.error("Failed to update AI model",{description:"There was an error updating the AI model. Please try again."})}finally{Z(!1)}};v.useEffect(()=>{console.log("Looking for focus group with ID:",e);const J=async()=>{try{return(await Dn.getAll()).data||[]}catch(je){return console.error("Error fetching personas:",je),[]}},Y=async je=>{try{const Qe=await St.getById(e);if(Qe&&Qe.data){const I=Qe.data;console.log("Focus group data from API:",I);const K={id:I._id||I.id,name:I.name,status:I.status||"in-progress",participants:I.participants||[],date:I.date||new Date().toISOString(),duration:I.duration||60,topic:I.topic||"general",discussionGuide:I.discussionGuide||"",llm_model:I.llm_model||"gemini-2.5-pro"};if(u(K),F(K.llm_model||"gemini-2.5-pro"),I.participants_data&&Array.isArray(I.participants_data))f(I.participants_data.map(W=>({...W,id:W._id||W.id})));else if(K.participants&&Array.isArray(K.participants)){console.log("Matching participants from DB:",{focusGroupParticipants:K.participants,allPersonas:je.map(ie=>({id:ie._id||ie.id,name:ie.name}))});const W=je.filter(ie=>{const he=ie._id||ie.id;return K.participants.includes(he)});console.log("Matched participants:",W.map(ie=>ie.name)),f(W)}return ee(),X(),S(!1),!0}return!1}catch(Qe){return console.error("Error fetching focus group:",Qe),!1}};let ye,xe;return J().then(je=>{Y(je).then(Qe=>{Qe?((()=>{ee(),X(),ye&&window.clearInterval(ye);const W=x?3e3:1e4;console.log("📡 Setting up message polling:",{aiModeActive:x,pollInterval:W,timestamp:new Date().toISOString()}),ye=window.setInterval(()=>{O.current?console.log("📡 Skipping poll - editing discussion guide"):(console.log("📡 Polling for messages...",new Date().toISOString()),ee(),X())},W)})(),xe=window.setInterval(async()=>{const W=st.current,ie=R.current,he=await Q();if(st.current=he.aiActive,R.current=he.sessionStatus,w(he.aiActive),C(he.sessionStatus),ie&&ie!==he.sessionStatus&&await z(he.sessionStatus,ie),W!==he.aiActive&&ye){window.clearInterval(ye);const ke=he.aiActive?3e3:1e4;ye=window.setInterval(()=>{O.current||(ee(),X())},ke)}},15e3)):(console.error("Focus group not found with ID:",e),S(!1),Ke.error("Focus group not found",{description:`Could not find focus group with ID: ${e}`}))})}),()=>{ye&&window.clearInterval(ye),xe&&window.clearInterval(xe)}},[e,t]);const Ie=J=>{if(!J||!J.sections||!Array.isArray(J.sections))return{content:"Welcome to our focus group session! Let's begin our discussion.",sectionId:"welcome",itemId:"welcome-message"};const Y=J.sections[0];if(!Y)return{content:"Welcome to our focus group session! Let's begin our discussion.",sectionId:"welcome",itemId:"welcome-message"};const ye=je=>je.questions&&Array.isArray(je.questions)&&je.questions.length>0?{content:je.questions[0].content,itemId:je.questions[0].id,type:"question"}:je.activities&&Array.isArray(je.activities)&&je.activities.length>0?{content:je.activities[0].content,itemId:je.activities[0].id,type:"activity"}:null;let xe=ye(Y);if(!xe&&Y.subsections&&Array.isArray(Y.subsections)){for(const je of Y.subsections)if(xe=ye(je),xe)break}return xe?{content:xe.content,sectionId:Y.id,itemId:xe.itemId}:{content:`Welcome to our focus group session on "${Y.title||"our topic"}". Let's begin our discussion.`,sectionId:Y.id,itemId:"section-intro"}},we=async()=>{var J,Y,ye,xe,je,Qe;if(e)try{Ke.info("Starting focus group session...",{description:"The session is now ready for AI moderation."});try{const I=await jn.getModeratorStatus(e),K=(Y=(J=I==null?void 0:I.data)==null?void 0:J.status)==null?void 0:Y.moderator_position;K?console.log("📍 Preserving existing moderator position:",K):(await jn.setModeratorPosition(e,((je=(xe=(ye=c==null?void 0:c.discussionGuide)==null?void 0:ye.sections)==null?void 0:xe[0])==null?void 0:je.id)||"welcome"),console.log("🚀 Moderator position initialized to start of discussion guide (first time)"))}catch(I){console.warn("Failed to check/initialize moderator position:",I)}await St.update(e,{status:"active"});try{const I=Ie(c==null?void 0:c.discussionGuide),K={id:`msg-${Date.now()}`,senderId:"moderator",text:I.content,timestamp:new Date,type:"question"},W=await St.sendMessage(e,{senderId:"moderator",text:K.text,type:"question"});(Qe=W==null?void 0:W.data)!=null&&Qe.message_id&&(K.id=W.data.message_id),ze(K),console.log("🚀 Initial moderator message created:",{content:I.content,sectionId:I.sectionId,itemId:I.itemId})}catch(I){console.warn("Failed to create initial moderator message:",I)}Ke.success("Focus group session started",{description:"The discussion has begun. Use the control panel below to moderate."})}catch(I){console.error("Error starting session:",I),Ke.error("Error starting session",{description:"There was a problem connecting to the server."})}},ze=J=>{r(Y=>[...Y,J])},gt=async J=>{const Y=[...n],ye=Y.findIndex(xe=>xe.id===J);if(ye!==-1){const xe=Y[ye],je=!xe.highlighted;if(Y[ye]={...xe,highlighted:je},r(Y),e)try{!J.startsWith("local-")&&!J.startsWith("msg-")?await St.updateMessageHighlight(e,J,je):console.log("Skipping database update for local message:",J)}catch(Qe){console.error("Error updating message highlight state:",Qe),Ke.error("Failed to save highlight state",{description:"The highlight may not persist if the page is refreshed."})}}},jt=J=>d.find(Y=>Y.id===J||Y._id===J),Ge=()=>{const J=n.map(xe=>{var I;let je;return xe.senderId==="moderator"?je="AI Moderator":xe.senderId==="facilitator"?je="Human Facilitator":je=((I=jt(xe.senderId))==null?void 0:I.name)||"Unknown",`[${xe.timestamp.toLocaleTimeString()}] ${je}: ${xe.text}`}).join(` + the props "valueKey" will be deprecated in 1.1.0`),b=f);var x=s.filter(function(P){return En(P,b,0)!==0}).length,w=(y>=360?x:x-1)*c,j=y-x*p-w,S=s.reduce(function(P,k){var O=En(k,b,0);return P+(Ae(O)?O:0)},0),N;if(S>0){var _;N=s.map(function(P,k){var O=En(P,b,0),M=En(P,d,k),A=(Ae(O)?O:0)/S,$;k?$=_.endAngle+Ar(m)*c*(O!==0?1:0):$=o;var L=$+Ar(m)*((O!==0?p:0)+A*j),G=($+L)/2,D=(g.innerRadius+g.outerRadius)/2,V=[{name:M,value:O,payload:P,dataKey:b,type:h}],T=Gt(g.cx,g.cy,D,G);return _=nn(nn(nn({percent:A,cornerRadius:a,name:M,tooltipPayload:V,midAngle:G,middleRadius:D,tooltipPosition:T},P),g),{},{value:En(P,b),startAngle:$,endAngle:L,payload:P,paddingAngle:Ar(m)*c}),_})}return nn(nn({},g),{},{sectors:N,data:s})});function i1e(e){return e&&e.length?e[0]:void 0}var o1e=i1e,l1e=o1e;const c1e=Ht(l1e);var u1e=["key"];function Au(e){"@babel/helpers - typeof";return Au=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Au(e)}function d1e(e,t){if(e==null)return{};var n=f1e(e,t),r,s;if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(s=0;s=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(n[r]=e[r])}return n}function f1e(e,t){if(e==null)return{};var n={};for(var r in e)if(Object.prototype.hasOwnProperty.call(e,r)){if(t.indexOf(r)>=0)continue;n[r]=e[r]}return n}function Ev(){return Ev=Object.assign?Object.assign.bind():function(e){for(var t=1;t=2&&(c=!0),u.push(Sr(Sr({},Gt(o,l,x,y)),{},{name:g,value:m,cx:o,cy:l,radius:x,angle:y,payload:h}))});var f=[];return c&&u.forEach(function(h){if(Array.isArray(h.value)){var p=c1e(h.value),g=Nt(p)?void 0:t.scale(p);f.push(Sr(Sr({},h),{},{radius:g},Gt(o,l,g,h.angle)))}else f.push(h)}),{points:u,isRange:c,baseLinePoints:f}});var b1e=Math.ceil,w1e=Math.max;function j1e(e,t,n,r){for(var s=-1,a=w1e(b1e((t-e)/(n||1)),0),o=Array(a);a--;)o[r?a:++s]=e,e+=n;return o}var S1e=j1e,N1e=C5,tk=1/0,_1e=17976931348623157e292;function P1e(e){if(!e)return e===0?e:0;if(e=N1e(e),e===tk||e===-tk){var t=e<0?-1:1;return t*_1e}return e===e?e:0}var v6=P1e,A1e=S1e,C1e=hx,J0=v6;function E1e(e){return function(t,n,r){return r&&typeof r!="number"&&C1e(t,n,r)&&(n=r=void 0),t=J0(t),n===void 0?(n=t,t=0):n=J0(n),r=r===void 0?t0&&r.handleDrag(s.changedTouches[0])}),Yr(r,"handleDragEnd",function(){r.setState({isTravellerMoving:!1,isSlideMoving:!1},function(){var s=r.props,a=s.endIndex,o=s.onDragEnd,l=s.startIndex;o==null||o({endIndex:a,startIndex:l})}),r.detachDragEndListener()}),Yr(r,"handleLeaveWrapper",function(){(r.state.isTravellerMoving||r.state.isSlideMoving)&&(r.leaveTimer=window.setTimeout(r.handleDragEnd,r.props.leaveTimeOut))}),Yr(r,"handleEnterSlideOrTraveller",function(){r.setState({isTextActive:!0})}),Yr(r,"handleLeaveSlideOrTraveller",function(){r.setState({isTextActive:!1})}),Yr(r,"handleSlideDragStart",function(s){var a=ik(s)?s.changedTouches[0]:s;r.setState({isTravellerMoving:!1,isSlideMoving:!0,slideMoveStartX:a.pageX}),r.attachDragEndListener()}),r.travellerDragStartHandlers={startX:r.handleTravellerDragStart.bind(r,"startX"),endX:r.handleTravellerDragStart.bind(r,"endX")},r.state={},r}return V1e(t,e),F1e(t,[{key:"componentWillUnmount",value:function(){this.leaveTimer&&(clearTimeout(this.leaveTimer),this.leaveTimer=null),this.detachDragEndListener()}},{key:"getIndex",value:function(r){var s=r.startX,a=r.endX,o=this.state.scaleValues,l=this.props,c=l.gap,u=l.data,d=u.length-1,f=Math.min(s,a),h=Math.max(s,a),p=t.getIndexInRange(o,f),g=t.getIndexInRange(o,h);return{startIndex:p-p%c,endIndex:g===d?d:g-g%c}}},{key:"getTextOfTick",value:function(r){var s=this.props,a=s.data,o=s.tickFormatter,l=s.dataKey,c=En(a[r],l,r);return ht(o)?o(c,r):c}},{key:"attachDragEndListener",value:function(){window.addEventListener("mouseup",this.handleDragEnd,!0),window.addEventListener("touchend",this.handleDragEnd,!0),window.addEventListener("mousemove",this.handleDrag,!0)}},{key:"detachDragEndListener",value:function(){window.removeEventListener("mouseup",this.handleDragEnd,!0),window.removeEventListener("touchend",this.handleDragEnd,!0),window.removeEventListener("mousemove",this.handleDrag,!0)}},{key:"handleSlideDrag",value:function(r){var s=this.state,a=s.slideMoveStartX,o=s.startX,l=s.endX,c=this.props,u=c.x,d=c.width,f=c.travellerWidth,h=c.startIndex,p=c.endIndex,g=c.onChange,m=r.pageX-a;m>0?m=Math.min(m,u+d-f-l,u+d-f-o):m<0&&(m=Math.max(m,u-o,u-l));var y=this.getIndex({startX:o+m,endX:l+m});(y.startIndex!==h||y.endIndex!==p)&&g&&g(y),this.setState({startX:o+m,endX:l+m,slideMoveStartX:r.pageX})}},{key:"handleTravellerDragStart",value:function(r,s){var a=ik(s)?s.changedTouches[0]:s;this.setState({isSlideMoving:!1,isTravellerMoving:!0,movingTravellerId:r,brushMoveStartX:a.pageX}),this.attachDragEndListener()}},{key:"handleTravellerMove",value:function(r){var s=this.state,a=s.brushMoveStartX,o=s.movingTravellerId,l=s.endX,c=s.startX,u=this.state[o],d=this.props,f=d.x,h=d.width,p=d.travellerWidth,g=d.onChange,m=d.gap,y=d.data,b={startX:this.state.startX,endX:this.state.endX},x=r.pageX-a;x>0?x=Math.min(x,f+h-p-u):x<0&&(x=Math.max(x,f-u)),b[o]=u+x;var w=this.getIndex(b),j=w.startIndex,S=w.endIndex,N=function(){var P=y.length-1;return o==="startX"&&(l>c?j%m===0:S%m===0)||lc?S%m===0:j%m===0)||l>c&&S===P};this.setState(Yr(Yr({},o,u+x),"brushMoveStartX",r.pageX),function(){g&&N()&&g(w)})}},{key:"handleTravellerMoveKeyboard",value:function(r,s){var a=this,o=this.state,l=o.scaleValues,c=o.startX,u=o.endX,d=this.state[s],f=l.indexOf(d);if(f!==-1){var h=f+r;if(!(h===-1||h>=l.length)){var p=l[h];s==="startX"&&p>=u||s==="endX"&&p<=c||this.setState(Yr({},s,p),function(){a.props.onChange(a.getIndex({startX:a.state.startX,endX:a.state.endX}))})}}}},{key:"renderBackground",value:function(){var r=this.props,s=r.x,a=r.y,o=r.width,l=r.height,c=r.fill,u=r.stroke;return E.createElement("rect",{stroke:u,fill:c,x:s,y:a,width:o,height:l})}},{key:"renderPanorama",value:function(){var r=this.props,s=r.x,a=r.y,o=r.width,l=r.height,c=r.data,u=r.children,d=r.padding,f=v.Children.only(u);return f?E.cloneElement(f,{x:s,y:a,width:o,height:l,margin:d,compact:!0,data:c}):null}},{key:"renderTravellerLayer",value:function(r,s){var a,o,l=this,c=this.props,u=c.y,d=c.travellerWidth,f=c.height,h=c.traveller,p=c.ariaLabel,g=c.data,m=c.startIndex,y=c.endIndex,b=Math.max(r,this.props.x),x=eb(eb({},Xe(this.props,!1)),{},{x:b,y:u,width:d,height:f}),w=p||"Min value: ".concat((a=g[m])===null||a===void 0?void 0:a.name,", Max value: ").concat((o=g[y])===null||o===void 0?void 0:o.name);return E.createElement(Rt,{tabIndex:0,role:"slider","aria-label":w,"aria-valuenow":r,className:"recharts-brush-traveller",onMouseEnter:this.handleEnterSlideOrTraveller,onMouseLeave:this.handleLeaveSlideOrTraveller,onMouseDown:this.travellerDragStartHandlers[s],onTouchStart:this.travellerDragStartHandlers[s],onKeyDown:function(S){["ArrowLeft","ArrowRight"].includes(S.key)&&(S.preventDefault(),S.stopPropagation(),l.handleTravellerMoveKeyboard(S.key==="ArrowRight"?1:-1,s))},onFocus:function(){l.setState({isTravellerFocused:!0})},onBlur:function(){l.setState({isTravellerFocused:!1})},style:{cursor:"col-resize"}},t.renderTraveller(h,x))}},{key:"renderSlide",value:function(r,s){var a=this.props,o=a.y,l=a.height,c=a.stroke,u=a.travellerWidth,d=Math.min(r,s)+u,f=Math.max(Math.abs(s-r)-u,0);return E.createElement("rect",{className:"recharts-brush-slide",onMouseEnter:this.handleEnterSlideOrTraveller,onMouseLeave:this.handleLeaveSlideOrTraveller,onMouseDown:this.handleSlideDragStart,onTouchStart:this.handleSlideDragStart,style:{cursor:"move"},stroke:"none",fill:c,fillOpacity:.2,x:d,y:o,width:f,height:l})}},{key:"renderText",value:function(){var r=this.props,s=r.startIndex,a=r.endIndex,o=r.y,l=r.height,c=r.travellerWidth,u=r.stroke,d=this.state,f=d.startX,h=d.endX,p=5,g={pointerEvents:"none",fill:u};return E.createElement(Rt,{className:"recharts-brush-texts"},E.createElement(zl,Tv({textAnchor:"end",verticalAnchor:"middle",x:Math.min(f,h)-p,y:o+l/2},g),this.getTextOfTick(s)),E.createElement(zl,Tv({textAnchor:"start",verticalAnchor:"middle",x:Math.max(f,h)+c+p,y:o+l/2},g),this.getTextOfTick(a)))}},{key:"render",value:function(){var r=this.props,s=r.data,a=r.className,o=r.children,l=r.x,c=r.y,u=r.width,d=r.height,f=r.alwaysShowText,h=this.state,p=h.startX,g=h.endX,m=h.isTextActive,y=h.isSlideMoving,b=h.isTravellerMoving,x=h.isTravellerFocused;if(!s||!s.length||!Ae(l)||!Ae(c)||!Ae(u)||!Ae(d)||u<=0||d<=0)return null;var w=jt("recharts-brush",a),j=E.Children.count(o)===1,S=D1e("userSelect","none");return E.createElement(Rt,{className:w,onMouseLeave:this.handleLeaveWrapper,onTouchMove:this.handleTouchMove,style:S},this.renderBackground(),j&&this.renderPanorama(),this.renderSlide(p,g),this.renderTravellerLayer(p,"startX"),this.renderTravellerLayer(g,"endX"),(m||y||b||x||f)&&this.renderText())}}],[{key:"renderDefaultTraveller",value:function(r){var s=r.x,a=r.y,o=r.width,l=r.height,c=r.stroke,u=Math.floor(a+l/2)-1;return E.createElement(E.Fragment,null,E.createElement("rect",{x:s,y:a,width:o,height:l,fill:c,stroke:"none"}),E.createElement("line",{x1:s+1,y1:u,x2:s+o-1,y2:u,fill:"none",stroke:"#fff"}),E.createElement("line",{x1:s+1,y1:u+2,x2:s+o-1,y2:u+2,fill:"none",stroke:"#fff"}))}},{key:"renderTraveller",value:function(r,s){var a;return E.isValidElement(r)?a=E.cloneElement(r,s):ht(r)?a=r(s):a=t.renderDefaultTraveller(s),a}},{key:"getDerivedStateFromProps",value:function(r,s){var a=r.data,o=r.width,l=r.x,c=r.travellerWidth,u=r.updateId,d=r.startIndex,f=r.endIndex;if(a!==s.prevData||u!==s.prevUpdateId)return eb({prevData:a,prevTravellerWidth:c,prevUpdateId:u,prevX:l,prevWidth:o},a&&a.length?G1e({data:a,width:o,x:l,travellerWidth:c,startIndex:d,endIndex:f}):{scale:null,scaleValues:null});if(s.scale&&(o!==s.prevWidth||l!==s.prevX||c!==s.prevTravellerWidth)){s.scale.range([l,l+o-c]);var h=s.scale.domain().map(function(p){return s.scale(p)});return{prevData:a,prevTravellerWidth:c,prevUpdateId:u,prevX:l,prevWidth:o,startX:s.scale(r.startIndex),endX:s.scale(r.endIndex),scaleValues:h}}return null}},{key:"getIndexInRange",value:function(r,s){for(var a=r.length,o=0,l=a-1;l-o>1;){var c=Math.floor((o+l)/2);r[c]>s?l=c:o=c}return s>=r[l]?l:o}}])}(v.PureComponent);Yr(Eu,"displayName","Brush");Yr(Eu,"defaultProps",{height:40,travellerWidth:5,gap:1,fill:"#fff",stroke:"#666",padding:{top:1,right:1,bottom:1,left:1},leaveTimeOut:1e3,alwaysShowText:!1});var H1e=p_;function q1e(e,t){var n;return H1e(e,function(r,s,a){return n=t(r,s,a),!n}),!!n}var K1e=q1e,X1e=t5,Y1e=za,Z1e=K1e,Q1e=Kr,J1e=hx;function eje(e,t,n){var r=Q1e(e)?X1e:Z1e;return n&&J1e(e,t,n)&&(t=void 0),r(e,Y1e(t))}var tje=eje;const nje=Ht(tje);var Oa=function(t,n){var r=t.alwaysShow,s=t.ifOverflow;return r&&(s="extendDomain"),s===n},ok=S5;function rje(e,t,n){t=="__proto__"&&ok?ok(e,t,{configurable:!0,enumerable:!0,value:n,writable:!0}):e[t]=n}var sje=rje,aje=sje,ije=w5,oje=za;function lje(e,t){var n={};return t=oje(t),ije(e,function(r,s,a){aje(n,s,t(r,s,a))}),n}var cje=lje;const uje=Ht(cje);function dje(e,t){for(var n=-1,r=e==null?0:e.length;++n=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(n[r]=e[r])}return n}function Cje(e,t){if(e==null)return{};var n={};for(var r in e)if(Object.prototype.hasOwnProperty.call(e,r)){if(t.indexOf(r)>=0)continue;n[r]=e[r]}return n}function Eje(e,t){var n=e.x,r=e.y,s=Aje(e,Sje),a="".concat(n),o=parseInt(a,10),l="".concat(r),c=parseInt(l,10),u="".concat(t.height||s.height),d=parseInt(u,10),f="".concat(t.width||s.width),h=parseInt(f,10);return zd(zd(zd(zd(zd({},t),s),o?{x:o}:{}),c?{y:c}:{}),{},{height:d,width:h,name:t.name,radius:t.radius})}function ck(e){return E.createElement(f6,tj({shapeType:"rectangle",propTransformer:Eje,activeClassName:"recharts-active-bar"},e))}var Oje=function(t){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0;return function(r,s){if(typeof t=="number")return t;var a=typeof r=="number";return a?t(r,s):(a||Wl(),n)}},kje=["value","background"],j6;function Ou(e){"@babel/helpers - typeof";return Ou=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Ou(e)}function Tje(e,t){if(e==null)return{};var n=$je(e,t),r,s;if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(s=0;s=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(n[r]=e[r])}return n}function $je(e,t){if(e==null)return{};var n={};for(var r in e)if(Object.prototype.hasOwnProperty.call(e,r)){if(t.indexOf(r)>=0)continue;n[r]=e[r]}return n}function Mv(){return Mv=Object.assign?Object.assign.bind():function(e){for(var t=1;t0&&Math.abs(G)0&&Math.abs(L)0&&($=Math.min((B||0)-(L[le-1]||0),$))}),Number.isFinite($)){var G=$/A,D=m.layout==="vertical"?r.height:r.width;if(m.padding==="gap"&&(_=G*D/2),m.padding==="no-gap"){var V=Cr(t.barCategoryGap,G*D),T=G*D/2;_=T-V-(T-V)/D*V}}}s==="xAxis"?P=[r.left+(w.left||0)+(_||0),r.left+r.width-(w.right||0)-(_||0)]:s==="yAxis"?P=c==="horizontal"?[r.top+r.height-(w.bottom||0),r.top+(w.top||0)]:[r.top+(w.top||0)+(_||0),r.top+r.height-(w.bottom||0)-(_||0)]:P=m.range,S&&(P=[P[1],P[0]]);var F=IF(m,a,h),q=F.scale,Z=F.realScaleType;q.domain(b).range(P),RF(q);var re=DF(q,Vs(Vs({},m),{},{realScaleType:Z}));s==="xAxis"?(M=y==="top"&&!j||y==="bottom"&&j,k=r.left,O=f[N]-M*m.height):s==="yAxis"&&(M=y==="left"&&!j||y==="right"&&j,k=f[N]-M*m.width,O=r.top);var ge=Vs(Vs(Vs({},m),re),{},{realScaleType:Z,x:k,y:O,scale:q,width:s==="xAxis"?r.width:m.width,height:s==="yAxis"?r.height:m.height});return ge.bandSize=vv(ge,re),!m.hide&&s==="xAxis"?f[N]+=(M?-1:1)*ge.height:m.hide||(f[N]+=(M?-1:1)*ge.width),Vs(Vs({},p),{},Ex({},g,ge))},{})},A6=function(t,n){var r=t.x,s=t.y,a=n.x,o=n.y;return{x:Math.min(r,a),y:Math.min(s,o),width:Math.abs(a-r),height:Math.abs(o-s)}},Wje=function(t){var n=t.x1,r=t.y1,s=t.x2,a=t.y2;return A6({x:n,y:r},{x:s,y:a})},C6=function(){function e(t){zje(this,e),this.scale=t}return Uje(e,[{key:"domain",get:function(){return this.scale.domain}},{key:"range",get:function(){return this.scale.range}},{key:"rangeMin",get:function(){return this.range()[0]}},{key:"rangeMax",get:function(){return this.range()[1]}},{key:"bandwidth",get:function(){return this.scale.bandwidth}},{key:"apply",value:function(n){var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},s=r.bandAware,a=r.position;if(n!==void 0){if(a)switch(a){case"start":return this.scale(n);case"middle":{var o=this.bandwidth?this.bandwidth()/2:0;return this.scale(n)+o}case"end":{var l=this.bandwidth?this.bandwidth():0;return this.scale(n)+l}default:return this.scale(n)}if(s){var c=this.bandwidth?this.bandwidth()/2:0;return this.scale(n)+c}return this.scale(n)}}},{key:"isInRange",value:function(n){var r=this.range(),s=r[0],a=r[r.length-1];return s<=a?n>=s&&n<=a:n>=a&&n<=s}}],[{key:"create",value:function(n){return new e(n)}}])}();Ex(C6,"EPS",1e-4);var V_=function(t){var n=Object.keys(t).reduce(function(r,s){return Vs(Vs({},r),{},Ex({},s,C6.create(t[s])))},{});return Vs(Vs({},n),{},{apply:function(s){var a=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},o=a.bandAware,l=a.position;return uje(s,function(c,u){return n[u].apply(c,{bandAware:o,position:l})})},isInRange:function(s){return w6(s,function(a,o){return n[o].isInRange(a)})}})};function Gje(e){return(e%180+180)%180}var Hje=function(t){var n=t.width,r=t.height,s=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,a=Gje(s),o=a*Math.PI/180,l=Math.atan(r/n),c=o>l&&o-1?s[a?t[o]:o]:void 0}}var Zje=Yje,Qje=v6;function Jje(e){var t=Qje(e),n=t%1;return t===t?n?t-n:t:0}var eSe=Jje,tSe=m5,nSe=za,rSe=eSe,sSe=Math.max;function aSe(e,t,n){var r=e==null?0:e.length;if(!r)return-1;var s=n==null?0:rSe(n);return s<0&&(s=sSe(r+s,0)),tSe(e,nSe(t),s)}var iSe=aSe,oSe=Zje,lSe=iSe,cSe=oSe(lSe),uSe=cSe;const dSe=Ht(uSe);var fSe=Yte(function(e){return{x:e.left,y:e.top,width:e.width,height:e.height}},function(e){return["l",e.left,"t",e.top,"w",e.width,"h",e.height].join("")}),W_=v.createContext(void 0),G_=v.createContext(void 0),E6=v.createContext(void 0),O6=v.createContext({}),k6=v.createContext(void 0),T6=v.createContext(0),$6=v.createContext(0),pk=function(t){var n=t.state,r=n.xAxisMap,s=n.yAxisMap,a=n.offset,o=t.clipPathId,l=t.children,c=t.width,u=t.height,d=fSe(a);return E.createElement(W_.Provider,{value:r},E.createElement(G_.Provider,{value:s},E.createElement(O6.Provider,{value:a},E.createElement(E6.Provider,{value:d},E.createElement(k6.Provider,{value:o},E.createElement(T6.Provider,{value:u},E.createElement($6.Provider,{value:c},l)))))))},hSe=function(){return v.useContext(k6)},M6=function(t){var n=v.useContext(W_);n==null&&Wl();var r=n[t];return r==null&&Wl(),r},pSe=function(){var t=v.useContext(W_);return Hi(t)},mSe=function(){var t=v.useContext(G_),n=dSe(t,function(r){return w6(r.domain,Number.isFinite)});return n||Hi(t)},I6=function(t){var n=v.useContext(G_);n==null&&Wl();var r=n[t];return r==null&&Wl(),r},gSe=function(){var t=v.useContext(E6);return t},vSe=function(){return v.useContext(O6)},H_=function(){return v.useContext($6)},q_=function(){return v.useContext(T6)};function ku(e){"@babel/helpers - typeof";return ku=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},ku(e)}function ySe(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function xSe(e,t){for(var n=0;ne.length)&&(t=e.length);for(var n=0,r=new Array(t);ne*s)return!1;var a=n();return e*(t-e*a/2-r)>=0&&e*(t+e*a/2-s)<=0}function eNe(e,t){return U6(e,t+1)}function tNe(e,t,n,r,s){for(var a=(r||[]).slice(),o=t.start,l=t.end,c=0,u=1,d=o,f=function(){var g=r==null?void 0:r[c];if(g===void 0)return{v:U6(r,u)};var m=c,y,b=function(){return y===void 0&&(y=n(g,m)),y},x=g.coordinate,w=c===0||Fv(e,x,b,d,l);w||(c=0,d=o,u+=1),w&&(d=x+e*(b()/2+s),c+=u)},h;u<=a.length;)if(h=f(),h)return h.v;return[]}function Vh(e){"@babel/helpers - typeof";return Vh=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Vh(e)}function jk(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(s){return Object.getOwnPropertyDescriptor(e,s).enumerable})),n.push.apply(n,r)}return n}function hr(e){for(var t=1;t0?p.coordinate-y*e:p.coordinate})}else a[h]=p=hr(hr({},p),{},{tickCoord:p.coordinate});var b=Fv(e,p.tickCoord,m,l,c);b&&(c=p.tickCoord-e*(m()/2+s),a[h]=hr(hr({},p),{},{isShow:!0}))},d=o-1;d>=0;d--)u(d);return a}function iNe(e,t,n,r,s,a){var o=(r||[]).slice(),l=o.length,c=t.start,u=t.end;if(a){var d=r[l-1],f=n(d,l-1),h=e*(d.coordinate+e*f/2-u);o[l-1]=d=hr(hr({},d),{},{tickCoord:h>0?d.coordinate-h*e:d.coordinate});var p=Fv(e,d.tickCoord,function(){return f},c,u);p&&(u=d.tickCoord-e*(f/2+s),o[l-1]=hr(hr({},d),{},{isShow:!0}))}for(var g=a?l-1:l,m=function(x){var w=o[x],j,S=function(){return j===void 0&&(j=n(w,x)),j};if(x===0){var N=e*(w.coordinate-e*S()/2-c);o[x]=w=hr(hr({},w),{},{tickCoord:N<0?w.coordinate-N*e:w.coordinate})}else o[x]=w=hr(hr({},w),{},{tickCoord:w.coordinate});var _=Fv(e,w.tickCoord,S,c,u);_&&(c=w.tickCoord+e*(S()/2+s),o[x]=hr(hr({},w),{},{isShow:!0}))},y=0;y=2?Ar(s[1].coordinate-s[0].coordinate):1,b=JSe(a,y,p);return c==="equidistantPreserveStart"?tNe(y,b,m,s,o):(c==="preserveStart"||c==="preserveStartEnd"?h=iNe(y,b,m,s,o,c==="preserveStartEnd"):h=aNe(y,b,m,s,o),h.filter(function(x){return x.isShow}))}var oNe=["viewBox"],lNe=["viewBox"],cNe=["ticks"];function Mu(e){"@babel/helpers - typeof";return Mu=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Mu(e)}function Ec(){return Ec=Object.assign?Object.assign.bind():function(e){for(var t=1;t=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(n[r]=e[r])}return n}function uNe(e,t){if(e==null)return{};var n={};for(var r in e)if(Object.prototype.hasOwnProperty.call(e,r)){if(t.indexOf(r)>=0)continue;n[r]=e[r]}return n}function dNe(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function Nk(e,t){for(var n=0;n0?c(this.props):c(p)),o<=0||l<=0||!g||!g.length?null:E.createElement(Rt,{className:jt("recharts-cartesian-axis",u),ref:function(y){r.layerReference=y}},a&&this.renderAxisLine(),this.renderTicks(g,this.state.fontSize,this.state.letterSpacing),Jn.renderCallByParent(this.props))}}],[{key:"renderTickItem",value:function(r,s,a){var o;return E.isValidElement(r)?o=E.cloneElement(r,s):ht(r)?o=r(s):o=E.createElement(zl,Ec({},s,{className:"recharts-cartesian-axis-tick-value"}),a),o}}])}(v.Component);Z_(vd,"displayName","CartesianAxis");Z_(vd,"defaultProps",{x:0,y:0,width:0,height:0,viewBox:{x:0,y:0,width:0,height:0},orientation:"bottom",ticks:[],stroke:"#666",tickLine:!0,axisLine:!0,tick:!0,mirror:!1,minTickGap:5,tickSize:6,tickMargin:2,interval:"preserveEnd"});var yNe=["x1","y1","x2","y2","key"],xNe=["offset"];function Gl(e){"@babel/helpers - typeof";return Gl=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Gl(e)}function _k(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(s){return Object.getOwnPropertyDescriptor(e,s).enumerable})),n.push.apply(n,r)}return n}function vr(e){for(var t=1;t=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(n[r]=e[r])}return n}function SNe(e,t){if(e==null)return{};var n={};for(var r in e)if(Object.prototype.hasOwnProperty.call(e,r)){if(t.indexOf(r)>=0)continue;n[r]=e[r]}return n}var NNe=function(t){var n=t.fill;if(!n||n==="none")return null;var r=t.fillOpacity,s=t.x,a=t.y,o=t.width,l=t.height,c=t.ry;return E.createElement("rect",{x:s,y:a,ry:c,width:o,height:l,stroke:"none",fill:n,fillOpacity:r,className:"recharts-cartesian-grid-bg"})};function G6(e,t){var n;if(E.isValidElement(e))n=E.cloneElement(e,t);else if(ht(e))n=e(t);else{var r=t.x1,s=t.y1,a=t.x2,o=t.y2,l=t.key,c=Pk(t,yNe),u=Xe(c,!1);u.offset;var d=Pk(u,xNe);n=E.createElement("line",dl({},d,{x1:r,y1:s,x2:a,y2:o,fill:"none",key:l}))}return n}function _Ne(e){var t=e.x,n=e.width,r=e.horizontal,s=r===void 0?!0:r,a=e.horizontalPoints;if(!s||!a||!a.length)return null;var o=a.map(function(l,c){var u=vr(vr({},e),{},{x1:t,y1:l,x2:t+n,y2:l,key:"line-".concat(c),index:c});return G6(s,u)});return E.createElement("g",{className:"recharts-cartesian-grid-horizontal"},o)}function PNe(e){var t=e.y,n=e.height,r=e.vertical,s=r===void 0?!0:r,a=e.verticalPoints;if(!s||!a||!a.length)return null;var o=a.map(function(l,c){var u=vr(vr({},e),{},{x1:l,y1:t,x2:l,y2:t+n,key:"line-".concat(c),index:c});return G6(s,u)});return E.createElement("g",{className:"recharts-cartesian-grid-vertical"},o)}function ANe(e){var t=e.horizontalFill,n=e.fillOpacity,r=e.x,s=e.y,a=e.width,o=e.height,l=e.horizontalPoints,c=e.horizontal,u=c===void 0?!0:c;if(!u||!t||!t.length)return null;var d=l.map(function(h){return Math.round(h+s-s)}).sort(function(h,p){return h-p});s!==d[0]&&d.unshift(0);var f=d.map(function(h,p){var g=!d[p+1],m=g?s+o-h:d[p+1]-h;if(m<=0)return null;var y=p%t.length;return E.createElement("rect",{key:"react-".concat(p),y:h,x:r,height:m,width:a,stroke:"none",fill:t[y],fillOpacity:n,className:"recharts-cartesian-grid-bg"})});return E.createElement("g",{className:"recharts-cartesian-gridstripes-horizontal"},f)}function CNe(e){var t=e.vertical,n=t===void 0?!0:t,r=e.verticalFill,s=e.fillOpacity,a=e.x,o=e.y,l=e.width,c=e.height,u=e.verticalPoints;if(!n||!r||!r.length)return null;var d=u.map(function(h){return Math.round(h+a-a)}).sort(function(h,p){return h-p});a!==d[0]&&d.unshift(0);var f=d.map(function(h,p){var g=!d[p+1],m=g?a+l-h:d[p+1]-h;if(m<=0)return null;var y=p%r.length;return E.createElement("rect",{key:"react-".concat(p),x:h,y:o,width:m,height:c,stroke:"none",fill:r[y],fillOpacity:s,className:"recharts-cartesian-grid-bg"})});return E.createElement("g",{className:"recharts-cartesian-gridstripes-vertical"},f)}var ENe=function(t,n){var r=t.xAxis,s=t.width,a=t.height,o=t.offset;return MF(Y_(vr(vr(vr({},vd.defaultProps),r),{},{ticks:ii(r,!0),viewBox:{x:0,y:0,width:s,height:a}})),o.left,o.left+o.width,n)},ONe=function(t,n){var r=t.yAxis,s=t.width,a=t.height,o=t.offset;return MF(Y_(vr(vr(vr({},vd.defaultProps),r),{},{ticks:ii(r,!0),viewBox:{x:0,y:0,width:s,height:a}})),o.top,o.top+o.height,n)},uc={horizontal:!0,vertical:!0,horizontalPoints:[],verticalPoints:[],stroke:"#ccc",fill:"none",verticalFill:[],horizontalFill:[]};function Wh(e){var t,n,r,s,a,o,l=H_(),c=q_(),u=vSe(),d=vr(vr({},e),{},{stroke:(t=e.stroke)!==null&&t!==void 0?t:uc.stroke,fill:(n=e.fill)!==null&&n!==void 0?n:uc.fill,horizontal:(r=e.horizontal)!==null&&r!==void 0?r:uc.horizontal,horizontalFill:(s=e.horizontalFill)!==null&&s!==void 0?s:uc.horizontalFill,vertical:(a=e.vertical)!==null&&a!==void 0?a:uc.vertical,verticalFill:(o=e.verticalFill)!==null&&o!==void 0?o:uc.verticalFill,x:Ae(e.x)?e.x:u.left,y:Ae(e.y)?e.y:u.top,width:Ae(e.width)?e.width:u.width,height:Ae(e.height)?e.height:u.height}),f=d.x,h=d.y,p=d.width,g=d.height,m=d.syncWithTicks,y=d.horizontalValues,b=d.verticalValues,x=pSe(),w=mSe();if(!Ae(p)||p<=0||!Ae(g)||g<=0||!Ae(f)||f!==+f||!Ae(h)||h!==+h)return null;var j=d.verticalCoordinatesGenerator||ENe,S=d.horizontalCoordinatesGenerator||ONe,N=d.horizontalPoints,_=d.verticalPoints;if((!N||!N.length)&&ht(S)){var P=y&&y.length,k=S({yAxis:w?vr(vr({},w),{},{ticks:P?y:w.ticks}):void 0,width:l,height:c,offset:u},P?!0:m);Js(Array.isArray(k),"horizontalCoordinatesGenerator should return Array but instead it returned [".concat(Gl(k),"]")),Array.isArray(k)&&(N=k)}if((!_||!_.length)&&ht(j)){var O=b&&b.length,M=j({xAxis:x?vr(vr({},x),{},{ticks:O?b:x.ticks}):void 0,width:l,height:c,offset:u},O?!0:m);Js(Array.isArray(M),"verticalCoordinatesGenerator should return Array but instead it returned [".concat(Gl(M),"]")),Array.isArray(M)&&(_=M)}return E.createElement("g",{className:"recharts-cartesian-grid"},E.createElement(NNe,{fill:d.fill,fillOpacity:d.fillOpacity,x:d.x,y:d.y,width:d.width,height:d.height,ry:d.ry}),E.createElement(_Ne,dl({},d,{offset:u,horizontalPoints:N,xAxis:x,yAxis:w})),E.createElement(PNe,dl({},d,{offset:u,verticalPoints:_,xAxis:x,yAxis:w})),E.createElement(ANe,dl({},d,{horizontalPoints:N})),E.createElement(CNe,dl({},d,{verticalPoints:_})))}Wh.displayName="CartesianGrid";var kNe=["layout","type","stroke","connectNulls","isRange","ref"],TNe=["key"],H6;function Iu(e){"@babel/helpers - typeof";return Iu=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Iu(e)}function q6(e,t){if(e==null)return{};var n=$Ne(e,t),r,s;if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(s=0;s=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(n[r]=e[r])}return n}function $Ne(e,t){if(e==null)return{};var n={};for(var r in e)if(Object.prototype.hasOwnProperty.call(e,r)){if(t.indexOf(r)>=0)continue;n[r]=e[r]}return n}function fl(){return fl=Object.assign?Object.assign.bind():function(e){for(var t=1;t0||!Ul(d,o)||!Ul(f,l))?this.renderAreaWithAnimation(r,s):this.renderAreaStatically(o,l,r,s)}},{key:"render",value:function(){var r,s=this.props,a=s.hide,o=s.dot,l=s.points,c=s.className,u=s.top,d=s.left,f=s.xAxis,h=s.yAxis,p=s.width,g=s.height,m=s.isAnimationActive,y=s.id;if(a||!l||!l.length)return null;var b=this.state.isAnimationFinished,x=l.length===1,w=jt("recharts-area",c),j=f&&f.allowDataOverflow,S=h&&h.allowDataOverflow,N=j||S,_=Nt(y)?this.id:y,P=(r=Xe(o,!1))!==null&&r!==void 0?r:{r:3,strokeWidth:2},k=P.r,O=k===void 0?3:k,M=P.strokeWidth,A=M===void 0?2:M,$=tre(o)?o:{},L=$.clipDot,G=L===void 0?!0:L,D=O*2+A;return E.createElement(Rt,{className:w},j||S?E.createElement("defs",null,E.createElement("clipPath",{id:"clipPath-".concat(_)},E.createElement("rect",{x:j?d:d-p/2,y:S?u:u-g/2,width:j?p:p*2,height:S?g:g*2})),!G&&E.createElement("clipPath",{id:"clipPath-dots-".concat(_)},E.createElement("rect",{x:d-D/2,y:u-D/2,width:p+D,height:g+D}))):null,x?null:this.renderArea(N,_),(o||x)&&this.renderDots(N,G,_),(!m||b)&&Ea.renderCallByParent(this.props,l))}}],[{key:"getDerivedStateFromProps",value:function(r,s){return r.animationId!==s.prevAnimationId?{prevAnimationId:r.animationId,curPoints:r.points,curBaseLine:r.baseLine,prevPoints:s.curPoints,prevBaseLine:s.curBaseLine}:r.points!==s.curPoints||r.baseLine!==s.curBaseLine?{curPoints:r.points,curBaseLine:r.baseLine}:null}}])}(v.PureComponent);H6=ta;Na(ta,"displayName","Area");Na(ta,"defaultProps",{stroke:"#3182bd",fill:"#3182bd",fillOpacity:.6,xAxisId:0,yAxisId:0,legendType:"line",connectNulls:!1,points:[],dot:!1,activeDot:!0,hide:!1,isAnimationActive:!ea.isSsr,animationBegin:0,animationDuration:1500,animationEasing:"ease"});Na(ta,"getBaseValue",function(e,t,n,r){var s=e.layout,a=e.baseValue,o=t.props.baseValue,l=o??a;if(Ae(l)&&typeof l=="number")return l;var c=s==="horizontal"?r:n,u=c.scale.domain();if(c.type==="number"){var d=Math.max(u[0],u[1]),f=Math.min(u[0],u[1]);return l==="dataMin"?f:l==="dataMax"||d<0?d:Math.max(Math.min(u[0],u[1]),0)}return l==="dataMin"?u[0]:l==="dataMax"?u[1]:u[0]});Na(ta,"getComposedData",function(e){var t=e.props,n=e.item,r=e.xAxis,s=e.yAxis,a=e.xAxisTicks,o=e.yAxisTicks,l=e.bandSize,c=e.dataKey,u=e.stackedData,d=e.dataStartIndex,f=e.displayedData,h=e.offset,p=t.layout,g=u&&u.length,m=H6.getBaseValue(t,n,r,s),y=p==="horizontal",b=!1,x=f.map(function(j,S){var N;g?N=u[d+S]:(N=En(j,c),Array.isArray(N)?b=!0:N=[m,N]);var _=N[1]==null||g&&En(j,c)==null;return y?{x:Y2({axis:r,ticks:a,bandSize:l,entry:j,index:S}),y:_?null:s.scale(N[1]),value:N,payload:j}:{x:_?null:r.scale(N[1]),y:Y2({axis:s,ticks:o,bandSize:l,entry:j,index:S}),value:N,payload:j}}),w;return g||b?w=x.map(function(j){var S=Array.isArray(j.value)?j.value[0]:null;return y?{x:j.x,y:S!=null&&j.y!=null?s.scale(S):null}:{x:S!=null?r.scale(S):null,y:j.y}}):w=y?s.scale(m):r.scale(m),Di({points:x,baseLine:w,layout:p,isRange:b},h)});Na(ta,"renderDotItem",function(e,t){var n;if(E.isValidElement(e))n=E.cloneElement(e,t);else if(ht(e))n=e(t);else{var r=jt("recharts-area-dot",typeof e!="boolean"?e.className:""),s=t.key,a=q6(t,TNe);n=E.createElement(Sp,fl({},a,{key:s,className:r}))}return n});function Ru(e){"@babel/helpers - typeof";return Ru=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Ru(e)}function zNe(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function UNe(e,t){for(var n=0;ne.length)&&(t=e.length);for(var n=0,r=new Array(t);n=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(n[r]=e[r])}return n}function C_e(e,t){if(e==null)return{};var n={};for(var r in e)if(Object.prototype.hasOwnProperty.call(e,r)){if(t.indexOf(r)>=0)continue;n[r]=e[r]}return n}function E_e(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function O_e(e,t){for(var n=0;ne.length)&&(t=e.length);for(var n=0,r=new Array(t);n0?o:t&&t.length&&Ae(s)&&Ae(a)?t.slice(s,a+1):[]};function cB(e){return e==="number"?[0,"auto"]:void 0}var xj=function(t,n,r,s){var a=t.graphicalItems,o=t.tooltipAxis,l=Mx(n,t);return r<0||!a||!a.length||r>=l.length?null:a.reduce(function(c,u){var d,f=(d=u.props.data)!==null&&d!==void 0?d:n;f&&t.dataStartIndex+t.dataEndIndex!==0&&t.dataEndIndex-t.dataStartIndex>=r&&(f=f.slice(t.dataStartIndex,t.dataEndIndex+1));var h;if(o.dataKey&&!o.allowDuplicatedCategory){var p=f===void 0?l:f;h=Vg(p,o.dataKey,s)}else h=f&&f[r]||l[r];return h?[].concat(Fu(c),[FF(u,h)]):c},[])},Mk=function(t,n,r,s){var a=s||{x:t.chartX,y:t.chartY},o=U_e(a,r),l=t.orderedTooltipTicks,c=t.tooltipAxis,u=t.tooltipTicks,d=nye(o,l,u,c);if(d>=0&&u){var f=u[d]&&u[d].value,h=xj(t,n,d,f),p=V_e(r,l,d,a);return{activeTooltipIndex:d,activeLabel:f,activePayload:h,activeCoordinate:p}}return null},W_e=function(t,n){var r=n.axes,s=n.graphicalItems,a=n.axisType,o=n.axisIdKey,l=n.stackGroups,c=n.dataStartIndex,u=n.dataEndIndex,d=t.layout,f=t.children,h=t.stackOffset,p=$F(d,a);return r.reduce(function(g,m){var y,b=m.type.defaultProps!==void 0?ue(ue({},m.type.defaultProps),m.props):m.props,x=b.type,w=b.dataKey,j=b.allowDataOverflow,S=b.allowDuplicatedCategory,N=b.scale,_=b.ticks,P=b.includeHidden,k=b[o];if(g[k])return g;var O=Mx(t.data,{graphicalItems:s.filter(function(re){var ge,B=o in re.props?re.props[o]:(ge=re.type.defaultProps)===null||ge===void 0?void 0:ge[o];return B===k}),dataStartIndex:c,dataEndIndex:u}),M=O.length,A,$,L;g_e(b.domain,j,x)&&(A=$1(b.domain,null,j),p&&(x==="number"||N!=="auto")&&(L=hf(O,w,"category")));var G=cB(x);if(!A||A.length===0){var D,V=(D=b.domain)!==null&&D!==void 0?D:G;if(w){if(A=hf(O,w,x),x==="category"&&p){var T=Hne(A);S&&T?($=A,A=kv(0,M)):S||(A=eO(V,A,m).reduce(function(re,ge){return re.indexOf(ge)>=0?re:[].concat(Fu(re),[ge])},[]))}else if(x==="category")S?A=A.filter(function(re){return re!==""&&!Nt(re)}):A=eO(V,A,m).reduce(function(re,ge){return re.indexOf(ge)>=0||ge===""||Nt(ge)?re:[].concat(Fu(re),[ge])},[]);else if(x==="number"){var F=oye(O,s.filter(function(re){var ge,B,le=o in re.props?re.props[o]:(ge=re.type.defaultProps)===null||ge===void 0?void 0:ge[o],se="hide"in re.props?re.props.hide:(B=re.type.defaultProps)===null||B===void 0?void 0:B.hide;return le===k&&(P||!se)}),w,a,d);F&&(A=F)}p&&(x==="number"||N!=="auto")&&(L=hf(O,w,"category"))}else p?A=kv(0,M):l&&l[k]&&l[k].hasStack&&x==="number"?A=h==="expand"?[0,1]:LF(l[k].stackGroups,c,u):A=TF(O,s.filter(function(re){var ge=o in re.props?re.props[o]:re.type.defaultProps[o],B="hide"in re.props?re.props.hide:re.type.defaultProps.hide;return ge===k&&(P||!B)}),x,d,!0);if(x==="number")A=gj(f,A,k,a,_),V&&(A=$1(V,A,j));else if(x==="category"&&V){var q=V,Z=A.every(function(re){return q.indexOf(re)>=0});Z&&(A=q)}}return ue(ue({},g),{},vt({},k,ue(ue({},b),{},{axisType:a,domain:A,categoricalDomain:L,duplicateDomain:$,originalDomain:(y=b.domain)!==null&&y!==void 0?y:G,isCategorical:p,layout:d})))},{})},G_e=function(t,n){var r=n.graphicalItems,s=n.Axis,a=n.axisType,o=n.axisIdKey,l=n.stackGroups,c=n.dataStartIndex,u=n.dataEndIndex,d=t.layout,f=t.children,h=Mx(t.data,{graphicalItems:r,dataStartIndex:c,dataEndIndex:u}),p=h.length,g=$F(d,a),m=-1;return r.reduce(function(y,b){var x=b.type.defaultProps!==void 0?ue(ue({},b.type.defaultProps),b.props):b.props,w=x[o],j=cB("number");if(!y[w]){m++;var S;return g?S=kv(0,p):l&&l[w]&&l[w].hasStack?(S=LF(l[w].stackGroups,c,u),S=gj(f,S,w,a)):(S=$1(j,TF(h,r.filter(function(N){var _,P,k=o in N.props?N.props[o]:(_=N.type.defaultProps)===null||_===void 0?void 0:_[o],O="hide"in N.props?N.props.hide:(P=N.type.defaultProps)===null||P===void 0?void 0:P.hide;return k===w&&!O}),"number",d),s.defaultProps.allowDataOverflow),S=gj(f,S,w,a)),ue(ue({},y),{},vt({},w,ue(ue({axisType:a},s.defaultProps),{},{hide:!0,orientation:ls(B_e,"".concat(a,".").concat(m%2),null),domain:S,originalDomain:j,isCategorical:g,layout:d})))}return y},{})},H_e=function(t,n){var r=n.axisType,s=r===void 0?"xAxis":r,a=n.AxisComp,o=n.graphicalItems,l=n.stackGroups,c=n.dataStartIndex,u=n.dataEndIndex,d=t.children,f="".concat(s,"Id"),h=As(d,a),p={};return h&&h.length?p=W_e(t,{axes:h,graphicalItems:o,axisType:s,axisIdKey:f,stackGroups:l,dataStartIndex:c,dataEndIndex:u}):o&&o.length&&(p=G_e(t,{Axis:a,graphicalItems:o,axisType:s,axisIdKey:f,stackGroups:l,dataStartIndex:c,dataEndIndex:u})),p},q_e=function(t){var n=Hi(t),r=ii(n,!1,!0);return{tooltipTicks:r,orderedTooltipTicks:m_(r,function(s){return s.coordinate}),tooltipAxis:n,tooltipAxisBandSize:vv(n,r)}},Ik=function(t){var n=t.children,r=t.defaultShowTooltip,s=es(n,Eu),a=0,o=0;return t.data&&t.data.length!==0&&(o=t.data.length-1),s&&s.props&&(s.props.startIndex>=0&&(a=s.props.startIndex),s.props.endIndex>=0&&(o=s.props.endIndex)),{chartX:0,chartY:0,dataStartIndex:a,dataEndIndex:o,activeTooltipIndex:-1,isTooltipActive:!!r}},K_e=function(t){return!t||!t.length?!1:t.some(function(n){var r=ui(n&&n.type);return r&&r.indexOf("Bar")>=0})},Rk=function(t){return t==="horizontal"?{numericAxisName:"yAxis",cateAxisName:"xAxis"}:t==="vertical"?{numericAxisName:"xAxis",cateAxisName:"yAxis"}:t==="centric"?{numericAxisName:"radiusAxis",cateAxisName:"angleAxis"}:{numericAxisName:"angleAxis",cateAxisName:"radiusAxis"}},X_e=function(t,n){var r=t.props,s=t.graphicalItems,a=t.xAxisMap,o=a===void 0?{}:a,l=t.yAxisMap,c=l===void 0?{}:l,u=r.width,d=r.height,f=r.children,h=r.margin||{},p=es(f,Eu),g=es(f,di),m=Object.keys(c).reduce(function(S,N){var _=c[N],P=_.orientation;return!_.mirror&&!_.hide?ue(ue({},S),{},vt({},P,S[P]+_.width)):S},{left:h.left||0,right:h.right||0}),y=Object.keys(o).reduce(function(S,N){var _=o[N],P=_.orientation;return!_.mirror&&!_.hide?ue(ue({},S),{},vt({},P,ls(S,"".concat(P))+_.height)):S},{top:h.top||0,bottom:h.bottom||0}),b=ue(ue({},y),m),x=b.bottom;p&&(b.bottom+=p.props.height||Eu.defaultProps.height),g&&n&&(b=aye(b,s,r,n));var w=u-b.left-b.right,j=d-b.top-b.bottom;return ue(ue({brushBottom:x},b),{},{width:Math.max(w,0),height:Math.max(j,0)})},Y_e=function(t,n){if(n==="xAxis")return t[n].width;if(n==="yAxis")return t[n].height},Ix=function(t){var n=t.chartName,r=t.GraphicalChild,s=t.defaultTooltipEventType,a=s===void 0?"axis":s,o=t.validateTooltipEventTypes,l=o===void 0?["axis"]:o,c=t.axisComponents,u=t.legendContent,d=t.formatAxisMap,f=t.defaultProps,h=function(y,b){var x=b.graphicalItems,w=b.stackGroups,j=b.offset,S=b.updateId,N=b.dataStartIndex,_=b.dataEndIndex,P=y.barSize,k=y.layout,O=y.barGap,M=y.barCategoryGap,A=y.maxBarSize,$=Rk(k),L=$.numericAxisName,G=$.cateAxisName,D=K_e(x),V=[];return x.forEach(function(T,F){var q=Mx(y.data,{graphicalItems:[T],dataStartIndex:N,dataEndIndex:_}),Z=T.type.defaultProps!==void 0?ue(ue({},T.type.defaultProps),T.props):T.props,re=Z.dataKey,ge=Z.maxBarSize,B=Z["".concat(L,"Id")],le=Z["".concat(G,"Id")],se={},ce=c.reduce(function(U,X){var Q=b["".concat(X.axisType,"Map")],z=Z["".concat(X.axisType,"Id")];Q&&Q[z]||X.axisType==="zAxis"||Wl();var ee=Q[z];return ue(ue({},U),{},vt(vt({},X.axisType,ee),"".concat(X.axisType,"Ticks"),ii(ee)))},se),De=ce[G],de=ce["".concat(G,"Ticks")],be=w&&w[B]&&w[B].hasStack&&gye(T,w[B].stackGroups),Pe=ui(T.type).indexOf("Bar")>=0,ne=vv(De,de),Je=[],ve=D&&rye({barSize:P,stackGroups:w,totalSize:Y_e(ce,G)});if(Pe){var at,st,Mt=Nt(ge)?A:ge,C=(at=(st=vv(De,de,!0))!==null&&st!==void 0?st:Mt)!==null&&at!==void 0?at:0;Je=sye({barGap:O,barCategoryGap:M,bandSize:C!==ne?C:ne,sizeList:ve[le],maxBarSize:Mt}),C!==ne&&(Je=Je.map(function(U){return ue(ue({},U),{},{position:ue(ue({},U.position),{},{offset:U.position.offset-C/2})})}))}var R=T&&T.type&&T.type.getComposedData;R&&V.push({props:ue(ue({},R(ue(ue({},ce),{},{displayedData:q,props:y,dataKey:re,item:T,bandSize:ne,barPosition:Je,offset:j,stackedData:be,layout:k,dataStartIndex:N,dataEndIndex:_}))),{},vt(vt(vt({key:T.key||"item-".concat(F)},L,ce[L]),G,ce[G]),"animationId",S)),childIndex:sre(T,y.children),item:T})}),V},p=function(y,b){var x=y.props,w=y.dataStartIndex,j=y.dataEndIndex,S=y.updateId;if(!qC({props:x}))return null;var N=x.children,_=x.layout,P=x.stackOffset,k=x.data,O=x.reverseStackOrder,M=Rk(_),A=M.numericAxisName,$=M.cateAxisName,L=As(N,r),G=pye(k,L,"".concat(A,"Id"),"".concat($,"Id"),P,O),D=c.reduce(function(Z,re){var ge="".concat(re.axisType,"Map");return ue(ue({},Z),{},vt({},ge,H_e(x,ue(ue({},re),{},{graphicalItems:L,stackGroups:re.axisType===A&&G,dataStartIndex:w,dataEndIndex:j}))))},{}),V=X_e(ue(ue({},D),{},{props:x,graphicalItems:L}),b==null?void 0:b.legendBBox);Object.keys(D).forEach(function(Z){D[Z]=d(x,D[Z],V,Z.replace("Map",""),n)});var T=D["".concat($,"Map")],F=q_e(T),q=h(x,ue(ue({},D),{},{dataStartIndex:w,dataEndIndex:j,updateId:S,graphicalItems:L,stackGroups:G,offset:V}));return ue(ue({formattedGraphicalItems:q,graphicalItems:L,offset:V,stackGroups:G},F),D)},g=function(m){function y(b){var x,w,j;return E_e(this,y),j=T_e(this,y,[b]),vt(j,"eventEmitterSymbol",Symbol("rechartsEventEmitter")),vt(j,"accessibilityManager",new m_e),vt(j,"handleLegendBBoxUpdate",function(S){if(S){var N=j.state,_=N.dataStartIndex,P=N.dataEndIndex,k=N.updateId;j.setState(ue({legendBBox:S},p({props:j.props,dataStartIndex:_,dataEndIndex:P,updateId:k},ue(ue({},j.state),{},{legendBBox:S}))))}}),vt(j,"handleReceiveSyncEvent",function(S,N,_){if(j.props.syncId===S){if(_===j.eventEmitterSymbol&&typeof j.props.syncMethod!="function")return;j.applySyncEvent(N)}}),vt(j,"handleBrushChange",function(S){var N=S.startIndex,_=S.endIndex;if(N!==j.state.dataStartIndex||_!==j.state.dataEndIndex){var P=j.state.updateId;j.setState(function(){return ue({dataStartIndex:N,dataEndIndex:_},p({props:j.props,dataStartIndex:N,dataEndIndex:_,updateId:P},j.state))}),j.triggerSyncEvent({dataStartIndex:N,dataEndIndex:_})}}),vt(j,"handleMouseEnter",function(S){var N=j.getMouseInfo(S);if(N){var _=ue(ue({},N),{},{isTooltipActive:!0});j.setState(_),j.triggerSyncEvent(_);var P=j.props.onMouseEnter;ht(P)&&P(_,S)}}),vt(j,"triggeredAfterMouseMove",function(S){var N=j.getMouseInfo(S),_=N?ue(ue({},N),{},{isTooltipActive:!0}):{isTooltipActive:!1};j.setState(_),j.triggerSyncEvent(_);var P=j.props.onMouseMove;ht(P)&&P(_,S)}),vt(j,"handleItemMouseEnter",function(S){j.setState(function(){return{isTooltipActive:!0,activeItem:S,activePayload:S.tooltipPayload,activeCoordinate:S.tooltipPosition||{x:S.cx,y:S.cy}}})}),vt(j,"handleItemMouseLeave",function(){j.setState(function(){return{isTooltipActive:!1}})}),vt(j,"handleMouseMove",function(S){S.persist(),j.throttleTriggeredAfterMouseMove(S)}),vt(j,"handleMouseLeave",function(S){j.throttleTriggeredAfterMouseMove.cancel();var N={isTooltipActive:!1};j.setState(N),j.triggerSyncEvent(N);var _=j.props.onMouseLeave;ht(_)&&_(N,S)}),vt(j,"handleOuterEvent",function(S){var N=rre(S),_=ls(j.props,"".concat(N));if(N&&ht(_)){var P,k;/.*touch.*/i.test(N)?k=j.getMouseInfo(S.changedTouches[0]):k=j.getMouseInfo(S),_((P=k)!==null&&P!==void 0?P:{},S)}}),vt(j,"handleClick",function(S){var N=j.getMouseInfo(S);if(N){var _=ue(ue({},N),{},{isTooltipActive:!0});j.setState(_),j.triggerSyncEvent(_);var P=j.props.onClick;ht(P)&&P(_,S)}}),vt(j,"handleMouseDown",function(S){var N=j.props.onMouseDown;if(ht(N)){var _=j.getMouseInfo(S);N(_,S)}}),vt(j,"handleMouseUp",function(S){var N=j.props.onMouseUp;if(ht(N)){var _=j.getMouseInfo(S);N(_,S)}}),vt(j,"handleTouchMove",function(S){S.changedTouches!=null&&S.changedTouches.length>0&&j.throttleTriggeredAfterMouseMove(S.changedTouches[0])}),vt(j,"handleTouchStart",function(S){S.changedTouches!=null&&S.changedTouches.length>0&&j.handleMouseDown(S.changedTouches[0])}),vt(j,"handleTouchEnd",function(S){S.changedTouches!=null&&S.changedTouches.length>0&&j.handleMouseUp(S.changedTouches[0])}),vt(j,"triggerSyncEvent",function(S){j.props.syncId!==void 0&&nb.emit(rb,j.props.syncId,S,j.eventEmitterSymbol)}),vt(j,"applySyncEvent",function(S){var N=j.props,_=N.layout,P=N.syncMethod,k=j.state.updateId,O=S.dataStartIndex,M=S.dataEndIndex;if(S.dataStartIndex!==void 0||S.dataEndIndex!==void 0)j.setState(ue({dataStartIndex:O,dataEndIndex:M},p({props:j.props,dataStartIndex:O,dataEndIndex:M,updateId:k},j.state)));else if(S.activeTooltipIndex!==void 0){var A=S.chartX,$=S.chartY,L=S.activeTooltipIndex,G=j.state,D=G.offset,V=G.tooltipTicks;if(!D)return;if(typeof P=="function")L=P(V,S);else if(P==="value"){L=-1;for(var T=0;T=0){var be,Pe;if(A.dataKey&&!A.allowDuplicatedCategory){var ne=typeof A.dataKey=="function"?de:"payload.".concat(A.dataKey.toString());be=Vg(T,ne,L),Pe=F&&q&&Vg(q,ne,L)}else be=T==null?void 0:T[$],Pe=F&&q&&q[$];if(le||B){var Je=S.props.activeIndex!==void 0?S.props.activeIndex:$;return[v.cloneElement(S,ue(ue(ue({},P.props),ce),{},{activeIndex:Je})),null,null]}if(!Nt(be))return[De].concat(Fu(j.renderActivePoints({item:P,activePoint:be,basePoint:Pe,childIndex:$,isRange:F})))}else{var ve,at=(ve=j.getItemByXY(j.state.activeCoordinate))!==null&&ve!==void 0?ve:{graphicalItem:De},st=at.graphicalItem,Mt=st.item,C=Mt===void 0?S:Mt,R=st.childIndex,U=ue(ue(ue({},P.props),ce),{},{activeIndex:R});return[v.cloneElement(C,U),null,null]}return F?[De,null,null]:[De,null]}),vt(j,"renderCustomized",function(S,N,_){return v.cloneElement(S,ue(ue({key:"recharts-customized-".concat(_)},j.props),j.state))}),vt(j,"renderMap",{CartesianGrid:{handler:fm,once:!0},ReferenceArea:{handler:j.renderReferenceElement},ReferenceLine:{handler:fm},ReferenceDot:{handler:j.renderReferenceElement},XAxis:{handler:fm},YAxis:{handler:fm},Brush:{handler:j.renderBrush,once:!0},Bar:{handler:j.renderGraphicChild},Line:{handler:j.renderGraphicChild},Area:{handler:j.renderGraphicChild},Radar:{handler:j.renderGraphicChild},RadialBar:{handler:j.renderGraphicChild},Scatter:{handler:j.renderGraphicChild},Pie:{handler:j.renderGraphicChild},Funnel:{handler:j.renderGraphicChild},Tooltip:{handler:j.renderCursor,once:!0},PolarGrid:{handler:j.renderPolarGrid,once:!0},PolarAngleAxis:{handler:j.renderPolarAxis},PolarRadiusAxis:{handler:j.renderPolarAxis},Customized:{handler:j.renderCustomized}}),j.clipPathId="".concat((x=b.id)!==null&&x!==void 0?x:od("recharts"),"-clip"),j.throttleTriggeredAfterMouseMove=E5(j.triggeredAfterMouseMove,(w=b.throttleDelay)!==null&&w!==void 0?w:1e3/60),j.state={},j}return I_e(y,m),k_e(y,[{key:"componentDidMount",value:function(){var x,w;this.addListener(),this.accessibilityManager.setDetails({container:this.container,offset:{left:(x=this.props.margin.left)!==null&&x!==void 0?x:0,top:(w=this.props.margin.top)!==null&&w!==void 0?w:0},coordinateList:this.state.tooltipTicks,mouseHandlerCallback:this.triggeredAfterMouseMove,layout:this.props.layout}),this.displayDefaultTooltip()}},{key:"displayDefaultTooltip",value:function(){var x=this.props,w=x.children,j=x.data,S=x.height,N=x.layout,_=es(w,mr);if(_){var P=_.props.defaultIndex;if(!(typeof P!="number"||P<0||P>this.state.tooltipTicks.length-1)){var k=this.state.tooltipTicks[P]&&this.state.tooltipTicks[P].value,O=xj(this.state,j,P,k),M=this.state.tooltipTicks[P].coordinate,A=(this.state.offset.top+S)/2,$=N==="horizontal",L=$?{x:M,y:A}:{y:M,x:A},G=this.state.formattedGraphicalItems.find(function(V){var T=V.item;return T.type.name==="Scatter"});G&&(L=ue(ue({},L),G.props.points[P].tooltipPosition),O=G.props.points[P].tooltipPayload);var D={activeTooltipIndex:P,isTooltipActive:!0,activeLabel:k,activePayload:O,activeCoordinate:L};this.setState(D),this.renderCursor(_),this.accessibilityManager.setIndex(P)}}}},{key:"getSnapshotBeforeUpdate",value:function(x,w){if(!this.props.accessibilityLayer)return null;if(this.state.tooltipTicks!==w.tooltipTicks&&this.accessibilityManager.setDetails({coordinateList:this.state.tooltipTicks}),this.props.layout!==x.layout&&this.accessibilityManager.setDetails({layout:this.props.layout}),this.props.margin!==x.margin){var j,S;this.accessibilityManager.setDetails({offset:{left:(j=this.props.margin.left)!==null&&j!==void 0?j:0,top:(S=this.props.margin.top)!==null&&S!==void 0?S:0}})}return null}},{key:"componentDidUpdate",value:function(x){Kw([es(x.children,mr)],[es(this.props.children,mr)])||this.displayDefaultTooltip()}},{key:"componentWillUnmount",value:function(){this.removeListener(),this.throttleTriggeredAfterMouseMove.cancel()}},{key:"getTooltipEventType",value:function(){var x=es(this.props.children,mr);if(x&&typeof x.props.shared=="boolean"){var w=x.props.shared?"axis":"item";return l.indexOf(w)>=0?w:a}return a}},{key:"getMouseInfo",value:function(x){if(!this.container)return null;var w=this.container,j=w.getBoundingClientRect(),S=Ohe(j),N={chartX:Math.round(x.pageX-S.left),chartY:Math.round(x.pageY-S.top)},_=j.width/w.offsetWidth||1,P=this.inRange(N.chartX,N.chartY,_);if(!P)return null;var k=this.state,O=k.xAxisMap,M=k.yAxisMap,A=this.getTooltipEventType();if(A!=="axis"&&O&&M){var $=Hi(O).scale,L=Hi(M).scale,G=$&&$.invert?$.invert(N.chartX):null,D=L&&L.invert?L.invert(N.chartY):null;return ue(ue({},N),{},{xValue:G,yValue:D})}var V=Mk(this.state,this.props.data,this.props.layout,P);return V?ue(ue({},N),V):null}},{key:"inRange",value:function(x,w){var j=arguments.length>2&&arguments[2]!==void 0?arguments[2]:1,S=this.props.layout,N=x/j,_=w/j;if(S==="horizontal"||S==="vertical"){var P=this.state.offset,k=N>=P.left&&N<=P.left+P.width&&_>=P.top&&_<=P.top+P.height;return k?{x:N,y:_}:null}var O=this.state,M=O.angleAxisMap,A=O.radiusAxisMap;if(M&&A){var $=Hi(M);return rO({x:N,y:_},$)}return null}},{key:"parseEventsOfWrapper",value:function(){var x=this.props.children,w=this.getTooltipEventType(),j=es(x,mr),S={};j&&w==="axis"&&(j.props.trigger==="click"?S={onClick:this.handleClick}:S={onMouseEnter:this.handleMouseEnter,onMouseMove:this.handleMouseMove,onMouseLeave:this.handleMouseLeave,onTouchMove:this.handleTouchMove,onTouchStart:this.handleTouchStart,onTouchEnd:this.handleTouchEnd});var N=Wg(this.props,this.handleOuterEvent);return ue(ue({},N),S)}},{key:"addListener",value:function(){nb.on(rb,this.handleReceiveSyncEvent)}},{key:"removeListener",value:function(){nb.removeListener(rb,this.handleReceiveSyncEvent)}},{key:"filterFormatItem",value:function(x,w,j){for(var S=this.state.formattedGraphicalItems,N=0,_=S.length;N<_;N++){var P=S[N];if(P.item===x||P.props.key===x.key||w===ui(P.item.type)&&j===P.childIndex)return P}return null}},{key:"renderClipPath",value:function(){var x=this.clipPathId,w=this.state.offset,j=w.left,S=w.top,N=w.height,_=w.width;return E.createElement("defs",null,E.createElement("clipPath",{id:x},E.createElement("rect",{x:j,y:S,height:N,width:_})))}},{key:"getXScales",value:function(){var x=this.state.xAxisMap;return x?Object.entries(x).reduce(function(w,j){var S=kk(j,2),N=S[0],_=S[1];return ue(ue({},w),{},vt({},N,_.scale))},{}):null}},{key:"getYScales",value:function(){var x=this.state.yAxisMap;return x?Object.entries(x).reduce(function(w,j){var S=kk(j,2),N=S[0],_=S[1];return ue(ue({},w),{},vt({},N,_.scale))},{}):null}},{key:"getXScaleByAxisId",value:function(x){var w;return(w=this.state.xAxisMap)===null||w===void 0||(w=w[x])===null||w===void 0?void 0:w.scale}},{key:"getYScaleByAxisId",value:function(x){var w;return(w=this.state.yAxisMap)===null||w===void 0||(w=w[x])===null||w===void 0?void 0:w.scale}},{key:"getItemByXY",value:function(x){var w=this.state,j=w.formattedGraphicalItems,S=w.activeItem;if(j&&j.length)for(var N=0,_=j.length;N<_;N++){var P=j[N],k=P.props,O=P.item,M=O.type.defaultProps!==void 0?ue(ue({},O.type.defaultProps),O.props):O.props,A=ui(O.type);if(A==="Bar"){var $=(k.data||[]).find(function(V){return ebe(x,V)});if($)return{graphicalItem:P,payload:$}}else if(A==="RadialBar"){var L=(k.data||[]).find(function(V){return rO(x,V)});if(L)return{graphicalItem:P,payload:L}}else if(Ax(P,S)||Cx(P,S)||Fh(P,S)){var G=Qwe({graphicalItem:P,activeTooltipItem:S,itemData:M.data}),D=M.activeIndex===void 0?G:M.activeIndex;return{graphicalItem:ue(ue({},P),{},{childIndex:D}),payload:Fh(P,S)?M.data[G]:P.props.data[G]}}}return null}},{key:"render",value:function(){var x=this;if(!qC(this))return null;var w=this.props,j=w.children,S=w.className,N=w.width,_=w.height,P=w.style,k=w.compact,O=w.title,M=w.desc,A=Tk(w,N_e),$=Xe(A,!1);if(k)return E.createElement(pk,{state:this.state,width:this.props.width,height:this.props.height,clipPathId:this.clipPathId},E.createElement(Yw,vf({},$,{width:N,height:_,title:O,desc:M}),this.renderClipPath(),XC(j,this.renderMap)));if(this.props.accessibilityLayer){var L,G;$.tabIndex=(L=this.props.tabIndex)!==null&&L!==void 0?L:0,$.role=(G=this.props.role)!==null&&G!==void 0?G:"application",$.onKeyDown=function(V){x.accessibilityManager.keyboardEvent(V)},$.onFocus=function(){x.accessibilityManager.focus()}}var D=this.parseEventsOfWrapper();return E.createElement(pk,{state:this.state,width:this.props.width,height:this.props.height,clipPathId:this.clipPathId},E.createElement("div",vf({className:jt("recharts-wrapper",S),style:ue({position:"relative",cursor:"default",width:N,height:_},P)},D,{ref:function(T){x.container=T}}),E.createElement(Yw,vf({},$,{width:N,height:_,title:O,desc:M,style:z_e}),this.renderClipPath(),XC(j,this.renderMap)),this.renderLegend(),this.renderTooltip()))}}])}(v.Component);return vt(g,"displayName",n),vt(g,"defaultProps",ue({layout:"horizontal",stackOffset:"none",barCategoryGap:"10%",barGap:4,margin:{top:5,right:5,bottom:5,left:5},reverseStackOrder:!1,syncMethod:"index"},f)),vt(g,"getDerivedStateFromProps",function(m,y){var b=m.dataKey,x=m.data,w=m.children,j=m.width,S=m.height,N=m.layout,_=m.stackOffset,P=m.margin,k=y.dataStartIndex,O=y.dataEndIndex;if(y.updateId===void 0){var M=Ik(m);return ue(ue(ue({},M),{},{updateId:0},p(ue(ue({props:m},M),{},{updateId:0}),y)),{},{prevDataKey:b,prevData:x,prevWidth:j,prevHeight:S,prevLayout:N,prevStackOffset:_,prevMargin:P,prevChildren:w})}if(b!==y.prevDataKey||x!==y.prevData||j!==y.prevWidth||S!==y.prevHeight||N!==y.prevLayout||_!==y.prevStackOffset||!Uc(P,y.prevMargin)){var A=Ik(m),$={chartX:y.chartX,chartY:y.chartY,isTooltipActive:y.isTooltipActive},L=ue(ue({},Mk(y,x,N)),{},{updateId:y.updateId+1}),G=ue(ue(ue({},A),$),L);return ue(ue(ue({},G),p(ue({props:m},G),y)),{},{prevDataKey:b,prevData:x,prevWidth:j,prevHeight:S,prevLayout:N,prevStackOffset:_,prevMargin:P,prevChildren:w})}if(!Kw(w,y.prevChildren)){var D,V,T,F,q=es(w,Eu),Z=q&&(D=(V=q.props)===null||V===void 0?void 0:V.startIndex)!==null&&D!==void 0?D:k,re=q&&(T=(F=q.props)===null||F===void 0?void 0:F.endIndex)!==null&&T!==void 0?T:O,ge=Z!==k||re!==O,B=!Nt(x),le=B&&!ge?y.updateId:y.updateId+1;return ue(ue({updateId:le},p(ue(ue({props:m},y),{},{updateId:le,dataStartIndex:Z,dataEndIndex:re}),y)),{},{prevChildren:w,dataStartIndex:Z,dataEndIndex:re})}return null}),vt(g,"renderActiveDot",function(m,y,b){var x;return v.isValidElement(m)?x=v.cloneElement(m,y):ht(m)?x=m(y):x=E.createElement(Sp,y),E.createElement(Rt,{className:"recharts-active-dot",key:b},x)}),function(y){return E.createElement(g,y)}},uB=Ix({chartName:"BarChart",GraphicalChild:Wo,defaultTooltipEventType:"axis",validateTooltipEventTypes:["axis","item"],axisComponents:[{axisType:"xAxis",AxisComp:ko},{axisType:"yAxis",AxisComp:To}],formatAxisMap:P6}),Q_=Ix({chartName:"PieChart",GraphicalChild:da,validateTooltipEventTypes:["item"],defaultTooltipEventType:"item",legendContent:"children",axisComponents:[{axisType:"angleAxis",AxisComp:gd},{axisType:"radiusAxis",AxisComp:md}],formatAxisMap:UF,defaultProps:{layout:"centric",startAngle:0,endAngle:360,cx:"50%",cy:"50%",innerRadius:0,outerRadius:"80%"}}),Z_e=Ix({chartName:"RadarChart",GraphicalChild:Np,axisComponents:[{axisType:"angleAxis",AxisComp:gd},{axisType:"radiusAxis",AxisComp:md}],formatAxisMap:UF,defaultProps:{layout:"centric",startAngle:90,endAngle:-270,cx:"50%",cy:"50%",innerRadius:0,outerRadius:"80%"}}),dB=Ix({chartName:"AreaChart",GraphicalChild:ta,axisComponents:[{axisType:"xAxis",AxisComp:ko},{axisType:"yAxis",AxisComp:To}],formatAxisMap:P6});const Q_e=({messages:e,themes:t,personas:n=[]})=>{var g;const[r,s]=v.useState([{name:"Very Positive",value:0,color:"#4ade80"},{name:"Positive",value:0,color:"#a3e635"},{name:"Neutral",value:0,color:"#93c5fd"},{name:"Negative",value:0,color:"#fb923c"},{name:"Very Negative",value:0,color:"#f87171"}]),[a,o]=v.useState([]),[l,c]=v.useState({}),[u,d]=v.useState({isBalanced:!1,score:0,reason:""}),f=m=>{const y=n.find(b=>b.id===m);return y?y.name:`Participant ${m}`};v.useEffect(()=>{if(e.length===0)return;const m={"Very Positive":0,Positive:0,Neutral:0,Negative:0,"Very Negative":0},y={},b={};e.forEach(j=>{if(j.senderId!=="moderator"&&j.senderId!=="facilitator"){const S=j.text.toLowerCase();let N="Neutral";S.includes("love")||S.includes("excellent")||S.includes("amazing")?N="Very Positive":S.includes("good")||S.includes("like")||S.includes("great")?N="Positive":S.includes("bad")||S.includes("issue")||S.includes("problem")?N="Negative":(S.includes("terrible")||S.includes("hate")||S.includes("awful"))&&(N="Very Negative"),m[N]++,b[j.senderId]||(b[j.senderId]={"Very Positive":0,Positive:0,Neutral:0,Negative:0,"Very Negative":0}),b[j.senderId][N]++,y[j.senderId]=(y[j.senderId]||0)+1}}),s(j=>j.map(S=>({...S,value:m[S.name]||0})));const x=Object.entries(y).map(([j,S])=>({name:f(j),messages:S}));o(x);const w={};Object.entries(b).forEach(([j,S])=>{w[j]={name:f(j),sentiments:S}}),c(w),h(y,b)},[e,n,f]);const h=(m,y)=>{if(Object.keys(m).length===0){d({isBalanced:!1,score:0,reason:"No participant data available"});return}const x=Object.values(m).reduce((V,T)=>V+T,0)/Object.keys(m).length,w=Object.values(m).map(V=>Math.abs(V-x)/x),j=w.reduce((V,T)=>V+T,0)/w.length,S=Object.values(y).map(V=>Object.values(V).filter(T=>T>0).length),N=S.reduce((V,T)=>V+T,0)/S.length,_=["Very Positive","Positive","Neutral","Negative","Very Negative"],P=Object.values(y).map(V=>{const T=Math.max(...Object.values(V));return _.find(F=>V[F]===T)||"Neutral"}),k=new Set(P).size,O=k/_.length,M=Math.max(0,100-j*100),A=N/5*100,$=O*100,L=Math.round(M*.6+A*.2+$*.2);let G="";const D=L>=70;j>.3&&(G+="Participation is uneven among participants. "),N<2&&(G+="Limited range of sentiments expressed. "),k<=1?G+="Participants show similar sentiment patterns, suggesting potential group-think. ":k>=4&&(G+="Wide divergence in participant sentiments, showing healthy diversity of opinions. "),G===""&&(G=D?"Good mix of participation and diverse opinions.":"Multiple factors affecting balance."),d({isBalanced:D,score:L,reason:G})},p=m=>{const y=l[m];if(!y)return"N/A";const b=y.sentiments;let x=0,w="Neutral";return Object.entries(b).forEach(([j,S])=>{S>x&&(x=S,w=j)}),w};return i.jsx("div",{className:"glass-panel rounded-xl p-4",children:i.jsxs(Fo,{defaultValue:"sentiment",children:[i.jsxs(Ai,{className:"grid grid-cols-2 mb-4",children:[i.jsxs(Xt,{value:"sentiment",className:"flex items-center",children:[i.jsx(yW,{className:"h-4 w-4 mr-2"}),"Sentiment"]}),i.jsxs(Xt,{value:"participation",className:"flex items-center",children:[i.jsx(fw,{className:"h-4 w-4 mr-2"}),"Participation"]})]}),i.jsx(Yt,{value:"sentiment",children:i.jsx(rt,{children:i.jsxs(wt,{className:"pt-6",children:[i.jsxs("div",{className:"flex items-center justify-between mb-4",children:[i.jsx("h3",{className:"text-lg font-semibold",children:"Sentiment Analysis"}),i.jsxs("div",{className:`px-3 py-1 rounded-full text-sm ${u.isBalanced?"bg-green-100 text-green-800":"bg-amber-100 text-amber-800"}`,children:["Balance score: ",u.score,"/100"]})]}),i.jsx("div",{className:"h-60",children:i.jsx(yo,{width:"100%",height:"100%",children:i.jsxs(Q_,{children:[i.jsx(mr,{}),i.jsx(da,{data:r,dataKey:"value",nameKey:"name",cx:"50%",cy:"50%",outerRadius:80,label:({name:m,percent:y})=>y>0?`${m} ${(y*100).toFixed(0)}%`:"",children:r.map((m,y)=>i.jsx(yp,{fill:m.color},`cell-${y}`))}),i.jsx(di,{})]})})}),i.jsxs("div",{className:"mt-4",children:[i.jsx("h4",{className:"text-sm font-medium mb-2",children:"Sentiment by Participant"}),i.jsx("div",{className:"space-y-2 max-h-60 overflow-y-auto pr-2",children:Object.entries(l).map(([m,y])=>{var w;const b=p(m),x=((w=r.find(j=>j.name===b))==null?void 0:w.color)||"#93c5fd";return i.jsxs("div",{className:"flex items-center justify-between p-2 bg-slate-50 rounded",children:[i.jsxs("div",{className:"flex items-center",children:[i.jsx(Vf,{className:"h-4 w-4 text-slate-400 mr-2"}),i.jsx("span",{className:"text-sm",children:y.name})]}),i.jsxs("div",{className:"flex items-center",children:[i.jsx("span",{className:"text-xs mr-2",children:"Predominant:"}),i.jsx("span",{className:"text-xs font-medium px-2 py-0.5 rounded",style:{backgroundColor:`${x}30`,color:x},children:b})]})]},m)})})]}),i.jsxs("div",{className:"mt-4 pt-4 border-t",children:[i.jsx("h4",{className:"text-sm font-medium mb-2",children:"Focus Group Balance Assessment"}),i.jsxs("div",{className:`p-3 rounded text-sm ${u.isBalanced?"bg-green-50 text-green-700":"bg-amber-50 text-amber-700"}`,children:[i.jsx("span",{className:"font-medium",children:u.isBalanced?"Balanced Focus Group":"Potential Balance Issues"}),i.jsx("p",{className:"mt-1 text-xs",children:u.reason})]})]})]})})}),i.jsx(Yt,{value:"participation",children:i.jsx(rt,{children:i.jsxs(wt,{className:"pt-6",children:[i.jsx("h3",{className:"text-lg font-semibold mb-4",children:"Participation Distribution"}),i.jsx("div",{className:"h-60",children:i.jsx(yo,{width:"100%",height:"100%",children:i.jsxs(uB,{data:a,layout:"vertical",margin:{top:5,right:30,left:20,bottom:5},children:[i.jsx(Wh,{strokeDasharray:"3 3"}),i.jsx(ko,{type:"number"}),i.jsx(To,{dataKey:"name",type:"category",width:100}),i.jsx(mr,{}),i.jsx(Wo,{dataKey:"messages",fill:"#8884d8",name:"Messages"})]})})}),i.jsx("p",{className:"text-sm text-muted-foreground mt-4",children:a.length>0?`Most active: ${(g=a.sort((m,y)=>y.messages-m.messages)[0])==null?void 0:g.name}`:"No participation data available"})]})})})]})})},J_e=({focusGroupId:e,personas:t,isVisible:n,onToggle:r})=>{const[s,a]=v.useState(null),[o,l]=v.useState(null),[c,u]=v.useState(null),[d,f]=v.useState(null),[h,p]=v.useState(!1),[g,m]=v.useState(null),[y,b]=v.useState(null);v.useEffect(()=>{if(n&&e){x();const _=setInterval(x,3e4);return()=>clearInterval(_)}},[n,e]);const x=async()=>{p(!0),m(null);try{const[_,P,k,O]=await Promise.allSettled([jn.getConversationAnalytics(e),jn.getConversationState(e),jn.getAutonomousConversationStatus(e),jn.getConversationInsights(e)]);_.status==="fulfilled"&&a(_.value.data.analytics),P.status==="fulfilled"&&l(P.value.data.state),k.status==="fulfilled"&&u(k.value.data.status),O.status==="fulfilled"&&f(O.value.data.insights),b(new Date)}catch(_){console.error("Error fetching dashboard data:",_),m("Failed to load dashboard data")}finally{p(!1)}},w=()=>{x()},j=_=>{switch(_){case"running":return"bg-green-500";case"paused":return"bg-amber-500";case"completed":return"bg-blue-500";case"error":return"bg-red-500";default:return"bg-gray-500"}},S=_=>{switch(_){case"positive":return"text-green-600";case"negative":return"text-red-600";default:return"text-gray-600"}},N=_=>{switch(_){case"excellent":return"text-green-600";case"good":return"text-blue-600";case"fair":return"text-amber-600";case"poor":return"text-red-600";default:return"text-gray-600"}};return n?i.jsxs("div",{className:"fixed right-4 top-4 bottom-4 w-80 bg-white rounded-lg shadow-lg border border-gray-200 flex flex-col overflow-hidden z-50",children:[i.jsxs("div",{className:"p-4 border-b border-gray-200 bg-gray-50",children:[i.jsxs("div",{className:"flex items-center justify-between",children:[i.jsxs("div",{className:"flex items-center gap-2",children:[i.jsx(ni,{className:"h-5 w-5 text-blue-600"}),i.jsx("h3",{className:"font-semibold text-gray-900",children:"AI Dashboard"})]}),i.jsxs("div",{className:"flex items-center gap-2",children:[i.jsx(te,{variant:"ghost",size:"sm",onClick:w,disabled:h,className:"p-1",children:i.jsx(Lc,{className:`h-4 w-4 ${h?"animate-spin":""}`})}),i.jsx(te,{variant:"ghost",size:"sm",onClick:r,className:"p-1",children:i.jsx(SW,{className:"h-4 w-4"})})]})]}),y&&i.jsxs("p",{className:"text-xs text-gray-500 mt-1",children:["Last updated: ",y.toLocaleTimeString()]})]}),i.jsxs("div",{className:"flex-1 overflow-y-auto p-4 space-y-4",children:[g&&i.jsx("div",{className:"bg-red-50 border border-red-200 rounded-lg p-3",children:i.jsxs("div",{className:"flex items-center gap-2",children:[i.jsx(xW,{className:"h-4 w-4 text-red-600"}),i.jsx("span",{className:"text-sm text-red-800",children:g})]})}),c&&i.jsxs(rt,{children:[i.jsx(Dr,{className:"pb-3",children:i.jsxs(ts,{className:"text-sm flex items-center gap-2",children:[i.jsx("div",{className:`w-3 h-3 rounded-full ${j(c.conversation_state)}`}),"Autonomous Status"]})}),i.jsx(wt,{className:"pt-0",children:i.jsxs("div",{className:"space-y-2",children:[i.jsxs("div",{className:"flex justify-between text-sm",children:[i.jsx("span",{children:"State:"}),i.jsx(Wn,{variant:c.conversation_state==="running"?"default":"secondary",children:c.conversation_state})]}),i.jsxs("div",{className:"flex justify-between text-sm",children:[i.jsx("span",{children:"Actions:"}),i.jsx("span",{className:"font-medium",children:c.action_count||0})]})]})})]}),o&&i.jsxs(rt,{children:[i.jsx(Dr,{className:"pb-3",children:i.jsxs(ts,{className:"text-sm flex items-center gap-2",children:[i.jsx(Qa,{className:"h-4 w-4"}),"Conversation Health"]})}),i.jsx(wt,{className:"pt-0",children:i.jsxs("div",{className:"space-y-3",children:[i.jsxs("div",{className:"flex justify-between items-center",children:[i.jsx("span",{className:"text-sm",children:"Overall Health:"}),i.jsx(Wn,{className:N(o.conversation_health.status),children:o.conversation_health.status})]}),i.jsxs("div",{className:"space-y-2",children:[i.jsxs("div",{className:"flex justify-between text-sm",children:[i.jsx("span",{children:"Score:"}),i.jsxs("span",{className:"font-medium",children:[o.conversation_health.score,"/100"]})]}),i.jsx(al,{value:o.conversation_health.score,className:"h-2"})]}),i.jsxs("div",{className:"space-y-1",children:[i.jsx("span",{className:"text-xs text-gray-600",children:"Indicators:"}),i.jsx("div",{className:"flex flex-wrap gap-1",children:o.conversation_health.indicators.map((_,P)=>i.jsx(Wn,{variant:"outline",className:"text-xs",children:_.replace("_"," ")},P))})]})]})})]}),s&&i.jsxs(rt,{children:[i.jsx(Dr,{className:"pb-3",children:i.jsxs(ts,{className:"text-sm flex items-center gap-2",children:[i.jsx(tr,{className:"h-4 w-4"}),"Participation"]})}),i.jsx(wt,{className:"pt-0",children:i.jsxs("div",{className:"space-y-3",children:[i.jsxs("div",{className:"grid grid-cols-2 gap-3",children:[i.jsxs("div",{className:"text-center",children:[i.jsx("div",{className:"text-lg font-semibold text-blue-600",children:s.overview.active_participants}),i.jsx("div",{className:"text-xs text-gray-600",children:"Active"})]}),i.jsxs("div",{className:"text-center",children:[i.jsx("div",{className:"text-lg font-semibold text-green-600",children:s.overview.participant_messages}),i.jsx("div",{className:"text-xs text-gray-600",children:"Messages"})]})]}),i.jsxs("div",{className:"space-y-2",children:[i.jsxs("div",{className:"flex justify-between text-sm",children:[i.jsx("span",{children:"Balance:"}),i.jsx(Wn,{variant:s.participation.participation_balance==="balanced"?"default":"secondary",children:s.participation.participation_balance.replace("_"," ")})]}),s.participation.dominant_participants.length>0&&i.jsxs("div",{className:"text-xs text-amber-600",children:["Dominant: ",s.participation.dominant_participants.length," participant(s)"]}),s.participation.quiet_participants.length>0&&i.jsxs("div",{className:"text-xs text-blue-600",children:["Quiet: ",s.participation.quiet_participants.length," participant(s)"]})]})]})})]}),s&&i.jsxs(rt,{children:[i.jsx(Dr,{className:"pb-3",children:i.jsxs(ts,{className:"text-sm flex items-center gap-2",children:[i.jsx(zW,{className:"h-4 w-4"}),"Sentiment"]})}),i.jsx(wt,{className:"pt-0",children:i.jsxs("div",{className:"space-y-3",children:[i.jsxs("div",{className:"flex justify-between items-center",children:[i.jsx("span",{className:"text-sm",children:"Overall:"}),i.jsx(Wn,{className:S(s.sentiment_analysis.overall_sentiment),children:s.sentiment_analysis.overall_sentiment})]}),i.jsxs("div",{className:"space-y-2",children:[i.jsxs("div",{className:"flex justify-between text-xs",children:[i.jsxs("span",{children:["Positive: ",s.sentiment_analysis.sentiment_distribution.positive]}),i.jsxs("span",{children:["Neutral: ",s.sentiment_analysis.sentiment_distribution.neutral]}),i.jsxs("span",{children:["Negative: ",s.sentiment_analysis.sentiment_distribution.negative]})]}),i.jsxs("div",{className:"flex justify-between text-sm",children:[i.jsx("span",{children:"Trend:"}),i.jsx("span",{className:"font-medium",children:s.sentiment_analysis.sentiment_trend})]})]})]})})]}),s&&i.jsxs(rt,{children:[i.jsx(Dr,{className:"pb-3",children:i.jsxs(ts,{className:"text-sm flex items-center gap-2",children:[i.jsx(vW,{className:"h-4 w-4"}),"Quality Metrics"]})}),i.jsx(wt,{className:"pt-0",children:i.jsxs("div",{className:"space-y-3",children:[i.jsxs("div",{className:"space-y-2",children:[i.jsxs("div",{className:"flex justify-between text-sm",children:[i.jsx("span",{children:"Engagement:"}),i.jsxs("span",{className:"font-medium",children:[Math.round(s.quality_metrics.engagement_score),"/100"]})]}),i.jsx(al,{value:s.quality_metrics.engagement_score,className:"h-2"})]}),i.jsxs("div",{className:"space-y-2",children:[i.jsxs("div",{className:"flex justify-between text-sm",children:[i.jsx("span",{children:"Depth:"}),i.jsxs("span",{className:"font-medium",children:[Math.round(s.quality_metrics.depth_score),"/100"]})]}),i.jsx(al,{value:s.quality_metrics.depth_score,className:"h-2"})]}),i.jsxs("div",{className:"space-y-2",children:[i.jsxs("div",{className:"flex justify-between text-sm",children:[i.jsx("span",{children:"Overall:"}),i.jsxs("span",{className:"font-medium",children:[Math.round(s.quality_metrics.quality_score),"/100"]})]}),i.jsx(al,{value:s.quality_metrics.quality_score,className:"h-2"})]})]})})]}),d&&i.jsxs(rt,{children:[i.jsx(Dr,{className:"pb-3",children:i.jsxs(ts,{className:"text-sm flex items-center gap-2",children:[i.jsx(Ml,{className:"h-4 w-4"}),"AI Insights"]})}),i.jsx(wt,{className:"pt-0",children:i.jsxs("div",{className:"space-y-2",children:[i.jsxs("div",{className:"flex justify-between text-sm",children:[i.jsx("span",{children:"Energy:"}),i.jsx(Wn,{variant:d.conversation_energy==="high"?"default":"secondary",children:d.conversation_energy})]}),i.jsxs("div",{className:"flex justify-between text-sm",children:[i.jsx("span",{children:"Engagement:"}),i.jsx(Wn,{variant:d.topic_engagement==="high"?"default":"secondary",children:d.topic_engagement})]}),d.next_suggested_action&&i.jsx("div",{className:"bg-blue-50 border border-blue-200 rounded-lg p-2 mt-2",children:i.jsxs("div",{className:"text-xs text-blue-800",children:[i.jsx("strong",{children:"Suggestion:"})," ",d.next_suggested_action]})})]})})]}),s&&s.recommendations.length>0&&i.jsxs(rt,{children:[i.jsx(Dr,{className:"pb-3",children:i.jsxs(ts,{className:"text-sm flex items-center gap-2",children:[i.jsx(LS,{className:"h-4 w-4"}),"Recommendations"]})}),i.jsx(wt,{className:"pt-0",children:i.jsx("div",{className:"space-y-2",children:s.recommendations.map((_,P)=>i.jsx("div",{className:"bg-amber-50 border border-amber-200 rounded-lg p-2",children:i.jsx("div",{className:"text-xs text-amber-800",children:_})},P))})})]})]})]}):null},ePe=({discussionGuide:e,moderatorStatus:t,onSectionSelect:n,onSetPosition:r,onSave:s,focusGroupId:a,isOpen:o,onToggle:l,className:c,onEditingChange:u})=>{const d=v.useRef(!1),f=v.useCallback(y=>{d.current=y,u==null||u(y)},[u]),[h,p]=v.useState(!1),g=async()=>{if(!e){oe.error("No discussion guide available",{description:"The discussion guide is not available for download"});return}p(!0);try{await bt.downloadDiscussionGuide(a),oe.success("Discussion guide downloaded",{description:"The guide has been saved to your downloads folder"})}catch(y){console.error("Error downloading discussion guide:",y),oe.error("Download failed",{description:"Unable to download the discussion guide. Please try again."})}finally{p(!1)}},m=e&&typeof e=="object"&&e.sections;return i.jsx("div",{className:Oe("w-full border-b bg-white shadow-sm",c),children:i.jsxs(up,{open:o,onOpenChange:l,children:[i.jsx(dp,{asChild:!0,children:i.jsxs("div",{className:"w-full px-4 py-3 flex items-center justify-between hover:bg-slate-50 transition-colors cursor-pointer",children:[i.jsxs("div",{className:"flex items-center gap-3",children:[i.jsx(jW,{className:"h-5 w-5 text-slate-600"}),i.jsxs("div",{children:[i.jsx("h2",{className:"font-semibold text-slate-900",children:"Discussion Guide"}),m&&i.jsxs("p",{className:"text-xs text-slate-500",children:[e.title," • ",e.total_duration," minutes"]})]})]}),i.jsxs("div",{className:"flex items-center gap-2",children:[i.jsx(te,{variant:"ghost",size:"sm",onClick:y=>{y.stopPropagation(),g()},disabled:!e||h,className:"h-8",children:h?i.jsx(li,{className:"h-4 w-4 animate-spin"}):i.jsx($l,{className:"h-4 w-4"})}),o?i.jsx(Tl,{className:"h-4 w-4 text-slate-500"}):i.jsx(xi,{className:"h-4 w-4 text-slate-500"})]})]})}),i.jsx(fp,{children:i.jsx("div",{className:"border-t bg-slate-50",children:i.jsx(rt,{className:"mx-4 mb-4 mt-2",children:i.jsx(wt,{className:"p-4",children:i.jsx("div",{className:"max-h-[70vh] overflow-y-auto",children:i.jsx(zN,{discussionGuide:e,moderatorStatus:t,onSectionSelect:n,onSetPosition:r,onSave:s,showProgress:!0,collapsible:!0,defaultExpanded:!0,focusGroupId:a,onEditingChange:f})})})})})})]})})},tPe=({focusGroupId:e,focusGroupName:t="Focus Group",onNoteClick:n})=>{const[r,s]=v.useState([]),[a,o]=v.useState(!0),[l,c]=v.useState(null);v.useEffect(()=>{u()},[e]);const u=async()=>{try{o(!0);const x=await bt.getNotes(e);if(x.data&&Array.isArray(x.data)){const w=x.data.map(j=>({...j,timestamp:new Date(j.timestamp),createdAt:new Date(j.createdAt)}));s(y(w))}}catch(x){console.error("Error fetching notes:",x),oe.error("Failed to load notes",{description:"Please refresh the page to try again."})}finally{o(!1)}},d=async x=>{c(x);try{await bt.deleteNote(e,x),s(r.filter(w=>w.id!==x)),oe.success("Note deleted successfully")}catch(w){console.error("Error deleting note:",w),oe.error("Failed to delete note",{description:"Please try again."})}finally{c(null)}},f=x=>{x.associatedMessageId&&n?n(x.associatedMessageId):oe.info("No associated message",{description:"This note is not linked to a specific discussion point."})},h=()=>{if(r.length===0){oe.warning("No notes to export",{description:"Create some notes first before exporting."});return}const x=p(),w=document.createElement("a"),j=new Blob([x],{type:"text/markdown"});w.href=URL.createObjectURL(j),w.download=`${t.replace(/[^a-z0-9]/gi,"_").toLowerCase()}_notes.md`,document.body.appendChild(w),w.click(),document.body.removeChild(w),oe.success("Notes exported successfully",{description:`Downloaded ${r.length} notes as Markdown file.`})},p=()=>{const x=[`# Notes: ${t}`,"",`Exported on: ${new Date().toLocaleString()}`,`Total notes: ${r.length}`,"","---",""];return r.forEach((w,j)=>{var S;x.push(`## Note ${j+1}`),x.push(""),x.push(`**Created:** ${w.createdAt.toLocaleString()}`),(S=w.sectionInfo)!=null&&S.sectionTitle&&x.push(`**Section:** ${w.sectionInfo.sectionTitle}`),x.push(`**Elapsed Time:** ${g(w.elapsedTime)}`),x.push(""),x.push("**Content:**"),x.push(w.content),x.push(""),x.push("---"),x.push("")}),x.join(` +`)},g=x=>{const w=Math.floor(x/1e3),j=Math.floor(w/60),S=w%60;return`${j}:${S.toString().padStart(2,"0")}`},m=x=>x.toLocaleString(void 0,{month:"short",day:"numeric",hour:"2-digit",minute:"2-digit"}),y=x=>[...x].sort((w,j)=>j.createdAt.getTime()-w.createdAt.getTime()),b=x=>{s(w=>y([...w,x]))};return v.useEffect(()=>(window.notesPanelAddNote=b,()=>{delete window.notesPanelAddNote}),[]),a?i.jsx("div",{className:"flex items-center justify-center h-64",children:i.jsx("div",{className:"animate-spin rounded-full h-8 w-8 border-b-2 border-primary"})}):i.jsxs("div",{className:"flex flex-col h-full",children:[i.jsxs("div",{className:"flex items-center justify-between mb-4",children:[i.jsxs("div",{className:"flex items-center",children:[i.jsx(pg,{className:"h-5 w-5 text-primary mr-2"}),i.jsx("h2",{className:"font-sf text-xl font-semibold",children:"Notes"}),r.length>0&&i.jsxs("span",{className:"ml-2 text-sm text-slate-500",children:["(",r.length,")"]})]}),i.jsxs(te,{variant:"outline",size:"sm",onClick:h,disabled:r.length===0,children:[i.jsx($l,{className:"mr-2 h-4 w-4"}),"Export Notes"]})]}),i.jsx(Gy,{className:"flex-1",children:r.length===0?i.jsxs("div",{className:"flex flex-col items-center justify-center p-8 text-center bg-slate-50 rounded-lg",children:[i.jsx(pg,{className:"h-8 w-8 text-slate-400 mb-3"}),i.jsx("p",{className:"text-slate-600",children:"No notes yet."}),i.jsx("p",{className:"text-sm text-slate-500 mt-2",children:'Click the "Note" button during the session to add contextual notes.'})]}):i.jsx("div",{className:"space-y-4",children:r.map(x=>{var w;return i.jsxs(rt,{className:"hover:shadow-md transition-shadow cursor-pointer group",onClick:()=>f(x),children:[i.jsx(Dr,{className:"pb-2",children:i.jsxs("div",{className:"flex items-start justify-between",children:[i.jsxs("div",{className:"flex-1",children:[i.jsx(ts,{className:"text-sm font-medium text-slate-600",children:m(x.createdAt)}),((w=x.sectionInfo)==null?void 0:w.sectionTitle)&&i.jsx("div",{className:"text-xs text-slate-500 mt-1",children:i.jsx("span",{children:x.sectionInfo.sectionTitle})})]}),i.jsxs("div",{className:"flex items-center space-x-1 opacity-0 group-hover:opacity-100 transition-opacity",children:[x.associatedMessageId&&i.jsx(te,{variant:"ghost",size:"sm",className:"h-6 w-6 p-0",onClick:j=>{j.stopPropagation(),f(x)},title:"Go to discussion point",children:i.jsx(MW,{className:"h-3 w-3"})}),i.jsx(te,{variant:"ghost",size:"sm",className:"h-6 w-6 p-0 text-red-600 hover:text-red-700",onClick:j=>{j.stopPropagation(),d(x.id)},disabled:l===x.id,title:"Delete note",children:i.jsx(_n,{className:"h-3 w-3"})})]})]})}),i.jsx(wt,{className:"pt-0",children:i.jsx("p",{className:"text-sm text-slate-700 whitespace-pre-wrap",children:x.content})})]},x.id)})})})]})},nPe=({isOpen:e,onClose:t,focusGroupId:n,associatedMessageId:r,sectionInfo:s,messageTimestamp:a,onNoteSaved:o})=>{const[l,c]=v.useState(""),[u,d]=v.useState(!1),f=async()=>{if(!l.trim()){oe.error("Note content cannot be empty");return}d(!0);try{const p={content:l.trim(),associatedMessageId:r,sectionInfo:s,elapsedTime:0,timestamp:a.toISOString(),createdAt:new Date().toISOString()},g=await bt.createNote(n,p);if(g.data){const m={...g.data,timestamp:new Date(g.data.timestamp),createdAt:new Date(g.data.createdAt)},y=s!=null&&s.sectionTitle?`'${s.sectionTitle}'`:"current section",b=a.toLocaleTimeString([],{hour:"2-digit",minute:"2-digit"});oe.success("Quick note saved",{description:`Note linked to ${y} at ${b}`}),o&&o(m),c(""),t()}}catch(p){console.error("Error saving note:",p),oe.error("Failed to save note",{description:"Please try again or check your connection."})}finally{d(!1)}},h=()=>{c(""),t()};return i.jsx(wl,{open:e,onOpenChange:h,children:i.jsxs(ho,{className:"sm:max-w-md",children:[i.jsx(po,{children:i.jsx(go,{children:"Quick Note"})}),i.jsxs("div",{className:"space-y-4",children:[i.jsxs("div",{className:"text-sm text-slate-600",children:[i.jsxs("div",{children:[i.jsx("strong",{children:"Section:"})," ",(s==null?void 0:s.sectionTitle)||"Unknown section"]}),i.jsxs("div",{children:[i.jsx("strong",{children:"Time:"})," ",a.toLocaleTimeString([],{hour:"2-digit",minute:"2-digit"})]})]}),i.jsx(nt,{placeholder:"Enter your note here...",value:l,onChange:p=>c(p.target.value),className:"min-h-[100px] resize-none",autoFocus:!0})]}),i.jsxs(mo,{children:[i.jsx(te,{variant:"outline",onClick:h,disabled:u,children:"Cancel"}),i.jsx(te,{onClick:f,disabled:u,children:u?"Saving...":"Save Note"})]})]})})},rPe=()=>{const{id:e}=DS(),t=Tn(),[n,r]=v.useState([]),[s,a]=v.useState([]),[o,l]=v.useState([]),[c,u]=v.useState(null),[d,f]=v.useState([]),[h,p]=v.useState("chat"),[g,m]=v.useState(null),[y,b]=v.useState(!1),[x,w]=v.useState(!1),[j,S]=v.useState(!0),[N,_]=v.useState(!1),[P,k]=v.useState(!1),O=v.useRef(!1),[M,A]=v.useState(!1),$=v.useRef(c);$.current=c;const[L,G]=v.useState([]),[D,V]=v.useState(!1),[T,F]=v.useState(""),[q,Z]=v.useState(!1),[re,ge]=v.useState(!1),[B,le]=v.useState(null),[se,ce]=v.useState([]),[De,de]=v.useState(!1),[be,Pe]=v.useState(!1),[ne,Je]=v.useState(!1),[ve,at]=v.useState({isOpen:!1}),st=v.useRef(!1),[Mt,C]=v.useState(""),R=v.useRef(""),U=v.useRef(!1),X=async()=>{var J;if(e)try{const Y=await jn.getModeratorStatus(e);if((J=Y==null?void 0:Y.data)!=null&&J.status){const ye=Y.data.status;if(g){const xe=g.current_section_id!==ye.current_section_id||g.current_item_id!==ye.current_item_id||g.progress!==ye.progress}O.current||m(ye)}}catch(Y){console.error("Error fetching moderator status:",Y)}},Q=async()=>{if(!e)return{aiActive:!1,sessionStatus:""};try{if(typeof(bt==null?void 0:bt.getById)!="function")return console.error("focusGroupsApi.getById is not a function:",typeof(bt==null?void 0:bt.getById)),{aiActive:x,sessionStatus:Mt};const J=await bt.getById(e);if(!J||typeof J!="object")return console.error("Invalid response object received:",J),{aiActive:x,sessionStatus:Mt};if(!J.data||typeof J.data!="object")return console.warn("Focus group response missing data property:",J),{aiActive:x,sessionStatus:Mt};const Y=J.data.status;if(typeof Y>"u")return console.warn("Focus group response missing status field:",J.data),{aiActive:x,sessionStatus:Mt};const ye=Y==="ai_mode";return Y==="autonomous_active"?console.warn('Detected legacy "autonomous_active" status - backend may need updating to "ai_mode"'):["ai_mode","active","completed","paused","draft","in-progress"].includes(Y)||console.warn("Unexpected focus group status value:",Y),{aiActive:ye,sessionStatus:Y}}catch(J){console.error("Error checking AI mode status:",J);const Y={focusGroupId:e,currentAiModeStatus:x,errorType:"unknown",timestamp:new Date().toISOString()};return J.response?(Y.errorType="api_error",Y.status=J.response.status,Y.data=J.response.data,console.error("API error response:",J.response.status,J.response.data),J.response.status===404?console.warn("Focus group not found - may have been deleted"):J.response.status===500&&console.error("Server error during status check - backend issue")):J.request?(Y.errorType="network_error",console.error("Network error - no response received, check connectivity")):(Y.errorType="request_setup",Y.message=J.message,console.error("Request setup error:",J.message)),console.debug("Status check error details:",Y),{aiActive:x,sessionStatus:Mt,isGenerating:!1}}},z=async(J,Y)=>{if(!e||U.current)return;const ye=["completed","paused"],je=["ai_mode","autonomous_active","active","in-progress"].includes(Y),Qe=ye.includes(J);if(je&&Qe){U.current=!0;try{let I="session_ended";J==="completed"?I="auto_complete":J==="paused"&&(I="manual_stop");const K=await jn.endSession(e,I);K!=null&&K.data&&(Ke.success("Session concluded",{description:"The focus group session has ended with a concluding statement from the moderator."}),setTimeout(()=>{ee()},1e3))}catch(I){console.error("❌ Error ending session with concluding statement:",I),Ke.error("Error ending session",{description:"Failed to add concluding statement, but the session has ended."})}}},ee=async()=>{var J;if(e)try{const Y=await bt.getMessages(e);let ye=[],xe=[];Y&&Y.data&&(Array.isArray(Y.data)?(ye=Y.data,xe=[]):Y.data.messages||Y.data.mode_events?(ye=Y.data.messages||[],xe=Y.data.mode_events||[]):(ye=Array.isArray(Y.data)?Y.data:[],xe=[]));const je=ye.map(W=>({id:W._id||W.id||`msg-${Date.now()}`,senderId:W.senderId,text:W.text,timestamp:new Date(W.timestamp||W.created_at||new Date),type:W.type||"response",highlighted:W.highlighted||!1})),Qe=xe.map(W=>({id:W._id||W.id||`event-${Date.now()}`,focus_group_id:W.focus_group_id,event_type:W.event_type,timestamp:new Date(W.timestamp||W.created_at||new Date),user_id:W.user_id,created_at:new Date(W.created_at||new Date)}));a(Qe),je.length>0?r(W=>{if(W.length===0)return je;{const ie=new Map;W.forEach(Wt=>ie.set(Wt.id,Wt));const he=je.map(Wt=>{if(ie.has(Wt.id)){const It=ie.get(Wt.id);return{...Wt,highlighted:It.highlighted}}return Wt}),Te=new Set(he.map(Wt=>Wt.id)),qe=W.filter(Wt=>!Te.has(Wt.id));return[...he,...qe].sort((Wt,It)=>Wt.timestamp.getTime()-It.timestamp.getTime())}}):je.length===0&&r(W=>W.length===0?[]:W);const I=je.filter(W=>W.highlighted),K=I.length>0?I.map(W=>({id:`theme-${W.id}`,text:W.text.substring(0,40)+(W.text.length>40?"...":""),count:1,messages:[W.id],source:"highlight"})):[];try{const W=await jn.getKeyThemes(e);if((J=W==null?void 0:W.data)!=null&&J.themes&&Array.isArray(W.data.themes)){const ie=W.data.themes;l([...K,...ie])}else l(K)}catch(W){console.error("Error fetching AI-generated themes:",W),l(K)}}catch(Y){console.error("Error fetching messages:",Y),n.length===0&&Ke.error("Failed to fetch messages",{description:"Please try again later or restart the session."})}},me=async()=>{if(!e)return!1;try{const Y=(await Dn.getAll()).data||[],ye=await bt.getById(e);if(ye&&ye.data){const xe=ye.data;console.log("Focus group data from API:",xe);const je={id:xe._id||xe.id,name:xe.name,status:xe.status||"in-progress",participants:xe.participants||[],date:xe.date||new Date().toISOString(),duration:xe.duration||60,topic:xe.topic||"general",discussionGuide:xe.discussionGuide||"",llm_model:xe.llm_model||"gemini-2.5-pro"};if(u(je),F(je.llm_model||"gemini-2.5-pro"),xe.participants_data&&Array.isArray(xe.participants_data))f(xe.participants_data.map(I=>({...I,id:I._id||I.id})));else if(je.participants&&Array.isArray(je.participants)){console.log("Matching participants from DB:",{focusGroupParticipants:je.participants,allPersonas:Y.map(K=>({id:K._id||K.id,name:K.name}))});const I=Y.filter(K=>{const W=K._id||K.id;return je.participants.includes(W)});console.log("Matched participants:",I.map(K=>K.name)),f(I)}await ee(),await X();const Qe=await Q();return w(Qe.aiActive),C(Qe.sessionStatus),st.current=Qe.aiActive,R.current=Qe.sessionStatus,!0}return!1}catch(J){return console.error("Error fetching focus group:",J),!1}},Se=async J=>{if(console.log("🔧 updateFocusGroupModel called with:",{id:e,focusGroup:!!c,newModel:J}),!e||!c){console.log("❌ updateFocusGroupModel: Missing id or focusGroup",{id:e,focusGroup:!!c});return}Z(!0);try{console.log("🔧 Making API call to update focus group model:",{id:e,newModel:J});const Y=await bt.update(e,{llm_model:J});console.log("🔧 API response:",Y),Y&&Y.data?(u(ye=>ye?{...ye,llm_model:J}:null),Ke.success("AI Model Updated",{description:`Focus group will now use ${J==="gemini-2.5-pro"?"Gemini 2.5 Pro":"GPT-4.1"} for AI responses`}),V(!1),console.log("✅ Model update successful")):console.log("❌ API response missing data:",Y)}catch(Y){console.error("❌ Error updating focus group model:",Y),Ke.error("Failed to update AI model",{description:"There was an error updating the AI model. Please try again."})}finally{Z(!1)}};v.useEffect(()=>{console.log("Looking for focus group with ID:",e);const J=async()=>{try{return(await Dn.getAll()).data||[]}catch(je){return console.error("Error fetching personas:",je),[]}},Y=async je=>{try{const Qe=await bt.getById(e);if(Qe&&Qe.data){const I=Qe.data;console.log("Focus group data from API:",I);const K={id:I._id||I.id,name:I.name,status:I.status||"in-progress",participants:I.participants||[],date:I.date||new Date().toISOString(),duration:I.duration||60,topic:I.topic||"general",discussionGuide:I.discussionGuide||"",llm_model:I.llm_model||"gemini-2.5-pro"};if(u(K),F(K.llm_model||"gemini-2.5-pro"),I.participants_data&&Array.isArray(I.participants_data))f(I.participants_data.map(W=>({...W,id:W._id||W.id})));else if(K.participants&&Array.isArray(K.participants)){console.log("Matching participants from DB:",{focusGroupParticipants:K.participants,allPersonas:je.map(ie=>({id:ie._id||ie.id,name:ie.name}))});const W=je.filter(ie=>{const he=ie._id||ie.id;return K.participants.includes(he)});console.log("Matched participants:",W.map(ie=>ie.name)),f(W)}return ee(),X(),S(!1),!0}return!1}catch(Qe){return console.error("Error fetching focus group:",Qe),!1}};let ye,xe;return J().then(je=>{Y(je).then(Qe=>{Qe?((()=>{ee(),X(),ye&&window.clearInterval(ye);const W=x?3e3:1e4;console.log("📡 Setting up message polling:",{aiModeActive:x,pollInterval:W,timestamp:new Date().toISOString()}),ye=window.setInterval(()=>{O.current?console.log("📡 Skipping poll - editing discussion guide"):(console.log("📡 Polling for messages...",new Date().toISOString()),ee(),X())},W)})(),xe=window.setInterval(async()=>{const W=st.current,ie=R.current,he=await Q();if(st.current=he.aiActive,R.current=he.sessionStatus,w(he.aiActive),C(he.sessionStatus),ie&&ie!==he.sessionStatus&&await z(he.sessionStatus,ie),W!==he.aiActive&&ye){window.clearInterval(ye);const Te=he.aiActive?3e3:1e4;ye=window.setInterval(()=>{O.current||(ee(),X())},Te)}},15e3)):(console.error("Focus group not found with ID:",e),S(!1),Ke.error("Focus group not found",{description:`Could not find focus group with ID: ${e}`}))})}),()=>{ye&&window.clearInterval(ye),xe&&window.clearInterval(xe)}},[e,t]);const Ie=J=>{if(!J||!J.sections||!Array.isArray(J.sections))return{content:"Welcome to our focus group session! Let's begin our discussion.",sectionId:"welcome",itemId:"welcome-message"};const Y=J.sections[0];if(!Y)return{content:"Welcome to our focus group session! Let's begin our discussion.",sectionId:"welcome",itemId:"welcome-message"};const ye=je=>je.questions&&Array.isArray(je.questions)&&je.questions.length>0?{content:je.questions[0].content,itemId:je.questions[0].id,type:"question"}:je.activities&&Array.isArray(je.activities)&&je.activities.length>0?{content:je.activities[0].content,itemId:je.activities[0].id,type:"activity"}:null;let xe=ye(Y);if(!xe&&Y.subsections&&Array.isArray(Y.subsections)){for(const je of Y.subsections)if(xe=ye(je),xe)break}return xe?{content:xe.content,sectionId:Y.id,itemId:xe.itemId}:{content:`Welcome to our focus group session on "${Y.title||"our topic"}". Let's begin our discussion.`,sectionId:Y.id,itemId:"section-intro"}},we=async()=>{var J,Y,ye,xe,je,Qe;if(e)try{Ke.info("Starting focus group session...",{description:"The session is now ready for AI moderation."});try{const I=await jn.getModeratorStatus(e),K=(Y=(J=I==null?void 0:I.data)==null?void 0:J.status)==null?void 0:Y.moderator_position;K?console.log("📍 Preserving existing moderator position:",K):(await jn.setModeratorPosition(e,((je=(xe=(ye=c==null?void 0:c.discussionGuide)==null?void 0:ye.sections)==null?void 0:xe[0])==null?void 0:je.id)||"welcome"),console.log("🚀 Moderator position initialized to start of discussion guide (first time)"))}catch(I){console.warn("Failed to check/initialize moderator position:",I)}await bt.update(e,{status:"active"});try{const I=Ie(c==null?void 0:c.discussionGuide),K={id:`msg-${Date.now()}`,senderId:"moderator",text:I.content,timestamp:new Date,type:"question"},W=await bt.sendMessage(e,{senderId:"moderator",text:K.text,type:"question"});(Qe=W==null?void 0:W.data)!=null&&Qe.message_id&&(K.id=W.data.message_id),ze(K),console.log("🚀 Initial moderator message created:",{content:I.content,sectionId:I.sectionId,itemId:I.itemId})}catch(I){console.warn("Failed to create initial moderator message:",I)}Ke.success("Focus group session started",{description:"The discussion has begun. Use the control panel below to moderate."})}catch(I){console.error("Error starting session:",I),Ke.error("Error starting session",{description:"There was a problem connecting to the server."})}},ze=J=>{r(Y=>[...Y,J])},gt=async J=>{const Y=[...n],ye=Y.findIndex(xe=>xe.id===J);if(ye!==-1){const xe=Y[ye],je=!xe.highlighted;if(Y[ye]={...xe,highlighted:je},r(Y),e)try{!J.startsWith("local-")&&!J.startsWith("msg-")?await bt.updateMessageHighlight(e,J,je):console.log("Skipping database update for local message:",J)}catch(Qe){console.error("Error updating message highlight state:",Qe),Ke.error("Failed to save highlight state",{description:"The highlight may not persist if the page is refreshed."})}}},St=J=>d.find(Y=>Y.id===J||Y._id===J),He=()=>{const J=n.map(xe=>{var I;let je;return xe.senderId==="moderator"?je="AI Moderator":xe.senderId==="facilitator"?je="Human Facilitator":je=((I=St(xe.senderId))==null?void 0:I.name)||"Unknown",`[${xe.timestamp.toLocaleTimeString()}] ${je}: ${xe.text}`}).join(` -`),Y=document.createElement("a"),ye=new Blob([J],{type:"text/plain"});Y.href=URL.createObjectURL(ye),Y.download=`focus-group-${e}-transcript.txt`,document.body.appendChild(Y),Y.click(),document.body.removeChild(Y),Ke.success("Transcript downloaded",{description:"The focus group transcript has been saved to your device."})},Ze=(J,Y)=>{const ye=he=>{const ke=he.match(/^\[([^\]]+)\]:\s*(.*)$/);return ke?ke[2].trim():he.trim()},xe=he=>he.toLowerCase().replace(/[^\w\s]/g," ").replace(/\s+/g," ").trim(),je=(he,ke)=>{const qe=xe(he),Ft=xe(ke);if(qe===Ft)return 1;if(qe.includes(Ft)||Ft.includes(qe))return Math.min(qe.length,Ft.length)/Math.max(qe.length,Ft.length);const Wt=qe.split(" "),It=Ft.split(" "),fa=Wt.filter(tc=>It.includes(tc)&&tc.length>2);return Wt.length===0||It.length===0?0:fa.length/Math.max(Wt.length,It.length)},Qe=typeof J=="object"&&J!==null,I=Qe?J.text:ye(J),K=Qe?J.original:J;let W=null,ie="";if(Y&&(W=n.find(he=>he.id===Y),W?ie="direct_message_id_match":console.warn(`Message ID ${Y} not found in current messages array`)),W||(W=n.find(he=>he.text.includes(K)),W&&(ie="exact_full_match")),W||(W=n.find(he=>he.text.includes(I)),W&&(ie="exact_text_match")),W||(W=n.find(he=>I.includes(he.text.trim())),W&&(ie="reverse_exact_match")),!W){const he=I.toLowerCase();W=n.find(ke=>ke.text.toLowerCase().includes(he)||he.includes(ke.text.toLowerCase())),W&&(ie="case_insensitive_match")}if(!W){const he=n.map(ke=>({message:ke,similarity:je(I,ke.text)})).filter(ke=>ke.similarity>.7).sort((ke,qe)=>qe.similarity-ke.similarity);he.length>0&&(W=he[0].message,ie=`fuzzy_match_${Math.round(he[0].similarity*100)}%`)}if(!W){const ke=xe(I).split(" ").filter(qe=>qe.length>3);ke.length>0&&(W=n.find(qe=>{const Ft=xe(qe.text);return ke.every(Wt=>Ft.includes(Wt))}),W&&(ie="partial_word_match"))}W?(console.log(`Quote match found using strategy: ${ie}`,{quoteType:Qe?"QuoteData":"string",providedMessageId:Y,extractedText:I,matchedMessage:W.text.substring(0,100),matchedMessageId:W.id,originalQuote:K.substring(0,100)}),p("chat"),setTimeout(()=>{const he=document.getElementById(`message-${W.id}`);he&&(P||he.scrollIntoView({behavior:"smooth",block:"center"}),he.style.backgroundColor="#fbbf24",he.style.transition="background-color 0.3s ease",setTimeout(()=>{he.style.backgroundColor=""},2e3))},100)):(console.warn("Quote match failed",{quoteType:Qe?"QuoteData":"string",providedMessageId:Y,originalQuote:K.substring(0,100),extractedText:I.substring(0,100),totalMessages:n.length,messageSample:n.slice(0,3).map(he=>({id:he.id,text:he.text.substring(0,50)}))}),Ke.warning("Message not found",{description:"Could not locate the original message for this quote. The quote may have been paraphrased by the AI."}))},kt=J=>{l(Y=>{const ye=new Set(Y.map(je=>je.id)),xe=J.filter(je=>!ye.has(je.id));return[...Y,...xe]})},Vt=async J=>{if(!e)return;const Y=o.find(ye=>ye.id===J);if(Y)try{"source"in Y&&Y.source==="generated"&&await jn.deleteKeyTheme(e,J),l(o.filter(ye=>ye.id!==J))}catch(ye){console.error("Error deleting theme:",ye),Ke.error("Failed to delete theme",{description:"There was an error removing the theme. Please try again."})}},Xn=v.useCallback(async(J,Y)=>{if(e)try{await jn.setModeratorPosition(e,J,Y),await X(),Ke.success("Moderator position updated",{description:"The moderator has been moved to the selected section."})}catch(ye){console.error("Error setting moderator position:",ye),Ke.error("Failed to update moderator position",{description:"There was an error updating the moderator position."})}},[e]),an=v.useCallback(async J=>{if(console.log("💾 handleDiscussionGuideSave called:",{hasId:!!e,isEditingGuideContent:M,timestamp:new Date().toISOString()}),!!e)try{await St.update(e,{discussionGuide:J}),M?($.current&&($.current={...$.current,discussionGuide:J}),console.log("⚠️ Skipping focus group state update during editing to preserve focus")):(console.log("🔄 Updating focus group state (not editing)"),u(Y=>Y?{...Y,discussionGuide:J}:null))}catch(Y){throw console.error("Error saving discussion guide:",Y),Y}},[e,M]),pt=v.useCallback(J=>{console.log("🔄 handleGuideEditingStateChange called:",{editing:J,timestamp:new Date().toISOString(),currentIsEditingGuideContent:M}),k(J),A(J),!J&&$.current&&(console.log("📝 Updating focus group state after editing ended"),u($.current))},[M]),tt=v.useCallback(()=>{_(J=>!J)},[]),it=v.useCallback((J,Y,ye,xe,je,Qe)=>{at({isOpen:!0,sectionId:J,itemId:Y,content:ye,sectionTitle:xe,itemTitle:je,itemType:Qe})},[]),Lt=J=>{console.log("🔍 EXTRACT ASSET FILENAME DEBUG - Input content:",J);const Y=[/'([^']*\.[a-zA-Z]{3,4})'/g,/"([^"]*\.[a-zA-Z]{3,4})"/g,/titled\s+['"]([^'"]*\.[a-zA-Z]{3,4})['"](?:\.|,|\s|$)/gi,/asset[:\s]+['"]?([^'"\s]*\.[a-zA-Z]{3,4})['"]?(?:\.|,|\s|$)/gi,/image[:\s]+['"]?([^'"\s]*\.[a-zA-Z]{3,4})['"]?(?:\.|,|\s|$)/gi,/file[:\s]+['"]?([^'"\s]*\.[a-zA-Z]{3,4})['"]?(?:\.|,|\s|$)/gi,/\b([a-zA-Z0-9_-]+\.[a-zA-Z]{3,4})\b/g];for(let ye=0;ye0){const Qe=je[0][1];if(console.log(`🔍 Pattern ${ye+1} extracted filename:`,Qe),Qe&&Qe.includes("."))return console.log("✅ EXTRACT ASSET FILENAME - Found:",Qe),Qe}}return console.warn("❌ EXTRACT ASSET FILENAME - No filename found in content"),null},tn=()=>{if(g)return{sectionId:g.current_section_id,sectionTitle:g.current_section,itemId:g.current_item_id,itemTitle:g.current_item}},Xr=()=>{if(n.length!==0)return n[n.length-1].id},za=()=>{const J=Xr();if(!J||n.length===0)return new Date;const Y=n.find(ye=>ye.id===J);return Y?Y.timestamp:new Date},G=async()=>{if(e){de(!0),Pe(!1),Je(!1),Ke.info("Analyzing discussion for key themes...",{description:"This may take a moment as we process the entire conversation."});try{const J=await jn.generateKeyThemes(e);J.data&&J.data.themes?(Pe(!0),Ke.success(`Generated ${J.data.themes.length} key themes`,{description:"New themes have been added to the analysis."}),l(Y=>[...Y,...J.data.themes])):(Pe(!0),Ke.warning("No new themes were generated",{description:"Try again when the discussion has more content."}))}catch(J){console.error("Error generating key themes:",J),Je(!0),Ke.error("Failed to generate key themes",{description:"There was an error analyzing the discussion. Please try again."})}}},Ce=()=>{de(!1),Pe(!1),Je(!1)},Oe=()=>{B||le(new Date),ge(!0)},Ue=J=>{H(Y=>[...Y,J].sort((ye,xe)=>xe.createdAt.getTime()-ye.createdAt.getTime())),window.notesPanelAddNote&&window.notesPanelAddNote(J)},Le=J=>{const Y=n.find(ye=>ye.id===J);Y?(p("chat"),setTimeout(()=>{const ye=document.getElementById(`message-${Y.id}`);ye&&(P||ye.scrollIntoView({behavior:"smooth",block:"center"}),ye.style.backgroundColor="#fbbf24",ye.style.transition="background-color 0.3s ease",setTimeout(()=>{ye.style.backgroundColor=""},2e3))},100)):Ke.info("Message not found",{description:"Could not locate the original message for this note."})};v.useEffect(()=>{n.length>0&&!B&&le(new Date)},[n.length,B]),v.useEffect(()=>{O.current=P,P||X()},[P]);const ft=J=>{ce(Y=>Y.includes(J)?Y.filter(ye=>ye!==J):[...Y,J])};return j?i.jsxs("div",{className:"min-h-screen bg-slate-50 pt-20 pb-16 px-4",children:[i.jsx(oi,{}),i.jsxs("div",{className:"max-w-7xl mx-auto text-center py-12",children:[i.jsx("div",{className:"flex justify-center items-center",children:i.jsx("div",{className:"animate-spin rounded-full h-8 w-8 border-b-2 border-primary"})}),i.jsx("p",{className:"mt-4 text-slate-600",children:"Loading focus group..."})]})]}):c?i.jsxs("div",{className:"min-h-screen bg-slate-50",children:[i.jsx(oi,{}),i.jsxs("main",{className:"pt-20 pb-16 px-4 sm:px-6 lg:px-8 max-w-7xl mx-auto",children:[i.jsxs("div",{className:"flex flex-col sm:flex-row justify-between items-start sm:items-center mb-4",children:[i.jsxs("div",{className:"flex items-center",children:[i.jsx(te,{variant:"ghost",onClick:()=>t("/focus-groups"),className:"mr-2",children:i.jsx(zf,{className:"h-4 w-4"})}),i.jsxs("div",{children:[i.jsx("h1",{className:"font-sf text-2xl font-bold text-slate-900",children:c.name}),i.jsx("p",{className:"text-slate-600",children:new Date(c.date).toLocaleString()}),i.jsxs("div",{className:"flex items-center mt-1",children:[i.jsx(fo,{className:"h-3 w-3 text-slate-500 mr-1"}),i.jsx(Wn,{variant:"secondary",className:"text-xs",children:c.llm_model==="gpt-4.1"?"GPT-4.1":"Gemini 2.5 Pro"})]})]})]}),i.jsxs("div",{className:"flex items-center space-x-4 mt-4 sm:mt-0",children:[i.jsxs(te,{variant:"outline",onClick:()=>b(!y),className:y?"bg-blue-50 text-blue-600":"",children:[i.jsx(cw,{className:"mr-2 h-4 w-4"}),"AI Dashboard"]}),i.jsxs(te,{variant:"outline",onClick:()=>V(!0),children:[i.jsx(LS,{className:"mr-2 h-4 w-4"}),"AI Model"]}),i.jsxs(te,{variant:"outline",onClick:Ge,children:[i.jsx($l,{className:"mr-2 h-4 w-4"}),"Download Transcript"]})]})]}),De&&i.jsx("div",{className:"mb-6",children:i.jsx(IN,{isActive:De,isComplete:be,hasError:ne,label:"Analyzing discussion for key themes",onComplete:Ce,className:"max-w-4xl mx-auto"})}),i.jsx(K_e,{discussionGuide:c.discussionGuide,moderatorStatus:g,onSectionSelect:Xn,onSetPosition:it,onSave:an,focusGroupId:e||"",isOpen:N,onToggle:tt,onEditingChange:pt}),i.jsxs("div",{className:"flex flex-col lg:flex-row gap-6 h-[calc(100vh-12rem)]",children:[i.jsx(OQ,{participants:d,selectedParticipantIds:se,onToggleParticipantFilter:ft}),i.jsx("div",{className:"flex-1 flex flex-col",children:i.jsxs(Fo,{defaultValue:"chat",value:h,onValueChange:p,className:"w-full h-full flex flex-col",children:[i.jsxs(Pi,{className:"grid grid-cols-4 mb-4",children:[i.jsxs(Xt,{value:"chat",className:"flex items-center",children:[i.jsx(xa,{className:"h-4 w-4 mr-2"}),"Discussion"]}),i.jsxs(Xt,{value:"themes",className:"flex items-center",children:[i.jsx(Ml,{className:"h-4 w-4 mr-2"}),"Key Themes"]}),i.jsxs(Xt,{value:"notes",className:"flex items-center",children:[i.jsx(dg,{className:"h-4 w-4 mr-2"}),"Notes"]}),i.jsxs(Xt,{value:"analytics",className:"flex items-center",children:[i.jsx(cw,{className:"h-4 w-4 mr-2"}),"Analytics"]})]}),i.jsx(Yt,{value:"chat",className:"m-0 flex-1 flex flex-col h-0",children:n.length===0?i.jsxs("div",{className:"flex flex-col items-center justify-center py-12 space-y-4",children:[i.jsx("p",{className:"text-lg text-slate-600",children:"No messages yet. Start the session to begin the discussion."}),i.jsxs(te,{onClick:we,size:"lg",className:"flex items-center gap-2",children:[i.jsx(sI,{className:"h-5 w-5"}),"Start Session"]})]}):i.jsx(aJ,{messages:n,modeEvents:s,personas:d,isSpeaking:!1,focusGroupId:e||"",isAiModeActive:x,selectedParticipantIds:se,onToggleHighlight:gt,onAdvanceDiscussion:()=>null,onNewMessage:ze,onStatusChange:me,isEditingDiscussionGuide:P})}),i.jsx(Yt,{value:"themes",className:"m-0",children:i.jsx(oJ,{themes:o,messages:n,personas:d,focusGroupId:e||"",onThemesGenerated:kt,onThemeDelete:Vt,onQuoteClick:Ze,onGenerateKeyThemes:G})}),i.jsx(Yt,{value:"notes",className:"m-0",style:{height:"calc(100% - 3.5rem)"},children:i.jsx("div",{className:"h-full",children:i.jsx(X_e,{focusGroupId:e||"",focusGroupName:c==null?void 0:c.name,onNoteClick:Le})})}),i.jsx(Yt,{value:"analytics",className:"m-0",children:i.jsx(G_e,{messages:n,themes:o,personas:d})})]})})]})]}),n.length>0&&i.jsx("div",{className:"fixed bottom-6 right-6 z-40",children:i.jsx(te,{onClick:Oe,className:"rounded-full h-12 w-12 p-0 shadow-lg",title:"Take a quick note",children:i.jsx(dg,{className:"h-5 w-5"})})}),i.jsx(Y_e,{isOpen:re,onClose:()=>ge(!1),focusGroupId:e||"",associatedMessageId:Xr(),sectionInfo:tn(),messageTimestamp:za(),onNoteSaved:Ue}),i.jsx(wl,{open:ve.isOpen,onOpenChange:J=>at(Y=>({...Y,isOpen:J})),children:i.jsxs(ho,{children:[i.jsxs(po,{children:[i.jsx(go,{children:"Set Moderator Position"}),i.jsxs(jl,{children:['Are you sure you want to set the moderator position to "',ve.itemTitle,'" in section "',ve.sectionTitle,'"? This will make the moderator ask this question in the chat.']})]}),i.jsxs(mo,{children:[i.jsx(te,{variant:"outline",disabled:ve.isLoading,onClick:()=>at({isOpen:!1}),children:"Cancel"}),i.jsxs(te,{disabled:ve.isLoading,onClick:async()=>{var J,Y,ye,xe,je,Qe,I,K,W;if(!(!e||!ve.sectionId||!ve.itemId||!ve.content)){at(ie=>({...ie,isLoading:!0}));try{await jn.setModeratorPosition(e,ve.sectionId,ve.itemId);let ie=[],he=!1,ke=ve.content;const qe=ve.content?Lt(ve.content):null,Ft=!!qe;if(console.log("🔍 MANUAL POSITION DEBUG:",{itemType:ve.itemType,hasImageAttached:Ft,assetFilename:qe,content:ve.content,sectionTitle:ve.sectionTitle,itemTitle:ve.itemTitle,contentLength:(J=ve.content)==null?void 0:J.length}),Ft&&ve.content&&qe)if(console.log("🔍 ASSET EXTRACTION DEBUG:",{originalContent:ve.content,extractedFilename:qe,contentLength:ve.content.length}),qe){ie=[qe],he=!0,console.log("🎨 MANUAL POSITION: Creative review detected, will activate visual context for:",qe);try{console.log("🎨 MANUAL MODE: Requesting AI description for",qe);try{console.log("🔍 TESTING: Calling test endpoint first...");const fa=await He.post(`/focus-groups/${e}/test-endpoint`,{test:"data"});console.log("✅ TEST: Test endpoint response:",fa.data)}catch(fa){console.error("❌ TEST: Test endpoint failed:",fa)}const It=await St.describeAsset(e,qe);It.data.description&&(ke=ve.content.replace(`'${qe}'`,`'${qe}' - ${It.data.description}`),console.log("✅ MANUAL MODE: Enhanced question with AI description"),console.log("🔍 Original:",ve.content),console.log("🔍 Enhanced:",ke))}catch(It){console.error("⚠️ MANUAL MODE: Failed to generate AI description:",It),console.error("⚠️ Error response data:",(Y=It.response)==null?void 0:Y.data),console.error("⚠️ Error status:",(ye=It.response)==null?void 0:ye.status),console.error("⚠️ Error headers:",(xe=It.response)==null?void 0:xe.headers),console.error("⚠️ Full axios error:",{message:It.message,code:It.code,status:(je=It.response)==null?void 0:je.status,statusText:(Qe=It.response)==null?void 0:Qe.statusText,url:(I=It.config)==null?void 0:I.url,method:(K=It.config)==null?void 0:K.method}),Ke.warning("AI description failed",{description:"Using original question text. Image will still be available to participants."})}}else console.warn("⚠️ MANUAL POSITION: Creative review detected but no asset filename extracted from content");const Wt={id:`msg-${Date.now()}`,senderId:"moderator",text:ke,timestamp:new Date,type:"question"};try{const It=await St.sendMessage(e,{senderId:"moderator",text:ke,type:"question",attached_assets:ie,activates_visual_context:he});(W=It==null?void 0:It.data)!=null&&W.message_id&&(Wt.id=It.data.message_id)}catch(It){console.warn("Failed to save message to API, showing locally:",It)}ze(Wt),at({isOpen:!1}),setTimeout(async()=>{await X(),setTimeout(()=>X(),500)},200),Ke.success("Moderator position set",{description:`Position set to "${ve.itemTitle}" in "${ve.sectionTitle}"`})}catch(ie){console.error("Error setting moderator position:",ie),at(he=>({...he,isLoading:!1})),Ke.error("Failed to set moderator position",{description:"There was an error setting the moderator position."})}}},className:"flex items-center gap-2",children:[ve.isLoading&&i.jsx("div",{className:"animate-spin rounded-full h-4 w-4 border-b-2 border-white"}),ve.isLoading?"Generating detailed image description...":"Confirm"]})]})]})}),i.jsx(wl,{open:D,onOpenChange:V,children:i.jsxs(ho,{children:[i.jsxs(po,{children:[i.jsx(go,{children:"AI Model Settings"}),i.jsx(jl,{children:"Choose which AI model to use for generating responses and discussion guides in this focus group."})]}),i.jsxs("div",{className:"space-y-4",children:[i.jsxs("div",{className:"flex items-center space-x-2",children:[i.jsx(fo,{className:"h-4 w-4 text-slate-500"}),i.jsx("span",{className:"text-sm font-medium",children:"Current Model:"}),i.jsx(Wn,{variant:"secondary",children:(c==null?void 0:c.llm_model)==="gpt-4.1"?"GPT-4.1":"Gemini 2.5 Pro"})]}),i.jsxs("div",{children:[i.jsx("label",{className:"text-sm font-medium",children:"Select AI Model:"}),i.jsxs(Mn,{value:T,onValueChange:J=>{console.log("🔧 Model selection changed:",{from:T,to:J}),F(J)},children:[i.jsx(Pn,{className:"mt-1",children:i.jsx(In,{placeholder:"Select AI model"})}),i.jsxs(An,{children:[i.jsx(fe,{value:"gemini-2.5-pro",children:"Gemini 2.5 Pro"}),i.jsx(fe,{value:"gpt-4.1",children:"GPT-4.1"})]})]})]}),i.jsxs("div",{className:"text-xs text-slate-600",children:[i.jsxs("p",{children:[i.jsx("strong",{children:"Gemini 2.5 Pro:"})," Google's advanced model, great for creative and analytical tasks."]}),i.jsxs("p",{children:[i.jsx("strong",{children:"GPT-4.1:"})," OpenAI's latest model, excellent for conversational and reasoning tasks."]})]})]}),i.jsxs(mo,{children:[i.jsx(te,{variant:"outline",onClick:()=>V(!1),disabled:q,children:"Cancel"}),i.jsxs(te,{onClick:()=>{console.log("🔧 Update button clicked:",{selectedModel:T,currentModel:c==null?void 0:c.llm_model,isDisabled:q||T===(c==null?void 0:c.llm_model)}),Se(T)},disabled:q||T===(c==null?void 0:c.llm_model),children:[q&&i.jsx("div",{className:"animate-spin rounded-full h-4 w-4 border-b-2 border-white mr-2"}),q?"Updating...":"Update Model"]})]})]})}),i.jsx(q_e,{focusGroupId:e,personas:d,isVisible:y,onToggle:()=>b(!y)})]}):i.jsxs("div",{className:"min-h-screen bg-slate-50 pt-20 pb-16 px-4",children:[i.jsx(oi,{}),i.jsxs("div",{className:"max-w-7xl mx-auto text-center py-12",children:[i.jsx("h1",{className:"text-2xl font-bold",children:"Focus group not found"}),i.jsx("p",{className:"mt-2 text-slate-600",children:"We couldn't find the focus group you're looking for."}),i.jsxs(te,{onClick:()=>t("/focus-groups"),className:"mt-4",children:[i.jsx(zf,{className:"mr-2 h-4 w-4"})," Back to Focus Groups"]})]})]})},Q_e=({title:e,description:t})=>i.jsxs("div",{className:"flex flex-col sm:flex-row justify-between items-start sm:items-center mb-8",children:[i.jsxs("div",{children:[i.jsx("h1",{className:"font-sf text-3xl font-bold text-slate-900",children:e}),i.jsx("p",{className:"text-slate-600 mt-1",children:t})]}),i.jsxs("div",{className:"mt-4 sm:mt-0 flex gap-2",children:[i.jsx(te,{variant:"outline",children:"Export Data"}),i.jsx(te,{children:"Generate Report"})]})]}),nb=({title:e,value:t,changePercentage:n,icon:r})=>i.jsx(rt,{className:"p-6 hover:shadow-md transition-shadow",children:i.jsxs("div",{className:"flex justify-between items-start",children:[i.jsxs("div",{children:[i.jsx("p",{className:"text-muted-foreground text-sm",children:e}),i.jsx("h3",{className:"text-2xl font-bold mt-1",children:t}),i.jsxs("p",{className:`${n>=0?"text-green-500":"text-red-500"} text-xs mt-1`,children:[n>=0?"↑":"↓"," ",Math.abs(n),"% from last month"]})]}),i.jsx("div",{className:"bg-primary/10 p-2 rounded-full",children:i.jsx(r,{className:"h-6 w-6 text-primary"})})]})}),J_e=[{name:"Jan",users:20,groups:3,interactions:120},{name:"Feb",users:25,groups:4,interactions:160},{name:"Mar",users:30,groups:5,interactions:220},{name:"Apr",users:40,groups:6,interactions:280},{name:"May",users:45,groups:7,interactions:350},{name:"Jun",users:48,groups:7,interactions:420}],ePe=[{id:"1",title:"User Interface Feedback",description:"Users consistently mentioned difficulty with the navigation menu on mobile devices.",source:"Mobile App Focus Group",date:"2023-06-12",sentiment:"negative"},{id:"2",title:"Feature Adoption",description:'The new search functionality is well-received, with 85% of users rating it as "very useful".',source:"Product Testing Group",date:"2023-06-10",sentiment:"positive"},{id:"3",title:"Pricing Strategy",description:"Price-conscious users expressed willingness to pay up to 20% more for premium features.",source:"Pricing Model Analysis",date:"2023-06-08",sentiment:"positive"},{id:"4",title:"Competitive Analysis",description:"Users who switched from competitor products cited our streamlined onboarding as a key factor.",source:"Customer Journey Mapping",date:"2023-06-05",sentiment:"positive"}],tPe=()=>i.jsxs("div",{className:"space-y-6",children:[i.jsxs(rt,{className:"p-6",children:[i.jsx("h3",{className:"font-sf text-lg font-semibold mb-4",children:"Research Activity"}),i.jsx("div",{className:"h-64",children:i.jsx(yo,{width:"100%",height:"100%",children:i.jsxs(lB,{data:J_e,margin:{top:10,right:30,left:0,bottom:0},children:[i.jsx(Vh,{strokeDasharray:"3 3"}),i.jsx(ko,{dataKey:"name"}),i.jsx(To,{}),i.jsx(mr,{}),i.jsx(ta,{type:"monotone",dataKey:"users",stackId:"1",stroke:"#8884d8",fill:"#8884d8",name:"Synthetic Users"}),i.jsx(ta,{type:"monotone",dataKey:"groups",stackId:"2",stroke:"#82ca9d",fill:"#82ca9d",name:"Focus Groups"}),i.jsx(ta,{type:"monotone",dataKey:"interactions",stackId:"3",stroke:"#ffc658",fill:"#ffc658",name:"Interactions"})]})})})]}),i.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-6",children:[i.jsxs(rt,{className:"p-6",children:[i.jsx("h3",{className:"font-sf text-lg font-semibold mb-4",children:"Recent AI Insights"}),i.jsxs("div",{className:"space-y-4",children:[ePe.slice(0,3).map(e=>i.jsx("div",{className:"border-b pb-4 last:border-b-0 last:pb-0",children:i.jsxs("div",{className:"flex items-start",children:[i.jsx("div",{className:`p-2 rounded-full mr-3 ${e.sentiment==="positive"?"bg-green-100":e.sentiment==="negative"?"bg-red-100":"bg-slate-100"}`,children:i.jsx(kl,{className:`h-4 w-4 ${e.sentiment==="positive"?"text-green-600":e.sentiment==="negative"?"text-red-600":"text-slate-600"}`})}),i.jsxs("div",{children:[i.jsx("h4",{className:"text-sm font-medium",children:e.title}),i.jsx("p",{className:"text-xs text-muted-foreground mt-1",children:e.description}),i.jsxs("div",{className:"flex items-center text-xs text-muted-foreground mt-2",children:[i.jsx("span",{children:e.source}),i.jsx("span",{className:"mx-2",children:"•"}),i.jsx("span",{children:e.date})]})]})]})},e.id)),i.jsx(te,{variant:"ghost",className:"w-full text-sm",size:"sm",children:"View All Insights"})]})]}),i.jsxs(rt,{className:"p-6",children:[i.jsx("h3",{className:"font-sf text-lg font-semibold mb-4",children:"Upcoming Research Tasks"}),i.jsxs("div",{className:"space-y-3",children:[i.jsxs("div",{className:"flex items-start",children:[i.jsx("div",{className:"bg-blue-100 p-2 rounded-full mr-3",children:i.jsx(qp,{className:"h-4 w-4 text-blue-600"})}),i.jsxs("div",{children:[i.jsx("h4",{className:"text-sm font-medium",children:"Website Redesign Feedback"}),i.jsx("p",{className:"text-xs text-muted-foreground",children:"Focus group scheduled for Jun 20"})]})]}),i.jsxs("div",{className:"flex items-start",children:[i.jsx("div",{className:"bg-purple-100 p-2 rounded-full mr-3",children:i.jsx(qp,{className:"h-4 w-4 text-purple-600"})}),i.jsxs("div",{children:[i.jsx("h4",{className:"text-sm font-medium",children:"Mobile App User Testing"}),i.jsx("p",{className:"text-xs text-muted-foreground",children:"8 participants needed by Jun 25"})]})]}),i.jsxs("div",{className:"flex items-start",children:[i.jsx("div",{className:"bg-amber-100 p-2 rounded-full mr-3",children:i.jsx(qp,{className:"h-4 w-4 text-amber-600"})}),i.jsxs("div",{children:[i.jsx("h4",{className:"text-sm font-medium",children:"Pricing Strategy Evaluation"}),i.jsx("p",{className:"text-xs text-muted-foreground",children:"Create discussion guide by Jun 22"})]})]}),i.jsxs("div",{className:"flex items-start",children:[i.jsx("div",{className:"bg-green-100 p-2 rounded-full mr-3",children:i.jsx(qp,{className:"h-4 w-4 text-green-600"})}),i.jsxs("div",{children:[i.jsx("h4",{className:"text-sm font-medium",children:"Product Onboarding Flow"}),i.jsx("p",{className:"text-xs text-muted-foreground",children:"Results analysis due Jun 30"})]})]}),i.jsx(te,{variant:"ghost",className:"w-full text-sm",size:"sm",children:"Manage Research Calendar"})]})]})]})]}),nPe=[{name:"18-24",value:15},{name:"25-34",value:35},{name:"35-44",value:25},{name:"45-54",value:15},{name:"55+",value:10}],rPe=()=>i.jsxs(rt,{className:"p-6",children:[i.jsxs("div",{className:"flex justify-between items-center mb-4",children:[i.jsx("h3",{className:"font-sf text-lg font-semibold",children:"Synthetic Persona Analytics"}),i.jsx(te,{variant:"outline",size:"sm",children:"View Demographics"})]}),i.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-6",children:[i.jsxs("div",{className:"space-y-4",children:[i.jsx("p",{className:"text-sm text-muted-foreground",children:"Persona Demographics"}),i.jsx("div",{className:"h-60",children:i.jsx(yo,{width:"100%",height:"100%",children:i.jsxs(q_,{children:[i.jsx(mr,{}),i.jsx(da,{data:nPe,dataKey:"value",nameKey:"name",cx:"50%",cy:"50%",outerRadius:80,fill:"#FFDEE2",label:!0})]})})})]}),i.jsxs("div",{className:"space-y-4",children:[i.jsx("p",{className:"text-sm text-muted-foreground",children:"Persona Distribution"}),i.jsxs("div",{className:"space-y-4",children:[i.jsxs("div",{children:[i.jsxs("div",{className:"flex justify-between text-xs mb-1",children:[i.jsx("span",{children:"Age: 25-34"}),i.jsx("span",{children:"35%"})]}),i.jsx("div",{className:"h-2 bg-slate-100 rounded-full overflow-hidden",children:i.jsx("div",{className:"h-full bg-pink-400 rounded-full",style:{width:"35%"}})})]}),i.jsxs("div",{children:[i.jsxs("div",{className:"flex justify-between text-xs mb-1",children:[i.jsx("span",{children:"Tech Savvy"}),i.jsx("span",{children:"72%"})]}),i.jsx("div",{className:"h-2 bg-slate-100 rounded-full overflow-hidden",children:i.jsx("div",{className:"h-full bg-pink-300 rounded-full",style:{width:"72%"}})})]}),i.jsxs("div",{children:[i.jsxs("div",{className:"flex justify-between text-xs mb-1",children:[i.jsx("span",{children:"Brand Loyal"}),i.jsx("span",{children:"58%"})]}),i.jsx("div",{className:"h-2 bg-slate-100 rounded-full overflow-hidden",children:i.jsx("div",{className:"h-full bg-pink-500 rounded-full",style:{width:"58%"}})})]}),i.jsxs("div",{children:[i.jsxs("div",{className:"flex justify-between text-xs mb-1",children:[i.jsx("span",{children:"Price Sensitive"}),i.jsx("span",{children:"67%"})]}),i.jsx("div",{className:"h-2 bg-slate-100 rounded-full overflow-hidden",children:i.jsx("div",{className:"h-full bg-pink-200 rounded-full",style:{width:"67%"}})})]})]})]})]}),i.jsx("div",{className:"flex justify-center mt-6",children:i.jsx(te,{onClick:()=>window.location.href="/synthetic-users",children:"Manage Synthetic Personas"})})]}),sPe=[{name:"Jan",users:20,groups:3,interactions:120},{name:"Feb",users:25,groups:4,interactions:160},{name:"Mar",users:30,groups:5,interactions:220},{name:"Apr",users:40,groups:6,interactions:280},{name:"May",users:45,groups:7,interactions:350},{name:"Jun",users:48,groups:7,interactions:420}],Tk=[{name:"Very Positive",value:25,color:"#4ade80"},{name:"Positive",value:40,color:"#a3e635"},{name:"Neutral",value:20,color:"#93c5fd"},{name:"Negative",value:10,color:"#fb923c"},{name:"Very Negative",value:5,color:"#f87171"}],aPe=[{name:"Navigation",count:42},{name:"Performance",count:28},{name:"UX Design",count:36},{name:"Features",count:22},{name:"Onboarding",count:18}],iPe=()=>{const e=Tn();return i.jsxs(rt,{className:"p-6",children:[i.jsxs("div",{className:"flex justify-between items-center mb-4",children:[i.jsx("h3",{className:"font-sf text-lg font-semibold",children:"Focus Group Insights"}),i.jsx(te,{variant:"outline",size:"sm",onClick:()=>e("/focus-groups"),children:"View All Sessions"})]}),i.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-6 mb-6",children:[i.jsxs("div",{className:"space-y-4",children:[i.jsx("p",{className:"text-sm text-muted-foreground",children:"Session Analytics"}),i.jsx("div",{className:"h-60",children:i.jsx(yo,{width:"100%",height:"100%",children:i.jsxs(lB,{data:sPe,margin:{top:10,right:30,left:0,bottom:0},children:[i.jsx(Vh,{strokeDasharray:"3 3"}),i.jsx(ko,{dataKey:"name"}),i.jsx(To,{}),i.jsx(mr,{}),i.jsx(ta,{type:"monotone",dataKey:"interactions",stroke:"#8884d8",fill:"#8884d8",name:"User Interactions"})]})})})]}),i.jsxs("div",{className:"space-y-4",children:[i.jsx("p",{className:"text-sm text-muted-foreground",children:"Feedback Sentiment"}),i.jsx("div",{className:"h-60",children:i.jsx(yo,{width:"100%",height:"100%",children:i.jsxs(q_,{children:[i.jsx(mr,{}),i.jsx(da,{data:Tk,dataKey:"value",nameKey:"name",cx:"50%",cy:"50%",outerRadius:80,label:({name:t,percent:n})=>`${t} ${(n*100).toFixed(0)}%`,children:Tk.map((t,n)=>i.jsx(vp,{fill:t.color},`cell-${n}`))}),i.jsx(ci,{})]})})})]})]}),i.jsxs("div",{className:"mb-6",children:[i.jsx("p",{className:"text-sm text-muted-foreground mb-4",children:"Topic Frequency Analysis"}),i.jsx("div",{className:"h-60",children:i.jsx(yo,{width:"100%",height:"100%",children:i.jsxs(oB,{data:aPe,margin:{top:5,right:30,left:20,bottom:5},children:[i.jsx(Vh,{strokeDasharray:"3 3"}),i.jsx(ko,{dataKey:"name"}),i.jsx(To,{}),i.jsx(mr,{}),i.jsx(ci,{}),i.jsx(Wo,{dataKey:"count",name:"Mentions",fill:"#8884d8"})]})})})]}),i.jsx("div",{className:"flex justify-center",children:i.jsx(te,{onClick:()=>e("/focus-groups"),children:"Manage Focus Groups"})})]})},oPe=()=>{const[e,t]=v.useState("overview");return i.jsxs("div",{className:"min-h-screen bg-slate-50",children:[i.jsx(oi,{}),i.jsxs("main",{className:"pt-20 pb-16 px-4 sm:px-6 lg:px-8 max-w-7xl mx-auto",children:[i.jsx(Q_e,{title:"Dashboard",description:"Monitor and analyze your research insights"}),i.jsxs("div",{className:"grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-3 gap-4 mb-8",children:[i.jsx(nb,{title:"Total Synthetic Users",value:48,changePercentage:12,icon:or}),i.jsx(nb,{title:"Active Focus Groups",value:7,changePercentage:5,icon:$a}),i.jsx(nb,{title:"Research Insights",value:124,changePercentage:18,icon:Ml})]}),i.jsxs(Fo,{value:e,onValueChange:t,className:"glass-panel rounded-xl p-6",children:[i.jsxs(Pi,{className:"grid w-full grid-cols-3 mb-6",children:[i.jsx(Xt,{value:"overview",children:"Overview"}),i.jsx(Xt,{value:"users",children:"Synthetic Users"}),i.jsx(Xt,{value:"focus-groups",children:"Focus Groups"})]}),i.jsx(Yt,{value:"overview",children:i.jsx(tPe,{})}),i.jsx(Yt,{value:"users",children:i.jsx(rPe,{})}),i.jsx(Yt,{value:"focus-groups",children:i.jsx(iPe,{})})]})]})]})};function lPe({persona:e}){const t=e.id==="0",n=e.id==="1";return i.jsxs(rt,{className:"p-6",children:[i.jsxs("div",{className:"flex items-center space-x-4",children:[i.jsx("div",{className:"h-16 w-16 rounded-full bg-muted flex items-center justify-center",children:i.jsx("img",{src:lp(e),alt:e.name,className:"h-16 w-16 rounded-full object-cover"})}),i.jsxs("div",{children:[i.jsx("h2",{className:"font-sf text-xl font-semibold",children:e.name}),i.jsx("p",{className:"text-muted-foreground",children:e.occupation})]})]}),i.jsxs("div",{className:"mt-6 space-y-4",children:[i.jsxs("div",{className:"sidebar-section",children:[i.jsx(or,{className:"sidebar-icon"}),i.jsxs("div",{children:[i.jsx("h3",{className:"font-medium text-sm",children:"Demographics"}),i.jsxs("p",{className:"text-sm text-muted-foreground mt-1",children:[e.age," ",e.gender?i.jsxs(i.Fragment,{children:["• ",e.gender]}):null,e.ethnicity?i.jsxs(i.Fragment,{children:[" • ",e.ethnicity]}):null]}),e.education&&i.jsx("p",{className:"sidebar-sub-item",children:e.education}),e.socialGrade&&i.jsxs("p",{className:"sidebar-sub-item",children:["Social Grade: ",e.socialGrade]}),e.householdIncome&&i.jsxs("p",{className:"sidebar-sub-item",children:["Household Income: ",e.householdIncome]}),e.householdComposition&&i.jsxs("p",{className:"sidebar-sub-item",children:["Household: ",e.householdComposition]})]})]}),i.jsxs("div",{className:"sidebar-section",children:[i.jsx(SW,{className:"sidebar-icon"}),i.jsxs("div",{children:[i.jsx("h3",{className:"font-medium text-sm",children:"Location"}),i.jsx("p",{className:"text-sm text-muted-foreground mt-1",children:e.location}),e.livingSituation&&i.jsx("p",{className:"sidebar-sub-item",children:e.livingSituation})]})]}),e.interests&&i.jsxs("div",{className:"sidebar-section",children:[i.jsx(fw,{className:"sidebar-icon"}),i.jsxs("div",{children:[i.jsx("h3",{className:"font-medium text-sm",children:"Interests"}),i.jsx("p",{className:"text-sm text-muted-foreground mt-1",children:e.interests})]})]}),e.mediaConsumption&&i.jsxs("div",{className:"sidebar-section",children:[i.jsx(d0,{className:"sidebar-icon"}),i.jsxs("div",{children:[i.jsx("h3",{className:"font-medium text-sm",children:"Media"}),i.jsx("p",{className:"text-sm text-muted-foreground mt-1",children:e.mediaConsumption})]})]}),i.jsxs("div",{className:"pt-4 border-t",children:[i.jsx("h3",{className:"font-medium text-sm mb-3",children:"Digital Behavior"}),i.jsxs("div",{className:"space-y-3",children:[i.jsxs("div",{children:[i.jsxs("div",{className:"flex justify-between text-xs mb-1",children:[i.jsx("span",{children:"Tech Savviness"}),i.jsxs("span",{children:[e.techSavviness,"%"]})]}),i.jsx("div",{className:"h-1.5 bg-slate-100 rounded-full overflow-hidden",children:i.jsx("div",{className:"h-full bg-blue-500 rounded-full",style:{width:`${e.techSavviness}%`}})})]}),e.brandLoyalty!==void 0&&i.jsxs("div",{children:[i.jsxs("div",{className:"flex justify-between text-xs mb-1",children:[i.jsx("span",{children:"Brand Loyalty"}),i.jsxs("span",{children:[e.brandLoyalty,"%"]})]}),i.jsx("div",{className:"h-1.5 bg-slate-100 rounded-full overflow-hidden",children:i.jsx("div",{className:"h-full bg-purple-500 rounded-full",style:{width:`${e.brandLoyalty}%`}})})]}),e.priceConsciousness!==void 0&&i.jsxs("div",{children:[i.jsxs("div",{className:"flex justify-between text-xs mb-1",children:[i.jsx("span",{children:"Price Sensitivity"}),i.jsxs("span",{children:[e.priceConsciousness,"%"]})]}),i.jsx("div",{className:"h-1.5 bg-slate-100 rounded-full overflow-hidden",children:i.jsx("div",{className:"h-full bg-amber-500 rounded-full",style:{width:`${e.priceConsciousness}%`}})})]}),e.environmentalConcern!==void 0&&i.jsxs("div",{children:[i.jsxs("div",{className:"flex justify-between text-xs mb-1",children:[i.jsx("span",{children:"Environmental Concern"}),i.jsxs("span",{children:[e.environmentalConcern,"%"]})]}),i.jsx("div",{className:"h-1.5 bg-slate-100 rounded-full overflow-hidden",children:i.jsx("div",{className:"h-full bg-green-500 rounded-full",style:{width:`${e.environmentalConcern}%`}})})]}),e.deviceUsage&&i.jsxs("div",{children:[i.jsx("h4",{className:"text-xs font-medium mt-3",children:"Device Usage"}),i.jsx("p",{className:"sidebar-sub-item text-xs",children:e.deviceUsage})]}),e.shoppingHabits&&i.jsxs("div",{children:[i.jsx("h4",{className:"text-xs font-medium mt-3",children:"Shopping Habits"}),i.jsx("p",{className:"sidebar-sub-item text-xs",children:e.shoppingHabits})]})]})]}),i.jsxs("div",{className:"pt-4 border-t",children:[i.jsx("h3",{className:"font-medium text-sm mb-3",children:"Additional Information"}),i.jsxs("div",{className:"space-y-2",children:[e.brandPreferences&&i.jsxs("div",{className:"sidebar-section",children:[i.jsx(fw,{className:"sidebar-icon"}),i.jsx("span",{className:"text-muted-foreground text-sm",children:e.brandPreferences})]}),e.communicationPreferences&&i.jsxs("div",{className:"sidebar-section",children:[i.jsx(fg,{className:"sidebar-icon"}),i.jsxs("span",{className:"text-muted-foreground text-sm",children:["Prefers: ",e.communicationPreferences]})]}),e.deviceUsage&&i.jsxs("div",{className:"sidebar-section",children:[i.jsx(_W,{className:"sidebar-icon"}),i.jsx("span",{className:"text-muted-foreground text-sm",children:e.deviceUsage})]}),e.shoppingHabits&&i.jsxs("div",{className:"sidebar-section",children:[i.jsx(EW,{className:"sidebar-icon"}),i.jsx("span",{className:"text-muted-foreground text-sm",children:e.shoppingHabits})]}),e.additionalInformation&&typeof e.additionalInformation=="string"&&i.jsxs("div",{className:"sidebar-section",children:[i.jsx(xW,{className:"sidebar-icon"}),i.jsx("div",{className:"sidebar-sub-item",children:e.additionalInformation.split(` -`).map((r,s)=>i.jsx("div",{className:"mb-1",children:r.trim().startsWith("•")||r.trim().startsWith("-")?r.trim():`• ${r.trim()}`},s))})]}),t&&i.jsxs("div",{className:"pt-2 space-y-2",children:[i.jsxs("div",{className:"sidebar-section",children:[i.jsx(IA,{className:"sidebar-icon"}),i.jsx("span",{className:"text-muted-foreground text-sm",children:"Maintains an extensive network of financial and luxury industry contacts"})]}),i.jsxs("div",{className:"sidebar-section",children:[i.jsx(hw,{className:"sidebar-icon"}),i.jsx("span",{className:"text-muted-foreground text-sm",children:"Owns vacation properties in the Cotswolds and South of France"})]}),i.jsxs("div",{className:"sidebar-section",children:[i.jsx(d0,{className:"sidebar-icon"}),i.jsx("span",{className:"text-muted-foreground text-sm",children:"Collector of rare first-edition books and limited-edition art prints"})]}),i.jsxs("div",{className:"sidebar-section",children:[i.jsx(RA,{className:"sidebar-icon"}),i.jsx("span",{className:"text-muted-foreground text-sm",children:"Significant investment portfolio with focus on sustainable luxury ventures"})]})]}),n&&i.jsxs("div",{className:"pt-2 space-y-2",children:[i.jsxs("div",{className:"sidebar-section",children:[i.jsx(d0,{className:"sidebar-icon"}),i.jsx("span",{className:"text-muted-foreground text-sm",children:"Active in industry panels, luxury brand collaborations, follows influencers in luxury & design"})]}),i.jsxs("div",{className:"sidebar-section",children:[i.jsx(hw,{className:"sidebar-icon"}),i.jsx("span",{className:"text-muted-foreground text-sm",children:"Modern flat in exclusive Chelsea, accessible to boutique services"})]}),i.jsxs("div",{className:"sidebar-section",children:[i.jsx(RA,{className:"sidebar-icon"}),i.jsx("span",{className:"text-muted-foreground text-sm",children:"Uses premium digital payment & secure banking for HNWIs"})]}),i.jsxs("div",{className:"sidebar-section",children:[i.jsx(IA,{className:"sidebar-icon"}),i.jsx("span",{className:"text-muted-foreground text-sm",children:"Respected network in London's luxury sector; attends exclusive events"})]}),i.jsxs("div",{className:"sidebar-section",children:[i.jsx(fg,{className:"sidebar-icon"}),i.jsx("span",{className:"text-muted-foreground text-sm",children:"Seeks autonomy, bespoke service, and acknowledgment for taste"})]})]})]})]})]})]})}function cPe({persona:e}){var t,n,r,s,a,o,l,c,u;return i.jsxs("div",{className:"space-y-6",children:[i.jsx(rt,{children:i.jsxs(bt,{className:"p-6",children:[i.jsxs("div",{className:"flex items-center mb-4",children:[i.jsx(Pm,{className:"h-5 w-5 text-primary mr-2"}),i.jsx("h3",{className:"font-sf text-lg font-medium",children:"Goals"})]}),i.jsx("ul",{className:"space-y-2",children:(t=e.goals)==null?void 0:t.map((d,f)=>i.jsxs("li",{className:"flex items-start",children:[i.jsx("div",{className:"h-5 w-5 rounded-full bg-primary/10 flex items-center justify-center mt-0.5 mr-3",children:i.jsx("span",{className:"text-xs text-primary font-medium",children:f+1})}),i.jsx("p",{className:"text-sm",children:d})]},f))})]})}),i.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-6",children:[i.jsx(rt,{children:i.jsxs(bt,{className:"p-6",children:[i.jsxs("div",{className:"flex items-center mb-4",children:[i.jsx(lI,{className:"h-5 w-5 text-amber-500 mr-2"}),i.jsx("h3",{className:"font-sf text-lg font-medium",children:"Frustrations"})]}),i.jsx("ul",{className:"space-y-2",children:(n=e.frustrations)==null?void 0:n.map((d,f)=>i.jsxs("li",{className:"text-sm flex items-start",children:[i.jsx("span",{className:"text-amber-500 mr-2",children:"•"}),i.jsx("span",{children:d})]},f))})]})}),i.jsx(rt,{children:i.jsxs(bt,{className:"p-6",children:[i.jsxs("div",{className:"flex items-center mb-4",children:[i.jsx(Za,{className:"h-5 w-5 text-green-500 mr-2"}),i.jsx("h3",{className:"font-sf text-lg font-medium",children:"Motivations"})]}),i.jsx("ul",{className:"space-y-2",children:(r=e.motivations)==null?void 0:r.map((d,f)=>i.jsxs("li",{className:"text-sm flex items-start",children:[i.jsx("span",{className:"text-green-500 mr-2",children:"•"}),i.jsx("span",{children:d})]},f))})]})})]}),i.jsx(rt,{children:i.jsxs(bt,{className:"p-6",children:[i.jsx("h3",{className:"font-sf text-lg font-medium mb-4",children:"Think, Feel, Do"}),i.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-3 gap-6",children:[i.jsxs("div",{children:[i.jsxs("div",{className:"flex items-center mb-3",children:[i.jsx(kl,{className:"h-5 w-5 text-blue-500 mr-2"}),i.jsx("h4",{className:"font-medium text-sm",children:"Thinks"})]}),i.jsx("ul",{className:"space-y-2",children:(a=(s=e.thinkFeelDo)==null?void 0:s.thinks)==null?void 0:a.map((d,f)=>i.jsxs("li",{className:"text-sm bg-blue-50 p-2 rounded-md",children:['"',d,'"']},f))})]}),i.jsxs("div",{children:[i.jsxs("div",{className:"flex items-center mb-3",children:[i.jsx(fw,{className:"h-5 w-5 text-red-500 mr-2"}),i.jsx("h4",{className:"font-medium text-sm",children:"Feels"})]}),i.jsx("ul",{className:"space-y-2",children:(l=(o=e.thinkFeelDo)==null?void 0:o.feels)==null?void 0:l.map((d,f)=>i.jsxs("li",{className:"text-sm bg-red-50 p-2 rounded-md",children:['"',d,'"']},f))})]}),i.jsxs("div",{children:[i.jsxs("div",{className:"flex items-center mb-3",children:[i.jsx(Za,{className:"h-5 w-5 text-green-500 mr-2"}),i.jsx("h4",{className:"font-medium text-sm",children:"Does"})]}),i.jsx("ul",{className:"space-y-2",children:(u=(c=e.thinkFeelDo)==null?void 0:c.does)==null?void 0:u.map((d,f)=>i.jsxs("li",{className:"text-sm bg-green-50 p-2 rounded-md",children:['"',d,'"']},f))})]})]})]})})]})}function uPe({persona:e}){var n,r,s,a,o;const t=[{trait:"Openness",value:((n=e.oceanTraits)==null?void 0:n.openness)||50},{trait:"Conscientiousness",value:((r=e.oceanTraits)==null?void 0:r.conscientiousness)||50},{trait:"Extraversion",value:((s=e.oceanTraits)==null?void 0:s.extraversion)||50},{trait:"Agreeableness",value:((a=e.oceanTraits)==null?void 0:a.agreeableness)||50},{trait:"Neuroticism",value:((o=e.oceanTraits)==null?void 0:o.neuroticism)||50}];return i.jsx(rt,{children:i.jsxs(bt,{className:"p-6",children:[i.jsx("h3",{className:"font-sf text-lg font-medium mb-4",children:"OCEAN Personality Traits"}),i.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-6",children:[i.jsx("div",{className:"h-80",children:i.jsx(yo,{width:"100%",height:"100%",children:i.jsxs(H_e,{outerRadius:90,data:t,children:[i.jsx(r6,{}),i.jsx(gd,{dataKey:"trait"}),i.jsx(md,{domain:[0,100]}),i.jsx(Sp,{name:"Personality",dataKey:"value",stroke:"#8884d8",fill:"#8884d8",fillOpacity:.5})]})})}),i.jsxs("div",{className:"space-y-4",children:[i.jsxs("div",{children:[i.jsxs("div",{className:"flex justify-between text-sm mb-1",children:[i.jsx("span",{children:"Openness to Experience"}),i.jsxs("span",{className:"font-medium",children:[t[0].value,"%"]})]}),i.jsx("div",{className:"h-2 bg-slate-100 rounded-full overflow-hidden",children:i.jsx("div",{className:"h-full bg-purple-500 rounded-full",style:{width:`${t[0].value}%`}})}),i.jsx("p",{className:"text-xs text-muted-foreground mt-1",children:t[0].value>75?"Highly creative and curious":t[0].value>50?"Somewhat imaginative and open to new ideas":"Practical and prefers routine"})]}),i.jsxs("div",{children:[i.jsxs("div",{className:"flex justify-between text-sm mb-1",children:[i.jsx("span",{children:"Conscientiousness"}),i.jsxs("span",{className:"font-medium",children:[t[1].value,"%"]})]}),i.jsx("div",{className:"h-2 bg-slate-100 rounded-full overflow-hidden",children:i.jsx("div",{className:"h-full bg-blue-500 rounded-full",style:{width:`${t[1].value}%`}})}),i.jsx("p",{className:"text-xs text-muted-foreground mt-1",children:t[1].value>75?"Highly organized and responsible":t[1].value>50?"Generally reliable and hardworking":"Spontaneous and flexible"})]}),i.jsxs("div",{children:[i.jsxs("div",{className:"flex justify-between text-sm mb-1",children:[i.jsx("span",{children:"Extraversion"}),i.jsxs("span",{className:"font-medium",children:[t[2].value,"%"]})]}),i.jsx("div",{className:"h-2 bg-slate-100 rounded-full overflow-hidden",children:i.jsx("div",{className:"h-full bg-green-500 rounded-full",style:{width:`${t[2].value}%`}})}),i.jsx("p",{className:"text-xs text-muted-foreground mt-1",children:t[2].value>75?"Highly sociable and outgoing":t[2].value>50?"Moderately social and talkative":"Reserved and reflective"})]}),i.jsxs("div",{children:[i.jsxs("div",{className:"flex justify-between text-sm mb-1",children:[i.jsx("span",{children:"Agreeableness"}),i.jsxs("span",{className:"font-medium",children:[t[3].value,"%"]})]}),i.jsx("div",{className:"h-2 bg-slate-100 rounded-full overflow-hidden",children:i.jsx("div",{className:"h-full bg-amber-500 rounded-full",style:{width:`${t[3].value}%`}})}),i.jsx("p",{className:"text-xs text-muted-foreground mt-1",children:t[3].value>75?"Highly cooperative and compassionate":t[3].value>50?"Generally kind and helpful":"Competitive and challenging"})]}),i.jsxs("div",{children:[i.jsxs("div",{className:"flex justify-between text-sm mb-1",children:[i.jsx("span",{children:"Neuroticism"}),i.jsxs("span",{className:"font-medium",children:[t[4].value,"%"]})]}),i.jsx("div",{className:"h-2 bg-slate-100 rounded-full overflow-hidden",children:i.jsx("div",{className:"h-full bg-red-500 rounded-full",style:{width:`${t[4].value}%`}})}),i.jsx("p",{className:"text-xs text-muted-foreground mt-1",children:t[4].value>75?"Highly sensitive and prone to stress":t[4].value>50?"Moderately reactive to challenges":"Emotionally stable and resilient"})]})]})]})]})})}function dPe({persona:e}){var r;const t=(s,a)=>{const o=[i.jsx(wW,{className:"sidebar-icon"},"grid"),i.jsx(OW,{className:"sidebar-icon"},"smartphone"),i.jsx(bW,{className:"sidebar-icon"},"laptop"),i.jsx(yW,{className:"sidebar-icon"},"grid2x2")];return o[a%o.length]},n=()=>e.scenarioType?e.scenarioType:"Life Scenarios";return i.jsx(rt,{children:i.jsxs(bt,{className:"p-6",children:[i.jsx("h3",{className:"font-sf text-lg font-medium mb-4",children:n()}),i.jsx("div",{className:"space-y-4",children:(r=e.scenarios)==null?void 0:r.map((s,a)=>i.jsx("div",{className:"bg-slate-50 p-4 rounded-lg border",children:i.jsxs("div",{className:"sidebar-section",children:[t(s,a),i.jsxs("div",{children:[i.jsxs("h4",{className:"font-medium text-sm mb-2",children:["Scenario ",a+1]}),i.jsx("p",{className:"text-sm",children:s})]})]})},a))})]})})}function fPe(){const e=Tn();return i.jsx("div",{className:"min-h-screen bg-slate-50 flex items-center justify-center",children:i.jsxs(rt,{className:"w-96 text-center p-6",children:[i.jsx("h2",{className:"text-xl font-semibold mb-4",children:"Persona Not Found"}),i.jsx("p",{className:"text-muted-foreground mb-6",children:"The persona you're looking for couldn't be found."}),i.jsx(te,{onClick:()=>e("/synthetic-users"),children:"Return to Personas"})]})})}function Ct({className:e,...t}){return i.jsx("div",{className:Me("animate-pulse rounded-md bg-muted",e),...t})}function hPe(){return i.jsxs("div",{className:"min-h-screen bg-slate-50",children:[i.jsx(oi,{}),i.jsxs("main",{className:"pt-20 pb-16 px-4 sm:px-6 lg:px-8 max-w-7xl mx-auto",children:[i.jsxs("div",{className:"flex items-center mb-6 relative",children:[i.jsx(Ct,{className:"absolute left-0 top-0 h-10 w-20"}),i.jsx(Ct,{className:"h-8 w-48 mx-auto"}),i.jsx(Ct,{className:"absolute right-0 top-0 h-10 w-32"})]}),i.jsxs("div",{className:"grid grid-cols-1 lg:grid-cols-3 gap-6 mt-10",children:[i.jsx("div",{className:"lg:col-span-1",children:i.jsxs(rt,{className:"p-6",children:[i.jsxs("div",{className:"flex items-center space-x-4",children:[i.jsx(Ct,{className:"h-16 w-16 rounded-full"}),i.jsxs("div",{className:"flex-1",children:[i.jsx(Ct,{className:"h-6 w-32 mb-2"}),i.jsx(Ct,{className:"h-4 w-24"})]})]}),i.jsxs("div",{className:"mt-6 space-y-4",children:[i.jsxs("div",{className:"flex items-start",children:[i.jsx(Ct,{className:"h-5 w-5 mr-3 mt-0.5"}),i.jsxs("div",{className:"flex-1",children:[i.jsx(Ct,{className:"h-4 w-20 mb-2"}),i.jsx(Ct,{className:"h-3 w-40 mb-1"}),i.jsx(Ct,{className:"h-3 w-36"})]})]}),i.jsxs("div",{className:"flex items-start",children:[i.jsx(Ct,{className:"h-5 w-5 mr-3 mt-0.5"}),i.jsxs("div",{className:"flex-1",children:[i.jsx(Ct,{className:"h-4 w-16 mb-2"}),i.jsx(Ct,{className:"h-3 w-32"})]})]}),i.jsxs("div",{className:"flex items-start",children:[i.jsx(Ct,{className:"h-5 w-5 mr-3 mt-0.5"}),i.jsxs("div",{className:"flex-1",children:[i.jsx(Ct,{className:"h-4 w-16 mb-2"}),i.jsx(Ct,{className:"h-3 w-full"})]})]}),i.jsxs("div",{className:"flex items-start",children:[i.jsx(Ct,{className:"h-5 w-5 mr-3 mt-0.5"}),i.jsxs("div",{className:"flex-1",children:[i.jsx(Ct,{className:"h-4 w-12 mb-2"}),i.jsx(Ct,{className:"h-3 w-full"})]})]}),i.jsxs("div",{className:"pt-4 border-t",children:[i.jsx(Ct,{className:"h-4 w-32 mb-3"}),i.jsx("div",{className:"space-y-3",children:[...Array(4)].map((e,t)=>i.jsxs("div",{children:[i.jsxs("div",{className:"flex justify-between mb-1",children:[i.jsx(Ct,{className:"h-3 w-24"}),i.jsx(Ct,{className:"h-3 w-8"})]}),i.jsx(Ct,{className:"h-1.5 w-full rounded-full"})]},t))})]}),i.jsxs("div",{className:"pt-4 border-t",children:[i.jsx(Ct,{className:"h-4 w-36 mb-3"}),i.jsx("div",{className:"space-y-2",children:[...Array(3)].map((e,t)=>i.jsxs("div",{className:"flex items-center",children:[i.jsx(Ct,{className:"h-4 w-4 mr-2"}),i.jsx(Ct,{className:"h-3 w-40"})]},t))})]})]})]})}),i.jsxs("div",{className:"lg:col-span-2",children:[i.jsxs("div",{className:"grid w-full grid-cols-3 gap-2 mb-6",children:[i.jsx(Ct,{className:"h-10 w-full"}),i.jsx(Ct,{className:"h-10 w-full"}),i.jsx(Ct,{className:"h-10 w-full"})]}),i.jsx(rt,{className:"p-6",children:i.jsxs("div",{className:"space-y-4",children:[i.jsx(Ct,{className:"h-6 w-48"}),i.jsx(Ct,{className:"h-4 w-full"}),i.jsx(Ct,{className:"h-4 w-full"}),i.jsx(Ct,{className:"h-4 w-3/4"}),i.jsxs("div",{className:"mt-8 space-y-4",children:[i.jsx(Ct,{className:"h-6 w-32"}),i.jsx(Ct,{className:"h-4 w-full"}),i.jsx(Ct,{className:"h-4 w-full"}),i.jsx(Ct,{className:"h-4 w-2/3"})]}),i.jsxs("div",{className:"mt-8 space-y-4",children:[i.jsx(Ct,{className:"h-6 w-40"}),i.jsx(Ct,{className:"h-4 w-full"}),i.jsx(Ct,{className:"h-4 w-full"}),i.jsx(Ct,{className:"h-4 w-5/6"})]})]})})]})]})]})]})}function pPe({message:e,onLoginSuccess:t,onCancel:n}){const{login:r}=Kl(),s=Tn(),[a,o]=v.useState("user"),[l,c]=v.useState("pass"),[u,d]=v.useState(!1),f=async()=>{if(!a||!l){oe.error("Please enter username and password");return}d(!0);try{await r(a,l),oe.success("Login successful"),t&&t()}catch(p){console.error("Login error:",p),oe.error("Login failed",{description:"Please check your credentials and try again"})}finally{d(!1)}},h=()=>{n?n():s("/synthetic-users")};return i.jsxs(rt,{className:"max-w-md mx-auto shadow-lg",children:[i.jsxs(Dr,{children:[i.jsx(ts,{children:"Login Required"}),i.jsx(nN,{children:e||"You need to log in to save personas to the database"})]}),i.jsxs(bt,{className:"space-y-4",children:[i.jsxs("div",{className:"space-y-2",children:[i.jsx(vs,{htmlFor:"username",children:"Username"}),i.jsx(Ot,{id:"username",placeholder:"Username",value:a,onChange:p=>o(p.target.value),disabled:u})]}),i.jsxs("div",{className:"space-y-2",children:[i.jsx(vs,{htmlFor:"password",children:"Password"}),i.jsx(Ot,{id:"password",type:"password",placeholder:"Password",value:l,onChange:p=>c(p.target.value),disabled:u})]}),i.jsx("div",{className:"text-sm text-muted-foreground",children:"Default credentials: user / pass"})]}),i.jsxs(rN,{className:"flex justify-between",children:[i.jsx(te,{variant:"outline",onClick:h,disabled:u,children:"Cancel"}),i.jsx(te,{onClick:f,disabled:u,children:u?i.jsxs(i.Fragment,{children:[i.jsx(ii,{className:"h-4 w-4 mr-2 animate-spin"}),"Logging in..."]}):"Login"})]})]})}function mPe({persona:e,onSave:t,onCancel:n}){var P,k,O,M,A,$,L,H,D,V,T,F,q,Z,re,ge;const r={...e,education:e.education||"",interests:e.interests||"",brandLoyalty:e.brandLoyalty||0,priceConsciousness:e.priceConsciousness||0,environmentalConcern:e.environmentalConcern||0,hasPurchasingPower:e.hasPurchasingPower||!1,hasChildren:e.hasChildren||!1,goals:e.goals||[],frustrations:e.frustrations||[],motivations:e.motivations||[],scenarios:e.scenarios||[],oceanTraits:e.oceanTraits||{openness:50,conscientiousness:50,extraversion:50,agreeableness:50,neuroticism:50},thinkFeelDo:e.thinkFeelDo||{thinks:[],feels:[],does:[]}},[s,a]=v.useState(r),[o,l]=v.useState(!1),[c,u]=v.useState(!1),[d,f]=v.useState(null);v.useState(!1);const{isAuthenticated:h,token:p}=Kl();v.useEffect(()=>{(async()=>{c&&h&&p&&(u(!1),d&&await _())})()},[h,p,c]);const g=(B,le)=>{a(se=>({...se,[B]:le}))},m=(B,le)=>{a(se=>({...se,oceanTraits:{...se.oceanTraits,[B]:le}}))},y=B=>{a(le=>({...le,[B]:[...le[B]||[],""]}))},b=(B,le,se)=>{a(ce=>{const De=[...ce[B]||[]];return De[le]=se,{...ce,[B]:De}})},x=(B,le)=>{a(se=>{const ce=[...se[B]||[]];return ce.splice(le,1),{...se,[B]:ce}})},w=(B,le,se)=>{a(ce=>{const De={...ce.thinkFeelDo},de=[...De[B]||[]];return de[le]=se,De[B]=de,{...ce,thinkFeelDo:De}})},j=B=>{a(le=>{var ce;const se={...le.thinkFeelDo,[B]:[...((ce=le.thinkFeelDo)==null?void 0:ce[B])||[],""]};return{...le,thinkFeelDo:se}})},S=(B,le)=>{a(se=>{const ce={...se.thinkFeelDo},De=[...ce[B]||[]];return De.splice(le,1),ce[B]=De,{...se,thinkFeelDo:ce}})},N=()=>{d&&(oe.error("Login canceled - Persona changes not saved"),u(!1),f(null),n())},_=async()=>{if(d){l(!0);try{const B={...d};delete B._id,delete B.isDbPersona;const le=await Dn.create(B),se={...d,id:le.data._id||le.data.id,_id:le.data._id||le.data.id,isDbPersona:!0};oe.success("Persona saved to database successfully"),u(!1),f(null),t(se)}catch(B){console.error("Error saving after login:",B),oe.error("Failed to save to database after login"),u(!1),f(null)}finally{l(!1)}}};return c?i.jsxs("div",{className:"max-w-5xl mx-auto bg-background p-6",children:[i.jsx("div",{className:"flex justify-between items-center mb-6",children:i.jsx("h2",{className:"font-sf text-2xl font-bold",children:"Authentication Required"})}),i.jsx("p",{className:"mb-6 text-muted-foreground",children:"Login is required to save personas to the database. You can either:"}),i.jsxs("ul",{className:"list-disc ml-6 mt-2 mb-6",children:[i.jsx("li",{children:"Log in to save this persona to the database"}),i.jsx("li",{children:"Cancel to discard your changes"})]}),i.jsx(pPe,{message:"Login is required to save your persona to the database",onLoginSuccess:_,onCancel:N})]}):i.jsxs("div",{className:"space-y-6",children:[i.jsxs("div",{className:"flex items-center justify-between",children:[i.jsxs("div",{className:"flex items-center",children:[i.jsx(te,{variant:"ghost",onClick:n,className:"mr-2",children:i.jsx(zf,{className:"h-5 w-5"})}),i.jsx("h2",{className:"font-sf text-2xl font-bold",children:"Edit Persona"})]}),i.jsxs(te,{onClick:async()=>{l(!0);try{const B=s._id||s.id,le={...s};le._id&&delete le._id,delete le.isDbPersona;let se;if(B&&typeof B=="string"&&B.startsWith("local-")){console.log("Creating new persona instead of updating local ID"),se=await Dn.create(le),oe.success("Persona saved to database");const ce={...s,id:se.data._id||se.data.id,_id:se.data._id||se.data.id,isDbPersona:!0};t(ce)}else if(B){se=await Dn.update(B,le),oe.success("Persona updated successfully");const ce={...s,isDbPersona:!0};t(ce)}else{se=await Dn.create(le);const ce={...s,id:se.data._id||se.data.id,_id:se.data._id||se.data.id,isDbPersona:!0};oe.success("Persona created successfully"),t(ce)}}catch(B){console.error("Error saving persona:",B),B.response&&B.response.status===401?h&&p?(console.log("Auth error despite having token - token likely invalid"),oe.error("Authentication error - saving locally instead"),t(s)):(f(s),u(!0)):(oe.error("Failed to save persona"),t(s))}finally{l(!1)}},disabled:o,children:[o?i.jsx(ii,{className:"h-4 w-4 mr-2 animate-spin"}):i.jsx(RS,{className:"h-4 w-4 mr-2"}),o?"Saving...":"Save Changes"]})]}),i.jsxs(Fo,{defaultValue:"basic",children:[i.jsxs(Pi,{className:"grid w-full grid-cols-6",children:[i.jsx(Xt,{value:"basic",children:"Basic"}),i.jsx(Xt,{value:"cooper",children:"Cooper"}),i.jsx(Xt,{value:"personality",children:"Personality"}),i.jsx(Xt,{value:"demographics",children:"Demographics"}),i.jsx(Xt,{value:"lifestyle",children:"Lifestyle"}),i.jsx(Xt,{value:"extended",children:"Extended"})]}),i.jsx(Yt,{value:"basic",className:"mt-6",children:i.jsx(rt,{children:i.jsx(bt,{className:"p-6",children:i.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-6",children:[i.jsxs("div",{className:"space-y-4",children:[i.jsxs("div",{children:[i.jsx("label",{className:"text-sm font-medium block mb-1",children:"Name"}),i.jsx(Ot,{value:s.name||"",onChange:B=>g("name",B.target.value)})]}),i.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[i.jsxs("div",{children:[i.jsx("label",{className:"text-sm font-medium block mb-1",children:"Age Range"}),i.jsxs(Mn,{value:s.age||"",onValueChange:B=>g("age",B),children:[i.jsx(Pn,{children:i.jsx(In,{placeholder:"Select age range"})}),i.jsxs(An,{children:[i.jsx(fe,{value:"18-24",children:"18-24"}),i.jsx(fe,{value:"25-34",children:"25-34"}),i.jsx(fe,{value:"35-44",children:"35-44"}),i.jsx(fe,{value:"45-54",children:"45-54"}),i.jsx(fe,{value:"55-64",children:"55-64"}),i.jsx(fe,{value:"65+",children:"65+"})]})]})]}),i.jsxs("div",{children:[i.jsx("label",{className:"text-sm font-medium block mb-1",children:"Gender"}),i.jsxs(Mn,{value:s.gender||"",onValueChange:B=>g("gender",B),children:[i.jsx(Pn,{children:i.jsx(In,{placeholder:"Select gender"})}),i.jsxs(An,{children:[i.jsx(fe,{value:"Male",children:"Male"}),i.jsx(fe,{value:"Female",children:"Female"}),i.jsx(fe,{value:"Non-binary",children:"Non-binary"}),i.jsx(fe,{value:"Other",children:"Other"})]})]})]})]}),i.jsxs("div",{children:[i.jsx("label",{className:"text-sm font-medium block mb-1",children:"Occupation"}),i.jsx(Ot,{value:s.occupation||"",onChange:B=>g("occupation",B.target.value)})]}),i.jsxs("div",{children:[i.jsx("label",{className:"text-sm font-medium block mb-1",children:"Education"}),i.jsxs(Mn,{value:s.education||"",onValueChange:B=>g("education",B),children:[i.jsx(Pn,{children:i.jsx(In,{placeholder:"Select education level"})}),i.jsxs(An,{children:[i.jsx(fe,{value:"High School",children:"High School"}),i.jsx(fe,{value:"Some College",children:"Some College"}),i.jsx(fe,{value:"Associate's Degree",children:"Associate's Degree"}),i.jsx(fe,{value:"Bachelor's Degree",children:"Bachelor's Degree"}),i.jsx(fe,{value:"Master's Degree",children:"Master's Degree"}),i.jsx(fe,{value:"PhD",children:"PhD"})]})]})]}),i.jsxs("div",{children:[i.jsx("label",{className:"text-sm font-medium block mb-1",children:"Location"}),i.jsx(Ot,{value:s.location||"",onChange:B=>g("location",B.target.value)})]}),i.jsxs("div",{children:[i.jsx("label",{className:"text-sm font-medium block mb-1",children:"Ethnicity (Optional)"}),i.jsxs(Mn,{value:s.ethnicity||"",onValueChange:B=>g("ethnicity",B),children:[i.jsx(Pn,{children:i.jsx(In,{placeholder:"Select ethnicity"})}),i.jsxs(An,{children:[i.jsx(fe,{value:"white",children:"White"}),i.jsx(fe,{value:"black",children:"Black"}),i.jsx(fe,{value:"asian",children:"Asian"}),i.jsx(fe,{value:"hispanic",children:"Hispanic/Latino"}),i.jsx(fe,{value:"native-american",children:"Native American"}),i.jsx(fe,{value:"middle-eastern",children:"Middle Eastern"}),i.jsx(fe,{value:"mixed",children:"Mixed"}),i.jsx(fe,{value:"other",children:"Other"}),i.jsx(fe,{value:"prefer-not-to-say",children:"Prefer not to say"})]})]})]})]}),i.jsxs("div",{className:"space-y-4",children:[i.jsxs("div",{children:[i.jsx("label",{className:"text-sm font-medium block mb-1",children:"Personality"}),i.jsx(nt,{value:s.personality||"",onChange:B=>g("personality",B.target.value),rows:3})]}),i.jsxs("div",{children:[i.jsx("label",{className:"text-sm font-medium block mb-1",children:"Interests"}),i.jsx(nt,{value:s.interests||"",onChange:B=>g("interests",B.target.value),rows:3,placeholder:"Tech, travel, cooking, etc."})]}),i.jsxs("div",{children:[i.jsxs("div",{className:"flex justify-between mb-1",children:[i.jsx("label",{className:"text-sm font-medium",children:"Tech Savviness"}),i.jsxs("span",{className:"text-sm",children:[s.techSavviness,"%"]})]}),i.jsx(Un,{value:[s.techSavviness],onValueChange:B=>g("techSavviness",B[0]),max:100,step:1})]}),i.jsxs("div",{children:[i.jsxs("div",{className:"flex justify-between mb-1",children:[i.jsx("label",{className:"text-sm font-medium",children:"Brand Loyalty"}),i.jsxs("span",{className:"text-sm",children:[s.brandLoyalty||0,"%"]})]}),i.jsx(Un,{value:[s.brandLoyalty||0],onValueChange:B=>g("brandLoyalty",B[0]),max:100,step:1})]}),i.jsxs("div",{children:[i.jsxs("div",{className:"flex justify-between mb-1",children:[i.jsx("label",{className:"text-sm font-medium",children:"Price Consciousness"}),i.jsxs("span",{className:"text-sm",children:[s.priceConsciousness||0,"%"]})]}),i.jsx(Un,{value:[s.priceConsciousness||0],onValueChange:B=>g("priceConsciousness",B[0]),max:100,step:1})]}),i.jsxs("div",{children:[i.jsxs("div",{className:"flex justify-between mb-1",children:[i.jsx("label",{className:"text-sm font-medium",children:"Environmental Concern"}),i.jsxs("span",{className:"text-sm",children:[s.environmentalConcern||0,"%"]})]}),i.jsx(Un,{value:[s.environmentalConcern||0],onValueChange:B=>g("environmentalConcern",B[0]),max:100,step:1})]}),i.jsxs("div",{className:"grid grid-cols-2 gap-4 pt-2",children:[i.jsxs("div",{className:"flex items-center justify-between",children:[i.jsx("label",{className:"text-sm font-medium",children:"Purchasing Power"}),i.jsx(ah,{checked:s.hasPurchasingPower||!1,onCheckedChange:B=>g("hasPurchasingPower",B)})]}),i.jsxs("div",{className:"flex items-center justify-between",children:[i.jsx("label",{className:"text-sm font-medium",children:"Has Children"}),i.jsx(ah,{checked:s.hasChildren||!1,onCheckedChange:B=>g("hasChildren",B)})]})]})]})]})})})}),i.jsxs(Yt,{value:"cooper",className:"mt-6 space-y-6",children:[i.jsx(rt,{children:i.jsxs(bt,{className:"p-6",children:[i.jsxs("div",{className:"mb-4",children:[i.jsx("h3",{className:"font-medium text-lg mb-3",children:"Goals"}),(s.goals||[]).map((B,le)=>i.jsxs("div",{className:"flex items-center gap-2 mb-2",children:[i.jsx(Ot,{value:B||"",onChange:se=>b("goals",le,se.target.value)}),i.jsx(te,{variant:"ghost",size:"icon",onClick:()=>x("goals",le),children:i.jsx(_n,{className:"h-4 w-4 text-muted-foreground"})})]},le)),i.jsxs(te,{variant:"outline",size:"sm",onClick:()=>y("goals"),className:"mt-2",children:[i.jsx(pr,{className:"h-4 w-4 mr-2"}),"Add Goal"]})]}),i.jsxs("div",{className:"mb-4 pt-4 border-t",children:[i.jsx("h3",{className:"font-medium text-lg mb-3",children:"Frustrations"}),(s.frustrations||[]).map((B,le)=>i.jsxs("div",{className:"flex items-center gap-2 mb-2",children:[i.jsx(Ot,{value:B||"",onChange:se=>b("frustrations",le,se.target.value)}),i.jsx(te,{variant:"ghost",size:"icon",onClick:()=>x("frustrations",le),children:i.jsx(_n,{className:"h-4 w-4 text-muted-foreground"})})]},le)),i.jsxs(te,{variant:"outline",size:"sm",onClick:()=>y("frustrations"),className:"mt-2",children:[i.jsx(pr,{className:"h-4 w-4 mr-2"}),"Add Frustration"]})]}),i.jsxs("div",{className:"mb-4 pt-4 border-t",children:[i.jsx("h3",{className:"font-medium text-lg mb-3",children:"Motivations"}),(s.motivations||[]).map((B,le)=>i.jsxs("div",{className:"flex items-center gap-2 mb-2",children:[i.jsx(Ot,{value:B||"",onChange:se=>b("motivations",le,se.target.value)}),i.jsx(te,{variant:"ghost",size:"icon",onClick:()=>x("motivations",le),children:i.jsx(_n,{className:"h-4 w-4 text-muted-foreground"})})]},le)),i.jsxs(te,{variant:"outline",size:"sm",onClick:()=>y("motivations"),className:"mt-2",children:[i.jsx(pr,{className:"h-4 w-4 mr-2"}),"Add Motivation"]})]})]})}),i.jsx(rt,{children:i.jsxs(bt,{className:"p-6",children:[i.jsx("h3",{className:"font-medium text-lg mb-4",children:"Think, Feel, Do"}),i.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-3 gap-6",children:[i.jsxs("div",{children:[i.jsx("h4",{className:"font-medium text-sm mb-3",children:"Thinks"}),(((P=s.thinkFeelDo)==null?void 0:P.thinks)||[]).map((B,le)=>i.jsxs("div",{className:"flex items-center gap-2 mb-2",children:[i.jsx(Ot,{value:B||"",onChange:se=>w("thinks",le,se.target.value)}),i.jsx(te,{variant:"ghost",size:"icon",onClick:()=>S("thinks",le),children:i.jsx(_n,{className:"h-4 w-4 text-muted-foreground"})})]},le)),i.jsxs(te,{variant:"outline",size:"sm",onClick:()=>j("thinks"),className:"mt-2",children:[i.jsx(pr,{className:"h-4 w-4 mr-2"}),"Add Thought"]})]}),i.jsxs("div",{children:[i.jsx("h4",{className:"font-medium text-sm mb-3",children:"Feels"}),(((k=s.thinkFeelDo)==null?void 0:k.feels)||[]).map((B,le)=>i.jsxs("div",{className:"flex items-center gap-2 mb-2",children:[i.jsx(Ot,{value:B||"",onChange:se=>w("feels",le,se.target.value)}),i.jsx(te,{variant:"ghost",size:"icon",onClick:()=>S("feels",le),children:i.jsx(_n,{className:"h-4 w-4 text-muted-foreground"})})]},le)),i.jsxs(te,{variant:"outline",size:"sm",onClick:()=>j("feels"),className:"mt-2",children:[i.jsx(pr,{className:"h-4 w-4 mr-2"}),"Add Feeling"]})]}),i.jsxs("div",{children:[i.jsx("h4",{className:"font-medium text-sm mb-3",children:"Does"}),(((O=s.thinkFeelDo)==null?void 0:O.does)||[]).map((B,le)=>i.jsxs("div",{className:"flex items-center gap-2 mb-2",children:[i.jsx(Ot,{value:B||"",onChange:se=>w("does",le,se.target.value)}),i.jsx(te,{variant:"ghost",size:"icon",onClick:()=>S("does",le),children:i.jsx(_n,{className:"h-4 w-4 text-muted-foreground"})})]},le)),i.jsxs(te,{variant:"outline",size:"sm",onClick:()=>j("does"),className:"mt-2",children:[i.jsx(pr,{className:"h-4 w-4 mr-2"}),"Add Action"]})]})]})]})}),i.jsx(rt,{children:i.jsxs(bt,{className:"p-6",children:[i.jsx("div",{className:"space-y-4 mb-6",children:i.jsxs("div",{children:[i.jsx("label",{className:"text-sm font-medium block mb-1",children:"Scenario Section Title"}),i.jsx(Ot,{value:s.scenarioType||"",onChange:B=>g("scenarioType",B.target.value),placeholder:"Life Scenarios"}),i.jsx("p",{className:"text-xs text-muted-foreground mt-1",children:'Custom title for the scenarios section (e.g., "Customer Journey", "Use Cases")'})]})}),i.jsx("h3",{className:"font-medium text-lg mb-3",children:"Usage Scenarios"}),(s.scenarios||[]).map((B,le)=>i.jsxs("div",{className:"flex items-start gap-2 mb-2",children:[i.jsx(nt,{value:B||"",onChange:se=>b("scenarios",le,se.target.value),rows:2}),i.jsx(te,{variant:"ghost",size:"icon",onClick:()=>x("scenarios",le),children:i.jsx(_n,{className:"h-4 w-4 text-muted-foreground"})})]},le)),i.jsxs(te,{variant:"outline",size:"sm",onClick:()=>y("scenarios"),className:"mt-2",children:[i.jsx(pr,{className:"h-4 w-4 mr-2"}),"Add Scenario"]})]})})]}),i.jsx(Yt,{value:"personality",className:"mt-6",children:i.jsx(rt,{children:i.jsxs(bt,{className:"p-6",children:[i.jsx("h3",{className:"font-medium text-lg mb-4",children:"OCEAN Personality Traits"}),i.jsxs("div",{className:"space-y-6",children:[i.jsxs("div",{children:[i.jsxs("div",{className:"flex justify-between mb-1",children:[i.jsx("label",{className:"text-sm font-medium",children:"Openness to Experience"}),i.jsxs("span",{className:"text-sm",children:[((M=s.oceanTraits)==null?void 0:M.openness)||50,"%"]})]}),i.jsx(Un,{value:[((A=s.oceanTraits)==null?void 0:A.openness)||50],onValueChange:B=>m("openness",B[0]),max:100,step:1}),i.jsx("p",{className:"text-xs text-muted-foreground mt-1",children:"Creativity, curiosity, and openness to new ideas"})]}),i.jsxs("div",{children:[i.jsxs("div",{className:"flex justify-between mb-1",children:[i.jsx("label",{className:"text-sm font-medium",children:"Conscientiousness"}),i.jsxs("span",{className:"text-sm",children:[(($=s.oceanTraits)==null?void 0:$.conscientiousness)||50,"%"]})]}),i.jsx(Un,{value:[((L=s.oceanTraits)==null?void 0:L.conscientiousness)||50],onValueChange:B=>m("conscientiousness",B[0]),max:100,step:1}),i.jsx("p",{className:"text-xs text-muted-foreground mt-1",children:"Organization, responsibility, and self-discipline"})]}),i.jsxs("div",{children:[i.jsxs("div",{className:"flex justify-between mb-1",children:[i.jsx("label",{className:"text-sm font-medium",children:"Extraversion"}),i.jsxs("span",{className:"text-sm",children:[((H=s.oceanTraits)==null?void 0:H.extraversion)||50,"%"]})]}),i.jsx(Un,{value:[((D=s.oceanTraits)==null?void 0:D.extraversion)||50],onValueChange:B=>m("extraversion",B[0]),max:100,step:1}),i.jsx("p",{className:"text-xs text-muted-foreground mt-1",children:"Sociability, assertiveness, and talkativeness"})]}),i.jsxs("div",{children:[i.jsxs("div",{className:"flex justify-between mb-1",children:[i.jsx("label",{className:"text-sm font-medium",children:"Agreeableness"}),i.jsxs("span",{className:"text-sm",children:[((V=s.oceanTraits)==null?void 0:V.agreeableness)||50,"%"]})]}),i.jsx(Un,{value:[((T=s.oceanTraits)==null?void 0:T.agreeableness)||50],onValueChange:B=>m("agreeableness",B[0]),max:100,step:1}),i.jsx("p",{className:"text-xs text-muted-foreground mt-1",children:"Compassion, cooperation, and concern for others"})]}),i.jsxs("div",{children:[i.jsxs("div",{className:"flex justify-between mb-1",children:[i.jsx("label",{className:"text-sm font-medium",children:"Neuroticism"}),i.jsxs("span",{className:"text-sm",children:[((F=s.oceanTraits)==null?void 0:F.neuroticism)||50,"%"]})]}),i.jsx(Un,{value:[((q=s.oceanTraits)==null?void 0:q.neuroticism)||50],onValueChange:B=>m("neuroticism",B[0]),max:100,step:1}),i.jsx("p",{className:"text-xs text-muted-foreground mt-1",children:"Emotional reactivity, anxiety, and sensitivity to stress"})]})]})]})})}),i.jsx(Yt,{value:"demographics",className:"mt-6",children:i.jsx(rt,{children:i.jsxs(bt,{className:"p-6",children:[i.jsx("h3",{className:"font-medium text-lg mb-4",children:"Demographic Information"}),i.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-6",children:[i.jsxs("div",{className:"space-y-4",children:[i.jsxs("div",{children:[i.jsx("label",{className:"text-sm font-medium block mb-1",children:"Social Grade"}),i.jsxs(Mn,{value:s.socialGrade||"",onValueChange:B=>g("socialGrade",B),children:[i.jsx(Pn,{children:i.jsx(In,{placeholder:"Select social grade"})}),i.jsxs(An,{children:[i.jsx(fe,{value:"A",children:"A - Higher managerial"}),i.jsx(fe,{value:"B",children:"B - Intermediate managerial"}),i.jsx(fe,{value:"C1",children:"C1 - Supervisory or clerical"}),i.jsx(fe,{value:"C2",children:"C2 - Skilled manual workers"}),i.jsx(fe,{value:"D",children:"D - Semi and unskilled manual workers"}),i.jsx(fe,{value:"E",children:"E - State pensioners, unemployed"})]})]})]}),i.jsxs("div",{children:[i.jsx("label",{className:"text-sm font-medium block mb-1",children:"Household Income"}),i.jsxs(Mn,{value:s.householdIncome||"",onValueChange:B=>g("householdIncome",B),children:[i.jsx(Pn,{children:i.jsx(In,{placeholder:"Select income range"})}),i.jsxs(An,{children:[i.jsx(fe,{value:"Under $25k",children:"Under $25,000"}),i.jsx(fe,{value:"$25k-$50k",children:"$25,000 - $50,000"}),i.jsx(fe,{value:"$50k-$75k",children:"$50,000 - $75,000"}),i.jsx(fe,{value:"$75k-$100k",children:"$75,000 - $100,000"}),i.jsx(fe,{value:"$100k-$150k",children:"$100,000 - $150,000"}),i.jsx(fe,{value:"$150k-$250k",children:"$150,000 - $250,000"}),i.jsx(fe,{value:"Over $250k",children:"Over $250,000"}),i.jsx(fe,{value:"Prefer not to say",children:"Prefer not to say"})]})]})]})]}),i.jsxs("div",{className:"space-y-4",children:[i.jsxs("div",{children:[i.jsx("label",{className:"text-sm font-medium block mb-1",children:"Household Composition"}),i.jsxs(Mn,{value:s.householdComposition||"",onValueChange:B=>g("householdComposition",B),children:[i.jsx(Pn,{children:i.jsx(In,{placeholder:"Select household type"})}),i.jsxs(An,{children:[i.jsx(fe,{value:"Single person",children:"Single person"}),i.jsx(fe,{value:"Couple without children",children:"Couple without children"}),i.jsx(fe,{value:"Couple with children",children:"Couple with children"}),i.jsx(fe,{value:"Single parent",children:"Single parent"}),i.jsx(fe,{value:"Multi-generational",children:"Multi-generational"}),i.jsx(fe,{value:"Shared housing",children:"Shared housing"}),i.jsx(fe,{value:"Other",children:"Other"})]})]})]}),i.jsxs("div",{children:[i.jsx("label",{className:"text-sm font-medium block mb-1",children:"Living Situation"}),i.jsxs(Mn,{value:s.livingSituation||"",onValueChange:B=>g("livingSituation",B),children:[i.jsx(Pn,{children:i.jsx(In,{placeholder:"Select living situation"})}),i.jsxs(An,{children:[i.jsx(fe,{value:"Own home",children:"Own home"}),i.jsx(fe,{value:"Rent apartment",children:"Rent apartment"}),i.jsx(fe,{value:"Rent house",children:"Rent house"}),i.jsx(fe,{value:"Live with family",children:"Live with family"}),i.jsx(fe,{value:"Student housing",children:"Student housing"}),i.jsx(fe,{value:"Assisted living",children:"Assisted living"}),i.jsx(fe,{value:"Other",children:"Other"})]})]})]})]})]})]})})}),i.jsx(Yt,{value:"lifestyle",className:"mt-6",children:i.jsx(rt,{children:i.jsxs(bt,{className:"p-6",children:[i.jsx("h3",{className:"font-medium text-lg mb-4",children:"Lifestyle & Behavior"}),i.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-6",children:[i.jsxs("div",{className:"space-y-4",children:[i.jsxs("div",{children:[i.jsx("label",{className:"text-sm font-medium block mb-1",children:"Media Consumption"}),i.jsx(nt,{value:s.mediaConsumption||"",onChange:B=>g("mediaConsumption",B.target.value),rows:3,placeholder:"TV shows, podcasts, news sources, social media platforms"}),i.jsx("p",{className:"text-xs text-muted-foreground mt-1",children:"Describe media consumption habits and preferences"})]}),i.jsxs("div",{children:[i.jsx("label",{className:"text-sm font-medium block mb-1",children:"Device Usage"}),i.jsx(nt,{value:s.deviceUsage||"",onChange:B=>g("deviceUsage",B.target.value),rows:3,placeholder:"Smartphone, laptop, tablet, smart TV, gaming console"}),i.jsx("p",{className:"text-xs text-muted-foreground mt-1",children:"Primary devices and usage patterns"})]}),i.jsxs("div",{children:[i.jsx("label",{className:"text-sm font-medium block mb-1",children:"Shopping Habits"}),i.jsx(nt,{value:s.shoppingHabits||"",onChange:B=>g("shoppingHabits",B.target.value),rows:3,placeholder:"Online vs in-store, frequency, preferred retailers"}),i.jsx("p",{className:"text-xs text-muted-foreground mt-1",children:"Shopping behavior and preferences"})]}),i.jsxs("div",{children:[i.jsx("label",{className:"text-sm font-medium block mb-1",children:"Brand Preferences"}),i.jsx(nt,{value:s.brandPreferences||"",onChange:B=>g("brandPreferences",B.target.value),rows:3,placeholder:"Favorite brands, brand values alignment"}),i.jsx("p",{className:"text-xs text-muted-foreground mt-1",children:"Preferred brands and reasoning"})]})]}),i.jsxs("div",{className:"space-y-4",children:[i.jsxs("div",{children:[i.jsx("label",{className:"text-sm font-medium block mb-1",children:"Communication Preferences"}),i.jsx(nt,{value:s.communicationPreferences||"",onChange:B=>g("communicationPreferences",B.target.value),rows:3,placeholder:"Email, phone, text, video calls, in-person"}),i.jsx("p",{className:"text-xs text-muted-foreground mt-1",children:"Preferred communication methods and channels"})]}),i.jsxs("div",{children:[i.jsx("label",{className:"text-sm font-medium block mb-1",children:"Payment Methods"}),i.jsx(nt,{value:s.paymentMethods||"",onChange:B=>g("paymentMethods",B.target.value),rows:3,placeholder:"Credit cards, digital wallets, cash, BNPL"}),i.jsx("p",{className:"text-xs text-muted-foreground mt-1",children:"Preferred payment methods and financial tools"})]}),i.jsxs("div",{children:[i.jsx("label",{className:"text-sm font-medium block mb-1",children:"Purchase Behavior"}),i.jsx(nt,{value:s.purchaseBehaviour||"",onChange:B=>g("purchaseBehaviour",B.target.value),rows:3,placeholder:"Research habits, decision factors, impulse vs planned buying"}),i.jsx("p",{className:"text-xs text-muted-foreground mt-1",children:"How they approach making purchase decisions"})]})]})]})]})})}),i.jsxs(Yt,{value:"extended",className:"mt-6 space-y-6",children:[i.jsx(rt,{children:i.jsxs(bt,{className:"p-6",children:[i.jsx("h3",{className:"font-medium text-lg mb-4",children:"Extended Profile"}),i.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-6",children:[i.jsxs("div",{className:"space-y-4",children:[i.jsxs("div",{children:[i.jsx("label",{className:"text-sm font-medium block mb-1",children:"Core Values"}),i.jsx(nt,{value:s.coreValues||"",onChange:B=>g("coreValues",B.target.value),rows:3,placeholder:"Key principles and values that guide decisions"})]}),i.jsxs("div",{children:[i.jsx("label",{className:"text-sm font-medium block mb-1",children:"Lifestyle Choices"}),i.jsx(nt,{value:s.lifestyleChoices||"",onChange:B=>g("lifestyleChoices",B.target.value),rows:3,placeholder:"Health, fitness, diet, work-life balance preferences"})]}),i.jsxs("div",{children:[i.jsx("label",{className:"text-sm font-medium block mb-1",children:"Social Activities"}),i.jsx(nt,{value:s.socialActivities||"",onChange:B=>g("socialActivities",B.target.value),rows:3,placeholder:"Social hobbies, community involvement, networking"})]}),i.jsxs("div",{children:[i.jsx("label",{className:"text-sm font-medium block mb-1",children:"Category Knowledge"}),i.jsx(nt,{value:s.categoryKnowledge||"",onChange:B=>g("categoryKnowledge",B.target.value),rows:3,placeholder:"Expertise in specific product/service categories"})]}),i.jsxs("div",{children:[i.jsx("label",{className:"text-sm font-medium block mb-1",children:"Decision Influences"}),i.jsx(nt,{value:s.decisionInfluences||"",onChange:B=>g("decisionInfluences",B.target.value),rows:3,placeholder:"What factors most influence their decisions"})]}),i.jsxs("div",{children:[i.jsx("label",{className:"text-sm font-medium block mb-1",children:"Pain Points"}),i.jsx(nt,{value:s.painPoints||"",onChange:B=>g("painPoints",B.target.value),rows:3,placeholder:"Common challenges and friction points"})]})]}),i.jsxs("div",{className:"space-y-4",children:[i.jsxs("div",{children:[i.jsx("label",{className:"text-sm font-medium block mb-1",children:"Journey Context"}),i.jsx(nt,{value:s.journeyContext||"",onChange:B=>g("journeyContext",B.target.value),rows:3,placeholder:"Current life stage and contextual factors"})]}),i.jsxs("div",{children:[i.jsx("label",{className:"text-sm font-medium block mb-1",children:"Key Touchpoints"}),i.jsx(nt,{value:s.keyTouchpoints||"",onChange:B=>g("keyTouchpoints",B.target.value),rows:3,placeholder:"Important interaction points and channels"})]}),i.jsxs("div",{className:"space-y-4",children:[i.jsx("h4",{className:"font-medium text-sm",children:"Self-Determination Needs"}),i.jsxs("div",{children:[i.jsx("label",{className:"text-sm font-medium block mb-1",children:"Autonomy"}),i.jsx(nt,{value:((Z=s.selfDeterminationNeeds)==null?void 0:Z.autonomy)||"",onChange:B=>g("selfDeterminationNeeds",{...s.selfDeterminationNeeds,autonomy:B.target.value}),rows:2,placeholder:"Need for independence and self-direction"})]}),i.jsxs("div",{children:[i.jsx("label",{className:"text-sm font-medium block mb-1",children:"Competence"}),i.jsx(nt,{value:((re=s.selfDeterminationNeeds)==null?void 0:re.competence)||"",onChange:B=>g("selfDeterminationNeeds",{...s.selfDeterminationNeeds,competence:B.target.value}),rows:2,placeholder:"Need to feel capable and effective"})]}),i.jsxs("div",{children:[i.jsx("label",{className:"text-sm font-medium block mb-1",children:"Relatedness"}),i.jsx(nt,{value:((ge=s.selfDeterminationNeeds)==null?void 0:ge.relatedness)||"",onChange:B=>g("selfDeterminationNeeds",{...s.selfDeterminationNeeds,relatedness:B.target.value}),rows:2,placeholder:"Need for connection and belonging"})]})]})]})]})]})}),i.jsx(rt,{children:i.jsx(bt,{className:"p-6",children:i.jsxs("div",{className:"space-y-4",children:[i.jsxs("div",{children:[i.jsx("h3",{className:"font-medium text-lg mb-3",children:"Fears & Concerns"}),(s.fears||[]).map((B,le)=>i.jsxs("div",{className:"flex items-center gap-2 mb-2",children:[i.jsx(Ot,{value:B,onChange:se=>b("fears",le,se.target.value),placeholder:"Enter a fear or concern"}),i.jsx(te,{variant:"ghost",size:"icon",onClick:()=>x("fears",le),children:i.jsx(_n,{className:"h-4 w-4 text-muted-foreground"})})]},le)),i.jsxs(te,{variant:"outline",size:"sm",onClick:()=>y("fears"),className:"mt-2",children:[i.jsx(pr,{className:"h-4 w-4 mr-2"}),"Add Fear/Concern"]})]}),i.jsxs("div",{children:[i.jsx("label",{className:"text-sm font-medium block mb-1",children:"Personal Narrative"}),i.jsx(nt,{value:s.narrative||"",onChange:B=>g("narrative",B.target.value),rows:4,placeholder:"Personal story, background, key life experiences"}),i.jsx("p",{className:"text-xs text-muted-foreground mt-1",children:"A brief narrative that captures their personal story"})]}),i.jsxs("div",{children:[i.jsx("label",{className:"text-sm font-medium block mb-1",children:"Additional Information"}),i.jsx(nt,{value:s.additionalInformation||"",onChange:B=>g("additionalInformation",B.target.value),rows:4,placeholder:"Any other relevant details or context"}),i.jsx("p",{className:"text-xs text-muted-foreground mt-1",children:"Additional context or details not covered elsewhere"})]})]})})})]})]})]})}function gPe(){const{id:e}=QM(),t=qr(),n=Tn(),{navigationState:r,clearNavigationState:s}=XL(),[a,o]=v.useState(void 0),[l,c]=v.useState(!1),[u,d]=v.useState(!1),[f,h]=v.useState(!0);return v.useEffect(()=>{if(!e){h(!1);return}let m=!0;const b=new URLSearchParams(t.search).get("fromReview")==="true";return c(b),h(!0),(async()=>{try{const w=e.startsWith("local-")?e.substring(6):e,j=await Dn.getById(w);if(j&&j.data){const S=j.data;if(m){console.log("Found persona in database:",S),o({...S,id:S.id||S._id,isDbPersona:!0}),h(!1);return}}console.error("Could not find persona with id:",e),m&&(o(void 0),h(!1),oe.error("Persona not found"))}catch(w){console.error("Error fetching persona:",w),m&&(o(void 0),h(!1),oe.error("Failed to load persona details"))}})(),()=>{m=!1}},[e,t.search]),{currentPersona:a,isEditing:u,isFromReview:l,isLoading:f,setIsEditing:d,handleGoBack:()=>{r.previousRoute==="/focus-groups"&&r.focusGroupTab?r.isNewFocusGroup?n(`/focus-groups?mode=create&tab=${r.focusGroupTab}`):r.focusGroupId?n(`/focus-groups?mode=edit&id=${r.focusGroupId}&tab=${r.focusGroupTab}`):n("/focus-groups?mode=create&tab=participants"):n(l?"/synthetic-users?mode=create&tab=ai&step=review":"/synthetic-users")},handleSaveEdit:async m=>{try{d(!1);const y=m.isDbPersona||e&&e.length===24&&/^[0-9a-f]{24}$/i.test(e),b={...m};if(b._id&&delete b._id,delete b.isDbPersona,y&&e&&e.length===24&&/^[0-9a-f]{24}$/i.test(e)){const x=await Dn.update(e,b);console.log("Updated persona in database:",x);const w={...m,isDbPersona:!0};o(w),oe.success("Persona updated in database successfully")}else{const x=await Dn.create(b);console.log("Created new persona in database:",x.data);const w={...m,id:x.data._id||x.data.id,_id:x.data._id||x.data.id,isDbPersona:!0};o(w),oe.success("Persona saved to database successfully")}}catch(y){return console.error("Error saving persona:",y),y.response&&y.response.status===401?oe.error("Authentication error - Please log in to save personas"):y.response&&y.response.status===404?oe.error("API endpoint not found - Database service may be unavailable"):oe.error("Failed to save persona to database: "+(y.message||"Unknown error")),!1}return!0}}}function $k(){const{currentPersona:e,isEditing:t,isFromReview:n,isLoading:r,setIsEditing:s,handleGoBack:a,handleSaveEdit:o}=gPe();return r?i.jsx(hPe,{}):e?i.jsxs("div",{className:"min-h-screen bg-slate-50",children:[i.jsx(oi,{}),i.jsx("main",{className:"pt-20 pb-16 px-4 sm:px-6 lg:px-8 max-w-7xl mx-auto",children:t?i.jsx(mPe,{persona:e,onSave:o,onCancel:()=>s(!1)}):i.jsxs(i.Fragment,{children:[i.jsxs("div",{className:"flex items-center mb-6 relative",children:[i.jsx(te,{variant:"ghost",onClick:a,className:"absolute left-0 top-0 flex items-center",children:i.jsx(zf,{className:"h-5 w-5"})}),i.jsx("h1",{className:"font-sf text-3xl font-bold text-slate-900 mx-auto",children:"Persona Profile"}),i.jsxs(te,{onClick:()=>s(!0),className:"absolute right-0 top-0",children:[i.jsx(TW,{className:"h-4 w-4 mr-2"}),"Edit Persona"]})]}),i.jsxs("div",{className:"grid grid-cols-1 lg:grid-cols-3 gap-6 mt-10",children:[i.jsx("div",{className:"lg:col-span-1",children:i.jsx(lPe,{persona:e})}),i.jsx("div",{className:"lg:col-span-2",children:i.jsxs(Fo,{defaultValue:"cooper-profile",children:[i.jsxs(Pi,{className:"grid w-full grid-cols-3",children:[i.jsx(Xt,{value:"cooper-profile",children:"Cooper Profile"}),i.jsx(Xt,{value:"personality",children:"Personality"}),i.jsx(Xt,{value:"scenarios",children:"Scenarios"})]}),i.jsx(Yt,{value:"cooper-profile",className:"mt-6",children:i.jsx(cPe,{persona:e})}),i.jsx(Yt,{value:"personality",className:"mt-6",children:i.jsx(uPe,{persona:e})}),i.jsx(Yt,{value:"scenarios",className:"mt-6",children:i.jsx(dPe,{persona:e})})]})})]})]})})]}):i.jsx(fPe,{})}const vPe=Te.object({username:Te.string().min(3,"Username must be at least 3 characters"),password:Te.string().min(4,"Password must be at least 4 characters")});function yPe(){var u;const e=Tn(),t=qr(),{login:n,isAuthenticated:r}=Kl(),[s,a]=v.useState(!1),o=((u=t.state)==null?void 0:u.from)||"/";console.log("Login page - destination path:",o),v.useEffect(()=>{r&&(console.log("User already authenticated, redirecting from login page"),e("/",{replace:!0}))},[r,e]);const l=Ny({resolver:_y(vPe),defaultValues:{username:"",password:""}});async function c(d){a(!0);try{await n(d.username,d.password)?(console.log("Login successful, received token, navigating to:",o),e(o,{replace:!0})):(console.error("Login succeeded but no token received"),a(!1))}catch(f){console.error("Login error in form handler:",f),a(!1)}}return i.jsx("div",{className:"flex min-h-screen items-center justify-center bg-gradient-to-br from-gray-100 to-gray-200 dark:from-gray-900 dark:to-gray-800 px-4",children:i.jsxs(rt,{className:"w-full max-w-md",children:[i.jsxs(Dr,{className:"space-y-1",children:[i.jsx(ts,{className:"text-2xl font-bold text-center",children:"Sign In"}),i.jsx(nN,{className:"text-center",children:"Enter your credentials to access your account"})]}),i.jsx(bt,{children:i.jsx(Ay,{...l,children:i.jsxs("form",{onSubmit:l.handleSubmit(c),className:"space-y-4",children:[i.jsx(dt,{control:l.control,name:"username",render:({field:d})=>i.jsxs(ot,{children:[i.jsx(lt,{children:"Username"}),i.jsx(ct,{children:i.jsx(Ot,{placeholder:"Enter your username",...d,disabled:s,autoComplete:"username"})}),i.jsx(ut,{})]})}),i.jsx(dt,{control:l.control,name:"password",render:({field:d})=>i.jsxs(ot,{children:[i.jsx(lt,{children:"Password"}),i.jsx(ct,{children:i.jsx(Ot,{placeholder:"Enter your password",type:"password",...d,disabled:s,autoComplete:"current-password"})}),i.jsx(ut,{})]})}),i.jsx(te,{type:"submit",className:"w-full",disabled:s,children:s?"Signing in...":"Sign In"})]})})}),i.jsxs(rN,{className:"flex flex-col space-y-2",children:[i.jsx("div",{className:"text-sm text-center text-gray-500 mb-2",children:"Default account: user / pass"}),!s&&i.jsxs("div",{className:"flex flex-col items-center justify-center gap-2",children:[i.jsx(te,{variant:"outline",onClick:()=>e("/",{replace:!0}),className:"mt-2",children:"Return to Home"}),i.jsx(te,{variant:"link",onClick:()=>{localStorage.setItem("offline_mode","true");const d={username:"guest",email:"guest@example.com",role:"user"};localStorage.setItem("auth_token","offline-mode-token"),localStorage.setItem("user",JSON.stringify(d)),Ke.success("Offline mode activated",{description:"Using demo account with limited functionality"}),e("/",{replace:!0})},className:"text-sm text-gray-500",children:"Use offline mode"})]})]})]})})}function dc({children:e}){const{isAuthenticated:t,isLoading:n}=Kl(),r=qr();return console.log("ProtectedRoute check:",{isAuthenticated:t,isLoading:n,path:r.pathname}),n?i.jsx("div",{className:"flex items-center justify-center min-h-screen",children:i.jsx("div",{className:"animate-spin rounded-full h-12 w-12 border-t-2 border-b-2 border-primary"})}):t?(console.log("User is authenticated, showing protected content"),i.jsx(i.Fragment,{children:e})):(console.log("Not authenticated, redirecting to login"),i.jsx(nI,{to:"/login",state:{from:r.pathname},replace:!0}))}const xPe=new s9,bPe=()=>i.jsx(i9,{client:xPe,children:i.jsx(nW,{basename:"/semblance",children:i.jsx(pG,{children:i.jsx(SQ,{children:i.jsxs(I7,{children:[i.jsx(cU,{}),i.jsxs(K9,{children:[i.jsx(Is,{path:"/",element:i.jsx(gG,{})}),i.jsx(Is,{path:"/login",element:i.jsx(yPe,{})}),i.jsx(Is,{path:"/synthetic-users",element:i.jsx(dc,{children:i.jsx(xQ,{})})}),i.jsx(Is,{path:"/synthetic-users/:id",element:i.jsx(dc,{children:i.jsx($k,{})})}),i.jsx(Is,{path:"/personas/:id",element:i.jsx(dc,{children:i.jsx($k,{})})}),i.jsx(Is,{path:"/focus-groups",element:i.jsx(dc,{children:i.jsx(EQ,{})})}),i.jsx(Is,{path:"/focus-groups/:id",element:i.jsx(dc,{children:i.jsx(Z_e,{})})}),i.jsx(Is,{path:"/dashboard",element:i.jsx(dc,{children:i.jsx(oPe,{})})}),i.jsx(Is,{path:"/old-path",element:i.jsx(nI,{to:"/",replace:!0})}),i.jsx(Is,{path:"*",element:i.jsx(vG,{})})]})]})})})})});nM(document.getElementById("root")).render(i.jsx(bPe,{})); +`),Y=document.createElement("a"),ye=new Blob([J],{type:"text/plain"});Y.href=URL.createObjectURL(ye),Y.download=`focus-group-${e}-transcript.txt`,document.body.appendChild(Y),Y.click(),document.body.removeChild(Y),Ke.success("Transcript downloaded",{description:"The focus group transcript has been saved to your device."})},Ze=(J,Y)=>{const ye=he=>{const Te=he.match(/^\[([^\]]+)\]:\s*(.*)$/);return Te?Te[2].trim():he.trim()},xe=he=>he.toLowerCase().replace(/[^\w\s]/g," ").replace(/\s+/g," ").trim(),je=(he,Te)=>{const qe=xe(he),Ft=xe(Te);if(qe===Ft)return 1;if(qe.includes(Ft)||Ft.includes(qe))return Math.min(qe.length,Ft.length)/Math.max(qe.length,Ft.length);const Wt=qe.split(" "),It=Ft.split(" "),fa=Wt.filter(tc=>It.includes(tc)&&tc.length>2);return Wt.length===0||It.length===0?0:fa.length/Math.max(Wt.length,It.length)},Qe=typeof J=="object"&&J!==null,I=Qe?J.text:ye(J),K=Qe?J.original:J;let W=null,ie="";if(Y&&(W=n.find(he=>he.id===Y),W?ie="direct_message_id_match":console.warn(`Message ID ${Y} not found in current messages array`)),W||(W=n.find(he=>he.text.includes(K)),W&&(ie="exact_full_match")),W||(W=n.find(he=>he.text.includes(I)),W&&(ie="exact_text_match")),W||(W=n.find(he=>I.includes(he.text.trim())),W&&(ie="reverse_exact_match")),!W){const he=I.toLowerCase();W=n.find(Te=>Te.text.toLowerCase().includes(he)||he.includes(Te.text.toLowerCase())),W&&(ie="case_insensitive_match")}if(!W){const he=n.map(Te=>({message:Te,similarity:je(I,Te.text)})).filter(Te=>Te.similarity>.7).sort((Te,qe)=>qe.similarity-Te.similarity);he.length>0&&(W=he[0].message,ie=`fuzzy_match_${Math.round(he[0].similarity*100)}%`)}if(!W){const Te=xe(I).split(" ").filter(qe=>qe.length>3);Te.length>0&&(W=n.find(qe=>{const Ft=xe(qe.text);return Te.every(Wt=>Ft.includes(Wt))}),W&&(ie="partial_word_match"))}W?(console.log(`Quote match found using strategy: ${ie}`,{quoteType:Qe?"QuoteData":"string",providedMessageId:Y,extractedText:I,matchedMessage:W.text.substring(0,100),matchedMessageId:W.id,originalQuote:K.substring(0,100)}),p("chat"),setTimeout(()=>{const he=document.getElementById(`message-${W.id}`);he&&(P||he.scrollIntoView({behavior:"smooth",block:"center"}),he.style.backgroundColor="#fbbf24",he.style.transition="background-color 0.3s ease",setTimeout(()=>{he.style.backgroundColor=""},2e3))},100)):(console.warn("Quote match failed",{quoteType:Qe?"QuoteData":"string",providedMessageId:Y,originalQuote:K.substring(0,100),extractedText:I.substring(0,100),totalMessages:n.length,messageSample:n.slice(0,3).map(he=>({id:he.id,text:he.text.substring(0,50)}))}),Ke.warning("Message not found",{description:"Could not locate the original message for this quote. The quote may have been paraphrased by the AI."}))},kt=J=>{l(Y=>{const ye=new Set(Y.map(je=>je.id)),xe=J.filter(je=>!ye.has(je.id));return[...Y,...xe]})},Vt=async J=>{if(!e)return;const Y=o.find(ye=>ye.id===J);if(Y)try{"source"in Y&&Y.source==="generated"&&await jn.deleteKeyTheme(e,J),l(o.filter(ye=>ye.id!==J))}catch(ye){console.error("Error deleting theme:",ye),Ke.error("Failed to delete theme",{description:"There was an error removing the theme. Please try again."})}},Xn=v.useCallback(async(J,Y)=>{if(e)try{await jn.setModeratorPosition(e,J,Y),await X(),Ke.success("Moderator position updated",{description:"The moderator has been moved to the selected section."})}catch(ye){console.error("Error setting moderator position:",ye),Ke.error("Failed to update moderator position",{description:"There was an error updating the moderator position."})}},[e]),an=v.useCallback(async J=>{if(console.log("💾 handleDiscussionGuideSave called:",{hasId:!!e,isEditingGuideContent:M,timestamp:new Date().toISOString()}),!!e)try{await bt.update(e,{discussionGuide:J}),M?($.current&&($.current={...$.current,discussionGuide:J}),console.log("⚠️ Skipping focus group state update during editing to preserve focus")):(console.log("🔄 Updating focus group state (not editing)"),u(Y=>Y?{...Y,discussionGuide:J}:null))}catch(Y){throw console.error("Error saving discussion guide:",Y),Y}},[e,M]),pt=v.useCallback(J=>{console.log("🔄 handleGuideEditingStateChange called:",{editing:J,timestamp:new Date().toISOString(),currentIsEditingGuideContent:M}),k(J),A(J),!J&&$.current&&(console.log("📝 Updating focus group state after editing ended"),u($.current))},[M]),tt=v.useCallback(()=>{_(J=>!J)},[]),it=v.useCallback((J,Y,ye,xe,je,Qe)=>{at({isOpen:!0,sectionId:J,itemId:Y,content:ye,sectionTitle:xe,itemTitle:je,itemType:Qe})},[]),Lt=J=>{console.log("🔍 EXTRACT ASSET FILENAME DEBUG - Input content:",J);const Y=[/'([^']*\.[a-zA-Z]{3,4})'/g,/"([^"]*\.[a-zA-Z]{3,4})"/g,/titled\s+['"]([^'"]*\.[a-zA-Z]{3,4})['"](?:\.|,|\s|$)/gi,/asset[:\s]+['"]?([^'"\s]*\.[a-zA-Z]{3,4})['"]?(?:\.|,|\s|$)/gi,/image[:\s]+['"]?([^'"\s]*\.[a-zA-Z]{3,4})['"]?(?:\.|,|\s|$)/gi,/file[:\s]+['"]?([^'"\s]*\.[a-zA-Z]{3,4})['"]?(?:\.|,|\s|$)/gi,/\b([a-zA-Z0-9_-]+\.[a-zA-Z]{3,4})\b/g];for(let ye=0;ye0){const Qe=je[0][1];if(console.log(`🔍 Pattern ${ye+1} extracted filename:`,Qe),Qe&&Qe.includes("."))return console.log("✅ EXTRACT ASSET FILENAME - Found:",Qe),Qe}}return console.warn("❌ EXTRACT ASSET FILENAME - No filename found in content"),null},tn=()=>{if(g)return{sectionId:g.current_section_id,sectionTitle:g.current_section,itemId:g.current_item_id,itemTitle:g.current_item}},Xr=()=>{if(n.length!==0)return n[n.length-1].id},Ua=()=>{const J=Xr();if(!J||n.length===0)return new Date;const Y=n.find(ye=>ye.id===J);return Y?Y.timestamp:new Date},H=async()=>{if(e){de(!0),Pe(!1),Je(!1),Ke.info("Analyzing discussion for key themes...",{description:"This may take a moment as we process the entire conversation."});try{const J=await jn.generateKeyThemes(e);J.data&&J.data.themes?(Pe(!0),Ke.success(`Generated ${J.data.themes.length} key themes`,{description:"New themes have been added to the analysis."}),l(Y=>[...Y,...J.data.themes])):(Pe(!0),Ke.warning("No new themes were generated",{description:"Try again when the discussion has more content."}))}catch(J){console.error("Error generating key themes:",J),Je(!0),Ke.error("Failed to generate key themes",{description:"There was an error analyzing the discussion. Please try again."})}}},Ce=()=>{de(!1),Pe(!1),Je(!1)},ke=()=>{B||le(new Date),ge(!0)},Ue=J=>{G(Y=>[...Y,J].sort((ye,xe)=>xe.createdAt.getTime()-ye.createdAt.getTime())),window.notesPanelAddNote&&window.notesPanelAddNote(J)},Le=J=>{const Y=n.find(ye=>ye.id===J);Y?(p("chat"),setTimeout(()=>{const ye=document.getElementById(`message-${Y.id}`);ye&&(P||ye.scrollIntoView({behavior:"smooth",block:"center"}),ye.style.backgroundColor="#fbbf24",ye.style.transition="background-color 0.3s ease",setTimeout(()=>{ye.style.backgroundColor=""},2e3))},100)):Ke.info("Message not found",{description:"Could not locate the original message for this note."})};v.useEffect(()=>{n.length>0&&!B&&le(new Date)},[n.length,B]),v.useEffect(()=>{O.current=P,P||X()},[P]);const ft=J=>{ce(Y=>Y.includes(J)?Y.filter(ye=>ye!==J):[...Y,J])};return j?i.jsxs("div",{className:"min-h-screen bg-slate-50 pt-20 pb-16 px-4",children:[i.jsx(ci,{}),i.jsxs("div",{className:"max-w-7xl mx-auto text-center py-12",children:[i.jsx("div",{className:"flex justify-center items-center",children:i.jsx("div",{className:"animate-spin rounded-full h-8 w-8 border-b-2 border-primary"})}),i.jsx("p",{className:"mt-4 text-slate-600",children:"Loading focus group..."})]})]}):c?i.jsxs("div",{className:"min-h-screen bg-slate-50",children:[i.jsx(ci,{}),i.jsxs("main",{className:"pt-20 pb-16 px-4 sm:px-6 lg:px-8 max-w-7xl mx-auto",children:[i.jsxs("div",{className:"flex flex-col sm:flex-row justify-between items-start sm:items-center mb-4",children:[i.jsxs("div",{className:"flex items-center",children:[i.jsx(te,{variant:"ghost",onClick:()=>t("/focus-groups"),className:"mr-2",children:i.jsx(zf,{className:"h-4 w-4"})}),i.jsxs("div",{children:[i.jsx("h1",{className:"font-sf text-2xl font-bold text-slate-900",children:c.name}),i.jsx("p",{className:"text-slate-600",children:new Date(c.date).toLocaleString()}),i.jsxs("div",{className:"flex items-center mt-1",children:[i.jsx(ni,{className:"h-3 w-3 text-slate-500 mr-1"}),i.jsx(Wn,{variant:"secondary",className:"text-xs",children:c.llm_model==="gpt-4.1"?"GPT-4.1":"Gemini 2.5 Pro"})]})]})]}),i.jsxs("div",{className:"flex items-center space-x-4 mt-4 sm:mt-0",children:[i.jsxs(te,{variant:"outline",onClick:()=>b(!y),className:y?"bg-blue-50 text-blue-600":"",children:[i.jsx(fw,{className:"mr-2 h-4 w-4"}),"AI Dashboard"]}),i.jsxs(te,{variant:"outline",onClick:()=>V(!0),children:[i.jsx(VS,{className:"mr-2 h-4 w-4"}),"AI Model"]}),i.jsxs(te,{variant:"outline",onClick:He,children:[i.jsx($l,{className:"mr-2 h-4 w-4"}),"Download Transcript"]})]})]}),De&&i.jsx("div",{className:"mb-6",children:i.jsx(BN,{isActive:De,isComplete:be,hasError:ne,label:"Analyzing discussion for key themes",onComplete:Ce,className:"max-w-4xl mx-auto"})}),i.jsx(ePe,{discussionGuide:c.discussionGuide,moderatorStatus:g,onSectionSelect:Xn,onSetPosition:it,onSave:an,focusGroupId:e||"",isOpen:N,onToggle:tt,onEditingChange:pt}),i.jsxs("div",{className:"flex flex-col lg:flex-row gap-6 h-[calc(100vh-12rem)]",children:[i.jsx(RQ,{participants:d,selectedParticipantIds:se,onToggleParticipantFilter:ft}),i.jsx("div",{className:"flex-1 flex flex-col",children:i.jsxs(Fo,{defaultValue:"chat",value:h,onValueChange:p,className:"w-full h-full flex flex-col",children:[i.jsxs(Ai,{className:"grid grid-cols-4 mb-4",children:[i.jsxs(Xt,{value:"chat",className:"flex items-center",children:[i.jsx(xa,{className:"h-4 w-4 mr-2"}),"Discussion"]}),i.jsxs(Xt,{value:"themes",className:"flex items-center",children:[i.jsx(Ml,{className:"h-4 w-4 mr-2"}),"Key Themes"]}),i.jsxs(Xt,{value:"notes",className:"flex items-center",children:[i.jsx(pg,{className:"h-4 w-4 mr-2"}),"Notes"]}),i.jsxs(Xt,{value:"analytics",className:"flex items-center",children:[i.jsx(fw,{className:"h-4 w-4 mr-2"}),"Analytics"]})]}),i.jsx(Yt,{value:"chat",className:"m-0 flex-1 flex flex-col h-0",children:n.length===0?i.jsxs("div",{className:"flex flex-col items-center justify-center py-12 space-y-4",children:[i.jsx("p",{className:"text-lg text-slate-600",children:"No messages yet. Start the session to begin the discussion."}),i.jsxs(te,{onClick:we,size:"lg",className:"flex items-center gap-2",children:[i.jsx(lI,{className:"h-5 w-5"}),"Start Session"]})]}):i.jsx(dJ,{messages:n,modeEvents:s,personas:d,isSpeaking:!1,focusGroupId:e||"",isAiModeActive:x,selectedParticipantIds:se,onToggleHighlight:gt,onAdvanceDiscussion:()=>null,onNewMessage:ze,onStatusChange:me,isEditingDiscussionGuide:P})}),i.jsx(Yt,{value:"themes",className:"m-0",children:i.jsx(hJ,{themes:o,messages:n,personas:d,focusGroupId:e||"",onThemesGenerated:kt,onThemeDelete:Vt,onQuoteClick:Ze,onGenerateKeyThemes:H})}),i.jsx(Yt,{value:"notes",className:"m-0",style:{height:"calc(100% - 3.5rem)"},children:i.jsx("div",{className:"h-full",children:i.jsx(tPe,{focusGroupId:e||"",focusGroupName:c==null?void 0:c.name,onNoteClick:Le})})}),i.jsx(Yt,{value:"analytics",className:"m-0",children:i.jsx(Q_e,{messages:n,themes:o,personas:d})})]})})]})]}),n.length>0&&i.jsx("div",{className:"fixed bottom-6 right-6 z-40",children:i.jsx(te,{onClick:ke,className:"rounded-full h-12 w-12 p-0 shadow-lg",title:"Take a quick note",children:i.jsx(pg,{className:"h-5 w-5"})})}),i.jsx(nPe,{isOpen:re,onClose:()=>ge(!1),focusGroupId:e||"",associatedMessageId:Xr(),sectionInfo:tn(),messageTimestamp:Ua(),onNoteSaved:Ue}),i.jsx(wl,{open:ve.isOpen,onOpenChange:J=>at(Y=>({...Y,isOpen:J})),children:i.jsxs(ho,{children:[i.jsxs(po,{children:[i.jsx(go,{children:"Set Moderator Position"}),i.jsxs(jl,{children:['Are you sure you want to set the moderator position to "',ve.itemTitle,'" in section "',ve.sectionTitle,'"? This will make the moderator ask this question in the chat.']})]}),i.jsxs(mo,{children:[i.jsx(te,{variant:"outline",disabled:ve.isLoading,onClick:()=>at({isOpen:!1}),children:"Cancel"}),i.jsxs(te,{disabled:ve.isLoading,onClick:async()=>{var J,Y,ye,xe,je,Qe,I,K,W;if(!(!e||!ve.sectionId||!ve.itemId||!ve.content)){at(ie=>({...ie,isLoading:!0}));try{await jn.setModeratorPosition(e,ve.sectionId,ve.itemId);let ie=[],he=!1,Te=ve.content;const qe=ve.content?Lt(ve.content):null,Ft=!!qe;if(console.log("🔍 MANUAL POSITION DEBUG:",{itemType:ve.itemType,hasImageAttached:Ft,assetFilename:qe,content:ve.content,sectionTitle:ve.sectionTitle,itemTitle:ve.itemTitle,contentLength:(J=ve.content)==null?void 0:J.length}),Ft&&ve.content&&qe)if(console.log("🔍 ASSET EXTRACTION DEBUG:",{originalContent:ve.content,extractedFilename:qe,contentLength:ve.content.length}),qe){ie=[qe],he=!0,console.log("🎨 MANUAL POSITION: Creative review detected, will activate visual context for:",qe);try{console.log("🎨 MANUAL MODE: Requesting AI description for",qe);try{console.log("🔍 TESTING: Calling test endpoint first...");const fa=await Ge.post(`/focus-groups/${e}/test-endpoint`,{test:"data"});console.log("✅ TEST: Test endpoint response:",fa.data)}catch(fa){console.error("❌ TEST: Test endpoint failed:",fa)}const It=await bt.describeAsset(e,qe);It.data.description&&(Te=ve.content.replace(`'${qe}'`,`'${qe}' - ${It.data.description}`),console.log("✅ MANUAL MODE: Enhanced question with AI description"),console.log("🔍 Original:",ve.content),console.log("🔍 Enhanced:",Te))}catch(It){console.error("⚠️ MANUAL MODE: Failed to generate AI description:",It),console.error("⚠️ Error response data:",(Y=It.response)==null?void 0:Y.data),console.error("⚠️ Error status:",(ye=It.response)==null?void 0:ye.status),console.error("⚠️ Error headers:",(xe=It.response)==null?void 0:xe.headers),console.error("⚠️ Full axios error:",{message:It.message,code:It.code,status:(je=It.response)==null?void 0:je.status,statusText:(Qe=It.response)==null?void 0:Qe.statusText,url:(I=It.config)==null?void 0:I.url,method:(K=It.config)==null?void 0:K.method}),Ke.warning("AI description failed",{description:"Using original question text. Image will still be available to participants."})}}else console.warn("⚠️ MANUAL POSITION: Creative review detected but no asset filename extracted from content");const Wt={id:`msg-${Date.now()}`,senderId:"moderator",text:Te,timestamp:new Date,type:"question"};try{const It=await bt.sendMessage(e,{senderId:"moderator",text:Te,type:"question",attached_assets:ie,activates_visual_context:he});(W=It==null?void 0:It.data)!=null&&W.message_id&&(Wt.id=It.data.message_id)}catch(It){console.warn("Failed to save message to API, showing locally:",It)}ze(Wt),at({isOpen:!1}),setTimeout(async()=>{await X(),setTimeout(()=>X(),500)},200),Ke.success("Moderator position set",{description:`Position set to "${ve.itemTitle}" in "${ve.sectionTitle}"`})}catch(ie){console.error("Error setting moderator position:",ie),at(he=>({...he,isLoading:!1})),Ke.error("Failed to set moderator position",{description:"There was an error setting the moderator position."})}}},className:"flex items-center gap-2",children:[ve.isLoading&&i.jsx("div",{className:"animate-spin rounded-full h-4 w-4 border-b-2 border-white"}),ve.isLoading?"Generating detailed image description...":"Confirm"]})]})]})}),i.jsx(wl,{open:D,onOpenChange:V,children:i.jsxs(ho,{children:[i.jsxs(po,{children:[i.jsx(go,{children:"AI Model Settings"}),i.jsx(jl,{children:"Choose which AI model to use for generating responses and discussion guides in this focus group."})]}),i.jsxs("div",{className:"space-y-4",children:[i.jsxs("div",{className:"flex items-center space-x-2",children:[i.jsx(ni,{className:"h-4 w-4 text-slate-500"}),i.jsx("span",{className:"text-sm font-medium",children:"Current Model:"}),i.jsx(Wn,{variant:"secondary",children:(c==null?void 0:c.llm_model)==="gpt-4.1"?"GPT-4.1":"Gemini 2.5 Pro"})]}),i.jsxs("div",{children:[i.jsx("label",{className:"text-sm font-medium",children:"Select AI Model:"}),i.jsxs(Mn,{value:T,onValueChange:J=>{console.log("🔧 Model selection changed:",{from:T,to:J}),F(J)},children:[i.jsx(Pn,{className:"mt-1",children:i.jsx(In,{placeholder:"Select AI model"})}),i.jsxs(An,{children:[i.jsx(fe,{value:"gemini-2.5-pro",children:"Gemini 2.5 Pro"}),i.jsx(fe,{value:"gpt-4.1",children:"GPT-4.1"})]})]})]}),i.jsxs("div",{className:"text-xs text-slate-600",children:[i.jsxs("p",{children:[i.jsx("strong",{children:"Gemini 2.5 Pro:"})," Google's advanced model, great for creative and analytical tasks."]}),i.jsxs("p",{children:[i.jsx("strong",{children:"GPT-4.1:"})," OpenAI's latest model, excellent for conversational and reasoning tasks."]})]})]}),i.jsxs(mo,{children:[i.jsx(te,{variant:"outline",onClick:()=>V(!1),disabled:q,children:"Cancel"}),i.jsxs(te,{onClick:()=>{console.log("🔧 Update button clicked:",{selectedModel:T,currentModel:c==null?void 0:c.llm_model,isDisabled:q||T===(c==null?void 0:c.llm_model)}),Se(T)},disabled:q||T===(c==null?void 0:c.llm_model),children:[q&&i.jsx("div",{className:"animate-spin rounded-full h-4 w-4 border-b-2 border-white mr-2"}),q?"Updating...":"Update Model"]})]})]})}),i.jsx(J_e,{focusGroupId:e,personas:d,isVisible:y,onToggle:()=>b(!y)})]}):i.jsxs("div",{className:"min-h-screen bg-slate-50 pt-20 pb-16 px-4",children:[i.jsx(ci,{}),i.jsxs("div",{className:"max-w-7xl mx-auto text-center py-12",children:[i.jsx("h1",{className:"text-2xl font-bold",children:"Focus group not found"}),i.jsx("p",{className:"mt-2 text-slate-600",children:"We couldn't find the focus group you're looking for."}),i.jsxs(te,{onClick:()=>t("/focus-groups"),className:"mt-4",children:[i.jsx(zf,{className:"mr-2 h-4 w-4"})," Back to Focus Groups"]})]})]})},sPe=({title:e,description:t})=>i.jsxs("div",{className:"flex flex-col sm:flex-row justify-between items-start sm:items-center mb-8",children:[i.jsxs("div",{children:[i.jsx("h1",{className:"font-sf text-3xl font-bold text-slate-900",children:e}),i.jsx("p",{className:"text-slate-600 mt-1",children:t})]}),i.jsxs("div",{className:"mt-4 sm:mt-0 flex gap-2",children:[i.jsx(te,{variant:"outline",children:"Export Data"}),i.jsx(te,{children:"Generate Report"})]})]}),ab=({title:e,value:t,changePercentage:n,icon:r})=>i.jsx(rt,{className:"p-6 hover:shadow-md transition-shadow",children:i.jsxs("div",{className:"flex justify-between items-start",children:[i.jsxs("div",{children:[i.jsx("p",{className:"text-muted-foreground text-sm",children:e}),i.jsx("h3",{className:"text-2xl font-bold mt-1",children:t}),i.jsxs("p",{className:`${n>=0?"text-green-500":"text-red-500"} text-xs mt-1`,children:[n>=0?"↑":"↓"," ",Math.abs(n),"% from last month"]})]}),i.jsx("div",{className:"bg-primary/10 p-2 rounded-full",children:i.jsx(r,{className:"h-6 w-6 text-primary"})})]})}),aPe=[{name:"Jan",users:20,groups:3,interactions:120},{name:"Feb",users:25,groups:4,interactions:160},{name:"Mar",users:30,groups:5,interactions:220},{name:"Apr",users:40,groups:6,interactions:280},{name:"May",users:45,groups:7,interactions:350},{name:"Jun",users:48,groups:7,interactions:420}],iPe=[{id:"1",title:"User Interface Feedback",description:"Users consistently mentioned difficulty with the navigation menu on mobile devices.",source:"Mobile App Focus Group",date:"2023-06-12",sentiment:"negative"},{id:"2",title:"Feature Adoption",description:'The new search functionality is well-received, with 85% of users rating it as "very useful".',source:"Product Testing Group",date:"2023-06-10",sentiment:"positive"},{id:"3",title:"Pricing Strategy",description:"Price-conscious users expressed willingness to pay up to 20% more for premium features.",source:"Pricing Model Analysis",date:"2023-06-08",sentiment:"positive"},{id:"4",title:"Competitive Analysis",description:"Users who switched from competitor products cited our streamlined onboarding as a key factor.",source:"Customer Journey Mapping",date:"2023-06-05",sentiment:"positive"}],oPe=()=>i.jsxs("div",{className:"space-y-6",children:[i.jsxs(rt,{className:"p-6",children:[i.jsx("h3",{className:"font-sf text-lg font-semibold mb-4",children:"Research Activity"}),i.jsx("div",{className:"h-64",children:i.jsx(yo,{width:"100%",height:"100%",children:i.jsxs(dB,{data:aPe,margin:{top:10,right:30,left:0,bottom:0},children:[i.jsx(Wh,{strokeDasharray:"3 3"}),i.jsx(ko,{dataKey:"name"}),i.jsx(To,{}),i.jsx(mr,{}),i.jsx(ta,{type:"monotone",dataKey:"users",stackId:"1",stroke:"#8884d8",fill:"#8884d8",name:"Synthetic Users"}),i.jsx(ta,{type:"monotone",dataKey:"groups",stackId:"2",stroke:"#82ca9d",fill:"#82ca9d",name:"Focus Groups"}),i.jsx(ta,{type:"monotone",dataKey:"interactions",stackId:"3",stroke:"#ffc658",fill:"#ffc658",name:"Interactions"})]})})})]}),i.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-6",children:[i.jsxs(rt,{className:"p-6",children:[i.jsx("h3",{className:"font-sf text-lg font-semibold mb-4",children:"Recent AI Insights"}),i.jsxs("div",{className:"space-y-4",children:[iPe.slice(0,3).map(e=>i.jsx("div",{className:"border-b pb-4 last:border-b-0 last:pb-0",children:i.jsxs("div",{className:"flex items-start",children:[i.jsx("div",{className:`p-2 rounded-full mr-3 ${e.sentiment==="positive"?"bg-green-100":e.sentiment==="negative"?"bg-red-100":"bg-slate-100"}`,children:i.jsx(kl,{className:`h-4 w-4 ${e.sentiment==="positive"?"text-green-600":e.sentiment==="negative"?"text-red-600":"text-slate-600"}`})}),i.jsxs("div",{children:[i.jsx("h4",{className:"text-sm font-medium",children:e.title}),i.jsx("p",{className:"text-xs text-muted-foreground mt-1",children:e.description}),i.jsxs("div",{className:"flex items-center text-xs text-muted-foreground mt-2",children:[i.jsx("span",{children:e.source}),i.jsx("span",{className:"mx-2",children:"•"}),i.jsx("span",{children:e.date})]})]})]})},e.id)),i.jsx(te,{variant:"ghost",className:"w-full text-sm",size:"sm",children:"View All Insights"})]})]}),i.jsxs(rt,{className:"p-6",children:[i.jsx("h3",{className:"font-sf text-lg font-semibold mb-4",children:"Upcoming Research Tasks"}),i.jsxs("div",{className:"space-y-3",children:[i.jsxs("div",{className:"flex items-start",children:[i.jsx("div",{className:"bg-blue-100 p-2 rounded-full mr-3",children:i.jsx(Kp,{className:"h-4 w-4 text-blue-600"})}),i.jsxs("div",{children:[i.jsx("h4",{className:"text-sm font-medium",children:"Website Redesign Feedback"}),i.jsx("p",{className:"text-xs text-muted-foreground",children:"Focus group scheduled for Jun 20"})]})]}),i.jsxs("div",{className:"flex items-start",children:[i.jsx("div",{className:"bg-purple-100 p-2 rounded-full mr-3",children:i.jsx(Kp,{className:"h-4 w-4 text-purple-600"})}),i.jsxs("div",{children:[i.jsx("h4",{className:"text-sm font-medium",children:"Mobile App User Testing"}),i.jsx("p",{className:"text-xs text-muted-foreground",children:"8 participants needed by Jun 25"})]})]}),i.jsxs("div",{className:"flex items-start",children:[i.jsx("div",{className:"bg-amber-100 p-2 rounded-full mr-3",children:i.jsx(Kp,{className:"h-4 w-4 text-amber-600"})}),i.jsxs("div",{children:[i.jsx("h4",{className:"text-sm font-medium",children:"Pricing Strategy Evaluation"}),i.jsx("p",{className:"text-xs text-muted-foreground",children:"Create discussion guide by Jun 22"})]})]}),i.jsxs("div",{className:"flex items-start",children:[i.jsx("div",{className:"bg-green-100 p-2 rounded-full mr-3",children:i.jsx(Kp,{className:"h-4 w-4 text-green-600"})}),i.jsxs("div",{children:[i.jsx("h4",{className:"text-sm font-medium",children:"Product Onboarding Flow"}),i.jsx("p",{className:"text-xs text-muted-foreground",children:"Results analysis due Jun 30"})]})]}),i.jsx(te,{variant:"ghost",className:"w-full text-sm",size:"sm",children:"Manage Research Calendar"})]})]})]})]}),lPe=[{name:"18-24",value:15},{name:"25-34",value:35},{name:"35-44",value:25},{name:"45-54",value:15},{name:"55+",value:10}],cPe=()=>i.jsxs(rt,{className:"p-6",children:[i.jsxs("div",{className:"flex justify-between items-center mb-4",children:[i.jsx("h3",{className:"font-sf text-lg font-semibold",children:"Synthetic Persona Analytics"}),i.jsx(te,{variant:"outline",size:"sm",children:"View Demographics"})]}),i.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-6",children:[i.jsxs("div",{className:"space-y-4",children:[i.jsx("p",{className:"text-sm text-muted-foreground",children:"Persona Demographics"}),i.jsx("div",{className:"h-60",children:i.jsx(yo,{width:"100%",height:"100%",children:i.jsxs(Q_,{children:[i.jsx(mr,{}),i.jsx(da,{data:lPe,dataKey:"value",nameKey:"name",cx:"50%",cy:"50%",outerRadius:80,fill:"#FFDEE2",label:!0})]})})})]}),i.jsxs("div",{className:"space-y-4",children:[i.jsx("p",{className:"text-sm text-muted-foreground",children:"Persona Distribution"}),i.jsxs("div",{className:"space-y-4",children:[i.jsxs("div",{children:[i.jsxs("div",{className:"flex justify-between text-xs mb-1",children:[i.jsx("span",{children:"Age: 25-34"}),i.jsx("span",{children:"35%"})]}),i.jsx("div",{className:"h-2 bg-slate-100 rounded-full overflow-hidden",children:i.jsx("div",{className:"h-full bg-pink-400 rounded-full",style:{width:"35%"}})})]}),i.jsxs("div",{children:[i.jsxs("div",{className:"flex justify-between text-xs mb-1",children:[i.jsx("span",{children:"Tech Savvy"}),i.jsx("span",{children:"72%"})]}),i.jsx("div",{className:"h-2 bg-slate-100 rounded-full overflow-hidden",children:i.jsx("div",{className:"h-full bg-pink-300 rounded-full",style:{width:"72%"}})})]}),i.jsxs("div",{children:[i.jsxs("div",{className:"flex justify-between text-xs mb-1",children:[i.jsx("span",{children:"Brand Loyal"}),i.jsx("span",{children:"58%"})]}),i.jsx("div",{className:"h-2 bg-slate-100 rounded-full overflow-hidden",children:i.jsx("div",{className:"h-full bg-pink-500 rounded-full",style:{width:"58%"}})})]}),i.jsxs("div",{children:[i.jsxs("div",{className:"flex justify-between text-xs mb-1",children:[i.jsx("span",{children:"Price Sensitive"}),i.jsx("span",{children:"67%"})]}),i.jsx("div",{className:"h-2 bg-slate-100 rounded-full overflow-hidden",children:i.jsx("div",{className:"h-full bg-pink-200 rounded-full",style:{width:"67%"}})})]})]})]})]}),i.jsx("div",{className:"flex justify-center mt-6",children:i.jsx(te,{onClick:()=>window.location.href="/synthetic-users",children:"Manage Synthetic Personas"})})]}),uPe=[{name:"Jan",users:20,groups:3,interactions:120},{name:"Feb",users:25,groups:4,interactions:160},{name:"Mar",users:30,groups:5,interactions:220},{name:"Apr",users:40,groups:6,interactions:280},{name:"May",users:45,groups:7,interactions:350},{name:"Jun",users:48,groups:7,interactions:420}],Dk=[{name:"Very Positive",value:25,color:"#4ade80"},{name:"Positive",value:40,color:"#a3e635"},{name:"Neutral",value:20,color:"#93c5fd"},{name:"Negative",value:10,color:"#fb923c"},{name:"Very Negative",value:5,color:"#f87171"}],dPe=[{name:"Navigation",count:42},{name:"Performance",count:28},{name:"UX Design",count:36},{name:"Features",count:22},{name:"Onboarding",count:18}],fPe=()=>{const e=Tn();return i.jsxs(rt,{className:"p-6",children:[i.jsxs("div",{className:"flex justify-between items-center mb-4",children:[i.jsx("h3",{className:"font-sf text-lg font-semibold",children:"Focus Group Insights"}),i.jsx(te,{variant:"outline",size:"sm",onClick:()=>e("/focus-groups"),children:"View All Sessions"})]}),i.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-6 mb-6",children:[i.jsxs("div",{className:"space-y-4",children:[i.jsx("p",{className:"text-sm text-muted-foreground",children:"Session Analytics"}),i.jsx("div",{className:"h-60",children:i.jsx(yo,{width:"100%",height:"100%",children:i.jsxs(dB,{data:uPe,margin:{top:10,right:30,left:0,bottom:0},children:[i.jsx(Wh,{strokeDasharray:"3 3"}),i.jsx(ko,{dataKey:"name"}),i.jsx(To,{}),i.jsx(mr,{}),i.jsx(ta,{type:"monotone",dataKey:"interactions",stroke:"#8884d8",fill:"#8884d8",name:"User Interactions"})]})})})]}),i.jsxs("div",{className:"space-y-4",children:[i.jsx("p",{className:"text-sm text-muted-foreground",children:"Feedback Sentiment"}),i.jsx("div",{className:"h-60",children:i.jsx(yo,{width:"100%",height:"100%",children:i.jsxs(Q_,{children:[i.jsx(mr,{}),i.jsx(da,{data:Dk,dataKey:"value",nameKey:"name",cx:"50%",cy:"50%",outerRadius:80,label:({name:t,percent:n})=>`${t} ${(n*100).toFixed(0)}%`,children:Dk.map((t,n)=>i.jsx(yp,{fill:t.color},`cell-${n}`))}),i.jsx(di,{})]})})})]})]}),i.jsxs("div",{className:"mb-6",children:[i.jsx("p",{className:"text-sm text-muted-foreground mb-4",children:"Topic Frequency Analysis"}),i.jsx("div",{className:"h-60",children:i.jsx(yo,{width:"100%",height:"100%",children:i.jsxs(uB,{data:dPe,margin:{top:5,right:30,left:20,bottom:5},children:[i.jsx(Wh,{strokeDasharray:"3 3"}),i.jsx(ko,{dataKey:"name"}),i.jsx(To,{}),i.jsx(mr,{}),i.jsx(di,{}),i.jsx(Wo,{dataKey:"count",name:"Mentions",fill:"#8884d8"})]})})})]}),i.jsx("div",{className:"flex justify-center",children:i.jsx(te,{onClick:()=>e("/focus-groups"),children:"Manage Focus Groups"})})]})},hPe=()=>{const[e,t]=v.useState("overview");return i.jsxs("div",{className:"min-h-screen bg-slate-50",children:[i.jsx(ci,{}),i.jsxs("main",{className:"pt-20 pb-16 px-4 sm:px-6 lg:px-8 max-w-7xl mx-auto",children:[i.jsx(sPe,{title:"Dashboard",description:"Monitor and analyze your research insights"}),i.jsxs("div",{className:"grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-3 gap-4 mb-8",children:[i.jsx(ab,{title:"Total Synthetic Users",value:48,changePercentage:12,icon:tr}),i.jsx(ab,{title:"Active Focus Groups",value:7,changePercentage:5,icon:Ma}),i.jsx(ab,{title:"Research Insights",value:124,changePercentage:18,icon:Ml})]}),i.jsxs(Fo,{value:e,onValueChange:t,className:"glass-panel rounded-xl p-6",children:[i.jsxs(Ai,{className:"grid w-full grid-cols-3 mb-6",children:[i.jsx(Xt,{value:"overview",children:"Overview"}),i.jsx(Xt,{value:"users",children:"Synthetic Users"}),i.jsx(Xt,{value:"focus-groups",children:"Focus Groups"})]}),i.jsx(Yt,{value:"overview",children:i.jsx(oPe,{})}),i.jsx(Yt,{value:"users",children:i.jsx(cPe,{})}),i.jsx(Yt,{value:"focus-groups",children:i.jsx(fPe,{})})]})]})]})},fB=v.forwardRef(({...e},t)=>i.jsx("nav",{ref:t,"aria-label":"breadcrumb",...e}));fB.displayName="Breadcrumb";const hB=v.forwardRef(({className:e,...t},n)=>i.jsx("ol",{ref:n,className:Oe("flex flex-wrap items-center gap-1.5 break-words text-sm text-muted-foreground sm:gap-2.5",e),...t}));hB.displayName="BreadcrumbList";const Im=v.forwardRef(({className:e,...t},n)=>i.jsx("li",{ref:n,className:Oe("inline-flex items-center gap-1.5",e),...t}));Im.displayName="BreadcrumbItem";const bj=v.forwardRef(({asChild:e,className:t,...n},r)=>{const s=e?ka:"a";return i.jsx(s,{ref:r,className:Oe("transition-colors hover:text-foreground",t),...n})});bj.displayName="BreadcrumbLink";const pB=v.forwardRef(({className:e,...t},n)=>i.jsx("span",{ref:n,role:"link","aria-disabled":"true","aria-current":"page",className:Oe("font-normal text-foreground",e),...t}));pB.displayName="BreadcrumbPage";const wj=({children:e,className:t,...n})=>i.jsx("li",{role:"presentation","aria-hidden":"true",className:Oe("[&>svg]:size-3.5",t),...n,children:e??i.jsx(gs,{})});wj.displayName="BreadcrumbSeparator";function pPe({persona:e}){const t=e.id==="0",n=e.id==="1";return i.jsxs(rt,{className:"p-6",children:[i.jsxs("div",{className:"flex items-center space-x-4",children:[i.jsx("div",{className:"h-16 w-16 rounded-full bg-muted flex items-center justify-center",children:i.jsx("img",{src:cp(e),alt:e.name,className:"h-16 w-16 rounded-full object-cover"})}),i.jsxs("div",{children:[i.jsx("h2",{className:"font-sf text-xl font-semibold",children:e.name}),i.jsx("p",{className:"text-muted-foreground",children:e.occupation})]})]}),i.jsxs("div",{className:"mt-6 space-y-4",children:[i.jsxs("div",{className:"sidebar-section",children:[i.jsx(tr,{className:"sidebar-icon"}),i.jsxs("div",{children:[i.jsx("h3",{className:"font-medium text-sm",children:"Demographics"}),i.jsxs("p",{className:"text-sm text-muted-foreground mt-1",children:[e.age," ",e.gender?i.jsxs(i.Fragment,{children:["• ",e.gender]}):null,e.ethnicity?i.jsxs(i.Fragment,{children:[" • ",e.ethnicity]}):null]}),e.education&&i.jsx("p",{className:"sidebar-sub-item",children:e.education}),e.socialGrade&&i.jsxs("p",{className:"sidebar-sub-item",children:["Social Grade: ",e.socialGrade]}),e.householdIncome&&i.jsxs("p",{className:"sidebar-sub-item",children:["Household Income: ",e.householdIncome]}),e.householdComposition&&i.jsxs("p",{className:"sidebar-sub-item",children:["Household: ",e.householdComposition]})]})]}),i.jsxs("div",{className:"sidebar-section",children:[i.jsx(EW,{className:"sidebar-icon"}),i.jsxs("div",{children:[i.jsx("h3",{className:"font-medium text-sm",children:"Location"}),i.jsx("p",{className:"text-sm text-muted-foreground mt-1",children:e.location}),e.livingSituation&&i.jsx("p",{className:"sidebar-sub-item",children:e.livingSituation})]})]}),e.interests&&i.jsxs("div",{className:"sidebar-section",children:[i.jsx(mw,{className:"sidebar-icon"}),i.jsxs("div",{children:[i.jsx("h3",{className:"font-medium text-sm",children:"Interests"}),i.jsx("p",{className:"text-sm text-muted-foreground mt-1",children:e.interests})]})]}),e.mediaConsumption&&i.jsxs("div",{className:"sidebar-section",children:[i.jsx(p0,{className:"sidebar-icon"}),i.jsxs("div",{children:[i.jsx("h3",{className:"font-medium text-sm",children:"Media"}),i.jsx("p",{className:"text-sm text-muted-foreground mt-1",children:e.mediaConsumption})]})]}),i.jsxs("div",{className:"pt-4 border-t",children:[i.jsx("h3",{className:"font-medium text-sm mb-3",children:"Digital Behavior"}),i.jsxs("div",{className:"space-y-3",children:[i.jsxs("div",{children:[i.jsxs("div",{className:"flex justify-between text-xs mb-1",children:[i.jsx("span",{children:"Tech Savviness"}),i.jsxs("span",{children:[e.techSavviness,"%"]})]}),i.jsx("div",{className:"h-1.5 bg-slate-100 rounded-full overflow-hidden",children:i.jsx("div",{className:"h-full bg-blue-500 rounded-full",style:{width:`${e.techSavviness}%`}})})]}),e.brandLoyalty!==void 0&&i.jsxs("div",{children:[i.jsxs("div",{className:"flex justify-between text-xs mb-1",children:[i.jsx("span",{children:"Brand Loyalty"}),i.jsxs("span",{children:[e.brandLoyalty,"%"]})]}),i.jsx("div",{className:"h-1.5 bg-slate-100 rounded-full overflow-hidden",children:i.jsx("div",{className:"h-full bg-purple-500 rounded-full",style:{width:`${e.brandLoyalty}%`}})})]}),e.priceConsciousness!==void 0&&i.jsxs("div",{children:[i.jsxs("div",{className:"flex justify-between text-xs mb-1",children:[i.jsx("span",{children:"Price Sensitivity"}),i.jsxs("span",{children:[e.priceConsciousness,"%"]})]}),i.jsx("div",{className:"h-1.5 bg-slate-100 rounded-full overflow-hidden",children:i.jsx("div",{className:"h-full bg-amber-500 rounded-full",style:{width:`${e.priceConsciousness}%`}})})]}),e.environmentalConcern!==void 0&&i.jsxs("div",{children:[i.jsxs("div",{className:"flex justify-between text-xs mb-1",children:[i.jsx("span",{children:"Environmental Concern"}),i.jsxs("span",{children:[e.environmentalConcern,"%"]})]}),i.jsx("div",{className:"h-1.5 bg-slate-100 rounded-full overflow-hidden",children:i.jsx("div",{className:"h-full bg-green-500 rounded-full",style:{width:`${e.environmentalConcern}%`}})})]}),e.deviceUsage&&i.jsxs("div",{children:[i.jsx("h4",{className:"text-xs font-medium mt-3",children:"Device Usage"}),i.jsx("p",{className:"sidebar-sub-item text-xs",children:e.deviceUsage})]}),e.shoppingHabits&&i.jsxs("div",{children:[i.jsx("h4",{className:"text-xs font-medium mt-3",children:"Shopping Habits"}),i.jsx("p",{className:"sidebar-sub-item text-xs",children:e.shoppingHabits})]})]})]}),i.jsxs("div",{className:"pt-4 border-t",children:[i.jsx("h3",{className:"font-medium text-sm mb-3",children:"Additional Information"}),i.jsxs("div",{className:"space-y-2",children:[e.brandPreferences&&i.jsxs("div",{className:"sidebar-section",children:[i.jsx(mw,{className:"sidebar-icon"}),i.jsx("span",{className:"text-muted-foreground text-sm",children:e.brandPreferences})]}),e.communicationPreferences&&i.jsxs("div",{className:"sidebar-section",children:[i.jsx(Vf,{className:"sidebar-icon"}),i.jsxs("span",{className:"text-muted-foreground text-sm",children:["Prefers: ",e.communicationPreferences]})]}),e.deviceUsage&&i.jsxs("div",{className:"sidebar-section",children:[i.jsx(kW,{className:"sidebar-icon"}),i.jsx("span",{className:"text-muted-foreground text-sm",children:e.deviceUsage})]}),e.shoppingHabits&&i.jsxs("div",{className:"sidebar-section",children:[i.jsx(IW,{className:"sidebar-icon"}),i.jsx("span",{className:"text-muted-foreground text-sm",children:e.shoppingHabits})]}),e.additionalInformation&&typeof e.additionalInformation=="string"&&i.jsxs("div",{className:"sidebar-section",children:[i.jsx(_W,{className:"sidebar-icon"}),i.jsx("div",{className:"sidebar-sub-item",children:e.additionalInformation.split(` +`).map((r,s)=>i.jsx("div",{className:"mb-1",children:r.trim().startsWith("•")||r.trim().startsWith("-")?r.trim().substring(1).trim():r.trim()},s))})]}),t&&i.jsxs("div",{className:"pt-2 space-y-2",children:[i.jsxs("div",{className:"sidebar-section",children:[i.jsx(BA,{className:"sidebar-icon"}),i.jsx("span",{className:"text-muted-foreground text-sm",children:"Maintains an extensive network of financial and luxury industry contacts"})]}),i.jsxs("div",{className:"sidebar-section",children:[i.jsx(hg,{className:"sidebar-icon"}),i.jsx("span",{className:"text-muted-foreground text-sm",children:"Owns vacation properties in the Cotswolds and South of France"})]}),i.jsxs("div",{className:"sidebar-section",children:[i.jsx(p0,{className:"sidebar-icon"}),i.jsx("span",{className:"text-muted-foreground text-sm",children:"Collector of rare first-edition books and limited-edition art prints"})]}),i.jsxs("div",{className:"sidebar-section",children:[i.jsx(zA,{className:"sidebar-icon"}),i.jsx("span",{className:"text-muted-foreground text-sm",children:"Significant investment portfolio with focus on sustainable luxury ventures"})]})]}),n&&i.jsxs("div",{className:"pt-2 space-y-2",children:[i.jsxs("div",{className:"sidebar-section",children:[i.jsx(p0,{className:"sidebar-icon"}),i.jsx("span",{className:"text-muted-foreground text-sm",children:"Active in industry panels, luxury brand collaborations, follows influencers in luxury & design"})]}),i.jsxs("div",{className:"sidebar-section",children:[i.jsx(hg,{className:"sidebar-icon"}),i.jsx("span",{className:"text-muted-foreground text-sm",children:"Modern flat in exclusive Chelsea, accessible to boutique services"})]}),i.jsxs("div",{className:"sidebar-section",children:[i.jsx(zA,{className:"sidebar-icon"}),i.jsx("span",{className:"text-muted-foreground text-sm",children:"Uses premium digital payment & secure banking for HNWIs"})]}),i.jsxs("div",{className:"sidebar-section",children:[i.jsx(BA,{className:"sidebar-icon"}),i.jsx("span",{className:"text-muted-foreground text-sm",children:"Respected network in London's luxury sector; attends exclusive events"})]}),i.jsxs("div",{className:"sidebar-section",children:[i.jsx(Vf,{className:"sidebar-icon"}),i.jsx("span",{className:"text-muted-foreground text-sm",children:"Seeks autonomy, bespoke service, and acknowledgment for taste"})]})]})]})]})]})]})}function mPe({persona:e}){var t,n,r,s,a,o,l,c,u;return i.jsxs("div",{className:"space-y-6",children:[i.jsx(rt,{children:i.jsxs(wt,{className:"p-6",children:[i.jsxs("div",{className:"flex items-center mb-4",children:[i.jsx(Am,{className:"h-5 w-5 text-primary mr-2"}),i.jsx("h3",{className:"font-sf text-lg font-medium",children:"Goals"})]}),i.jsx("ul",{className:"space-y-2",children:(t=e.goals)==null?void 0:t.map((d,f)=>i.jsxs("li",{className:"flex items-start",children:[i.jsx("div",{className:"h-5 w-5 rounded-full bg-primary/10 flex items-center justify-center mt-0.5 mr-3",children:i.jsx("span",{className:"text-xs text-primary font-medium",children:f+1})}),i.jsx("p",{className:"text-sm",children:d})]},f))})]})}),i.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-6",children:[i.jsx(rt,{children:i.jsxs(wt,{className:"p-6",children:[i.jsxs("div",{className:"flex items-center mb-4",children:[i.jsx(fI,{className:"h-5 w-5 text-amber-500 mr-2"}),i.jsx("h3",{className:"font-sf text-lg font-medium",children:"Frustrations"})]}),i.jsx("ul",{className:"space-y-2",children:(n=e.frustrations)==null?void 0:n.map((d,f)=>i.jsxs("li",{className:"text-sm flex items-start",children:[i.jsx("span",{className:"text-amber-500 mr-2",children:"•"}),i.jsx("span",{children:d})]},f))})]})}),i.jsx(rt,{children:i.jsxs(wt,{className:"p-6",children:[i.jsxs("div",{className:"flex items-center mb-4",children:[i.jsx(Qa,{className:"h-5 w-5 text-green-500 mr-2"}),i.jsx("h3",{className:"font-sf text-lg font-medium",children:"Motivations"})]}),i.jsx("ul",{className:"space-y-2",children:(r=e.motivations)==null?void 0:r.map((d,f)=>i.jsxs("li",{className:"text-sm flex items-start",children:[i.jsx("span",{className:"text-green-500 mr-2",children:"•"}),i.jsx("span",{children:d})]},f))})]})})]}),i.jsx(rt,{children:i.jsxs(wt,{className:"p-6",children:[i.jsx("h3",{className:"font-sf text-lg font-medium mb-4",children:"Think, Feel, Do"}),i.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-3 gap-6",children:[i.jsxs("div",{children:[i.jsxs("div",{className:"flex items-center mb-3",children:[i.jsx(kl,{className:"h-5 w-5 text-blue-500 mr-2"}),i.jsx("h4",{className:"font-medium text-sm",children:"Thinks"})]}),i.jsx("ul",{className:"space-y-2",children:(a=(s=e.thinkFeelDo)==null?void 0:s.thinks)==null?void 0:a.map((d,f)=>i.jsxs("li",{className:"text-sm bg-blue-50 p-2 rounded-md",children:['"',d,'"']},f))})]}),i.jsxs("div",{children:[i.jsxs("div",{className:"flex items-center mb-3",children:[i.jsx(mw,{className:"h-5 w-5 text-red-500 mr-2"}),i.jsx("h4",{className:"font-medium text-sm",children:"Feels"})]}),i.jsx("ul",{className:"space-y-2",children:(l=(o=e.thinkFeelDo)==null?void 0:o.feels)==null?void 0:l.map((d,f)=>i.jsxs("li",{className:"text-sm bg-red-50 p-2 rounded-md",children:['"',d,'"']},f))})]}),i.jsxs("div",{children:[i.jsxs("div",{className:"flex items-center mb-3",children:[i.jsx(Qa,{className:"h-5 w-5 text-green-500 mr-2"}),i.jsx("h4",{className:"font-medium text-sm",children:"Does"})]}),i.jsx("ul",{className:"space-y-2",children:(u=(c=e.thinkFeelDo)==null?void 0:c.does)==null?void 0:u.map((d,f)=>i.jsxs("li",{className:"text-sm bg-green-50 p-2 rounded-md",children:['"',d,'"']},f))})]})]})]})})]})}function gPe({persona:e}){var n,r,s,a,o;const t=[{trait:"Openness",value:((n=e.oceanTraits)==null?void 0:n.openness)||50},{trait:"Conscientiousness",value:((r=e.oceanTraits)==null?void 0:r.conscientiousness)||50},{trait:"Extraversion",value:((s=e.oceanTraits)==null?void 0:s.extraversion)||50},{trait:"Agreeableness",value:((a=e.oceanTraits)==null?void 0:a.agreeableness)||50},{trait:"Neuroticism",value:((o=e.oceanTraits)==null?void 0:o.neuroticism)||50}];return i.jsx(rt,{children:i.jsxs(wt,{className:"p-6",children:[i.jsx("h3",{className:"font-sf text-lg font-medium mb-4",children:"OCEAN Personality Traits"}),i.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-6",children:[i.jsx("div",{className:"h-80",children:i.jsx(yo,{width:"100%",height:"100%",children:i.jsxs(Z_e,{outerRadius:90,data:t,children:[i.jsx(i6,{}),i.jsx(gd,{dataKey:"trait"}),i.jsx(md,{domain:[0,100]}),i.jsx(Np,{name:"Personality",dataKey:"value",stroke:"#8884d8",fill:"#8884d8",fillOpacity:.5})]})})}),i.jsxs("div",{className:"space-y-4",children:[i.jsxs("div",{children:[i.jsxs("div",{className:"flex justify-between text-sm mb-1",children:[i.jsx("span",{children:"Openness to Experience"}),i.jsxs("span",{className:"font-medium",children:[t[0].value,"%"]})]}),i.jsx("div",{className:"h-2 bg-slate-100 rounded-full overflow-hidden",children:i.jsx("div",{className:"h-full bg-purple-500 rounded-full",style:{width:`${t[0].value}%`}})}),i.jsx("p",{className:"text-xs text-muted-foreground mt-1",children:t[0].value>75?"Highly creative and curious":t[0].value>50?"Somewhat imaginative and open to new ideas":"Practical and prefers routine"})]}),i.jsxs("div",{children:[i.jsxs("div",{className:"flex justify-between text-sm mb-1",children:[i.jsx("span",{children:"Conscientiousness"}),i.jsxs("span",{className:"font-medium",children:[t[1].value,"%"]})]}),i.jsx("div",{className:"h-2 bg-slate-100 rounded-full overflow-hidden",children:i.jsx("div",{className:"h-full bg-blue-500 rounded-full",style:{width:`${t[1].value}%`}})}),i.jsx("p",{className:"text-xs text-muted-foreground mt-1",children:t[1].value>75?"Highly organized and responsible":t[1].value>50?"Generally reliable and hardworking":"Spontaneous and flexible"})]}),i.jsxs("div",{children:[i.jsxs("div",{className:"flex justify-between text-sm mb-1",children:[i.jsx("span",{children:"Extraversion"}),i.jsxs("span",{className:"font-medium",children:[t[2].value,"%"]})]}),i.jsx("div",{className:"h-2 bg-slate-100 rounded-full overflow-hidden",children:i.jsx("div",{className:"h-full bg-green-500 rounded-full",style:{width:`${t[2].value}%`}})}),i.jsx("p",{className:"text-xs text-muted-foreground mt-1",children:t[2].value>75?"Highly sociable and outgoing":t[2].value>50?"Moderately social and talkative":"Reserved and reflective"})]}),i.jsxs("div",{children:[i.jsxs("div",{className:"flex justify-between text-sm mb-1",children:[i.jsx("span",{children:"Agreeableness"}),i.jsxs("span",{className:"font-medium",children:[t[3].value,"%"]})]}),i.jsx("div",{className:"h-2 bg-slate-100 rounded-full overflow-hidden",children:i.jsx("div",{className:"h-full bg-amber-500 rounded-full",style:{width:`${t[3].value}%`}})}),i.jsx("p",{className:"text-xs text-muted-foreground mt-1",children:t[3].value>75?"Highly cooperative and compassionate":t[3].value>50?"Generally kind and helpful":"Competitive and challenging"})]}),i.jsxs("div",{children:[i.jsxs("div",{className:"flex justify-between text-sm mb-1",children:[i.jsx("span",{children:"Neuroticism"}),i.jsxs("span",{className:"font-medium",children:[t[4].value,"%"]})]}),i.jsx("div",{className:"h-2 bg-slate-100 rounded-full overflow-hidden",children:i.jsx("div",{className:"h-full bg-red-500 rounded-full",style:{width:`${t[4].value}%`}})}),i.jsx("p",{className:"text-xs text-muted-foreground mt-1",children:t[4].value>75?"Highly sensitive and prone to stress":t[4].value>50?"Moderately reactive to challenges":"Emotionally stable and resilient"})]})]})]})]})})}function vPe({persona:e}){var r;const t=(s,a)=>{const o=[i.jsx(AW,{className:"sidebar-icon"},"grid"),i.jsx(RW,{className:"sidebar-icon"},"smartphone"),i.jsx(PW,{className:"sidebar-icon"},"laptop"),i.jsx(NW,{className:"sidebar-icon"},"grid2x2")];return o[a%o.length]},n=()=>e.scenarioType?e.scenarioType:"Life Scenarios";return i.jsx(rt,{children:i.jsxs(wt,{className:"p-6",children:[i.jsx("h3",{className:"font-sf text-lg font-medium mb-4",children:n()}),i.jsx("div",{className:"space-y-4",children:(r=e.scenarios)==null?void 0:r.map((s,a)=>i.jsx("div",{className:"bg-slate-50 p-4 rounded-lg border",children:i.jsxs("div",{className:"sidebar-section",children:[t(s,a),i.jsxs("div",{children:[i.jsxs("h4",{className:"font-medium text-sm mb-2",children:["Scenario ",a+1]}),i.jsx("p",{className:"text-sm",children:s})]})]})},a))})]})})}function yPe(){const e=Tn();return i.jsx("div",{className:"min-h-screen bg-slate-50 flex items-center justify-center",children:i.jsxs(rt,{className:"w-96 text-center p-6",children:[i.jsx("h2",{className:"text-xl font-semibold mb-4",children:"Persona Not Found"}),i.jsx("p",{className:"text-muted-foreground mb-6",children:"The persona you're looking for couldn't be found."}),i.jsx(te,{onClick:()=>e("/synthetic-users"),children:"Return to Personas"})]})})}function Ct({className:e,...t}){return i.jsx("div",{className:Oe("animate-pulse rounded-md bg-muted",e),...t})}function xPe(){return i.jsxs("div",{className:"min-h-screen bg-slate-50",children:[i.jsx(ci,{}),i.jsxs("main",{className:"pt-20 pb-16 px-4 sm:px-6 lg:px-8 max-w-7xl mx-auto",children:[i.jsxs("div",{className:"flex items-center mb-6 relative",children:[i.jsx(Ct,{className:"absolute left-0 top-0 h-10 w-20"}),i.jsx(Ct,{className:"h-8 w-48 mx-auto"}),i.jsx(Ct,{className:"absolute right-0 top-0 h-10 w-32"})]}),i.jsxs("div",{className:"grid grid-cols-1 lg:grid-cols-3 gap-6 mt-10",children:[i.jsx("div",{className:"lg:col-span-1",children:i.jsxs(rt,{className:"p-6",children:[i.jsxs("div",{className:"flex items-center space-x-4",children:[i.jsx(Ct,{className:"h-16 w-16 rounded-full"}),i.jsxs("div",{className:"flex-1",children:[i.jsx(Ct,{className:"h-6 w-32 mb-2"}),i.jsx(Ct,{className:"h-4 w-24"})]})]}),i.jsxs("div",{className:"mt-6 space-y-4",children:[i.jsxs("div",{className:"flex items-start",children:[i.jsx(Ct,{className:"h-5 w-5 mr-3 mt-0.5"}),i.jsxs("div",{className:"flex-1",children:[i.jsx(Ct,{className:"h-4 w-20 mb-2"}),i.jsx(Ct,{className:"h-3 w-40 mb-1"}),i.jsx(Ct,{className:"h-3 w-36"})]})]}),i.jsxs("div",{className:"flex items-start",children:[i.jsx(Ct,{className:"h-5 w-5 mr-3 mt-0.5"}),i.jsxs("div",{className:"flex-1",children:[i.jsx(Ct,{className:"h-4 w-16 mb-2"}),i.jsx(Ct,{className:"h-3 w-32"})]})]}),i.jsxs("div",{className:"flex items-start",children:[i.jsx(Ct,{className:"h-5 w-5 mr-3 mt-0.5"}),i.jsxs("div",{className:"flex-1",children:[i.jsx(Ct,{className:"h-4 w-16 mb-2"}),i.jsx(Ct,{className:"h-3 w-full"})]})]}),i.jsxs("div",{className:"flex items-start",children:[i.jsx(Ct,{className:"h-5 w-5 mr-3 mt-0.5"}),i.jsxs("div",{className:"flex-1",children:[i.jsx(Ct,{className:"h-4 w-12 mb-2"}),i.jsx(Ct,{className:"h-3 w-full"})]})]}),i.jsxs("div",{className:"pt-4 border-t",children:[i.jsx(Ct,{className:"h-4 w-32 mb-3"}),i.jsx("div",{className:"space-y-3",children:[...Array(4)].map((e,t)=>i.jsxs("div",{children:[i.jsxs("div",{className:"flex justify-between mb-1",children:[i.jsx(Ct,{className:"h-3 w-24"}),i.jsx(Ct,{className:"h-3 w-8"})]}),i.jsx(Ct,{className:"h-1.5 w-full rounded-full"})]},t))})]}),i.jsxs("div",{className:"pt-4 border-t",children:[i.jsx(Ct,{className:"h-4 w-36 mb-3"}),i.jsx("div",{className:"space-y-2",children:[...Array(3)].map((e,t)=>i.jsxs("div",{className:"flex items-center",children:[i.jsx(Ct,{className:"h-4 w-4 mr-2"}),i.jsx(Ct,{className:"h-3 w-40"})]},t))})]})]})]})}),i.jsxs("div",{className:"lg:col-span-2",children:[i.jsxs("div",{className:"grid w-full grid-cols-3 gap-2 mb-6",children:[i.jsx(Ct,{className:"h-10 w-full"}),i.jsx(Ct,{className:"h-10 w-full"}),i.jsx(Ct,{className:"h-10 w-full"})]}),i.jsx(rt,{className:"p-6",children:i.jsxs("div",{className:"space-y-4",children:[i.jsx(Ct,{className:"h-6 w-48"}),i.jsx(Ct,{className:"h-4 w-full"}),i.jsx(Ct,{className:"h-4 w-full"}),i.jsx(Ct,{className:"h-4 w-3/4"}),i.jsxs("div",{className:"mt-8 space-y-4",children:[i.jsx(Ct,{className:"h-6 w-32"}),i.jsx(Ct,{className:"h-4 w-full"}),i.jsx(Ct,{className:"h-4 w-full"}),i.jsx(Ct,{className:"h-4 w-2/3"})]}),i.jsxs("div",{className:"mt-8 space-y-4",children:[i.jsx(Ct,{className:"h-6 w-40"}),i.jsx(Ct,{className:"h-4 w-full"}),i.jsx(Ct,{className:"h-4 w-full"}),i.jsx(Ct,{className:"h-4 w-5/6"})]})]})})]})]})]})]})}function bPe({message:e,onLoginSuccess:t,onCancel:n}){const{login:r}=Kl(),s=Tn(),[a,o]=v.useState("user"),[l,c]=v.useState("pass"),[u,d]=v.useState(!1),f=async()=>{if(!a||!l){oe.error("Please enter username and password");return}d(!0);try{await r(a,l),oe.success("Login successful"),t&&t()}catch(p){console.error("Login error:",p),oe.error("Login failed",{description:"Please check your credentials and try again"})}finally{d(!1)}},h=()=>{n?n():s("/synthetic-users")};return i.jsxs(rt,{className:"max-w-md mx-auto shadow-lg",children:[i.jsxs(Dr,{children:[i.jsx(ts,{children:"Login Required"}),i.jsx(oN,{children:e||"You need to log in to save personas to the database"})]}),i.jsxs(wt,{className:"space-y-4",children:[i.jsxs("div",{className:"space-y-2",children:[i.jsx(ys,{htmlFor:"username",children:"Username"}),i.jsx(Ot,{id:"username",placeholder:"Username",value:a,onChange:p=>o(p.target.value),disabled:u})]}),i.jsxs("div",{className:"space-y-2",children:[i.jsx(ys,{htmlFor:"password",children:"Password"}),i.jsx(Ot,{id:"password",type:"password",placeholder:"Password",value:l,onChange:p=>c(p.target.value),disabled:u})]}),i.jsx("div",{className:"text-sm text-muted-foreground",children:"Default credentials: user / pass"})]}),i.jsxs(lN,{className:"flex justify-between",children:[i.jsx(te,{variant:"outline",onClick:h,disabled:u,children:"Cancel"}),i.jsx(te,{onClick:f,disabled:u,children:u?i.jsxs(i.Fragment,{children:[i.jsx(li,{className:"h-4 w-4 mr-2 animate-spin"}),"Logging in..."]}):"Login"})]})]})}function wPe({persona:e,onSave:t,onCancel:n}){var P,k,O,M,A,$,L,G,D,V,T,F,q,Z,re,ge;const r={...e,education:e.education||"",interests:e.interests||"",brandLoyalty:e.brandLoyalty||0,priceConsciousness:e.priceConsciousness||0,environmentalConcern:e.environmentalConcern||0,hasPurchasingPower:e.hasPurchasingPower||!1,hasChildren:e.hasChildren||!1,goals:e.goals||[],frustrations:e.frustrations||[],motivations:e.motivations||[],scenarios:e.scenarios||[],oceanTraits:e.oceanTraits||{openness:50,conscientiousness:50,extraversion:50,agreeableness:50,neuroticism:50},thinkFeelDo:e.thinkFeelDo||{thinks:[],feels:[],does:[]}},[s,a]=v.useState(r),[o,l]=v.useState(!1),[c,u]=v.useState(!1),[d,f]=v.useState(null);v.useState(!1);const{isAuthenticated:h,token:p}=Kl();v.useEffect(()=>{(async()=>{c&&h&&p&&(u(!1),d&&await _())})()},[h,p,c]);const g=(B,le)=>{a(se=>({...se,[B]:le}))},m=(B,le)=>{a(se=>({...se,oceanTraits:{...se.oceanTraits,[B]:le}}))},y=B=>{a(le=>({...le,[B]:[...le[B]||[],""]}))},b=(B,le,se)=>{a(ce=>{const De=[...ce[B]||[]];return De[le]=se,{...ce,[B]:De}})},x=(B,le)=>{a(se=>{const ce=[...se[B]||[]];return ce.splice(le,1),{...se,[B]:ce}})},w=(B,le,se)=>{a(ce=>{const De={...ce.thinkFeelDo},de=[...De[B]||[]];return de[le]=se,De[B]=de,{...ce,thinkFeelDo:De}})},j=B=>{a(le=>{var ce;const se={...le.thinkFeelDo,[B]:[...((ce=le.thinkFeelDo)==null?void 0:ce[B])||[],""]};return{...le,thinkFeelDo:se}})},S=(B,le)=>{a(se=>{const ce={...se.thinkFeelDo},De=[...ce[B]||[]];return De.splice(le,1),ce[B]=De,{...se,thinkFeelDo:ce}})},N=()=>{d&&(oe.error("Login canceled - Persona changes not saved"),u(!1),f(null),n())},_=async()=>{if(d){l(!0);try{const B={...d};delete B._id,delete B.isDbPersona;const le=await Dn.create(B),se={...d,id:le.data._id||le.data.id,_id:le.data._id||le.data.id,isDbPersona:!0};oe.success("Persona saved to database successfully"),u(!1),f(null),t(se)}catch(B){console.error("Error saving after login:",B),oe.error("Failed to save to database after login"),u(!1),f(null)}finally{l(!1)}}};return c?i.jsxs("div",{className:"max-w-5xl mx-auto bg-background p-6",children:[i.jsx("div",{className:"flex justify-between items-center mb-6",children:i.jsx("h2",{className:"font-sf text-2xl font-bold",children:"Authentication Required"})}),i.jsx("p",{className:"mb-6 text-muted-foreground",children:"Login is required to save personas to the database. You can either:"}),i.jsxs("ul",{className:"list-disc ml-6 mt-2 mb-6",children:[i.jsx("li",{children:"Log in to save this persona to the database"}),i.jsx("li",{children:"Cancel to discard your changes"})]}),i.jsx(bPe,{message:"Login is required to save your persona to the database",onLoginSuccess:_,onCancel:N})]}):i.jsxs("div",{className:"space-y-6",children:[i.jsxs("div",{className:"flex items-center justify-between",children:[i.jsxs("div",{className:"flex items-center",children:[i.jsx(te,{variant:"ghost",onClick:n,className:"mr-2",children:i.jsx(zf,{className:"h-5 w-5"})}),i.jsx("h2",{className:"font-sf text-2xl font-bold",children:"Edit Persona"})]}),i.jsxs(te,{onClick:async()=>{l(!0);try{const B=s._id||s.id,le={...s};le._id&&delete le._id,delete le.isDbPersona;let se;if(B&&typeof B=="string"&&B.startsWith("local-")){console.log("Creating new persona instead of updating local ID"),se=await Dn.create(le),oe.success("Persona saved to database");const ce={...s,id:se.data._id||se.data.id,_id:se.data._id||se.data.id,isDbPersona:!0};t(ce)}else if(B){se=await Dn.update(B,le),oe.success("Persona updated successfully");const ce={...s,isDbPersona:!0};t(ce)}else{se=await Dn.create(le);const ce={...s,id:se.data._id||se.data.id,_id:se.data._id||se.data.id,isDbPersona:!0};oe.success("Persona created successfully"),t(ce)}}catch(B){console.error("Error saving persona:",B),B.response&&B.response.status===401?h&&p?(console.log("Auth error despite having token - token likely invalid"),oe.error("Authentication error - saving locally instead"),t(s)):(f(s),u(!0)):(oe.error("Failed to save persona"),t(s))}finally{l(!1)}},disabled:o,children:[o?i.jsx(li,{className:"h-4 w-4 mr-2 animate-spin"}):i.jsx(zS,{className:"h-4 w-4 mr-2"}),o?"Saving...":"Save Changes"]})]}),i.jsxs(Fo,{defaultValue:"basic",children:[i.jsxs(Ai,{className:"grid w-full grid-cols-6",children:[i.jsx(Xt,{value:"basic",children:"Basic"}),i.jsx(Xt,{value:"cooper",children:"Cooper"}),i.jsx(Xt,{value:"personality",children:"Personality"}),i.jsx(Xt,{value:"demographics",children:"Demographics"}),i.jsx(Xt,{value:"lifestyle",children:"Lifestyle"}),i.jsx(Xt,{value:"extended",children:"Extended"})]}),i.jsx(Yt,{value:"basic",className:"mt-6",children:i.jsx(rt,{children:i.jsx(wt,{className:"p-6",children:i.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-6",children:[i.jsxs("div",{className:"space-y-4",children:[i.jsxs("div",{children:[i.jsx("label",{className:"text-sm font-medium block mb-1",children:"Name"}),i.jsx(Ot,{value:s.name||"",onChange:B=>g("name",B.target.value)})]}),i.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[i.jsxs("div",{children:[i.jsx("label",{className:"text-sm font-medium block mb-1",children:"Age Range"}),i.jsxs(Mn,{value:s.age||"",onValueChange:B=>g("age",B),children:[i.jsx(Pn,{children:i.jsx(In,{placeholder:"Select age range"})}),i.jsxs(An,{children:[i.jsx(fe,{value:"18-24",children:"18-24"}),i.jsx(fe,{value:"25-34",children:"25-34"}),i.jsx(fe,{value:"35-44",children:"35-44"}),i.jsx(fe,{value:"45-54",children:"45-54"}),i.jsx(fe,{value:"55-64",children:"55-64"}),i.jsx(fe,{value:"65+",children:"65+"})]})]})]}),i.jsxs("div",{children:[i.jsx("label",{className:"text-sm font-medium block mb-1",children:"Gender"}),i.jsxs(Mn,{value:s.gender||"",onValueChange:B=>g("gender",B),children:[i.jsx(Pn,{children:i.jsx(In,{placeholder:"Select gender"})}),i.jsxs(An,{children:[i.jsx(fe,{value:"Male",children:"Male"}),i.jsx(fe,{value:"Female",children:"Female"}),i.jsx(fe,{value:"Non-binary",children:"Non-binary"}),i.jsx(fe,{value:"Other",children:"Other"})]})]})]})]}),i.jsxs("div",{children:[i.jsx("label",{className:"text-sm font-medium block mb-1",children:"Occupation"}),i.jsx(Ot,{value:s.occupation||"",onChange:B=>g("occupation",B.target.value)})]}),i.jsxs("div",{children:[i.jsx("label",{className:"text-sm font-medium block mb-1",children:"Education"}),i.jsxs(Mn,{value:s.education||"",onValueChange:B=>g("education",B),children:[i.jsx(Pn,{children:i.jsx(In,{placeholder:"Select education level"})}),i.jsxs(An,{children:[i.jsx(fe,{value:"High School",children:"High School"}),i.jsx(fe,{value:"Some College",children:"Some College"}),i.jsx(fe,{value:"Associate's Degree",children:"Associate's Degree"}),i.jsx(fe,{value:"Bachelor's Degree",children:"Bachelor's Degree"}),i.jsx(fe,{value:"Master's Degree",children:"Master's Degree"}),i.jsx(fe,{value:"PhD",children:"PhD"})]})]})]}),i.jsxs("div",{children:[i.jsx("label",{className:"text-sm font-medium block mb-1",children:"Location"}),i.jsx(Ot,{value:s.location||"",onChange:B=>g("location",B.target.value)})]}),i.jsxs("div",{children:[i.jsx("label",{className:"text-sm font-medium block mb-1",children:"Ethnicity (Optional)"}),i.jsxs(Mn,{value:s.ethnicity||"",onValueChange:B=>g("ethnicity",B),children:[i.jsx(Pn,{children:i.jsx(In,{placeholder:"Select ethnicity"})}),i.jsxs(An,{children:[i.jsx(fe,{value:"white",children:"White"}),i.jsx(fe,{value:"black",children:"Black"}),i.jsx(fe,{value:"asian",children:"Asian"}),i.jsx(fe,{value:"hispanic",children:"Hispanic/Latino"}),i.jsx(fe,{value:"native-american",children:"Native American"}),i.jsx(fe,{value:"middle-eastern",children:"Middle Eastern"}),i.jsx(fe,{value:"mixed",children:"Mixed"}),i.jsx(fe,{value:"other",children:"Other"}),i.jsx(fe,{value:"prefer-not-to-say",children:"Prefer not to say"})]})]})]})]}),i.jsxs("div",{className:"space-y-4",children:[i.jsxs("div",{children:[i.jsx("label",{className:"text-sm font-medium block mb-1",children:"Personality"}),i.jsx(nt,{value:s.personality||"",onChange:B=>g("personality",B.target.value),rows:3})]}),i.jsxs("div",{children:[i.jsx("label",{className:"text-sm font-medium block mb-1",children:"Interests"}),i.jsx(nt,{value:s.interests||"",onChange:B=>g("interests",B.target.value),rows:3,placeholder:"Tech, travel, cooking, etc."})]}),i.jsxs("div",{children:[i.jsxs("div",{className:"flex justify-between mb-1",children:[i.jsx("label",{className:"text-sm font-medium",children:"Tech Savviness"}),i.jsxs("span",{className:"text-sm",children:[s.techSavviness,"%"]})]}),i.jsx(Un,{value:[s.techSavviness],onValueChange:B=>g("techSavviness",B[0]),max:100,step:1})]}),i.jsxs("div",{children:[i.jsxs("div",{className:"flex justify-between mb-1",children:[i.jsx("label",{className:"text-sm font-medium",children:"Brand Loyalty"}),i.jsxs("span",{className:"text-sm",children:[s.brandLoyalty||0,"%"]})]}),i.jsx(Un,{value:[s.brandLoyalty||0],onValueChange:B=>g("brandLoyalty",B[0]),max:100,step:1})]}),i.jsxs("div",{children:[i.jsxs("div",{className:"flex justify-between mb-1",children:[i.jsx("label",{className:"text-sm font-medium",children:"Price Consciousness"}),i.jsxs("span",{className:"text-sm",children:[s.priceConsciousness||0,"%"]})]}),i.jsx(Un,{value:[s.priceConsciousness||0],onValueChange:B=>g("priceConsciousness",B[0]),max:100,step:1})]}),i.jsxs("div",{children:[i.jsxs("div",{className:"flex justify-between mb-1",children:[i.jsx("label",{className:"text-sm font-medium",children:"Environmental Concern"}),i.jsxs("span",{className:"text-sm",children:[s.environmentalConcern||0,"%"]})]}),i.jsx(Un,{value:[s.environmentalConcern||0],onValueChange:B=>g("environmentalConcern",B[0]),max:100,step:1})]}),i.jsxs("div",{className:"grid grid-cols-2 gap-4 pt-2",children:[i.jsxs("div",{className:"flex items-center justify-between",children:[i.jsx("label",{className:"text-sm font-medium",children:"Purchasing Power"}),i.jsx(ih,{checked:s.hasPurchasingPower||!1,onCheckedChange:B=>g("hasPurchasingPower",B)})]}),i.jsxs("div",{className:"flex items-center justify-between",children:[i.jsx("label",{className:"text-sm font-medium",children:"Has Children"}),i.jsx(ih,{checked:s.hasChildren||!1,onCheckedChange:B=>g("hasChildren",B)})]})]})]})]})})})}),i.jsxs(Yt,{value:"cooper",className:"mt-6 space-y-6",children:[i.jsx(rt,{children:i.jsxs(wt,{className:"p-6",children:[i.jsxs("div",{className:"mb-4",children:[i.jsx("h3",{className:"font-medium text-lg mb-3",children:"Goals"}),(s.goals||[]).map((B,le)=>i.jsxs("div",{className:"flex items-center gap-2 mb-2",children:[i.jsx(Ot,{value:B||"",onChange:se=>b("goals",le,se.target.value)}),i.jsx(te,{variant:"ghost",size:"icon",onClick:()=>x("goals",le),children:i.jsx(_n,{className:"h-4 w-4 text-muted-foreground"})})]},le)),i.jsxs(te,{variant:"outline",size:"sm",onClick:()=>y("goals"),className:"mt-2",children:[i.jsx(pr,{className:"h-4 w-4 mr-2"}),"Add Goal"]})]}),i.jsxs("div",{className:"mb-4 pt-4 border-t",children:[i.jsx("h3",{className:"font-medium text-lg mb-3",children:"Frustrations"}),(s.frustrations||[]).map((B,le)=>i.jsxs("div",{className:"flex items-center gap-2 mb-2",children:[i.jsx(Ot,{value:B||"",onChange:se=>b("frustrations",le,se.target.value)}),i.jsx(te,{variant:"ghost",size:"icon",onClick:()=>x("frustrations",le),children:i.jsx(_n,{className:"h-4 w-4 text-muted-foreground"})})]},le)),i.jsxs(te,{variant:"outline",size:"sm",onClick:()=>y("frustrations"),className:"mt-2",children:[i.jsx(pr,{className:"h-4 w-4 mr-2"}),"Add Frustration"]})]}),i.jsxs("div",{className:"mb-4 pt-4 border-t",children:[i.jsx("h3",{className:"font-medium text-lg mb-3",children:"Motivations"}),(s.motivations||[]).map((B,le)=>i.jsxs("div",{className:"flex items-center gap-2 mb-2",children:[i.jsx(Ot,{value:B||"",onChange:se=>b("motivations",le,se.target.value)}),i.jsx(te,{variant:"ghost",size:"icon",onClick:()=>x("motivations",le),children:i.jsx(_n,{className:"h-4 w-4 text-muted-foreground"})})]},le)),i.jsxs(te,{variant:"outline",size:"sm",onClick:()=>y("motivations"),className:"mt-2",children:[i.jsx(pr,{className:"h-4 w-4 mr-2"}),"Add Motivation"]})]})]})}),i.jsx(rt,{children:i.jsxs(wt,{className:"p-6",children:[i.jsx("h3",{className:"font-medium text-lg mb-4",children:"Think, Feel, Do"}),i.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-3 gap-6",children:[i.jsxs("div",{children:[i.jsx("h4",{className:"font-medium text-sm mb-3",children:"Thinks"}),(((P=s.thinkFeelDo)==null?void 0:P.thinks)||[]).map((B,le)=>i.jsxs("div",{className:"flex items-center gap-2 mb-2",children:[i.jsx(Ot,{value:B||"",onChange:se=>w("thinks",le,se.target.value)}),i.jsx(te,{variant:"ghost",size:"icon",onClick:()=>S("thinks",le),children:i.jsx(_n,{className:"h-4 w-4 text-muted-foreground"})})]},le)),i.jsxs(te,{variant:"outline",size:"sm",onClick:()=>j("thinks"),className:"mt-2",children:[i.jsx(pr,{className:"h-4 w-4 mr-2"}),"Add Thought"]})]}),i.jsxs("div",{children:[i.jsx("h4",{className:"font-medium text-sm mb-3",children:"Feels"}),(((k=s.thinkFeelDo)==null?void 0:k.feels)||[]).map((B,le)=>i.jsxs("div",{className:"flex items-center gap-2 mb-2",children:[i.jsx(Ot,{value:B||"",onChange:se=>w("feels",le,se.target.value)}),i.jsx(te,{variant:"ghost",size:"icon",onClick:()=>S("feels",le),children:i.jsx(_n,{className:"h-4 w-4 text-muted-foreground"})})]},le)),i.jsxs(te,{variant:"outline",size:"sm",onClick:()=>j("feels"),className:"mt-2",children:[i.jsx(pr,{className:"h-4 w-4 mr-2"}),"Add Feeling"]})]}),i.jsxs("div",{children:[i.jsx("h4",{className:"font-medium text-sm mb-3",children:"Does"}),(((O=s.thinkFeelDo)==null?void 0:O.does)||[]).map((B,le)=>i.jsxs("div",{className:"flex items-center gap-2 mb-2",children:[i.jsx(Ot,{value:B||"",onChange:se=>w("does",le,se.target.value)}),i.jsx(te,{variant:"ghost",size:"icon",onClick:()=>S("does",le),children:i.jsx(_n,{className:"h-4 w-4 text-muted-foreground"})})]},le)),i.jsxs(te,{variant:"outline",size:"sm",onClick:()=>j("does"),className:"mt-2",children:[i.jsx(pr,{className:"h-4 w-4 mr-2"}),"Add Action"]})]})]})]})}),i.jsx(rt,{children:i.jsxs(wt,{className:"p-6",children:[i.jsx("div",{className:"space-y-4 mb-6",children:i.jsxs("div",{children:[i.jsx("label",{className:"text-sm font-medium block mb-1",children:"Scenario Section Title"}),i.jsx(Ot,{value:s.scenarioType||"",onChange:B=>g("scenarioType",B.target.value),placeholder:"Life Scenarios"}),i.jsx("p",{className:"text-xs text-muted-foreground mt-1",children:'Custom title for the scenarios section (e.g., "Customer Journey", "Use Cases")'})]})}),i.jsx("h3",{className:"font-medium text-lg mb-3",children:"Usage Scenarios"}),(s.scenarios||[]).map((B,le)=>i.jsxs("div",{className:"flex items-start gap-2 mb-2",children:[i.jsx(nt,{value:B||"",onChange:se=>b("scenarios",le,se.target.value),rows:2}),i.jsx(te,{variant:"ghost",size:"icon",onClick:()=>x("scenarios",le),children:i.jsx(_n,{className:"h-4 w-4 text-muted-foreground"})})]},le)),i.jsxs(te,{variant:"outline",size:"sm",onClick:()=>y("scenarios"),className:"mt-2",children:[i.jsx(pr,{className:"h-4 w-4 mr-2"}),"Add Scenario"]})]})})]}),i.jsx(Yt,{value:"personality",className:"mt-6",children:i.jsx(rt,{children:i.jsxs(wt,{className:"p-6",children:[i.jsx("h3",{className:"font-medium text-lg mb-4",children:"OCEAN Personality Traits"}),i.jsxs("div",{className:"space-y-6",children:[i.jsxs("div",{children:[i.jsxs("div",{className:"flex justify-between mb-1",children:[i.jsx("label",{className:"text-sm font-medium",children:"Openness to Experience"}),i.jsxs("span",{className:"text-sm",children:[((M=s.oceanTraits)==null?void 0:M.openness)||50,"%"]})]}),i.jsx(Un,{value:[((A=s.oceanTraits)==null?void 0:A.openness)||50],onValueChange:B=>m("openness",B[0]),max:100,step:1}),i.jsx("p",{className:"text-xs text-muted-foreground mt-1",children:"Creativity, curiosity, and openness to new ideas"})]}),i.jsxs("div",{children:[i.jsxs("div",{className:"flex justify-between mb-1",children:[i.jsx("label",{className:"text-sm font-medium",children:"Conscientiousness"}),i.jsxs("span",{className:"text-sm",children:[(($=s.oceanTraits)==null?void 0:$.conscientiousness)||50,"%"]})]}),i.jsx(Un,{value:[((L=s.oceanTraits)==null?void 0:L.conscientiousness)||50],onValueChange:B=>m("conscientiousness",B[0]),max:100,step:1}),i.jsx("p",{className:"text-xs text-muted-foreground mt-1",children:"Organization, responsibility, and self-discipline"})]}),i.jsxs("div",{children:[i.jsxs("div",{className:"flex justify-between mb-1",children:[i.jsx("label",{className:"text-sm font-medium",children:"Extraversion"}),i.jsxs("span",{className:"text-sm",children:[((G=s.oceanTraits)==null?void 0:G.extraversion)||50,"%"]})]}),i.jsx(Un,{value:[((D=s.oceanTraits)==null?void 0:D.extraversion)||50],onValueChange:B=>m("extraversion",B[0]),max:100,step:1}),i.jsx("p",{className:"text-xs text-muted-foreground mt-1",children:"Sociability, assertiveness, and talkativeness"})]}),i.jsxs("div",{children:[i.jsxs("div",{className:"flex justify-between mb-1",children:[i.jsx("label",{className:"text-sm font-medium",children:"Agreeableness"}),i.jsxs("span",{className:"text-sm",children:[((V=s.oceanTraits)==null?void 0:V.agreeableness)||50,"%"]})]}),i.jsx(Un,{value:[((T=s.oceanTraits)==null?void 0:T.agreeableness)||50],onValueChange:B=>m("agreeableness",B[0]),max:100,step:1}),i.jsx("p",{className:"text-xs text-muted-foreground mt-1",children:"Compassion, cooperation, and concern for others"})]}),i.jsxs("div",{children:[i.jsxs("div",{className:"flex justify-between mb-1",children:[i.jsx("label",{className:"text-sm font-medium",children:"Neuroticism"}),i.jsxs("span",{className:"text-sm",children:[((F=s.oceanTraits)==null?void 0:F.neuroticism)||50,"%"]})]}),i.jsx(Un,{value:[((q=s.oceanTraits)==null?void 0:q.neuroticism)||50],onValueChange:B=>m("neuroticism",B[0]),max:100,step:1}),i.jsx("p",{className:"text-xs text-muted-foreground mt-1",children:"Emotional reactivity, anxiety, and sensitivity to stress"})]})]})]})})}),i.jsx(Yt,{value:"demographics",className:"mt-6",children:i.jsx(rt,{children:i.jsxs(wt,{className:"p-6",children:[i.jsx("h3",{className:"font-medium text-lg mb-4",children:"Demographic Information"}),i.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-6",children:[i.jsxs("div",{className:"space-y-4",children:[i.jsxs("div",{children:[i.jsx("label",{className:"text-sm font-medium block mb-1",children:"Social Grade"}),i.jsxs(Mn,{value:s.socialGrade||"",onValueChange:B=>g("socialGrade",B),children:[i.jsx(Pn,{children:i.jsx(In,{placeholder:"Select social grade"})}),i.jsxs(An,{children:[i.jsx(fe,{value:"A",children:"A - Higher managerial"}),i.jsx(fe,{value:"B",children:"B - Intermediate managerial"}),i.jsx(fe,{value:"C1",children:"C1 - Supervisory or clerical"}),i.jsx(fe,{value:"C2",children:"C2 - Skilled manual workers"}),i.jsx(fe,{value:"D",children:"D - Semi and unskilled manual workers"}),i.jsx(fe,{value:"E",children:"E - State pensioners, unemployed"})]})]})]}),i.jsxs("div",{children:[i.jsx("label",{className:"text-sm font-medium block mb-1",children:"Household Income"}),i.jsxs(Mn,{value:s.householdIncome||"",onValueChange:B=>g("householdIncome",B),children:[i.jsx(Pn,{children:i.jsx(In,{placeholder:"Select income range"})}),i.jsxs(An,{children:[i.jsx(fe,{value:"Under $25k",children:"Under $25,000"}),i.jsx(fe,{value:"$25k-$50k",children:"$25,000 - $50,000"}),i.jsx(fe,{value:"$50k-$75k",children:"$50,000 - $75,000"}),i.jsx(fe,{value:"$75k-$100k",children:"$75,000 - $100,000"}),i.jsx(fe,{value:"$100k-$150k",children:"$100,000 - $150,000"}),i.jsx(fe,{value:"$150k-$250k",children:"$150,000 - $250,000"}),i.jsx(fe,{value:"Over $250k",children:"Over $250,000"}),i.jsx(fe,{value:"Prefer not to say",children:"Prefer not to say"})]})]})]})]}),i.jsxs("div",{className:"space-y-4",children:[i.jsxs("div",{children:[i.jsx("label",{className:"text-sm font-medium block mb-1",children:"Household Composition"}),i.jsxs(Mn,{value:s.householdComposition||"",onValueChange:B=>g("householdComposition",B),children:[i.jsx(Pn,{children:i.jsx(In,{placeholder:"Select household type"})}),i.jsxs(An,{children:[i.jsx(fe,{value:"Single person",children:"Single person"}),i.jsx(fe,{value:"Couple without children",children:"Couple without children"}),i.jsx(fe,{value:"Couple with children",children:"Couple with children"}),i.jsx(fe,{value:"Single parent",children:"Single parent"}),i.jsx(fe,{value:"Multi-generational",children:"Multi-generational"}),i.jsx(fe,{value:"Shared housing",children:"Shared housing"}),i.jsx(fe,{value:"Other",children:"Other"})]})]})]}),i.jsxs("div",{children:[i.jsx("label",{className:"text-sm font-medium block mb-1",children:"Living Situation"}),i.jsxs(Mn,{value:s.livingSituation||"",onValueChange:B=>g("livingSituation",B),children:[i.jsx(Pn,{children:i.jsx(In,{placeholder:"Select living situation"})}),i.jsxs(An,{children:[i.jsx(fe,{value:"Own home",children:"Own home"}),i.jsx(fe,{value:"Rent apartment",children:"Rent apartment"}),i.jsx(fe,{value:"Rent house",children:"Rent house"}),i.jsx(fe,{value:"Live with family",children:"Live with family"}),i.jsx(fe,{value:"Student housing",children:"Student housing"}),i.jsx(fe,{value:"Assisted living",children:"Assisted living"}),i.jsx(fe,{value:"Other",children:"Other"})]})]})]})]})]})]})})}),i.jsx(Yt,{value:"lifestyle",className:"mt-6",children:i.jsx(rt,{children:i.jsxs(wt,{className:"p-6",children:[i.jsx("h3",{className:"font-medium text-lg mb-4",children:"Lifestyle & Behavior"}),i.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-6",children:[i.jsxs("div",{className:"space-y-4",children:[i.jsxs("div",{children:[i.jsx("label",{className:"text-sm font-medium block mb-1",children:"Media Consumption"}),i.jsx(nt,{value:s.mediaConsumption||"",onChange:B=>g("mediaConsumption",B.target.value),rows:3,placeholder:"TV shows, podcasts, news sources, social media platforms"}),i.jsx("p",{className:"text-xs text-muted-foreground mt-1",children:"Describe media consumption habits and preferences"})]}),i.jsxs("div",{children:[i.jsx("label",{className:"text-sm font-medium block mb-1",children:"Device Usage"}),i.jsx(nt,{value:s.deviceUsage||"",onChange:B=>g("deviceUsage",B.target.value),rows:3,placeholder:"Smartphone, laptop, tablet, smart TV, gaming console"}),i.jsx("p",{className:"text-xs text-muted-foreground mt-1",children:"Primary devices and usage patterns"})]}),i.jsxs("div",{children:[i.jsx("label",{className:"text-sm font-medium block mb-1",children:"Shopping Habits"}),i.jsx(nt,{value:s.shoppingHabits||"",onChange:B=>g("shoppingHabits",B.target.value),rows:3,placeholder:"Online vs in-store, frequency, preferred retailers"}),i.jsx("p",{className:"text-xs text-muted-foreground mt-1",children:"Shopping behavior and preferences"})]}),i.jsxs("div",{children:[i.jsx("label",{className:"text-sm font-medium block mb-1",children:"Brand Preferences"}),i.jsx(nt,{value:s.brandPreferences||"",onChange:B=>g("brandPreferences",B.target.value),rows:3,placeholder:"Favorite brands, brand values alignment"}),i.jsx("p",{className:"text-xs text-muted-foreground mt-1",children:"Preferred brands and reasoning"})]})]}),i.jsxs("div",{className:"space-y-4",children:[i.jsxs("div",{children:[i.jsx("label",{className:"text-sm font-medium block mb-1",children:"Communication Preferences"}),i.jsx(nt,{value:s.communicationPreferences||"",onChange:B=>g("communicationPreferences",B.target.value),rows:3,placeholder:"Email, phone, text, video calls, in-person"}),i.jsx("p",{className:"text-xs text-muted-foreground mt-1",children:"Preferred communication methods and channels"})]}),i.jsxs("div",{children:[i.jsx("label",{className:"text-sm font-medium block mb-1",children:"Payment Methods"}),i.jsx(nt,{value:s.paymentMethods||"",onChange:B=>g("paymentMethods",B.target.value),rows:3,placeholder:"Credit cards, digital wallets, cash, BNPL"}),i.jsx("p",{className:"text-xs text-muted-foreground mt-1",children:"Preferred payment methods and financial tools"})]}),i.jsxs("div",{children:[i.jsx("label",{className:"text-sm font-medium block mb-1",children:"Purchase Behavior"}),i.jsx(nt,{value:s.purchaseBehaviour||"",onChange:B=>g("purchaseBehaviour",B.target.value),rows:3,placeholder:"Research habits, decision factors, impulse vs planned buying"}),i.jsx("p",{className:"text-xs text-muted-foreground mt-1",children:"How they approach making purchase decisions"})]})]})]})]})})}),i.jsxs(Yt,{value:"extended",className:"mt-6 space-y-6",children:[i.jsx(rt,{children:i.jsxs(wt,{className:"p-6",children:[i.jsx("h3",{className:"font-medium text-lg mb-4",children:"Extended Profile"}),i.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-6",children:[i.jsxs("div",{className:"space-y-4",children:[i.jsxs("div",{children:[i.jsx("label",{className:"text-sm font-medium block mb-1",children:"Core Values"}),i.jsx(nt,{value:s.coreValues||"",onChange:B=>g("coreValues",B.target.value),rows:3,placeholder:"Key principles and values that guide decisions"})]}),i.jsxs("div",{children:[i.jsx("label",{className:"text-sm font-medium block mb-1",children:"Lifestyle Choices"}),i.jsx(nt,{value:s.lifestyleChoices||"",onChange:B=>g("lifestyleChoices",B.target.value),rows:3,placeholder:"Health, fitness, diet, work-life balance preferences"})]}),i.jsxs("div",{children:[i.jsx("label",{className:"text-sm font-medium block mb-1",children:"Social Activities"}),i.jsx(nt,{value:s.socialActivities||"",onChange:B=>g("socialActivities",B.target.value),rows:3,placeholder:"Social hobbies, community involvement, networking"})]}),i.jsxs("div",{children:[i.jsx("label",{className:"text-sm font-medium block mb-1",children:"Category Knowledge"}),i.jsx(nt,{value:s.categoryKnowledge||"",onChange:B=>g("categoryKnowledge",B.target.value),rows:3,placeholder:"Expertise in specific product/service categories"})]}),i.jsxs("div",{children:[i.jsx("label",{className:"text-sm font-medium block mb-1",children:"Decision Influences"}),i.jsx(nt,{value:s.decisionInfluences||"",onChange:B=>g("decisionInfluences",B.target.value),rows:3,placeholder:"What factors most influence their decisions"})]}),i.jsxs("div",{children:[i.jsx("label",{className:"text-sm font-medium block mb-1",children:"Pain Points"}),i.jsx(nt,{value:s.painPoints||"",onChange:B=>g("painPoints",B.target.value),rows:3,placeholder:"Common challenges and friction points"})]})]}),i.jsxs("div",{className:"space-y-4",children:[i.jsxs("div",{children:[i.jsx("label",{className:"text-sm font-medium block mb-1",children:"Journey Context"}),i.jsx(nt,{value:s.journeyContext||"",onChange:B=>g("journeyContext",B.target.value),rows:3,placeholder:"Current life stage and contextual factors"})]}),i.jsxs("div",{children:[i.jsx("label",{className:"text-sm font-medium block mb-1",children:"Key Touchpoints"}),i.jsx(nt,{value:s.keyTouchpoints||"",onChange:B=>g("keyTouchpoints",B.target.value),rows:3,placeholder:"Important interaction points and channels"})]}),i.jsxs("div",{className:"space-y-4",children:[i.jsx("h4",{className:"font-medium text-sm",children:"Self-Determination Needs"}),i.jsxs("div",{children:[i.jsx("label",{className:"text-sm font-medium block mb-1",children:"Autonomy"}),i.jsx(nt,{value:((Z=s.selfDeterminationNeeds)==null?void 0:Z.autonomy)||"",onChange:B=>g("selfDeterminationNeeds",{...s.selfDeterminationNeeds,autonomy:B.target.value}),rows:2,placeholder:"Need for independence and self-direction"})]}),i.jsxs("div",{children:[i.jsx("label",{className:"text-sm font-medium block mb-1",children:"Competence"}),i.jsx(nt,{value:((re=s.selfDeterminationNeeds)==null?void 0:re.competence)||"",onChange:B=>g("selfDeterminationNeeds",{...s.selfDeterminationNeeds,competence:B.target.value}),rows:2,placeholder:"Need to feel capable and effective"})]}),i.jsxs("div",{children:[i.jsx("label",{className:"text-sm font-medium block mb-1",children:"Relatedness"}),i.jsx(nt,{value:((ge=s.selfDeterminationNeeds)==null?void 0:ge.relatedness)||"",onChange:B=>g("selfDeterminationNeeds",{...s.selfDeterminationNeeds,relatedness:B.target.value}),rows:2,placeholder:"Need for connection and belonging"})]})]})]})]})]})}),i.jsx(rt,{children:i.jsx(wt,{className:"p-6",children:i.jsxs("div",{className:"space-y-4",children:[i.jsxs("div",{children:[i.jsx("h3",{className:"font-medium text-lg mb-3",children:"Fears & Concerns"}),(s.fears||[]).map((B,le)=>i.jsxs("div",{className:"flex items-center gap-2 mb-2",children:[i.jsx(Ot,{value:B,onChange:se=>b("fears",le,se.target.value),placeholder:"Enter a fear or concern"}),i.jsx(te,{variant:"ghost",size:"icon",onClick:()=>x("fears",le),children:i.jsx(_n,{className:"h-4 w-4 text-muted-foreground"})})]},le)),i.jsxs(te,{variant:"outline",size:"sm",onClick:()=>y("fears"),className:"mt-2",children:[i.jsx(pr,{className:"h-4 w-4 mr-2"}),"Add Fear/Concern"]})]}),i.jsxs("div",{children:[i.jsx("label",{className:"text-sm font-medium block mb-1",children:"Personal Narrative"}),i.jsx(nt,{value:s.narrative||"",onChange:B=>g("narrative",B.target.value),rows:4,placeholder:"Personal story, background, key life experiences"}),i.jsx("p",{className:"text-xs text-muted-foreground mt-1",children:"A brief narrative that captures their personal story"})]}),i.jsxs("div",{children:[i.jsx("label",{className:"text-sm font-medium block mb-1",children:"Additional Information"}),i.jsx(nt,{value:s.additionalInformation||"",onChange:B=>g("additionalInformation",B.target.value),rows:4,placeholder:"Any other relevant details or context"}),i.jsx("p",{className:"text-xs text-muted-foreground mt-1",children:"Additional context or details not covered elsewhere"})]})]})})})]})]})]})}function jPe(){const{id:e}=DS(),t=qr(),n=Tn(),{navigationState:r,clearNavigationState:s}=Uy(),[a,o]=v.useState(void 0),[l,c]=v.useState(!1),[u,d]=v.useState(!1),[f,h]=v.useState(!0);return v.useEffect(()=>{if(!e){h(!1);return}let m=!0;const b=new URLSearchParams(t.search).get("fromReview")==="true";return c(b),h(!0),(async()=>{try{const w=e.startsWith("local-")?e.substring(6):e,j=await Dn.getById(w);if(j&&j.data){const S=j.data;if(m){console.log("Found persona in database:",S),o({...S,id:S.id||S._id,isDbPersona:!0}),h(!1);return}}console.error("Could not find persona with id:",e),m&&(o(void 0),h(!1),oe.error("Persona not found"))}catch(w){console.error("Error fetching persona:",w),m&&(o(void 0),h(!1),oe.error("Failed to load persona details"))}})(),()=>{m=!1}},[e,t.search]),{currentPersona:a,isEditing:u,isFromReview:l,isLoading:f,setIsEditing:d,handleGoBack:()=>{r.previousRoute&&r.previousRoute.startsWith("/focus-groups/")&&r.focusGroupId?n(`/focus-groups/${r.focusGroupId}`):r.previousRoute==="/focus-groups"&&r.focusGroupTab?r.isNewFocusGroup?n(`/focus-groups?mode=create&tab=${r.focusGroupTab}`):r.focusGroupId?n(`/focus-groups?mode=edit&id=${r.focusGroupId}&tab=${r.focusGroupTab}`):n("/focus-groups?mode=create&tab=participants"):n(l?"/synthetic-users?mode=create&tab=ai&step=review":"/synthetic-users")},handleSaveEdit:async m=>{try{d(!1);const y=m.isDbPersona||e&&e.length===24&&/^[0-9a-f]{24}$/i.test(e),b={...m};if(b._id&&delete b._id,delete b.isDbPersona,y&&e&&e.length===24&&/^[0-9a-f]{24}$/i.test(e)){const x=await Dn.update(e,b);console.log("Updated persona in database:",x);const w={...m,isDbPersona:!0};o(w),oe.success("Persona updated in database successfully")}else{const x=await Dn.create(b);console.log("Created new persona in database:",x.data);const w={...m,id:x.data._id||x.data.id,_id:x.data._id||x.data.id,isDbPersona:!0};o(w),oe.success("Persona saved to database successfully")}}catch(y){return console.error("Error saving persona:",y),y.response&&y.response.status===401?oe.error("Authentication error - Please log in to save personas"):y.response&&y.response.status===404?oe.error("API endpoint not found - Database service may be unavailable"):oe.error("Failed to save persona to database: "+(y.message||"Unknown error")),!1}return!0}}}function Lk(){var f;const{currentPersona:e,isEditing:t,isFromReview:n,isLoading:r,setIsEditing:s,handleGoBack:a,handleSaveEdit:o}=jPe(),{navigationState:l}=Uy(),[c,u]=v.useState("");v.useEffect(()=>{var h;l.focusGroupId&&((h=l.previousRoute)!=null&&h.startsWith("/focus-groups/"))&&(async()=>{var g;try{const m=await bt.getById(l.focusGroupId);(g=m==null?void 0:m.data)!=null&&g.name&&u(m.data.name)}catch(m){console.error("Error fetching focus group name:",m)}})()},[l.focusGroupId,l.previousRoute]);const d=((f=l.previousRoute)==null?void 0:f.startsWith("/focus-groups/"))&&l.focusGroupId;return r?i.jsx(xPe,{}):e?i.jsxs("div",{className:"min-h-screen bg-slate-50",children:[i.jsx(ci,{}),i.jsx("main",{className:"pt-20 pb-16 px-4 sm:px-6 lg:px-8 max-w-7xl mx-auto",children:t?i.jsx(wPe,{persona:e,onSave:o,onCancel:()=>s(!1)}):i.jsxs(i.Fragment,{children:[d&&i.jsx("div",{className:"mb-4",children:i.jsx(fB,{children:i.jsxs(hB,{children:[i.jsx(Im,{children:i.jsxs(bj,{href:"/focus-groups",className:"flex items-center",children:[i.jsx(hg,{className:"h-4 w-4 mr-1"}),"Focus Groups"]})}),i.jsx(wj,{}),i.jsx(Im,{children:i.jsxs(bj,{href:`/focus-groups/${l.focusGroupId}`,className:"flex items-center",children:[i.jsx(tr,{className:"h-4 w-4 mr-1"}),c||"Focus Group Session"]})}),i.jsx(wj,{}),i.jsx(Im,{children:i.jsxs(pB,{className:"flex items-center",children:[i.jsx(Vf,{className:"h-4 w-4 mr-1"}),(e==null?void 0:e.name)||"Participant"]})})]})})}),i.jsxs("div",{className:"flex items-center mb-6 relative",children:[i.jsx(te,{variant:"ghost",onClick:a,className:"absolute left-0 top-0 flex items-center",children:i.jsx(zf,{className:"h-5 w-5"})}),i.jsx("h1",{className:"font-sf text-3xl font-bold text-slate-900 mx-auto",children:"Persona Profile"}),i.jsxs(te,{onClick:()=>s(!0),className:"absolute right-0 top-0",children:[i.jsx(LW,{className:"h-4 w-4 mr-2"}),"Edit Persona"]})]}),i.jsxs("div",{className:"grid grid-cols-1 lg:grid-cols-3 gap-6 mt-10",children:[i.jsx("div",{className:"lg:col-span-1",children:i.jsx(pPe,{persona:e})}),i.jsx("div",{className:"lg:col-span-2",children:i.jsxs(Fo,{defaultValue:"cooper-profile",children:[i.jsxs(Ai,{className:"grid w-full grid-cols-3",children:[i.jsx(Xt,{value:"cooper-profile",children:"Cooper Profile"}),i.jsx(Xt,{value:"personality",children:"Personality"}),i.jsx(Xt,{value:"scenarios",children:"Scenarios"})]}),i.jsx(Yt,{value:"cooper-profile",className:"mt-6",children:i.jsx(mPe,{persona:e})}),i.jsx(Yt,{value:"personality",className:"mt-6",children:i.jsx(gPe,{persona:e})}),i.jsx(Yt,{value:"scenarios",className:"mt-6",children:i.jsx(vPe,{persona:e})})]})})]})]})})]}):i.jsx(yPe,{})}const SPe=$e.object({username:$e.string().min(3,"Username must be at least 3 characters"),password:$e.string().min(4,"Password must be at least 4 characters")});function NPe(){var u;const e=Tn(),t=qr(),{login:n,isAuthenticated:r}=Kl(),[s,a]=v.useState(!1),o=((u=t.state)==null?void 0:u.from)||"/";console.log("Login page - destination path:",o),v.useEffect(()=>{r&&(console.log("User already authenticated, redirecting from login page"),e("/",{replace:!0}))},[r,e]);const l=Py({resolver:Ay(SPe),defaultValues:{username:"",password:""}});async function c(d){a(!0);try{await n(d.username,d.password)?(console.log("Login successful, received token, navigating to:",o),e(o,{replace:!0})):(console.error("Login succeeded but no token received"),a(!1))}catch(f){console.error("Login error in form handler:",f),a(!1)}}return i.jsx("div",{className:"flex min-h-screen items-center justify-center bg-gradient-to-br from-gray-100 to-gray-200 dark:from-gray-900 dark:to-gray-800 px-4",children:i.jsxs(rt,{className:"w-full max-w-md",children:[i.jsxs(Dr,{className:"space-y-1",children:[i.jsx(ts,{className:"text-2xl font-bold text-center",children:"Sign In"}),i.jsx(oN,{className:"text-center",children:"Enter your credentials to access your account"})]}),i.jsx(wt,{children:i.jsx(Ey,{...l,children:i.jsxs("form",{onSubmit:l.handleSubmit(c),className:"space-y-4",children:[i.jsx(dt,{control:l.control,name:"username",render:({field:d})=>i.jsxs(ot,{children:[i.jsx(lt,{children:"Username"}),i.jsx(ct,{children:i.jsx(Ot,{placeholder:"Enter your username",...d,disabled:s,autoComplete:"username"})}),i.jsx(ut,{})]})}),i.jsx(dt,{control:l.control,name:"password",render:({field:d})=>i.jsxs(ot,{children:[i.jsx(lt,{children:"Password"}),i.jsx(ct,{children:i.jsx(Ot,{placeholder:"Enter your password",type:"password",...d,disabled:s,autoComplete:"current-password"})}),i.jsx(ut,{})]})}),i.jsx(te,{type:"submit",className:"w-full",disabled:s,children:s?"Signing in...":"Sign In"})]})})}),i.jsxs(lN,{className:"flex flex-col space-y-2",children:[i.jsx("div",{className:"text-sm text-center text-gray-500 mb-2",children:"Default account: user / pass"}),!s&&i.jsxs("div",{className:"flex flex-col items-center justify-center gap-2",children:[i.jsx(te,{variant:"outline",onClick:()=>e("/",{replace:!0}),className:"mt-2",children:"Return to Home"}),i.jsx(te,{variant:"link",onClick:()=>{localStorage.setItem("offline_mode","true");const d={username:"guest",email:"guest@example.com",role:"user"};localStorage.setItem("auth_token","offline-mode-token"),localStorage.setItem("user",JSON.stringify(d)),Ke.success("Offline mode activated",{description:"Using demo account with limited functionality"}),e("/",{replace:!0})},className:"text-sm text-gray-500",children:"Use offline mode"})]})]})]})})}function dc({children:e}){const{isAuthenticated:t,isLoading:n}=Kl(),r=qr();return console.log("ProtectedRoute check:",{isAuthenticated:t,isLoading:n,path:r.pathname}),n?i.jsx("div",{className:"flex items-center justify-center min-h-screen",children:i.jsx("div",{className:"animate-spin rounded-full h-12 w-12 border-t-2 border-b-2 border-primary"})}):t?(console.log("User is authenticated, showing protected content"),i.jsx(i.Fragment,{children:e})):(console.log("Not authenticated, redirecting to login"),i.jsx(iI,{to:"/login",state:{from:r.pathname},replace:!0}))}const _Pe=new u9,PPe=()=>i.jsx(f9,{client:_Pe,children:i.jsx(lW,{basename:"/semblance",children:i.jsx(bH,{children:i.jsx(EQ,{children:i.jsxs(z7,{children:[i.jsx(mU,{}),i.jsxs(eW,{children:[i.jsx(Rs,{path:"/",element:i.jsx(jH,{})}),i.jsx(Rs,{path:"/login",element:i.jsx(NPe,{})}),i.jsx(Rs,{path:"/synthetic-users",element:i.jsx(dc,{children:i.jsx(_Q,{})})}),i.jsx(Rs,{path:"/synthetic-users/:id",element:i.jsx(dc,{children:i.jsx(Lk,{})})}),i.jsx(Rs,{path:"/personas/:id",element:i.jsx(dc,{children:i.jsx(Lk,{})})}),i.jsx(Rs,{path:"/focus-groups",element:i.jsx(dc,{children:i.jsx(IQ,{})})}),i.jsx(Rs,{path:"/focus-groups/:id",element:i.jsx(dc,{children:i.jsx(rPe,{})})}),i.jsx(Rs,{path:"/dashboard",element:i.jsx(dc,{children:i.jsx(hPe,{})})}),i.jsx(Rs,{path:"/old-path",element:i.jsx(iI,{to:"/",replace:!0})}),i.jsx(Rs,{path:"*",element:i.jsx(SH,{})})]})]})})})})});oM(document.getElementById("root")).render(i.jsx(PPe,{})); diff --git a/dist/assets/index-DXcM4-s2.css b/dist/assets/index-DXcM4-s2.css new file mode 100644 index 00000000..f7428ca4 --- /dev/null +++ b/dist/assets/index-DXcM4-s2.css @@ -0,0 +1 @@ +@import"https://fonts.googleapis.com/css2?family=Inter:wght@100;200;300;400;500;600;700;800;900&display=swap";.back-button{position:absolute;top:1.25rem;left:1.25rem;z-index:10;display:flex;align-items:center;justify-content:center;width:2.5rem;height:2.5rem;border-radius:9999px;background-color:#fffc;border:1px solid rgba(0,0,0,.1);-webkit-backdrop-filter:blur(4px);backdrop-filter:blur(4px);transition:all .15s ease}.back-button:hover{background-color:#ffffffe6;transform:translateY(-1px);box-shadow:0 2px 4px #0000000d}.back-button:active{transform:translateY(0)}.back-button-content{display:flex;align-items:center;gap:.25rem}.page-header-with-back{display:flex;align-items:center;gap:.75rem;padding-left:2.5rem;position:relative}*,:before,:after{--tw-border-spacing-x: 0;--tw-border-spacing-y: 0;--tw-translate-x: 0;--tw-translate-y: 0;--tw-rotate: 0;--tw-skew-x: 0;--tw-skew-y: 0;--tw-scale-x: 1;--tw-scale-y: 1;--tw-pan-x: ;--tw-pan-y: ;--tw-pinch-zoom: ;--tw-scroll-snap-strictness: proximity;--tw-gradient-from-position: ;--tw-gradient-via-position: ;--tw-gradient-to-position: ;--tw-ordinal: ;--tw-slashed-zero: ;--tw-numeric-figure: ;--tw-numeric-spacing: ;--tw-numeric-fraction: ;--tw-ring-inset: ;--tw-ring-offset-width: 0px;--tw-ring-offset-color: #fff;--tw-ring-color: rgb(59 130 246 / .5);--tw-ring-offset-shadow: 0 0 #0000;--tw-ring-shadow: 0 0 #0000;--tw-shadow: 0 0 #0000;--tw-shadow-colored: 0 0 #0000;--tw-blur: ;--tw-brightness: ;--tw-contrast: ;--tw-grayscale: ;--tw-hue-rotate: ;--tw-invert: ;--tw-saturate: ;--tw-sepia: ;--tw-drop-shadow: ;--tw-backdrop-blur: ;--tw-backdrop-brightness: ;--tw-backdrop-contrast: ;--tw-backdrop-grayscale: ;--tw-backdrop-hue-rotate: ;--tw-backdrop-invert: ;--tw-backdrop-opacity: ;--tw-backdrop-saturate: ;--tw-backdrop-sepia: ;--tw-contain-size: ;--tw-contain-layout: ;--tw-contain-paint: ;--tw-contain-style: }::backdrop{--tw-border-spacing-x: 0;--tw-border-spacing-y: 0;--tw-translate-x: 0;--tw-translate-y: 0;--tw-rotate: 0;--tw-skew-x: 0;--tw-skew-y: 0;--tw-scale-x: 1;--tw-scale-y: 1;--tw-pan-x: ;--tw-pan-y: ;--tw-pinch-zoom: ;--tw-scroll-snap-strictness: proximity;--tw-gradient-from-position: ;--tw-gradient-via-position: ;--tw-gradient-to-position: ;--tw-ordinal: ;--tw-slashed-zero: ;--tw-numeric-figure: ;--tw-numeric-spacing: ;--tw-numeric-fraction: ;--tw-ring-inset: ;--tw-ring-offset-width: 0px;--tw-ring-offset-color: #fff;--tw-ring-color: rgb(59 130 246 / .5);--tw-ring-offset-shadow: 0 0 #0000;--tw-ring-shadow: 0 0 #0000;--tw-shadow: 0 0 #0000;--tw-shadow-colored: 0 0 #0000;--tw-blur: ;--tw-brightness: ;--tw-contrast: ;--tw-grayscale: ;--tw-hue-rotate: ;--tw-invert: ;--tw-saturate: ;--tw-sepia: ;--tw-drop-shadow: ;--tw-backdrop-blur: ;--tw-backdrop-brightness: ;--tw-backdrop-contrast: ;--tw-backdrop-grayscale: ;--tw-backdrop-hue-rotate: ;--tw-backdrop-invert: ;--tw-backdrop-opacity: ;--tw-backdrop-saturate: ;--tw-backdrop-sepia: ;--tw-contain-size: ;--tw-contain-layout: ;--tw-contain-paint: ;--tw-contain-style: }*,:before,:after{box-sizing:border-box;border-width:0;border-style:solid;border-color:#e5e7eb}:before,:after{--tw-content: ""}html,:host{line-height:1.5;-webkit-text-size-adjust:100%;-moz-tab-size:4;-o-tab-size:4;tab-size:4;font-family:Inter,system-ui,sans-serif;font-feature-settings:normal;font-variation-settings:normal;-webkit-tap-highlight-color:transparent}body{margin:0;line-height:inherit}hr{height:0;color:inherit;border-top-width:1px}abbr:where([title]){-webkit-text-decoration:underline dotted;text-decoration:underline dotted}h1,h2,h3,h4,h5,h6{font-size:inherit;font-weight:inherit}a{color:inherit;text-decoration:inherit}b,strong{font-weight:bolder}code,kbd,samp,pre{font-family:ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,Liberation Mono,Courier New,monospace;font-feature-settings:normal;font-variation-settings:normal;font-size:1em}small{font-size:80%}sub,sup{font-size:75%;line-height:0;position:relative;vertical-align:baseline}sub{bottom:-.25em}sup{top:-.5em}table{text-indent:0;border-color:inherit;border-collapse:collapse}button,input,optgroup,select,textarea{font-family:inherit;font-feature-settings:inherit;font-variation-settings:inherit;font-size:100%;font-weight:inherit;line-height:inherit;letter-spacing:inherit;color:inherit;margin:0;padding:0}button,select{text-transform:none}button,input:where([type=button]),input:where([type=reset]),input:where([type=submit]){-webkit-appearance:button;background-color:transparent;background-image:none}:-moz-focusring{outline:auto}:-moz-ui-invalid{box-shadow:none}progress{vertical-align:baseline}::-webkit-inner-spin-button,::-webkit-outer-spin-button{height:auto}[type=search]{-webkit-appearance:textfield;outline-offset:-2px}::-webkit-search-decoration{-webkit-appearance:none}::-webkit-file-upload-button{-webkit-appearance:button;font:inherit}summary{display:list-item}blockquote,dl,dd,h1,h2,h3,h4,h5,h6,hr,figure,p,pre{margin:0}fieldset{margin:0;padding:0}legend{padding:0}ol,ul,menu{list-style:none;margin:0;padding:0}dialog{padding:0}textarea{resize:vertical}input::-moz-placeholder,textarea::-moz-placeholder{opacity:1;color:#9ca3af}input::placeholder,textarea::placeholder{opacity:1;color:#9ca3af}button,[role=button]{cursor:pointer}:disabled{cursor:default}img,svg,video,canvas,audio,iframe,embed,object{display:block;vertical-align:middle}img,video{max-width:100%;height:auto}[hidden]:where(:not([hidden=until-found])){display:none}:root{--background: 350 30% 98%;--foreground: 345 30% 15%;--card: 0 0% 100%;--card-foreground: 345 30% 15%;--popover: 0 0% 100%;--popover-foreground: 345 30% 15%;--primary: 350 85% 80%;--primary-foreground: 350 30% 20%;--secondary: 350 30% 96.1%;--secondary-foreground: 345 30% 15%;--muted: 350 30% 96.1%;--muted-foreground: 350 10% 50%;--accent: 350 30% 96.1%;--accent-foreground: 345 30% 15%;--destructive: 0 84.2% 60.2%;--destructive-foreground: 350 30% 98%;--border: 350 30% 91.4%;--input: 350 30% 91.4%;--ring: 350 85% 80%;--radius: .5rem;--sidebar-background: 0 0% 100%;--sidebar-foreground: 345 30% 15%;--sidebar-primary: 350 85% 80%;--sidebar-primary-foreground: 350 30% 20%;--sidebar-accent: 350 30% 96.1%;--sidebar-accent-foreground: 345 30% 15%;--sidebar-border: 350 30% 91.4%;--sidebar-ring: 350 85% 80%}.dark{--background: 345 30% 10%;--foreground: 350 30% 98%;--card: 345 30% 10%;--card-foreground: 350 30% 98%;--popover: 345 30% 10%;--popover-foreground: 350 30% 98%;--primary: 350 85% 80%;--primary-foreground: 345 30% 15%;--secondary: 342 20% 17.5%;--secondary-foreground: 350 30% 98%;--muted: 342 20% 17.5%;--muted-foreground: 350 10% 70%;--accent: 342 20% 17.5%;--accent-foreground: 350 30% 98%;--destructive: 0 62.8% 30.6%;--destructive-foreground: 350 30% 98%;--border: 342 20% 17.5%;--input: 342 20% 17.5%;--ring: 350 70% 85%;--sidebar-background: 345 30% 10%;--sidebar-foreground: 350 30% 98%;--sidebar-primary: 350 85% 80%;--sidebar-primary-foreground: 350 30% 98%;--sidebar-accent: 342 20% 17.5%;--sidebar-accent-foreground: 350 30% 98%;--sidebar-border: 342 20% 17.5%;--sidebar-ring: 350 70% 85%}*{border-color:hsl(var(--border))}body{background-color:hsl(var(--background));font-family:Inter,system-ui,sans-serif;color:hsl(var(--foreground));font-feature-settings:"rlig" 1,"calt" 1}::-webkit-scrollbar{width:8px;height:8px}::-webkit-scrollbar-track{background-color:transparent}::-webkit-scrollbar-thumb{border-radius:9999px;background-color:hsl(var(--muted-foreground) / .4)}::-webkit-scrollbar-thumb:hover{background-color:hsl(var(--muted-foreground) / .6)}@font-face{font-family:SF Pro Display;src:local("SF Pro Display"),local("SFProDisplay"),url(https://applesocial.s3.amazonaws.com/assets/styles/fonts/sanfrancisco/sanfranciscodisplay-regular-webfont.woff) format("woff");font-weight:400;font-style:normal}@font-face{font-family:SF Pro Display;src:local("SF Pro Display Medium"),local("SFProDisplay-Medium"),url(https://applesocial.s3.amazonaws.com/assets/styles/fonts/sanfrancisco/sanfranciscodisplay-medium-webfont.woff) format("woff");font-weight:500;font-style:normal}@font-face{font-family:SF Pro Display;src:local("SF Pro Display Semibold"),local("SFProDisplay-Semibold"),url(https://applesocial.s3.amazonaws.com/assets/styles/fonts/sanfrancisco/sanfranciscodisplay-semibold-webfont.woff) format("woff");font-weight:600;font-style:normal}@font-face{font-family:SF Pro Display;src:local("SF Pro Display Bold"),local("SFProDisplay-Bold"),url(https://applesocial.s3.amazonaws.com/assets/styles/fonts/sanfrancisco/sanfranciscodisplay-bold-webfont.woff) format("woff");font-weight:700;font-style:normal}.container{width:100%;margin-right:auto;margin-left:auto;padding-right:2rem;padding-left:2rem}@media (min-width: 1400px){.container{max-width:1400px}}.glass-card{border-width:1px;border-color:#fff3;background-color:#fffc;--tw-shadow: 0 1px 2px 0 rgb(0 0 0 / .05);--tw-shadow-colored: 0 1px 2px 0 var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow);--tw-backdrop-blur: blur(12px);-webkit-backdrop-filter:var(--tw-backdrop-blur) var(--tw-backdrop-brightness) var(--tw-backdrop-contrast) var(--tw-backdrop-grayscale) var(--tw-backdrop-hue-rotate) var(--tw-backdrop-invert) var(--tw-backdrop-opacity) var(--tw-backdrop-saturate) var(--tw-backdrop-sepia);backdrop-filter:var(--tw-backdrop-blur) var(--tw-backdrop-brightness) var(--tw-backdrop-contrast) var(--tw-backdrop-grayscale) var(--tw-backdrop-hue-rotate) var(--tw-backdrop-invert) var(--tw-backdrop-opacity) var(--tw-backdrop-saturate) var(--tw-backdrop-sepia)}.glass-panel{border-width:1px;border-color:#fff6;background-color:#ffffffe6;--tw-shadow: 0 1px 2px 0 rgb(0 0 0 / .05);--tw-shadow-colored: 0 1px 2px 0 var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow);--tw-backdrop-blur: blur(4px);-webkit-backdrop-filter:var(--tw-backdrop-blur) var(--tw-backdrop-brightness) var(--tw-backdrop-contrast) var(--tw-backdrop-grayscale) var(--tw-backdrop-hue-rotate) var(--tw-backdrop-invert) var(--tw-backdrop-opacity) var(--tw-backdrop-saturate) var(--tw-backdrop-sepia);backdrop-filter:var(--tw-backdrop-blur) var(--tw-backdrop-brightness) var(--tw-backdrop-contrast) var(--tw-backdrop-grayscale) var(--tw-backdrop-hue-rotate) var(--tw-backdrop-invert) var(--tw-backdrop-opacity) var(--tw-backdrop-saturate) var(--tw-backdrop-sepia)}.text-gradient{background-image:linear-gradient(to right,var(--tw-gradient-stops));--tw-gradient-from: hsl(var(--primary)) var(--tw-gradient-from-position);--tw-gradient-to: hsl(var(--primary) / 0) var(--tw-gradient-to-position);--tw-gradient-stops: var(--tw-gradient-from), var(--tw-gradient-to);--tw-gradient-to: #f9a8d4 var(--tw-gradient-to-position);-webkit-background-clip:text;background-clip:text;color:transparent}.hover-transition{transition-property:all;transition-duration:.3s;transition-timing-function:cubic-bezier(.4,0,.2,1);animation-duration:.3s;animation-timing-function:cubic-bezier(.4,0,.2,1)}.button-transition{transition-property:all;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.2s;transition-timing-function:cubic-bezier(0,0,.2,1);animation-duration:.2s;animation-timing-function:cubic-bezier(0,0,.2,1)}.sidebar-icon{margin-right:.75rem;margin-top:.125rem;height:1rem;width:1rem;flex-shrink:0;--tw-text-opacity: 1;color:rgb(100 116 139 / var(--tw-text-opacity, 1))}.sidebar-section{display:flex;align-items:flex-start}.sidebar-sub-item{font-size:.875rem;line-height:1.25rem;color:hsl(var(--muted-foreground))}.persona-card{position:relative;overflow:hidden;min-height:360px}.persona-card-overlay{pointer-events:none;position:absolute;top:0;right:0;bottom:0;left:0;transition-property:all;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.2s;transition-timing-function:cubic-bezier(0,0,.2,1);animation-duration:.2s;animation-timing-function:cubic-bezier(0,0,.2,1)}.persona-card:hover .persona-card-overlay,.persona-card.selected .persona-card-overlay{background-color:#ecd1de4d}.persona-card-checkmark{position:absolute;top:.75rem;left:.75rem;z-index:20;opacity:0;transition-property:all;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.2s;transition-timing-function:cubic-bezier(0,0,.2,1);animation-duration:.2s;animation-timing-function:cubic-bezier(0,0,.2,1);border-radius:9999px;border-width:1px;border-color:#fff6;background-color:#ffffffe6;padding:.25rem;--tw-shadow: 0 1px 2px 0 rgb(0 0 0 / .05);--tw-shadow-colored: 0 1px 2px 0 var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)}.persona-card.selected .persona-card-checkmark{opacity:1}.sr-only{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0,0,0,0);white-space:nowrap;border-width:0}.pointer-events-none{pointer-events:none}.visible{visibility:visible}.invisible{visibility:hidden}.fixed{position:fixed}.absolute{position:absolute}.relative{position:relative}.sticky{position:sticky}.inset-0{top:0;right:0;bottom:0;left:0}.inset-x-0{left:0;right:0}.inset-y-0{top:0;bottom:0}.-bottom-12{bottom:-3rem}.-left-12{left:-3rem}.-right-12{right:-3rem}.-top-12{top:-3rem}.bottom-0{bottom:0}.bottom-4{bottom:1rem}.bottom-5{bottom:1.25rem}.bottom-6{bottom:1.5rem}.bottom-\[-10rem\]{bottom:-10rem}.bottom-full{bottom:100%}.left-0{left:0}.left-1{left:.25rem}.left-1\/2{left:50%}.left-2{left:.5rem}.left-3{left:.75rem}.left-4{left:1rem}.left-\[50\%\]{left:50%}.left-\[calc\(50\%\+11rem\)\]{left:calc(50% + 11rem)}.left-\[calc\(50\%-11rem\)\]{left:calc(50% - 11rem)}.right-0{right:0}.right-1{right:.25rem}.right-2{right:.5rem}.right-3{right:.75rem}.right-4{right:1rem}.right-6{right:1.5rem}.top-0{top:0}.top-1{top:.25rem}.top-1\.5{top:.375rem}.top-1\/2{top:50%}.top-16{top:4rem}.top-2{top:.5rem}.top-20{top:5rem}.top-3\.5{top:.875rem}.top-4{top:1rem}.top-\[-10rem\]{top:-10rem}.top-\[1px\]{top:1px}.top-\[50\%\]{top:50%}.top-\[60\%\]{top:60%}.top-full{top:100%}.isolate{isolation:isolate}.-z-10{z-index:-10}.z-10{z-index:10}.z-20{z-index:20}.z-40{z-index:40}.z-50{z-index:50}.z-\[100\]{z-index:100}.z-\[1\]{z-index:1}.col-span-full{grid-column:1 / -1}.m-0{margin:0}.-mx-1{margin-left:-.25rem;margin-right:-.25rem}.mx-2{margin-left:.5rem;margin-right:.5rem}.mx-3\.5{margin-left:.875rem;margin-right:.875rem}.mx-4{margin-left:1rem;margin-right:1rem}.mx-auto{margin-left:auto;margin-right:auto}.my-0\.5{margin-top:.125rem;margin-bottom:.125rem}.my-1{margin-top:.25rem;margin-bottom:.25rem}.my-6{margin-top:1.5rem;margin-bottom:1.5rem}.-ml-4{margin-left:-1rem}.-mt-4{margin-top:-1rem}.mb-1{margin-bottom:.25rem}.mb-16{margin-bottom:4rem}.mb-2{margin-bottom:.5rem}.mb-3{margin-bottom:.75rem}.mb-4{margin-bottom:1rem}.mb-6{margin-bottom:1.5rem}.mb-8{margin-bottom:2rem}.ml-1{margin-left:.25rem}.ml-2{margin-left:.5rem}.ml-4{margin-left:1rem}.ml-6{margin-left:1.5rem}.ml-auto{margin-left:auto}.mr-1{margin-right:.25rem}.mr-2{margin-right:.5rem}.mr-3{margin-right:.75rem}.mr-5{margin-right:1.25rem}.mt-0\.5{margin-top:.125rem}.mt-1{margin-top:.25rem}.mt-1\.5{margin-top:.375rem}.mt-10{margin-top:2.5rem}.mt-12{margin-top:3rem}.mt-16{margin-top:4rem}.mt-2{margin-top:.5rem}.mt-24{margin-top:6rem}.mt-3{margin-top:.75rem}.mt-4{margin-top:1rem}.mt-6{margin-top:1.5rem}.mt-8{margin-top:2rem}.mt-auto{margin-top:auto}.line-clamp-2{overflow:hidden;display:-webkit-box;-webkit-box-orient:vertical;-webkit-line-clamp:2}.line-clamp-3{overflow:hidden;display:-webkit-box;-webkit-box-orient:vertical;-webkit-line-clamp:3}.block{display:block}.inline{display:inline}.flex{display:flex}.inline-flex{display:inline-flex}.table{display:table}.grid{display:grid}.hidden{display:none}.aspect-\[1155\/678\]{aspect-ratio:1155/678}.aspect-square{aspect-ratio:1 / 1}.aspect-video{aspect-ratio:16 / 9}.size-4{width:1rem;height:1rem}.h-0{height:0px}.h-1{height:.25rem}.h-1\.5{height:.375rem}.h-10{height:2.5rem}.h-11{height:2.75rem}.h-12{height:3rem}.h-16{height:4rem}.h-2{height:.5rem}.h-2\.5{height:.625rem}.h-24{height:6rem}.h-3{height:.75rem}.h-3\.5{height:.875rem}.h-32{height:8rem}.h-36{height:9rem}.h-4{height:1rem}.h-40{height:10rem}.h-5{height:1.25rem}.h-6{height:1.5rem}.h-60{height:15rem}.h-64{height:16rem}.h-7{height:1.75rem}.h-8{height:2rem}.h-80{height:20rem}.h-9{height:2.25rem}.h-\[1px\]{height:1px}.h-\[25vh\]{height:25vh}.h-\[450px\]{height:450px}.h-\[70vh\]{height:70vh}.h-\[calc\(100vh-12rem\)\]{height:calc(100vh - 12rem)}.h-\[var\(--radix-navigation-menu-viewport-height\)\]{height:var(--radix-navigation-menu-viewport-height)}.h-\[var\(--radix-select-trigger-height\)\]{height:var(--radix-select-trigger-height)}.h-auto{height:auto}.h-full{height:100%}.h-px{height:1px}.h-svh{height:100svh}.max-h-48{max-height:12rem}.max-h-60{max-height:15rem}.max-h-96{max-height:24rem}.max-h-\[300px\]{max-height:300px}.max-h-\[400px\]{max-height:400px}.max-h-\[70vh\]{max-height:70vh}.max-h-\[80vh\]{max-height:80vh}.max-h-\[90vh\]{max-height:90vh}.max-h-full{max-height:100%}.min-h-0{min-height:0px}.min-h-\[100px\]{min-height:100px}.min-h-\[40px\]{min-height:40px}.min-h-\[60px\]{min-height:60px}.min-h-\[80px\]{min-height:80px}.min-h-screen{min-height:100vh}.min-h-svh{min-height:100svh}.w-0{width:0px}.w-1{width:.25rem}.w-10{width:2.5rem}.w-11{width:2.75rem}.w-12{width:3rem}.w-16{width:4rem}.w-2{width:.5rem}.w-2\.5{width:.625rem}.w-2\/3{width:66.666667%}.w-20{width:5rem}.w-24{width:6rem}.w-3{width:.75rem}.w-3\.5{width:.875rem}.w-3\/4{width:75%}.w-32{width:8rem}.w-36{width:9rem}.w-4{width:1rem}.w-40{width:10rem}.w-48{width:12rem}.w-5{width:1.25rem}.w-5\/6{width:83.333333%}.w-6{width:1.5rem}.w-64{width:16rem}.w-7{width:1.75rem}.w-72{width:18rem}.w-8{width:2rem}.w-80{width:20rem}.w-9{width:2.25rem}.w-96{width:24rem}.w-\[--sidebar-width\]{width:var(--sidebar-width)}.w-\[100px\]{width:100px}.w-\[1px\]{width:1px}.w-\[350px\]{width:350px}.w-\[36\.125rem\]{width:36.125rem}.w-auto{width:auto}.w-fit{width:-moz-fit-content;width:fit-content}.w-full{width:100%}.w-max{width:-moz-max-content;width:max-content}.w-px{width:1px}.min-w-0{min-width:0px}.min-w-32{min-width:8rem}.min-w-36{min-width:9rem}.min-w-5{min-width:1.25rem}.min-w-\[12rem\]{min-width:12rem}.min-w-\[8rem\]{min-width:8rem}.min-w-\[var\(--radix-select-trigger-width\)\]{min-width:var(--radix-select-trigger-width)}.max-w-2xl{max-width:42rem}.max-w-3xl{max-width:48rem}.max-w-4xl{max-width:56rem}.max-w-5xl{max-width:64rem}.max-w-7xl{max-width:80rem}.max-w-\[--skeleton-width\]{max-width:var(--skeleton-width)}.max-w-\[400px\]{max-width:400px}.max-w-\[70\%\]{max-width:70%}.max-w-full{max-width:100%}.max-w-lg{max-width:32rem}.max-w-max{max-width:-moz-max-content;max-width:max-content}.max-w-md{max-width:28rem}.max-w-none{max-width:none}.flex-1{flex:1 1 0%}.flex-shrink-0,.shrink-0{flex-shrink:0}.flex-grow,.grow{flex-grow:1}.grow-0{flex-grow:0}.basis-full{flex-basis:100%}.caption-bottom{caption-side:bottom}.border-collapse{border-collapse:collapse}.-translate-x-1\/2{--tw-translate-x: -50%;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.-translate-x-px{--tw-translate-x: -1px;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.-translate-y-1\/2{--tw-translate-y: -50%;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.translate-x-\[-50\%\]{--tw-translate-x: -50%;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.translate-x-px{--tw-translate-x: 1px;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.translate-y-\[-50\%\]{--tw-translate-y: -50%;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.rotate-45{--tw-rotate: 45deg;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.rotate-90{--tw-rotate: 90deg;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.rotate-\[30deg\]{--tw-rotate: 30deg;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.transform{transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.transform-gpu{transform:translate3d(var(--tw-translate-x),var(--tw-translate-y),0) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}@keyframes fade-in{0%{opacity:0}to{opacity:1}}.animate-fade-in{animation:fade-in .5s ease-out}@keyframes float{0%,to{transform:translateY(0)}50%{transform:translateY(-5px)}}.animate-float{animation:float 3s ease-in-out infinite}@keyframes pulse{50%{opacity:.5}}.animate-pulse{animation:pulse 2s cubic-bezier(.4,0,.6,1) infinite}@keyframes spin{to{transform:rotate(360deg)}}.animate-spin{animation:spin 1s linear infinite}.cursor-default{cursor:default}.cursor-pointer{cursor:pointer}.touch-none{touch-action:none}.select-none{-webkit-user-select:none;-moz-user-select:none;user-select:none}.select-all{-webkit-user-select:all;-moz-user-select:all;user-select:all}.resize-none{resize:none}.resize-y{resize:vertical}.list-disc{list-style-type:disc}.list-none{list-style-type:none}.grid-cols-1{grid-template-columns:repeat(1,minmax(0,1fr))}.grid-cols-2{grid-template-columns:repeat(2,minmax(0,1fr))}.grid-cols-3{grid-template-columns:repeat(3,minmax(0,1fr))}.grid-cols-4{grid-template-columns:repeat(4,minmax(0,1fr))}.grid-cols-6{grid-template-columns:repeat(6,minmax(0,1fr))}.flex-row{flex-direction:row}.flex-col{flex-direction:column}.flex-col-reverse{flex-direction:column-reverse}.flex-wrap{flex-wrap:wrap}.items-start{align-items:flex-start}.items-end{align-items:flex-end}.items-center{align-items:center}.items-stretch{align-items:stretch}.justify-start{justify-content:flex-start}.justify-end{justify-content:flex-end}.justify-center{justify-content:center}.justify-between{justify-content:space-between}.gap-1{gap:.25rem}.gap-1\.5{gap:.375rem}.gap-2{gap:.5rem}.gap-3{gap:.75rem}.gap-4{gap:1rem}.gap-6{gap:1.5rem}.gap-8{gap:2rem}.gap-x-4{-moz-column-gap:1rem;column-gap:1rem}.gap-x-6{-moz-column-gap:1.5rem;column-gap:1.5rem}.space-x-1>:not([hidden])~:not([hidden]){--tw-space-x-reverse: 0;margin-right:calc(.25rem * var(--tw-space-x-reverse));margin-left:calc(.25rem * calc(1 - var(--tw-space-x-reverse)))}.space-x-2>:not([hidden])~:not([hidden]){--tw-space-x-reverse: 0;margin-right:calc(.5rem * var(--tw-space-x-reverse));margin-left:calc(.5rem * calc(1 - var(--tw-space-x-reverse)))}.space-x-4>:not([hidden])~:not([hidden]){--tw-space-x-reverse: 0;margin-right:calc(1rem * var(--tw-space-x-reverse));margin-left:calc(1rem * calc(1 - var(--tw-space-x-reverse)))}.space-x-8>:not([hidden])~:not([hidden]){--tw-space-x-reverse: 0;margin-right:calc(2rem * var(--tw-space-x-reverse));margin-left:calc(2rem * calc(1 - var(--tw-space-x-reverse)))}.space-y-1>:not([hidden])~:not([hidden]){--tw-space-y-reverse: 0;margin-top:calc(.25rem * calc(1 - var(--tw-space-y-reverse)));margin-bottom:calc(.25rem * var(--tw-space-y-reverse))}.space-y-1\.5>:not([hidden])~:not([hidden]){--tw-space-y-reverse: 0;margin-top:calc(.375rem * calc(1 - var(--tw-space-y-reverse)));margin-bottom:calc(.375rem * var(--tw-space-y-reverse))}.space-y-2>:not([hidden])~:not([hidden]){--tw-space-y-reverse: 0;margin-top:calc(.5rem * calc(1 - var(--tw-space-y-reverse)));margin-bottom:calc(.5rem * var(--tw-space-y-reverse))}.space-y-3>:not([hidden])~:not([hidden]){--tw-space-y-reverse: 0;margin-top:calc(.75rem * calc(1 - var(--tw-space-y-reverse)));margin-bottom:calc(.75rem * var(--tw-space-y-reverse))}.space-y-4>:not([hidden])~:not([hidden]){--tw-space-y-reverse: 0;margin-top:calc(1rem * calc(1 - var(--tw-space-y-reverse)));margin-bottom:calc(1rem * var(--tw-space-y-reverse))}.space-y-6>:not([hidden])~:not([hidden]){--tw-space-y-reverse: 0;margin-top:calc(1.5rem * calc(1 - var(--tw-space-y-reverse)));margin-bottom:calc(1.5rem * var(--tw-space-y-reverse))}.overflow-auto{overflow:auto}.overflow-hidden{overflow:hidden}.overflow-y-auto{overflow-y:auto}.overflow-x-hidden{overflow-x:hidden}.truncate{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.whitespace-nowrap{white-space:nowrap}.whitespace-pre-wrap{white-space:pre-wrap}.break-words{overflow-wrap:break-word}.rounded{border-radius:.25rem}.rounded-2xl{border-radius:1rem}.rounded-\[2px\]{border-radius:2px}.rounded-\[inherit\]{border-radius:inherit}.rounded-full{border-radius:9999px}.rounded-lg{border-radius:var(--radius)}.rounded-md{border-radius:calc(var(--radius) - 2px)}.rounded-sm{border-radius:calc(var(--radius) - 4px)}.rounded-xl{border-radius:.75rem}.rounded-t-\[10px\]{border-top-left-radius:10px;border-top-right-radius:10px}.rounded-tl-sm{border-top-left-radius:calc(var(--radius) - 4px)}.border{border-width:1px}.border-0{border-width:0px}.border-2{border-width:2px}.border-\[1\.5px\]{border-width:1.5px}.border-y{border-top-width:1px;border-bottom-width:1px}.border-b{border-bottom-width:1px}.border-b-2{border-bottom-width:2px}.border-l{border-left-width:1px}.border-l-2{border-left-width:2px}.border-l-4{border-left-width:4px}.border-r{border-right-width:1px}.border-t{border-top-width:1px}.border-t-2{border-top-width:2px}.border-dashed{border-style:dashed}.border-\[--color-border\]{border-color:var(--color-border)}.border-amber-200{--tw-border-opacity: 1;border-color:rgb(253 230 138 / var(--tw-border-opacity, 1))}.border-blue-200{--tw-border-opacity: 1;border-color:rgb(191 219 254 / var(--tw-border-opacity, 1))}.border-blue-500{--tw-border-opacity: 1;border-color:rgb(59 130 246 / var(--tw-border-opacity, 1))}.border-border{border-color:hsl(var(--border))}.border-border\/50{border-color:hsl(var(--border) / .5)}.border-destructive\/50{border-color:hsl(var(--destructive) / .5)}.border-gray-100{--tw-border-opacity: 1;border-color:rgb(243 244 246 / var(--tw-border-opacity, 1))}.border-gray-200{--tw-border-opacity: 1;border-color:rgb(229 231 235 / var(--tw-border-opacity, 1))}.border-gray-300{--tw-border-opacity: 1;border-color:rgb(209 213 219 / var(--tw-border-opacity, 1))}.border-green-200{--tw-border-opacity: 1;border-color:rgb(187 247 208 / var(--tw-border-opacity, 1))}.border-input{border-color:hsl(var(--input))}.border-primary{border-color:hsl(var(--primary))}.border-primary\/50{border-color:hsl(var(--primary) / .5)}.border-purple-200{--tw-border-opacity: 1;border-color:rgb(233 213 255 / var(--tw-border-opacity, 1))}.border-red-200{--tw-border-opacity: 1;border-color:rgb(254 202 202 / var(--tw-border-opacity, 1))}.border-sidebar-border{border-color:hsl(var(--sidebar-border))}.border-slate-100{--tw-border-opacity: 1;border-color:rgb(241 245 249 / var(--tw-border-opacity, 1))}.border-slate-200{--tw-border-opacity: 1;border-color:rgb(226 232 240 / var(--tw-border-opacity, 1))}.border-slate-200\/80{border-color:#e2e8f0cc}.border-slate-300{--tw-border-opacity: 1;border-color:rgb(203 213 225 / var(--tw-border-opacity, 1))}.border-transparent{border-color:transparent}.border-white{--tw-border-opacity: 1;border-color:rgb(255 255 255 / var(--tw-border-opacity, 1))}.border-l-green-500{--tw-border-opacity: 1;border-left-color:rgb(34 197 94 / var(--tw-border-opacity, 1))}.border-l-primary{border-left-color:hsl(var(--primary))}.border-l-transparent{border-left-color:transparent}.border-t-transparent{border-top-color:transparent}.bg-\[--color-bg\]{background-color:var(--color-bg)}.bg-accent{background-color:hsl(var(--accent))}.bg-amber-100{--tw-bg-opacity: 1;background-color:rgb(254 243 199 / var(--tw-bg-opacity, 1))}.bg-amber-50{--tw-bg-opacity: 1;background-color:rgb(255 251 235 / var(--tw-bg-opacity, 1))}.bg-amber-500{--tw-bg-opacity: 1;background-color:rgb(245 158 11 / var(--tw-bg-opacity, 1))}.bg-background{background-color:hsl(var(--background))}.bg-black\/80{background-color:#000c}.bg-blue-100{--tw-bg-opacity: 1;background-color:rgb(219 234 254 / var(--tw-bg-opacity, 1))}.bg-blue-50{--tw-bg-opacity: 1;background-color:rgb(239 246 255 / var(--tw-bg-opacity, 1))}.bg-blue-50\/50{background-color:#eff6ff80}.bg-blue-500{--tw-bg-opacity: 1;background-color:rgb(59 130 246 / var(--tw-bg-opacity, 1))}.bg-blue-600{--tw-bg-opacity: 1;background-color:rgb(37 99 235 / var(--tw-bg-opacity, 1))}.bg-border{background-color:hsl(var(--border))}.bg-card{background-color:hsl(var(--card))}.bg-destructive{background-color:hsl(var(--destructive))}.bg-foreground{background-color:hsl(var(--foreground))}.bg-gray-100{--tw-bg-opacity: 1;background-color:rgb(243 244 246 / var(--tw-bg-opacity, 1))}.bg-gray-200{--tw-bg-opacity: 1;background-color:rgb(229 231 235 / var(--tw-bg-opacity, 1))}.bg-gray-50{--tw-bg-opacity: 1;background-color:rgb(249 250 251 / var(--tw-bg-opacity, 1))}.bg-gray-500{--tw-bg-opacity: 1;background-color:rgb(107 114 128 / var(--tw-bg-opacity, 1))}.bg-gray-900\/10{background-color:#1118271a}.bg-green-100{--tw-bg-opacity: 1;background-color:rgb(220 252 231 / var(--tw-bg-opacity, 1))}.bg-green-400{--tw-bg-opacity: 1;background-color:rgb(74 222 128 / var(--tw-bg-opacity, 1))}.bg-green-50{--tw-bg-opacity: 1;background-color:rgb(240 253 244 / var(--tw-bg-opacity, 1))}.bg-green-500{--tw-bg-opacity: 1;background-color:rgb(34 197 94 / var(--tw-bg-opacity, 1))}.bg-muted{background-color:hsl(var(--muted))}.bg-muted\/30{background-color:hsl(var(--muted) / .3)}.bg-muted\/50{background-color:hsl(var(--muted) / .5)}.bg-pink-200{--tw-bg-opacity: 1;background-color:rgb(251 207 232 / var(--tw-bg-opacity, 1))}.bg-pink-300{--tw-bg-opacity: 1;background-color:rgb(249 168 212 / var(--tw-bg-opacity, 1))}.bg-pink-400{--tw-bg-opacity: 1;background-color:rgb(244 114 182 / var(--tw-bg-opacity, 1))}.bg-pink-500{--tw-bg-opacity: 1;background-color:rgb(236 72 153 / var(--tw-bg-opacity, 1))}.bg-popover{background-color:hsl(var(--popover))}.bg-primary{background-color:hsl(var(--primary))}.bg-primary\/10{background-color:hsl(var(--primary) / .1)}.bg-primary\/5{background-color:hsl(var(--primary) / .05)}.bg-purple-100{--tw-bg-opacity: 1;background-color:rgb(243 232 255 / var(--tw-bg-opacity, 1))}.bg-purple-50{--tw-bg-opacity: 1;background-color:rgb(250 245 255 / var(--tw-bg-opacity, 1))}.bg-purple-500{--tw-bg-opacity: 1;background-color:rgb(168 85 247 / var(--tw-bg-opacity, 1))}.bg-red-100{--tw-bg-opacity: 1;background-color:rgb(254 226 226 / var(--tw-bg-opacity, 1))}.bg-red-400{--tw-bg-opacity: 1;background-color:rgb(248 113 113 / var(--tw-bg-opacity, 1))}.bg-red-50{--tw-bg-opacity: 1;background-color:rgb(254 242 242 / var(--tw-bg-opacity, 1))}.bg-red-500{--tw-bg-opacity: 1;background-color:rgb(239 68 68 / var(--tw-bg-opacity, 1))}.bg-red-600{--tw-bg-opacity: 1;background-color:rgb(220 38 38 / var(--tw-bg-opacity, 1))}.bg-secondary{background-color:hsl(var(--secondary))}.bg-sidebar{background-color:hsl(var(--sidebar-background))}.bg-sidebar-border{background-color:hsl(var(--sidebar-border))}.bg-slate-100{--tw-bg-opacity: 1;background-color:rgb(241 245 249 / var(--tw-bg-opacity, 1))}.bg-slate-200{--tw-bg-opacity: 1;background-color:rgb(226 232 240 / var(--tw-bg-opacity, 1))}.bg-slate-50{--tw-bg-opacity: 1;background-color:rgb(248 250 252 / var(--tw-bg-opacity, 1))}.bg-transparent{background-color:transparent}.bg-white{--tw-bg-opacity: 1;background-color:rgb(255 255 255 / var(--tw-bg-opacity, 1))}.bg-white\/70{background-color:#ffffffb3}.bg-white\/80{background-color:#fffc}.bg-yellow-400{--tw-bg-opacity: 1;background-color:rgb(250 204 21 / var(--tw-bg-opacity, 1))}.bg-gradient-to-b{background-image:linear-gradient(to bottom,var(--tw-gradient-stops))}.bg-gradient-to-br{background-image:linear-gradient(to bottom right,var(--tw-gradient-stops))}.bg-gradient-to-r{background-image:linear-gradient(to right,var(--tw-gradient-stops))}.bg-gradient-to-tr{background-image:linear-gradient(to top right,var(--tw-gradient-stops))}.from-blue-400{--tw-gradient-from: #60a5fa var(--tw-gradient-from-position);--tw-gradient-to: rgb(96 165 250 / 0) var(--tw-gradient-to-position);--tw-gradient-stops: var(--tw-gradient-from), var(--tw-gradient-to)}.from-gray-100{--tw-gradient-from: #f3f4f6 var(--tw-gradient-from-position);--tw-gradient-to: rgb(243 244 246 / 0) var(--tw-gradient-to-position);--tw-gradient-stops: var(--tw-gradient-from), var(--tw-gradient-to)}.from-primary{--tw-gradient-from: hsl(var(--primary)) var(--tw-gradient-from-position);--tw-gradient-to: hsl(var(--primary) / 0) var(--tw-gradient-to-position);--tw-gradient-stops: var(--tw-gradient-from), var(--tw-gradient-to)}.from-primary\/5{--tw-gradient-from: hsl(var(--primary) / .05) var(--tw-gradient-from-position);--tw-gradient-to: hsl(var(--primary) / 0) var(--tw-gradient-to-position);--tw-gradient-stops: var(--tw-gradient-from), var(--tw-gradient-to)}.from-white{--tw-gradient-from: #fff var(--tw-gradient-from-position);--tw-gradient-to: rgb(255 255 255 / 0) var(--tw-gradient-to-position);--tw-gradient-stops: var(--tw-gradient-from), var(--tw-gradient-to)}.to-blue-400{--tw-gradient-to: #60a5fa var(--tw-gradient-to-position)}.to-blue-400\/5{--tw-gradient-to: rgb(96 165 250 / .05) var(--tw-gradient-to-position)}.to-gray-200{--tw-gradient-to: #e5e7eb var(--tw-gradient-to-position)}.to-primary{--tw-gradient-to: hsl(var(--primary)) var(--tw-gradient-to-position)}.to-slate-50{--tw-gradient-to: #f8fafc var(--tw-gradient-to-position)}.fill-amber-400{fill:#fbbf24}.fill-current{fill:currentColor}.object-contain{-o-object-fit:contain;object-fit:contain}.object-cover{-o-object-fit:cover;object-fit:cover}.p-0{padding:0}.p-1{padding:.25rem}.p-2{padding:.5rem}.p-3{padding:.75rem}.p-4{padding:1rem}.p-6{padding:1.5rem}.p-8{padding:2rem}.p-\[1px\]{padding:1px}.px-1{padding-left:.25rem;padding-right:.25rem}.px-2{padding-left:.5rem;padding-right:.5rem}.px-2\.5{padding-left:.625rem;padding-right:.625rem}.px-3{padding-left:.75rem;padding-right:.75rem}.px-4{padding-left:1rem;padding-right:1rem}.px-5{padding-left:1.25rem;padding-right:1.25rem}.px-6{padding-left:1.5rem;padding-right:1.5rem}.px-8{padding-left:2rem;padding-right:2rem}.py-0\.5{padding-top:.125rem;padding-bottom:.125rem}.py-1{padding-top:.25rem;padding-bottom:.25rem}.py-1\.5{padding-top:.375rem;padding-bottom:.375rem}.py-12{padding-top:3rem;padding-bottom:3rem}.py-2{padding-top:.5rem;padding-bottom:.5rem}.py-20{padding-top:5rem;padding-bottom:5rem}.py-24{padding-top:6rem;padding-bottom:6rem}.py-3{padding-top:.75rem;padding-bottom:.75rem}.py-4{padding-top:1rem;padding-bottom:1rem}.py-6{padding-top:1.5rem;padding-bottom:1.5rem}.pb-16{padding-bottom:4rem}.pb-2{padding-bottom:.5rem}.pb-3{padding-bottom:.75rem}.pb-4{padding-bottom:1rem}.pl-10{padding-left:2.5rem}.pl-2\.5{padding-left:.625rem}.pl-4{padding-left:1rem}.pl-8{padding-left:2rem}.pr-2{padding-right:.5rem}.pr-2\.5{padding-right:.625rem}.pr-4{padding-right:1rem}.pt-0{padding-top:0}.pt-1{padding-top:.25rem}.pt-16{padding-top:4rem}.pt-2{padding-top:.5rem}.pt-20{padding-top:5rem}.pt-3{padding-top:.75rem}.pt-4{padding-top:1rem}.pt-6{padding-top:1.5rem}.pt-8{padding-top:2rem}.text-left{text-align:left}.text-center{text-align:center}.align-middle{vertical-align:middle}.font-mono{font-family:ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,Liberation Mono,Courier New,monospace}.font-sans{font-family:Inter,system-ui,sans-serif}.font-sf{font-family:SF Pro Display,system-ui,sans-serif}.text-2xl{font-size:1.5rem;line-height:2rem}.text-3xl{font-size:1.875rem;line-height:2.25rem}.text-4xl{font-size:2.25rem;line-height:2.5rem}.text-\[0\.8rem\]{font-size:.8rem}.text-base{font-size:1rem;line-height:1.5rem}.text-lg{font-size:1.125rem;line-height:1.75rem}.text-sm{font-size:.875rem;line-height:1.25rem}.text-xl{font-size:1.25rem;line-height:1.75rem}.text-xs{font-size:.75rem;line-height:1rem}.font-bold{font-weight:700}.font-medium{font-weight:500}.font-normal{font-weight:400}.font-semibold{font-weight:600}.italic{font-style:italic}.tabular-nums{--tw-numeric-spacing: tabular-nums;font-variant-numeric:var(--tw-ordinal) var(--tw-slashed-zero) var(--tw-numeric-figure) var(--tw-numeric-spacing) var(--tw-numeric-fraction)}.leading-6{line-height:1.5rem}.leading-8{line-height:2rem}.leading-none{line-height:1}.leading-relaxed{line-height:1.625}.tracking-tight{letter-spacing:-.025em}.tracking-widest{letter-spacing:.1em}.text-accent-foreground{color:hsl(var(--accent-foreground))}.text-amber-400{--tw-text-opacity: 1;color:rgb(251 191 36 / var(--tw-text-opacity, 1))}.text-amber-500{--tw-text-opacity: 1;color:rgb(245 158 11 / var(--tw-text-opacity, 1))}.text-amber-600{--tw-text-opacity: 1;color:rgb(217 119 6 / var(--tw-text-opacity, 1))}.text-amber-700{--tw-text-opacity: 1;color:rgb(180 83 9 / var(--tw-text-opacity, 1))}.text-amber-800{--tw-text-opacity: 1;color:rgb(146 64 14 / var(--tw-text-opacity, 1))}.text-blue-500{--tw-text-opacity: 1;color:rgb(59 130 246 / var(--tw-text-opacity, 1))}.text-blue-600{--tw-text-opacity: 1;color:rgb(37 99 235 / var(--tw-text-opacity, 1))}.text-blue-700{--tw-text-opacity: 1;color:rgb(29 78 216 / var(--tw-text-opacity, 1))}.text-blue-800{--tw-text-opacity: 1;color:rgb(30 64 175 / var(--tw-text-opacity, 1))}.text-blue-900{--tw-text-opacity: 1;color:rgb(30 58 138 / var(--tw-text-opacity, 1))}.text-card-foreground{color:hsl(var(--card-foreground))}.text-current{color:currentColor}.text-destructive{color:hsl(var(--destructive))}.text-destructive-foreground{color:hsl(var(--destructive-foreground))}.text-foreground{color:hsl(var(--foreground))}.text-gray-300{--tw-text-opacity: 1;color:rgb(209 213 219 / var(--tw-text-opacity, 1))}.text-gray-400{--tw-text-opacity: 1;color:rgb(156 163 175 / var(--tw-text-opacity, 1))}.text-gray-500{--tw-text-opacity: 1;color:rgb(107 114 128 / var(--tw-text-opacity, 1))}.text-gray-600{--tw-text-opacity: 1;color:rgb(75 85 99 / var(--tw-text-opacity, 1))}.text-gray-700{--tw-text-opacity: 1;color:rgb(55 65 81 / var(--tw-text-opacity, 1))}.text-gray-800{--tw-text-opacity: 1;color:rgb(31 41 55 / var(--tw-text-opacity, 1))}.text-gray-900{--tw-text-opacity: 1;color:rgb(17 24 39 / var(--tw-text-opacity, 1))}.text-green-500{--tw-text-opacity: 1;color:rgb(34 197 94 / var(--tw-text-opacity, 1))}.text-green-600{--tw-text-opacity: 1;color:rgb(22 163 74 / var(--tw-text-opacity, 1))}.text-green-700{--tw-text-opacity: 1;color:rgb(21 128 61 / var(--tw-text-opacity, 1))}.text-green-800{--tw-text-opacity: 1;color:rgb(22 101 52 / var(--tw-text-opacity, 1))}.text-muted-foreground{color:hsl(var(--muted-foreground))}.text-orange-500{--tw-text-opacity: 1;color:rgb(249 115 22 / var(--tw-text-opacity, 1))}.text-popover-foreground{color:hsl(var(--popover-foreground))}.text-primary{color:hsl(var(--primary))}.text-primary-foreground{color:hsl(var(--primary-foreground))}.text-purple-500{--tw-text-opacity: 1;color:rgb(168 85 247 / var(--tw-text-opacity, 1))}.text-purple-600{--tw-text-opacity: 1;color:rgb(147 51 234 / var(--tw-text-opacity, 1))}.text-purple-700{--tw-text-opacity: 1;color:rgb(126 34 206 / var(--tw-text-opacity, 1))}.text-purple-800{--tw-text-opacity: 1;color:rgb(107 33 168 / var(--tw-text-opacity, 1))}.text-red-500{--tw-text-opacity: 1;color:rgb(239 68 68 / var(--tw-text-opacity, 1))}.text-red-600{--tw-text-opacity: 1;color:rgb(220 38 38 / var(--tw-text-opacity, 1))}.text-red-800{--tw-text-opacity: 1;color:rgb(153 27 27 / var(--tw-text-opacity, 1))}.text-secondary-foreground{color:hsl(var(--secondary-foreground))}.text-sidebar-foreground{color:hsl(var(--sidebar-foreground))}.text-sidebar-foreground\/70{color:hsl(var(--sidebar-foreground) / .7)}.text-slate-400{--tw-text-opacity: 1;color:rgb(148 163 184 / var(--tw-text-opacity, 1))}.text-slate-500{--tw-text-opacity: 1;color:rgb(100 116 139 / var(--tw-text-opacity, 1))}.text-slate-600{--tw-text-opacity: 1;color:rgb(71 85 105 / var(--tw-text-opacity, 1))}.text-slate-700{--tw-text-opacity: 1;color:rgb(51 65 85 / var(--tw-text-opacity, 1))}.text-slate-800{--tw-text-opacity: 1;color:rgb(30 41 59 / var(--tw-text-opacity, 1))}.text-slate-900{--tw-text-opacity: 1;color:rgb(15 23 42 / var(--tw-text-opacity, 1))}.text-white{--tw-text-opacity: 1;color:rgb(255 255 255 / var(--tw-text-opacity, 1))}.text-yellow-500{--tw-text-opacity: 1;color:rgb(234 179 8 / var(--tw-text-opacity, 1))}.underline-offset-4{text-underline-offset:4px}.opacity-0{opacity:0}.opacity-20{opacity:.2}.opacity-50{opacity:.5}.opacity-60{opacity:.6}.opacity-70{opacity:.7}.opacity-75{opacity:.75}.shadow-\[0_-2px_4px_rgba\(0\,0\,0\,0\.05\)\]{--tw-shadow: 0 -2px 4px rgba(0,0,0,.05);--tw-shadow-colored: 0 -2px 4px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)}.shadow-\[0_0_0_1px_hsl\(var\(--sidebar-border\)\)\]{--tw-shadow: 0 0 0 1px hsl(var(--sidebar-border));--tw-shadow-colored: 0 0 0 1px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)}.shadow-lg{--tw-shadow: 0 10px 15px -3px rgb(0 0 0 / .1), 0 4px 6px -4px rgb(0 0 0 / .1);--tw-shadow-colored: 0 10px 15px -3px var(--tw-shadow-color), 0 4px 6px -4px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)}.shadow-md{--tw-shadow: 0 4px 6px -1px rgb(0 0 0 / .1), 0 2px 4px -2px rgb(0 0 0 / .1);--tw-shadow-colored: 0 4px 6px -1px var(--tw-shadow-color), 0 2px 4px -2px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)}.shadow-none{--tw-shadow: 0 0 #0000;--tw-shadow-colored: 0 0 #0000;box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)}.shadow-sm{--tw-shadow: 0 1px 2px 0 rgb(0 0 0 / .05);--tw-shadow-colored: 0 1px 2px 0 var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)}.shadow-xl{--tw-shadow: 0 20px 25px -5px rgb(0 0 0 / .1), 0 8px 10px -6px rgb(0 0 0 / .1);--tw-shadow-colored: 0 20px 25px -5px var(--tw-shadow-color), 0 8px 10px -6px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)}.outline-none{outline:2px solid transparent;outline-offset:2px}.outline{outline-style:solid}.ring-0{--tw-ring-offset-shadow: var(--tw-ring-inset) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-shadow: var(--tw-ring-inset) 0 0 0 calc(0px + var(--tw-ring-offset-width)) var(--tw-ring-color);box-shadow:var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow, 0 0 #0000)}.ring-1{--tw-ring-offset-shadow: var(--tw-ring-inset) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-shadow: var(--tw-ring-inset) 0 0 0 calc(1px + var(--tw-ring-offset-width)) var(--tw-ring-color);box-shadow:var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow, 0 0 #0000)}.ring-2{--tw-ring-offset-shadow: var(--tw-ring-inset) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-shadow: var(--tw-ring-inset) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color);box-shadow:var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow, 0 0 #0000)}.ring-blue-200{--tw-ring-opacity: 1;--tw-ring-color: rgb(191 219 254 / var(--tw-ring-opacity, 1))}.ring-gray-900\/10{--tw-ring-color: rgb(17 24 39 / .1)}.ring-primary{--tw-ring-color: hsl(var(--primary))}.ring-ring{--tw-ring-color: hsl(var(--ring))}.ring-sidebar-ring{--tw-ring-color: hsl(var(--sidebar-ring))}.ring-offset-background{--tw-ring-offset-color: hsl(var(--background))}.ring-offset-white{--tw-ring-offset-color: #fff}.blur-3xl{--tw-blur: blur(64px);filter:var(--tw-blur) var(--tw-brightness) var(--tw-contrast) var(--tw-grayscale) var(--tw-hue-rotate) var(--tw-invert) var(--tw-saturate) var(--tw-sepia) var(--tw-drop-shadow)}.filter{filter:var(--tw-blur) var(--tw-brightness) var(--tw-contrast) var(--tw-grayscale) var(--tw-hue-rotate) var(--tw-invert) var(--tw-saturate) var(--tw-sepia) var(--tw-drop-shadow)}.backdrop-blur-md{--tw-backdrop-blur: blur(12px);-webkit-backdrop-filter:var(--tw-backdrop-blur) var(--tw-backdrop-brightness) var(--tw-backdrop-contrast) var(--tw-backdrop-grayscale) var(--tw-backdrop-hue-rotate) var(--tw-backdrop-invert) var(--tw-backdrop-opacity) var(--tw-backdrop-saturate) var(--tw-backdrop-sepia);backdrop-filter:var(--tw-backdrop-blur) var(--tw-backdrop-brightness) var(--tw-backdrop-contrast) var(--tw-backdrop-grayscale) var(--tw-backdrop-hue-rotate) var(--tw-backdrop-invert) var(--tw-backdrop-opacity) var(--tw-backdrop-saturate) var(--tw-backdrop-sepia)}.backdrop-blur-sm{--tw-backdrop-blur: blur(4px);-webkit-backdrop-filter:var(--tw-backdrop-blur) var(--tw-backdrop-brightness) var(--tw-backdrop-contrast) var(--tw-backdrop-grayscale) var(--tw-backdrop-hue-rotate) var(--tw-backdrop-invert) var(--tw-backdrop-opacity) var(--tw-backdrop-saturate) var(--tw-backdrop-sepia);backdrop-filter:var(--tw-backdrop-blur) var(--tw-backdrop-brightness) var(--tw-backdrop-contrast) var(--tw-backdrop-grayscale) var(--tw-backdrop-hue-rotate) var(--tw-backdrop-invert) var(--tw-backdrop-opacity) var(--tw-backdrop-saturate) var(--tw-backdrop-sepia)}.transition{transition-property:color,background-color,border-color,text-decoration-color,fill,stroke,opacity,box-shadow,transform,filter,-webkit-backdrop-filter;transition-property:color,background-color,border-color,text-decoration-color,fill,stroke,opacity,box-shadow,transform,filter,backdrop-filter;transition-property:color,background-color,border-color,text-decoration-color,fill,stroke,opacity,box-shadow,transform,filter,backdrop-filter,-webkit-backdrop-filter;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s}.transition-\[left\,right\,width\]{transition-property:left,right,width;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s}.transition-\[margin\,opa\]{transition-property:margin,opa;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s}.transition-\[width\,height\,padding\]{transition-property:width,height,padding;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s}.transition-\[width\]{transition-property:width;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s}.transition-all{transition-property:all;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s}.transition-colors{transition-property:color,background-color,border-color,text-decoration-color,fill,stroke;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s}.transition-opacity{transition-property:opacity;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s}.transition-shadow{transition-property:box-shadow;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s}.transition-transform{transition-property:transform;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s}.duration-1000{transition-duration:1s}.duration-200{transition-duration:.2s}.duration-300{transition-duration:.3s}.ease-in-out{transition-timing-function:cubic-bezier(.4,0,.2,1)}.ease-linear{transition-timing-function:linear}@keyframes enter{0%{opacity:var(--tw-enter-opacity, 1);transform:translate3d(var(--tw-enter-translate-x, 0),var(--tw-enter-translate-y, 0),0) scale3d(var(--tw-enter-scale, 1),var(--tw-enter-scale, 1),var(--tw-enter-scale, 1)) rotate(var(--tw-enter-rotate, 0))}}@keyframes exit{to{opacity:var(--tw-exit-opacity, 1);transform:translate3d(var(--tw-exit-translate-x, 0),var(--tw-exit-translate-y, 0),0) scale3d(var(--tw-exit-scale, 1),var(--tw-exit-scale, 1),var(--tw-exit-scale, 1)) rotate(var(--tw-exit-rotate, 0))}}.animate-in{animation-name:enter;animation-duration:.15s;--tw-enter-opacity: initial;--tw-enter-scale: initial;--tw-enter-rotate: initial;--tw-enter-translate-x: initial;--tw-enter-translate-y: initial}.fade-in-0{--tw-enter-opacity: 0}.fade-in-80{--tw-enter-opacity: .8}.zoom-in-95{--tw-enter-scale: .95}.duration-1000{animation-duration:1s}.duration-200{animation-duration:.2s}.duration-300{animation-duration:.3s}.ease-in-out{animation-timing-function:cubic-bezier(.4,0,.2,1)}.ease-linear{animation-timing-function:linear}.running{animation-play-state:running}.paused{animation-play-state:paused}.file\:border-0::file-selector-button{border-width:0px}.file\:bg-transparent::file-selector-button{background-color:transparent}.file\:text-sm::file-selector-button{font-size:.875rem;line-height:1.25rem}.file\:font-medium::file-selector-button{font-weight:500}.file\:text-foreground::file-selector-button{color:hsl(var(--foreground))}.placeholder\:text-muted-foreground::-moz-placeholder{color:hsl(var(--muted-foreground))}.placeholder\:text-muted-foreground::placeholder{color:hsl(var(--muted-foreground))}.placeholder\:text-slate-500::-moz-placeholder{--tw-text-opacity: 1;color:rgb(100 116 139 / var(--tw-text-opacity, 1))}.placeholder\:text-slate-500::placeholder{--tw-text-opacity: 1;color:rgb(100 116 139 / var(--tw-text-opacity, 1))}.after\:absolute:after{content:var(--tw-content);position:absolute}.after\:-inset-2:after{content:var(--tw-content);top:-.5rem;right:-.5rem;bottom:-.5rem;left:-.5rem}.after\:inset-y-0:after{content:var(--tw-content);top:0;bottom:0}.after\:left-1\/2:after{content:var(--tw-content);left:50%}.after\:w-1:after{content:var(--tw-content);width:.25rem}.after\:w-\[2px\]:after{content:var(--tw-content);width:2px}.after\:-translate-x-1\/2:after{content:var(--tw-content);--tw-translate-x: -50%;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.first\:rounded-l-md:first-child{border-top-left-radius:calc(var(--radius) - 2px);border-bottom-left-radius:calc(var(--radius) - 2px)}.first\:border-l:first-child{border-left-width:1px}.last\:rounded-r-md:last-child{border-top-right-radius:calc(var(--radius) - 2px);border-bottom-right-radius:calc(var(--radius) - 2px)}.last\:border-b-0:last-child{border-bottom-width:0px}.last\:pb-0:last-child{padding-bottom:0}.focus-within\:relative:focus-within{position:relative}.focus-within\:z-20:focus-within{z-index:20}.hover\:translate-y-\[-2px\]:hover{--tw-translate-y: -2px;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.hover\:translate-y-\[-4px\]:hover{--tw-translate-y: -4px;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.hover\:border-slate-300:hover{--tw-border-opacity: 1;border-color:rgb(203 213 225 / var(--tw-border-opacity, 1))}.hover\:bg-accent:hover{background-color:hsl(var(--accent))}.hover\:bg-blue-100:hover{--tw-bg-opacity: 1;background-color:rgb(219 234 254 / var(--tw-bg-opacity, 1))}.hover\:bg-destructive\/80:hover{background-color:hsl(var(--destructive) / .8)}.hover\:bg-destructive\/90:hover{background-color:hsl(var(--destructive) / .9)}.hover\:bg-gray-300:hover{--tw-bg-opacity: 1;background-color:rgb(209 213 219 / var(--tw-bg-opacity, 1))}.hover\:bg-gray-50:hover{--tw-bg-opacity: 1;background-color:rgb(249 250 251 / var(--tw-bg-opacity, 1))}.hover\:bg-gray-50\/50:hover{background-color:#f9fafb80}.hover\:bg-muted:hover{background-color:hsl(var(--muted))}.hover\:bg-muted\/50:hover{background-color:hsl(var(--muted) / .5)}.hover\:bg-primary:hover{background-color:hsl(var(--primary))}.hover\:bg-primary\/80:hover{background-color:hsl(var(--primary) / .8)}.hover\:bg-primary\/90:hover{background-color:hsl(var(--primary) / .9)}.hover\:bg-red-100:hover{--tw-bg-opacity: 1;background-color:rgb(254 226 226 / var(--tw-bg-opacity, 1))}.hover\:bg-red-700:hover{--tw-bg-opacity: 1;background-color:rgb(185 28 28 / var(--tw-bg-opacity, 1))}.hover\:bg-secondary\/80:hover{background-color:hsl(var(--secondary) / .8)}.hover\:bg-sidebar-accent:hover{background-color:hsl(var(--sidebar-accent))}.hover\:bg-slate-100:hover{--tw-bg-opacity: 1;background-color:rgb(241 245 249 / var(--tw-bg-opacity, 1))}.hover\:bg-slate-200:hover{--tw-bg-opacity: 1;background-color:rgb(226 232 240 / var(--tw-bg-opacity, 1))}.hover\:bg-slate-300:hover{--tw-bg-opacity: 1;background-color:rgb(203 213 225 / var(--tw-bg-opacity, 1))}.hover\:bg-slate-50:hover{--tw-bg-opacity: 1;background-color:rgb(248 250 252 / var(--tw-bg-opacity, 1))}.hover\:text-accent-foreground:hover{color:hsl(var(--accent-foreground))}.hover\:text-blue-600:hover{--tw-text-opacity: 1;color:rgb(37 99 235 / var(--tw-text-opacity, 1))}.hover\:text-blue-800:hover{--tw-text-opacity: 1;color:rgb(30 64 175 / var(--tw-text-opacity, 1))}.hover\:text-foreground:hover{color:hsl(var(--foreground))}.hover\:text-muted-foreground:hover{color:hsl(var(--muted-foreground))}.hover\:text-primary:hover{color:hsl(var(--primary))}.hover\:text-primary-foreground:hover{color:hsl(var(--primary-foreground))}.hover\:text-red-700:hover{--tw-text-opacity: 1;color:rgb(185 28 28 / var(--tw-text-opacity, 1))}.hover\:text-sidebar-accent-foreground:hover{color:hsl(var(--sidebar-accent-foreground))}.hover\:text-slate-900:hover{--tw-text-opacity: 1;color:rgb(15 23 42 / var(--tw-text-opacity, 1))}.hover\:underline:hover{text-decoration-line:underline}.hover\:opacity-100:hover{opacity:1}.hover\:shadow-\[0_0_0_1px_hsl\(var\(--sidebar-accent\)\)\]:hover{--tw-shadow: 0 0 0 1px hsl(var(--sidebar-accent));--tw-shadow-colored: 0 0 0 1px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)}.hover\:shadow-lg:hover{--tw-shadow: 0 10px 15px -3px rgb(0 0 0 / .1), 0 4px 6px -4px rgb(0 0 0 / .1);--tw-shadow-colored: 0 10px 15px -3px var(--tw-shadow-color), 0 4px 6px -4px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)}.hover\:shadow-md:hover{--tw-shadow: 0 4px 6px -1px rgb(0 0 0 / .1), 0 2px 4px -2px rgb(0 0 0 / .1);--tw-shadow-colored: 0 4px 6px -1px var(--tw-shadow-color), 0 2px 4px -2px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)}.hover\:ring-gray-900\/20:hover{--tw-ring-color: rgb(17 24 39 / .2)}.hover\:after\:bg-sidebar-border:hover:after{content:var(--tw-content);background-color:hsl(var(--sidebar-border))}.focus\:bg-accent:focus{background-color:hsl(var(--accent))}.focus\:bg-primary:focus{background-color:hsl(var(--primary))}.focus\:text-accent-foreground:focus{color:hsl(var(--accent-foreground))}.focus\:text-primary-foreground:focus{color:hsl(var(--primary-foreground))}.focus\:outline-none:focus{outline:2px solid transparent;outline-offset:2px}.focus\:ring-2:focus{--tw-ring-offset-shadow: var(--tw-ring-inset) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-shadow: var(--tw-ring-inset) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color);box-shadow:var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow, 0 0 #0000)}.focus\:ring-primary:focus{--tw-ring-color: hsl(var(--primary))}.focus\:ring-ring:focus{--tw-ring-color: hsl(var(--ring))}.focus\:ring-offset-2:focus{--tw-ring-offset-width: 2px}.focus-visible\:outline-none:focus-visible{outline:2px solid transparent;outline-offset:2px}.focus-visible\:ring-1:focus-visible{--tw-ring-offset-shadow: var(--tw-ring-inset) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-shadow: var(--tw-ring-inset) 0 0 0 calc(1px + var(--tw-ring-offset-width)) var(--tw-ring-color);box-shadow:var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow, 0 0 #0000)}.focus-visible\:ring-2:focus-visible{--tw-ring-offset-shadow: var(--tw-ring-inset) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-shadow: var(--tw-ring-inset) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color);box-shadow:var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow, 0 0 #0000)}.focus-visible\:ring-ring:focus-visible{--tw-ring-color: hsl(var(--ring))}.focus-visible\:ring-sidebar-ring:focus-visible{--tw-ring-color: hsl(var(--sidebar-ring))}.focus-visible\:ring-slate-950:focus-visible{--tw-ring-opacity: 1;--tw-ring-color: rgb(2 6 23 / var(--tw-ring-opacity, 1))}.focus-visible\:ring-offset-1:focus-visible{--tw-ring-offset-width: 1px}.focus-visible\:ring-offset-2:focus-visible{--tw-ring-offset-width: 2px}.focus-visible\:ring-offset-background:focus-visible{--tw-ring-offset-color: hsl(var(--background))}.active\:bg-sidebar-accent:active{background-color:hsl(var(--sidebar-accent))}.active\:text-sidebar-accent-foreground:active{color:hsl(var(--sidebar-accent-foreground))}.disabled\:pointer-events-none:disabled{pointer-events:none}.disabled\:cursor-not-allowed:disabled{cursor:not-allowed}.disabled\:opacity-50:disabled{opacity:.5}.group\/menu-item:focus-within .group-focus-within\/menu-item\:opacity-100{opacity:1}.group\/menu-item:hover .group-hover\/menu-item\:opacity-100,.group:hover .group-hover\:opacity-100{opacity:1}.group.toast .group-\[\.toast\]\:absolute{position:absolute}.group.toast .group-\[\.toast\]\:left-3{left:.75rem}.group.toast .group-\[\.toast\]\:top-3{top:.75rem}.group.toast .group-\[\.toast\]\:h-5{height:1.25rem}.group.toast .group-\[\.toast\]\:w-5{width:1.25rem}.group.toast .group-\[\.toast\]\:rounded-md{border-radius:calc(var(--radius) - 2px)}.group.toaster .group-\[\.toaster\]\:border-border{border-color:hsl(var(--border))}.group.toast .group-\[\.toast\]\:bg-muted{background-color:hsl(var(--muted))}.group.toast .group-\[\.toast\]\:bg-primary{background-color:hsl(var(--primary))}.group.toaster .group-\[\.toaster\]\:bg-background{background-color:hsl(var(--background))}.group.toast .group-\[\.toast\]\:p-1{padding:.25rem}.group.toaster .group-\[\.toaster\]\:pr-8{padding-right:2rem}.group.toast .group-\[\.toast\]\:text-foreground\/70{color:hsl(var(--foreground) / .7)}.group.toast .group-\[\.toast\]\:text-muted-foreground{color:hsl(var(--muted-foreground))}.group.toast .group-\[\.toast\]\:text-primary-foreground{color:hsl(var(--primary-foreground))}.group.toaster .group-\[\.toaster\]\:text-foreground{color:hsl(var(--foreground))}.group.toast .group-\[\.toast\]\:opacity-100{opacity:1}.group.toaster .group-\[\.toaster\]\:shadow-lg{--tw-shadow: 0 10px 15px -3px rgb(0 0 0 / .1), 0 4px 6px -4px rgb(0 0 0 / .1);--tw-shadow-colored: 0 10px 15px -3px var(--tw-shadow-color), 0 4px 6px -4px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)}.group.toast .group-\[\.toast\]\:transition-opacity{transition-property:opacity;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s}.group.toast .hover\:group-\[\.toast\]\:bg-muted\/50:hover{background-color:hsl(var(--muted) / .5)}.group.toast .hover\:group-\[\.toast\]\:text-foreground:hover{color:hsl(var(--foreground))}.group.toast .focus\:group-\[\.toast\]\:opacity-100:focus{opacity:1}.group.toast .focus\:group-\[\.toast\]\:outline-none:focus{outline:2px solid transparent;outline-offset:2px}.group.toast .focus\:group-\[\.toast\]\:ring-1:focus{--tw-ring-offset-shadow: var(--tw-ring-inset) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-shadow: var(--tw-ring-inset) 0 0 0 calc(1px + var(--tw-ring-offset-width)) var(--tw-ring-color);box-shadow:var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow, 0 0 #0000)}.group.toast .focus\:group-\[\.toast\]\:ring-ring:focus{--tw-ring-color: hsl(var(--ring))}.peer\/menu-button:hover~.peer-hover\/menu-button\:text-sidebar-accent-foreground{color:hsl(var(--sidebar-accent-foreground))}.peer:disabled~.peer-disabled\:cursor-not-allowed{cursor:not-allowed}.peer:disabled~.peer-disabled\:opacity-70{opacity:.7}.has-\[\[data-variant\=inset\]\]\:bg-sidebar:has([data-variant=inset]){background-color:hsl(var(--sidebar-background))}.has-\[\:disabled\]\:opacity-50:has(:disabled){opacity:.5}.group\/menu-item:has([data-sidebar=menu-action]) .group-has-\[\[data-sidebar\=menu-action\]\]\/menu-item\:pr-8{padding-right:2rem}.aria-disabled\:pointer-events-none[aria-disabled=true]{pointer-events:none}.aria-disabled\:opacity-50[aria-disabled=true]{opacity:.5}.aria-selected\:bg-accent[aria-selected=true]{background-color:hsl(var(--accent))}.aria-selected\:bg-accent\/50[aria-selected=true]{background-color:hsl(var(--accent) / .5)}.aria-selected\:text-accent-foreground[aria-selected=true]{color:hsl(var(--accent-foreground))}.aria-selected\:text-muted-foreground[aria-selected=true]{color:hsl(var(--muted-foreground))}.aria-selected\:opacity-100[aria-selected=true]{opacity:1}.aria-selected\:opacity-30[aria-selected=true]{opacity:.3}.data-\[disabled\=true\]\:pointer-events-none[data-disabled=true],.data-\[disabled\]\:pointer-events-none[data-disabled]{pointer-events:none}.data-\[panel-group-direction\=vertical\]\:h-px[data-panel-group-direction=vertical]{height:1px}.data-\[panel-group-direction\=vertical\]\:w-full[data-panel-group-direction=vertical]{width:100%}.data-\[side\=bottom\]\:translate-y-1[data-side=bottom]{--tw-translate-y: .25rem;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.data-\[side\=left\]\:-translate-x-1[data-side=left]{--tw-translate-x: -.25rem;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.data-\[side\=right\]\:translate-x-1[data-side=right]{--tw-translate-x: .25rem;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.data-\[side\=top\]\:-translate-y-1[data-side=top]{--tw-translate-y: -.25rem;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.data-\[state\=checked\]\:translate-x-5[data-state=checked]{--tw-translate-x: 1.25rem;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.data-\[state\=unchecked\]\:translate-x-0[data-state=unchecked]{--tw-translate-x: 0px;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.data-\[state\=open\]\:rotate-90[data-state=open]{--tw-rotate: 90deg;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}@keyframes accordion-up{0%{height:var(--radix-accordion-content-height)}to{height:0}}.data-\[state\=closed\]\:animate-accordion-up[data-state=closed]{animation:accordion-up .2s ease-out}@keyframes accordion-down{0%{height:0}to{height:var(--radix-accordion-content-height)}}.data-\[state\=open\]\:animate-accordion-down[data-state=open]{animation:accordion-down .2s ease-out}.data-\[panel-group-direction\=vertical\]\:flex-col[data-panel-group-direction=vertical]{flex-direction:column}.data-\[active\=true\]\:bg-sidebar-accent[data-active=true]{background-color:hsl(var(--sidebar-accent))}.data-\[active\]\:bg-accent\/50[data-active]{background-color:hsl(var(--accent) / .5)}.data-\[selected\=\'true\'\]\:bg-accent[data-selected=true]{background-color:hsl(var(--accent))}.data-\[state\=active\]\:bg-background[data-state=active]{background-color:hsl(var(--background))}.data-\[state\=checked\]\:bg-primary[data-state=checked]{background-color:hsl(var(--primary))}.data-\[state\=on\]\:bg-accent[data-state=on],.data-\[state\=open\]\:bg-accent[data-state=open]{background-color:hsl(var(--accent))}.data-\[state\=open\]\:bg-accent\/50[data-state=open]{background-color:hsl(var(--accent) / .5)}.data-\[state\=open\]\:bg-secondary[data-state=open]{background-color:hsl(var(--secondary))}.data-\[state\=selected\]\:bg-muted[data-state=selected]{background-color:hsl(var(--muted))}.data-\[state\=unchecked\]\:bg-input[data-state=unchecked]{background-color:hsl(var(--input))}.data-\[active\=true\]\:font-medium[data-active=true]{font-weight:500}.data-\[active\=true\]\:text-sidebar-accent-foreground[data-active=true]{color:hsl(var(--sidebar-accent-foreground))}.data-\[selected\=true\]\:text-accent-foreground[data-selected=true]{color:hsl(var(--accent-foreground))}.data-\[state\=active\]\:text-foreground[data-state=active]{color:hsl(var(--foreground))}.data-\[state\=checked\]\:text-primary-foreground[data-state=checked]{color:hsl(var(--primary-foreground))}.data-\[state\=on\]\:text-accent-foreground[data-state=on],.data-\[state\=open\]\:text-accent-foreground[data-state=open]{color:hsl(var(--accent-foreground))}.data-\[state\=open\]\:text-muted-foreground[data-state=open]{color:hsl(var(--muted-foreground))}.data-\[disabled\=true\]\:opacity-50[data-disabled=true],.data-\[disabled\]\:opacity-50[data-disabled]{opacity:.5}.data-\[state\=open\]\:opacity-100[data-state=open]{opacity:1}.data-\[state\=active\]\:shadow-sm[data-state=active]{--tw-shadow: 0 1px 2px 0 rgb(0 0 0 / .05);--tw-shadow-colored: 0 1px 2px 0 var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)}.data-\[state\=closed\]\:duration-300[data-state=closed]{transition-duration:.3s}.data-\[state\=open\]\:duration-500[data-state=open]{transition-duration:.5s}.data-\[motion\^\=from-\]\:animate-in[data-motion^=from-],.data-\[state\=open\]\:animate-in[data-state=open],.data-\[state\=visible\]\:animate-in[data-state=visible]{animation-name:enter;animation-duration:.15s;--tw-enter-opacity: initial;--tw-enter-scale: initial;--tw-enter-rotate: initial;--tw-enter-translate-x: initial;--tw-enter-translate-y: initial}.data-\[motion\^\=to-\]\:animate-out[data-motion^=to-],.data-\[state\=closed\]\:animate-out[data-state=closed],.data-\[state\=hidden\]\:animate-out[data-state=hidden]{animation-name:exit;animation-duration:.15s;--tw-exit-opacity: initial;--tw-exit-scale: initial;--tw-exit-rotate: initial;--tw-exit-translate-x: initial;--tw-exit-translate-y: initial}.data-\[motion\^\=from-\]\:fade-in[data-motion^=from-]{--tw-enter-opacity: 0}.data-\[motion\^\=to-\]\:fade-out[data-motion^=to-],.data-\[state\=closed\]\:fade-out-0[data-state=closed],.data-\[state\=hidden\]\:fade-out[data-state=hidden]{--tw-exit-opacity: 0}.data-\[state\=open\]\:fade-in-0[data-state=open],.data-\[state\=visible\]\:fade-in[data-state=visible]{--tw-enter-opacity: 0}.data-\[state\=closed\]\:zoom-out-95[data-state=closed]{--tw-exit-scale: .95}.data-\[state\=open\]\:zoom-in-90[data-state=open]{--tw-enter-scale: .9}.data-\[state\=open\]\:zoom-in-95[data-state=open]{--tw-enter-scale: .95}.data-\[motion\=from-end\]\:slide-in-from-right-52[data-motion=from-end]{--tw-enter-translate-x: 13rem}.data-\[motion\=from-start\]\:slide-in-from-left-52[data-motion=from-start]{--tw-enter-translate-x: -13rem}.data-\[motion\=to-end\]\:slide-out-to-right-52[data-motion=to-end]{--tw-exit-translate-x: 13rem}.data-\[motion\=to-start\]\:slide-out-to-left-52[data-motion=to-start]{--tw-exit-translate-x: -13rem}.data-\[side\=bottom\]\:slide-in-from-top-2[data-side=bottom]{--tw-enter-translate-y: -.5rem}.data-\[side\=left\]\:slide-in-from-right-2[data-side=left]{--tw-enter-translate-x: .5rem}.data-\[side\=right\]\:slide-in-from-left-2[data-side=right]{--tw-enter-translate-x: -.5rem}.data-\[side\=top\]\:slide-in-from-bottom-2[data-side=top]{--tw-enter-translate-y: .5rem}.data-\[state\=closed\]\:slide-out-to-bottom[data-state=closed]{--tw-exit-translate-y: 100%}.data-\[state\=closed\]\:slide-out-to-left[data-state=closed]{--tw-exit-translate-x: -100%}.data-\[state\=closed\]\:slide-out-to-left-1\/2[data-state=closed]{--tw-exit-translate-x: -50%}.data-\[state\=closed\]\:slide-out-to-right[data-state=closed]{--tw-exit-translate-x: 100%}.data-\[state\=closed\]\:slide-out-to-top[data-state=closed]{--tw-exit-translate-y: -100%}.data-\[state\=closed\]\:slide-out-to-top-\[48\%\][data-state=closed]{--tw-exit-translate-y: -48%}.data-\[state\=open\]\:slide-in-from-bottom[data-state=open]{--tw-enter-translate-y: 100%}.data-\[state\=open\]\:slide-in-from-left[data-state=open]{--tw-enter-translate-x: -100%}.data-\[state\=open\]\:slide-in-from-left-1\/2[data-state=open]{--tw-enter-translate-x: -50%}.data-\[state\=open\]\:slide-in-from-right[data-state=open]{--tw-enter-translate-x: 100%}.data-\[state\=open\]\:slide-in-from-top[data-state=open]{--tw-enter-translate-y: -100%}.data-\[state\=open\]\:slide-in-from-top-\[48\%\][data-state=open]{--tw-enter-translate-y: -48%}.data-\[state\=closed\]\:duration-300[data-state=closed]{animation-duration:.3s}.data-\[state\=open\]\:duration-500[data-state=open]{animation-duration:.5s}.data-\[panel-group-direction\=vertical\]\:after\:left-0[data-panel-group-direction=vertical]:after{content:var(--tw-content);left:0}.data-\[panel-group-direction\=vertical\]\:after\:h-1[data-panel-group-direction=vertical]:after{content:var(--tw-content);height:.25rem}.data-\[panel-group-direction\=vertical\]\:after\:w-full[data-panel-group-direction=vertical]:after{content:var(--tw-content);width:100%}.data-\[panel-group-direction\=vertical\]\:after\:-translate-y-1\/2[data-panel-group-direction=vertical]:after{content:var(--tw-content);--tw-translate-y: -50%;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.data-\[panel-group-direction\=vertical\]\:after\:translate-x-0[data-panel-group-direction=vertical]:after{content:var(--tw-content);--tw-translate-x: 0px;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.data-\[state\=open\]\:hover\:bg-sidebar-accent:hover[data-state=open]{background-color:hsl(var(--sidebar-accent))}.data-\[state\=open\]\:hover\:text-sidebar-accent-foreground:hover[data-state=open]{color:hsl(var(--sidebar-accent-foreground))}.group[data-collapsible=offcanvas] .group-data-\[collapsible\=offcanvas\]\:left-\[calc\(var\(--sidebar-width\)\*-1\)\]{left:calc(var(--sidebar-width) * -1)}.group[data-collapsible=offcanvas] .group-data-\[collapsible\=offcanvas\]\:right-\[calc\(var\(--sidebar-width\)\*-1\)\]{right:calc(var(--sidebar-width) * -1)}.group[data-side=left] .group-data-\[side\=left\]\:-right-4{right:-1rem}.group[data-side=right] .group-data-\[side\=right\]\:left-0{left:0}.group[data-collapsible=icon] .group-data-\[collapsible\=icon\]\:-mt-8{margin-top:-2rem}.group[data-collapsible=icon] .group-data-\[collapsible\=icon\]\:hidden{display:none}.group[data-collapsible=icon] .group-data-\[collapsible\=icon\]\:\!size-8{width:2rem!important;height:2rem!important}.group[data-collapsible=icon] .group-data-\[collapsible\=icon\]\:w-\[--sidebar-width-icon\]{width:var(--sidebar-width-icon)}.group[data-collapsible=icon] .group-data-\[collapsible\=icon\]\:w-\[calc\(var\(--sidebar-width-icon\)_\+_theme\(spacing\.4\)\)\]{width:calc(var(--sidebar-width-icon) + 1rem)}.group[data-collapsible=icon] .group-data-\[collapsible\=icon\]\:w-\[calc\(var\(--sidebar-width-icon\)_\+_theme\(spacing\.4\)_\+2px\)\]{width:calc(var(--sidebar-width-icon) + 1rem + 2px)}.group[data-collapsible=offcanvas] .group-data-\[collapsible\=offcanvas\]\:w-0{width:0px}.group[data-collapsible=offcanvas] .group-data-\[collapsible\=offcanvas\]\:translate-x-0{--tw-translate-x: 0px;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.group[data-side=right] .group-data-\[side\=right\]\:rotate-180,.group[data-state=open] .group-data-\[state\=open\]\:rotate-180{--tw-rotate: 180deg;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.group[data-collapsible=icon] .group-data-\[collapsible\=icon\]\:overflow-hidden{overflow:hidden}.group[data-variant=floating] .group-data-\[variant\=floating\]\:rounded-lg{border-radius:var(--radius)}.group[data-variant=floating] .group-data-\[variant\=floating\]\:border{border-width:1px}.group[data-side=left] .group-data-\[side\=left\]\:border-r{border-right-width:1px}.group[data-side=right] .group-data-\[side\=right\]\:border-l{border-left-width:1px}.group[data-variant=floating] .group-data-\[variant\=floating\]\:border-sidebar-border{border-color:hsl(var(--sidebar-border))}.group[data-collapsible=icon] .group-data-\[collapsible\=icon\]\:\!p-0{padding:0!important}.group[data-collapsible=icon] .group-data-\[collapsible\=icon\]\:\!p-2{padding:.5rem!important}.group[data-collapsible=icon] .group-data-\[collapsible\=icon\]\:opacity-0{opacity:0}.group[data-variant=floating] .group-data-\[variant\=floating\]\:shadow{--tw-shadow: 0 1px 3px 0 rgb(0 0 0 / .1), 0 1px 2px -1px rgb(0 0 0 / .1);--tw-shadow-colored: 0 1px 3px 0 var(--tw-shadow-color), 0 1px 2px -1px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)}.group[data-collapsible=offcanvas] .group-data-\[collapsible\=offcanvas\]\:after\:left-full:after{content:var(--tw-content);left:100%}.group[data-collapsible=offcanvas] .group-data-\[collapsible\=offcanvas\]\:hover\:bg-sidebar:hover{background-color:hsl(var(--sidebar-background))}.peer\/menu-button[data-size=default]~.peer-data-\[size\=default\]\/menu-button\:top-1\.5{top:.375rem}.peer\/menu-button[data-size=lg]~.peer-data-\[size\=lg\]\/menu-button\:top-2\.5{top:.625rem}.peer\/menu-button[data-size=sm]~.peer-data-\[size\=sm\]\/menu-button\:top-1{top:.25rem}.peer[data-variant=inset]~.peer-data-\[variant\=inset\]\:min-h-\[calc\(100svh-theme\(spacing\.4\)\)\]{min-height:calc(100svh - 1rem)}.peer\/menu-button[data-active=true]~.peer-data-\[active\=true\]\/menu-button\:text-sidebar-accent-foreground{color:hsl(var(--sidebar-accent-foreground))}.dark\:border-destructive:is(.dark *){border-color:hsl(var(--destructive))}.dark\:from-gray-900:is(.dark *){--tw-gradient-from: #111827 var(--tw-gradient-from-position);--tw-gradient-to: rgb(17 24 39 / 0) var(--tw-gradient-to-position);--tw-gradient-stops: var(--tw-gradient-from), var(--tw-gradient-to)}.dark\:to-gray-800:is(.dark *){--tw-gradient-to: #1f2937 var(--tw-gradient-to-position)}@media (min-width: 640px){.sm\:bottom-\[-20rem\]{bottom:-20rem}.sm\:left-\[calc\(50\%\+30rem\)\]{left:calc(50% + 30rem)}.sm\:left-\[calc\(50\%-30rem\)\]{left:calc(50% - 30rem)}.sm\:top-\[-20rem\]{top:-20rem}.sm\:mt-0{margin-top:0}.sm\:mt-24{margin-top:6rem}.sm\:flex{display:flex}.sm\:w-\[72\.1875rem\]{width:72.1875rem}.sm\:max-w-md{max-width:28rem}.sm\:max-w-sm{max-width:24rem}.sm\:grid-cols-1{grid-template-columns:repeat(1,minmax(0,1fr))}.sm\:grid-cols-2{grid-template-columns:repeat(2,minmax(0,1fr))}.sm\:grid-cols-3{grid-template-columns:repeat(3,minmax(0,1fr))}.sm\:flex-row{flex-direction:row}.sm\:items-center{align-items:center}.sm\:justify-end{justify-content:flex-end}.sm\:gap-2\.5{gap:.625rem}.sm\:space-x-2>:not([hidden])~:not([hidden]){--tw-space-x-reverse: 0;margin-right:calc(.5rem * var(--tw-space-x-reverse));margin-left:calc(.5rem * calc(1 - var(--tw-space-x-reverse)))}.sm\:space-x-4>:not([hidden])~:not([hidden]){--tw-space-x-reverse: 0;margin-right:calc(1rem * var(--tw-space-x-reverse));margin-left:calc(1rem * calc(1 - var(--tw-space-x-reverse)))}.sm\:space-y-0>:not([hidden])~:not([hidden]){--tw-space-y-reverse: 0;margin-top:calc(0px * calc(1 - var(--tw-space-y-reverse)));margin-bottom:calc(0px * var(--tw-space-y-reverse))}.sm\:rounded-lg{border-radius:var(--radius)}.sm\:px-6{padding-left:1.5rem;padding-right:1.5rem}.sm\:py-32{padding-top:8rem;padding-bottom:8rem}.sm\:text-left{text-align:left}.sm\:text-4xl{font-size:2.25rem;line-height:2.5rem}.sm\:text-6xl{font-size:3.75rem;line-height:1}}@media (min-width: 768px){.md\:absolute{position:absolute}.md\:mb-0{margin-bottom:0}.md\:block{display:block}.md\:flex{display:flex}.md\:hidden{display:none}.md\:w-64{width:16rem}.md\:w-\[var\(--radix-navigation-menu-viewport-width\)\]{width:var(--radix-navigation-menu-viewport-width)}.md\:w-auto{width:auto}.md\:grid-cols-2{grid-template-columns:repeat(2,minmax(0,1fr))}.md\:grid-cols-3{grid-template-columns:repeat(3,minmax(0,1fr))}.md\:grid-cols-4{grid-template-columns:repeat(4,minmax(0,1fr))}.md\:flex-row{flex-direction:row}.md\:border-l{border-left-width:1px}.md\:text-sm{font-size:.875rem;line-height:1.25rem}.md\:opacity-0{opacity:0}.after\:md\:hidden:after{content:var(--tw-content);display:none}.peer[data-variant=inset]~.md\:peer-data-\[variant\=inset\]\:m-2{margin:.5rem}.peer[data-state=collapsed][data-variant=inset]~.md\:peer-data-\[state\=collapsed\]\:peer-data-\[variant\=inset\]\:ml-2{margin-left:.5rem}.peer[data-variant=inset]~.md\:peer-data-\[variant\=inset\]\:ml-0{margin-left:0}.peer[data-variant=inset]~.md\:peer-data-\[variant\=inset\]\:rounded-xl{border-radius:.75rem}.peer[data-variant=inset]~.md\:peer-data-\[variant\=inset\]\:shadow{--tw-shadow: 0 1px 3px 0 rgb(0 0 0 / .1), 0 1px 2px -1px rgb(0 0 0 / .1);--tw-shadow-colored: 0 1px 3px 0 var(--tw-shadow-color), 0 1px 2px -1px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)}}@media (min-width: 1024px){.lg\:col-span-1{grid-column:span 1 / span 1}.lg\:col-span-2{grid-column:span 2 / span 2}.lg\:mx-0{margin-left:0;margin-right:0}.lg\:mt-0{margin-top:0}.lg\:flex{display:flex}.lg\:w-64{width:16rem}.lg\:flex-auto{flex:1 1 auto}.lg\:flex-shrink-0{flex-shrink:0}.lg\:flex-grow{flex-grow:1}.lg\:grid-cols-2{grid-template-columns:repeat(2,minmax(0,1fr))}.lg\:grid-cols-3{grid-template-columns:repeat(3,minmax(0,1fr))}.lg\:flex-row{flex-direction:row}.lg\:items-center{align-items:center}.lg\:gap-x-10{-moz-column-gap:2.5rem;column-gap:2.5rem}.lg\:px-8{padding-left:2rem;padding-right:2rem}.lg\:py-40{padding-top:10rem;padding-bottom:10rem}}@media (min-width: 1280px){.xl\:grid-cols-2{grid-template-columns:repeat(2,minmax(0,1fr))}}.\[\&\:has\(\[aria-selected\]\)\]\:bg-accent:has([aria-selected]){background-color:hsl(var(--accent))}.first\:\[\&\:has\(\[aria-selected\]\)\]\:rounded-l-md:has([aria-selected]):first-child{border-top-left-radius:calc(var(--radius) - 2px);border-bottom-left-radius:calc(var(--radius) - 2px)}.last\:\[\&\:has\(\[aria-selected\]\)\]\:rounded-r-md:has([aria-selected]):last-child{border-top-right-radius:calc(var(--radius) - 2px);border-bottom-right-radius:calc(var(--radius) - 2px)}.\[\&\:has\(\[aria-selected\]\.day-outside\)\]\:bg-accent\/50:has([aria-selected].day-outside){background-color:hsl(var(--accent) / .5)}.\[\&\:has\(\[aria-selected\]\.day-range-end\)\]\:rounded-r-md:has([aria-selected].day-range-end){border-top-right-radius:calc(var(--radius) - 2px);border-bottom-right-radius:calc(var(--radius) - 2px)}.\[\&\:has\(\[role\=checkbox\]\)\]\:pr-0:has([role=checkbox]){padding-right:0}.\[\&\>button\]\:hidden>button{display:none}.\[\&\>span\:last-child\]\:truncate>span:last-child{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.\[\&\>span\]\:line-clamp-1>span{overflow:hidden;display:-webkit-box;-webkit-box-orient:vertical;-webkit-line-clamp:1}.\[\&\>svg\+div\]\:translate-y-\[-3px\]>svg+div{--tw-translate-y: -3px;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.\[\&\>svg\]\:absolute>svg{position:absolute}.\[\&\>svg\]\:left-4>svg{left:1rem}.\[\&\>svg\]\:top-4>svg{top:1rem}.\[\&\>svg\]\:size-3\.5>svg{width:.875rem;height:.875rem}.\[\&\>svg\]\:size-4>svg{width:1rem;height:1rem}.\[\&\>svg\]\:h-2\.5>svg{height:.625rem}.\[\&\>svg\]\:h-3>svg{height:.75rem}.\[\&\>svg\]\:w-2\.5>svg{width:.625rem}.\[\&\>svg\]\:w-3>svg{width:.75rem}.\[\&\>svg\]\:shrink-0>svg{flex-shrink:0}.\[\&\>svg\]\:text-destructive>svg{color:hsl(var(--destructive))}.\[\&\>svg\]\:text-foreground>svg{color:hsl(var(--foreground))}.\[\&\>svg\]\:text-muted-foreground>svg{color:hsl(var(--muted-foreground))}.\[\&\>svg\]\:text-sidebar-accent-foreground>svg{color:hsl(var(--sidebar-accent-foreground))}.\[\&\>svg\~\*\]\:pl-7>svg~*{padding-left:1.75rem}.\[\&\>tr\]\:last\:border-b-0:last-child>tr{border-bottom-width:0px}.\[\&\[data-panel-group-direction\=vertical\]\>div\]\:rotate-90[data-panel-group-direction=vertical]>div{--tw-rotate: 90deg;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.\[\&\[data-state\=open\]\>svg\]\:rotate-180[data-state=open]>svg{--tw-rotate: 180deg;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.\[\&_\.recharts-cartesian-axis-tick_text\]\:fill-muted-foreground .recharts-cartesian-axis-tick text{fill:hsl(var(--muted-foreground))}.\[\&_\.recharts-cartesian-grid_line\[stroke\=\'\#ccc\'\]\]\:stroke-border\/50 .recharts-cartesian-grid line[stroke="#ccc"]{stroke:hsl(var(--border) / .5)}.\[\&_\.recharts-curve\.recharts-tooltip-cursor\]\:stroke-border .recharts-curve.recharts-tooltip-cursor{stroke:hsl(var(--border))}.\[\&_\.recharts-dot\[stroke\=\'\#fff\'\]\]\:stroke-transparent .recharts-dot[stroke="#fff"]{stroke:transparent}.\[\&_\.recharts-layer\]\:outline-none .recharts-layer{outline:2px solid transparent;outline-offset:2px}.\[\&_\.recharts-polar-grid_\[stroke\=\'\#ccc\'\]\]\:stroke-border .recharts-polar-grid [stroke="#ccc"]{stroke:hsl(var(--border))}.\[\&_\.recharts-radial-bar-background-sector\]\:fill-muted .recharts-radial-bar-background-sector,.\[\&_\.recharts-rectangle\.recharts-tooltip-cursor\]\:fill-muted .recharts-rectangle.recharts-tooltip-cursor{fill:hsl(var(--muted))}.\[\&_\.recharts-reference-line_\[stroke\=\'\#ccc\'\]\]\:stroke-border .recharts-reference-line [stroke="#ccc"]{stroke:hsl(var(--border))}.\[\&_\.recharts-sector\[stroke\=\'\#fff\'\]\]\:stroke-transparent .recharts-sector[stroke="#fff"]{stroke:transparent}.\[\&_\.recharts-sector\]\:outline-none .recharts-sector,.\[\&_\.recharts-surface\]\:outline-none .recharts-surface{outline:2px solid transparent;outline-offset:2px}.\[\&_\[cmdk-group-heading\]\]\:px-2 [cmdk-group-heading]{padding-left:.5rem;padding-right:.5rem}.\[\&_\[cmdk-group-heading\]\]\:py-1\.5 [cmdk-group-heading]{padding-top:.375rem;padding-bottom:.375rem}.\[\&_\[cmdk-group-heading\]\]\:text-xs [cmdk-group-heading]{font-size:.75rem;line-height:1rem}.\[\&_\[cmdk-group-heading\]\]\:font-medium [cmdk-group-heading]{font-weight:500}.\[\&_\[cmdk-group-heading\]\]\:text-muted-foreground [cmdk-group-heading]{color:hsl(var(--muted-foreground))}.\[\&_\[cmdk-group\]\:not\(\[hidden\]\)_\~\[cmdk-group\]\]\:pt-0 [cmdk-group]:not([hidden])~[cmdk-group]{padding-top:0}.\[\&_\[cmdk-group\]\]\:px-2 [cmdk-group]{padding-left:.5rem;padding-right:.5rem}.\[\&_\[cmdk-input-wrapper\]_svg\]\:h-5 [cmdk-input-wrapper] svg{height:1.25rem}.\[\&_\[cmdk-input-wrapper\]_svg\]\:w-5 [cmdk-input-wrapper] svg{width:1.25rem}.\[\&_\[cmdk-input\]\]\:h-12 [cmdk-input]{height:3rem}.\[\&_\[cmdk-item\]\]\:px-2 [cmdk-item]{padding-left:.5rem;padding-right:.5rem}.\[\&_\[cmdk-item\]\]\:py-3 [cmdk-item]{padding-top:.75rem;padding-bottom:.75rem}.\[\&_\[cmdk-item\]_svg\]\:h-5 [cmdk-item] svg{height:1.25rem}.\[\&_\[cmdk-item\]_svg\]\:w-5 [cmdk-item] svg{width:1.25rem}.\[\&_p\]\:leading-relaxed p{line-height:1.625}.\[\&_svg\]\:pointer-events-none svg{pointer-events:none}.\[\&_svg\]\:size-4 svg{width:1rem;height:1rem}.\[\&_svg\]\:shrink-0 svg{flex-shrink:0}.\[\&_tr\:last-child\]\:border-0 tr:last-child{border-width:0px}.\[\&_tr\]\:border-b tr{border-bottom-width:1px}[data-side=left][data-collapsible=offcanvas] .\[\[data-side\=left\]\[data-collapsible\=offcanvas\]_\&\]\:-right-2{right:-.5rem}[data-side=left][data-state=collapsed] .\[\[data-side\=left\]\[data-state\=collapsed\]_\&\]\:cursor-e-resize{cursor:e-resize}[data-side=left] .\[\[data-side\=left\]_\&\]\:cursor-w-resize{cursor:w-resize}[data-side=right][data-collapsible=offcanvas] .\[\[data-side\=right\]\[data-collapsible\=offcanvas\]_\&\]\:-left-2{left:-.5rem}[data-side=right][data-state=collapsed] .\[\[data-side\=right\]\[data-state\=collapsed\]_\&\]\:cursor-w-resize{cursor:w-resize}[data-side=right] .\[\[data-side\=right\]_\&\]\:cursor-e-resize{cursor:e-resize} diff --git a/dist/index.html b/dist/index.html index 00b36ee9..defed7d0 100644 --- a/dist/index.html +++ b/dist/index.html @@ -7,8 +7,8 @@ - - + + diff --git a/src/components/focus-group-session/DiscussionPanel.tsx b/src/components/focus-group-session/DiscussionPanel.tsx index cdc9d782..eda9914b 100644 --- a/src/components/focus-group-session/DiscussionPanel.tsx +++ b/src/components/focus-group-session/DiscussionPanel.tsx @@ -29,7 +29,7 @@ interface DiscussionPanelProps { personas: Persona[]; isSpeaking: boolean; focusGroupId: string; - isAiModeActive?: boolean; // Whether the focus group is in AI mode + isAiModeActive?: boolean; // Whether the focus group is in AI mode (shows continuous loading when true) selectedParticipantIds: string[]; onToggleHighlight: (messageId: string) => void; onAdvanceDiscussion: () => void; @@ -1103,12 +1103,18 @@ const DiscussionPanel = ({ /> ) ))} - {isTyping && ( + {(isTyping || isAiModeActive) && (
- + {isAiModeActive ? ( + + ) : ( + + )}
- Generating AI response... + + {isAiModeActive ? 'AI is generating next response...' : 'Generating AI response...'} +
)} {/* This empty div helps with proper scroll positioning */} diff --git a/src/components/focus-group-session/ParticipantPanel.tsx b/src/components/focus-group-session/ParticipantPanel.tsx index ac8d8914..57aa1e5c 100644 --- a/src/components/focus-group-session/ParticipantPanel.tsx +++ b/src/components/focus-group-session/ParticipantPanel.tsx @@ -1,8 +1,9 @@ import { UserCircle, Bot, Users, Check } from 'lucide-react'; import { Persona } from '@/types/persona'; -import { useNavigate } from 'react-router-dom'; +import { useNavigate, useParams } from 'react-router-dom'; import { getPersonaAvatarSrc } from '@/utils/avatarUtils'; +import { useNavigation } from '@/contexts/NavigationContext'; interface ParticipantPanelProps { participants: Persona[]; @@ -12,10 +13,16 @@ interface ParticipantPanelProps { const ParticipantPanel = ({ participants, selectedParticipantIds, onToggleParticipantFilter }: ParticipantPanelProps) => { const navigate = useNavigate(); + const { id: focusGroupId } = useParams<{ id: string }>(); + const { setPreviousRoute } = useNavigation(); const handleAvatarClick = (participant: Persona) => { const personaId = participant.id || participant._id; - if (personaId) { + if (personaId && focusGroupId) { + // Set navigation context so back button returns to focus group session + setPreviousRoute(`/focus-groups/${focusGroupId}`, { + focusGroupId: focusGroupId + }); navigate(`/personas/${personaId}`); } }; diff --git a/src/components/persona/PersonaProfile.tsx b/src/components/persona/PersonaProfile.tsx index 0a4e1606..1268b249 100644 --- a/src/components/persona/PersonaProfile.tsx +++ b/src/components/persona/PersonaProfile.tsx @@ -1,9 +1,19 @@ -import { useState } from 'react'; +import { useState, useEffect } from 'react'; import Navigation from '@/components/Navigation'; import { Button } from '@/components/ui/button'; import { Tabs, TabsContent, TabsList, TabsTrigger } from '@/components/ui/tabs'; -import { ArrowLeft, Edit } from 'lucide-react'; +import { + Breadcrumb, + BreadcrumbList, + BreadcrumbItem, + BreadcrumbLink, + BreadcrumbPage, + BreadcrumbSeparator +} from '@/components/ui/breadcrumb'; +import { ArrowLeft, Edit, Home, Users, User } from 'lucide-react'; +import { useNavigation } from '@/contexts/NavigationContext'; +import { focusGroupsApi } from '@/lib/api'; import { PersonaSidebar } from './PersonaSidebar'; import { PersonaCooperProfile } from './PersonaCooperProfile'; @@ -25,6 +35,29 @@ export default function PersonaProfile() { handleSaveEdit } = usePersonaDetails(); + const { navigationState } = useNavigation(); + const [focusGroupName, setFocusGroupName] = useState(''); + + // Fetch focus group name if coming from focus group session + useEffect(() => { + if (navigationState.focusGroupId && navigationState.previousRoute?.startsWith('/focus-groups/')) { + const fetchFocusGroupName = async () => { + try { + const response = await focusGroupsApi.getById(navigationState.focusGroupId); + if (response?.data?.name) { + setFocusGroupName(response.data.name); + } + } catch (error) { + console.error('Error fetching focus group name:', error); + } + }; + fetchFocusGroupName(); + } + }, [navigationState.focusGroupId, navigationState.previousRoute]); + + // Determine if we should show breadcrumbs + const showBreadcrumbs = navigationState.previousRoute?.startsWith('/focus-groups/') && navigationState.focusGroupId; + if (isLoading) { return ; } @@ -46,6 +79,39 @@ export default function PersonaProfile() { /> ) : ( <> + {/* Breadcrumbs */} + {showBreadcrumbs && ( +
+ + + + + + Focus Groups + + + + + + + {focusGroupName || 'Focus Group Session'} + + + + + + + {currentPersona?.name || 'Participant'} + + + + +
+ )} +